/* =============================================================================
   order-theme.css — public checkout theme, modelled on the onimator/Wayfront
   order page (measured from portal.onimator.com/order/...). EVERYTHING is scoped
   under .order-theme so it can never bleed into the Bootstrap admin (base.html).
   Tokens measured from the reference:
     text navy #00254d · primary #007bff · card border #dfe1e6 (radius 4px)
     right "Summary" rail = fixed vertical gradient #5a67bd -> #004a99, white text
     font Proxima Nova (paid/Typekit) -> self-hosted Mulish substitute
   ========================================================================== */
@import url("mulish.css");

/* The order/form pages are a standalone document and this stylesheet is only loaded
   there (never in the admin), so it's safe to clip the summary's edge-bleed at the
   root — guarantees no horizontal scrollbar on any browser. */
html { overflow-x: hidden; }

.order-theme {
  --c-navy: #00254d;
  --c-muted: #5b6b80;
  --c-desc: #6b778c;          /* plan-card description grey, measured 1:1 from the reference */
  --c-blue: #007bff;
  --c-blue-600: #0069d9;
  --c-border: #dfe1e6;
  --c-bg: #ffffff;
  --grad: linear-gradient(180deg, #5a67bd 0%, #004a99 100%);
  --font: "Mulish", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;

  font-family: var(--font);
  color: var(--c-navy);
  background: var(--c-bg);
  font-size: 0.9rem;          /* 14.4px, matching the reference body */
  line-height: 1.5;
  overflow-x: hidden;         /* clip the summary's edge-bleed pseudo-element */
}

.order-theme *,
.order-theme *::before,
.order-theme *::after { box-sizing: border-box; }

.order-theme a { color: var(--c-blue); text-decoration: none; }
.order-theme a:hover { text-decoration: underline; }

/* ---- Brand header / footer ------------------------------------------------ */
.order-theme .checkout-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--c-navy);
}
.order-theme .checkout-brand .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--c-blue);
  color: #fff;
  font-size: 1rem;
}
.order-theme .checkout-foot {
  margin-top: 40px;
  padding: 24px 0;
  color: var(--c-muted);
  font-size: 0.8rem;
  text-align: center;
}

/* ---- Split-screen shell --------------------------------------------------- */
.order-theme .checkout {
  position: relative;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
}

.order-theme .checkout-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }

.order-theme .checkout-main { padding: 40px 0; min-width: 0; }

/* On mobile the summary is a self-contained blue card above the form. */
.order-theme .summary-panel {
  color: #fff;
  background: var(--grad);
  border-radius: 12px;
  padding: 32px 28px;
}
.order-theme .summary-panel h2 { color: #fff; font-weight: 600; font-size: 1.35rem; margin: 0 0 20px; }
.order-theme .summary-hr { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.25); margin: 20px 0; }
.order-theme .summary-line { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.order-theme .summary-line .label { color: rgba(255, 255, 255, 0.85); }
.order-theme .summary-total-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; }
.order-theme .summary-total-row .t-label { font-weight: 600; }
.order-theme .summary-total-row .t-sub { display: block; font-size: 0.75rem; color: rgba(255, 255, 255, 0.7); }
.order-theme .summary-total-row .t-amount { font-size: 1.5rem; font-weight: 700; }
.order-theme .summary-note { margin-top: 18px; font-size: 0.8rem; color: rgba(255, 255, 255, 0.8); }
.order-theme .summary-pill {
  display: block; width: 100%; background: rgba(255, 255, 255, 0.12);
  border: 0; border-radius: 8px; color: #fff; padding: 12px 14px; font-family: var(--font);
}
.order-theme .summary-pill::placeholder { color: rgba(255, 255, 255, 0.7); }

@media (min-width: 992px) {
  /* Two columns hugging the page centre; the summary column carries the blue and
     bleeds to the right viewport edge via ::after (no fragile fixed-50% maths). */
  .order-theme .checkout-grid { grid-template-columns: minmax(0, 1fr) 380px; gap: 0; align-items: stretch; }
  .order-theme .checkout-main { grid-column: 1; padding: 56px 48px 56px 0; }
  .order-theme .summary-panel {
    grid-column: 2; position: relative;
    background: var(--grad); border-radius: 0;
    min-height: 100vh; padding: 56px 32px;
  }
  .order-theme .summary-panel::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: 100%;
    width: 100vw; background: var(--grad);
  }
}

/* ---- Type ----------------------------------------------------------------- */
.order-theme h1.checkout-title {
  font-weight: 600; font-size: clamp(1.4rem, 1.1rem + 1.4vw, 1.7rem);
  line-height: 1.2; color: var(--c-navy); margin: 18px 0 14px;
}
.order-theme .lead-copy { color: var(--c-navy); margin-bottom: 14px; }
.order-theme .muted { color: var(--c-muted); }
.order-theme .secure-line { color: var(--c-navy); font-size: 0.9rem; margin: 0 0 6px; }
.order-theme .rule { border: 0; border-top: 1px solid rgba(0, 0, 0, 0.1); margin: 22px 0; }

/* ---- Plan cards (storefront + selected line) ------------------------------ */
.order-theme .plan-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: #fff; border: 1px solid var(--c-border); border-radius: 4px;
  padding: 20px 24px; margin-bottom: 14px; transition: border-color .15s, box-shadow .15s;
}
.order-theme a.plan-card { color: inherit; }
.order-theme a.plan-card:hover { border-color: var(--c-blue); box-shadow: 0 1px 6px rgba(0, 123, 255, 0.12); text-decoration: none; }
.order-theme .plan-card .p-name { font-weight: 500; color: var(--c-navy); }
.order-theme .plan-card .p-meta { color: var(--c-muted); font-size: 0.82rem; margin-top: 4px; }
.order-theme .plan-card .p-meta span { display: inline-block; margin-right: 10px; }
.order-theme .p-desc { display: block; color: var(--c-desc); font-size: 0.9rem; line-height: 1.5; margin: 4px 0 2px; }
.order-theme .plan-card .p-price { font-weight: 700; font-size: 1.15rem; white-space: nowrap; color: var(--c-navy); }
.order-theme .plan-card .p-price small { display: block; font-weight: 400; font-size: 0.72rem; color: var(--c-muted); text-align: right; }

/* ---- Forms ---------------------------------------------------------------- */
.order-theme .field { margin-bottom: 18px; }
.order-theme .field > label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--c-navy); }
.order-theme .field .form-control,
.order-theme .field .form-select {
  width: 100%; padding: 11px 14px; font-size: 0.95rem; font-family: var(--font);
  color: var(--c-navy); background: #fff; border: 1px solid var(--c-border); border-radius: 6px;
}
.order-theme .field .form-control:focus,
.order-theme .field .form-select:focus {
  outline: 0; border-color: var(--c-blue); box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* ---- Payment-method radio cards ------------------------------------------- */
.order-theme .pay-options { display: grid; gap: 10px; }
.order-theme .pay-option {
  display: flex; align-items: center; gap: 12px; margin: 0; cursor: pointer;
  border: 1px solid var(--c-border); border-radius: 8px; padding: 14px 16px;
  font-weight: 600; color: var(--c-navy);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.order-theme .pay-radio { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; accent-color: var(--c-blue); }
.order-theme .pay-option .pay-icon { display: inline-flex; font-size: 1.2rem; color: var(--c-blue); }
.order-theme .pay-option .pay-label { flex: 1 1 auto; }
.order-theme .pay-option .pay-check { color: var(--c-blue); opacity: 0; transition: opacity .15s; }
.order-theme .pay-option:hover { border-color: var(--c-blue); }
.order-theme .pay-option:has(.pay-radio:checked) {
  border-color: var(--c-blue); background: rgba(0, 123, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.12);
}
.order-theme .pay-option:has(.pay-radio:checked) .pay-check { opacity: 1; }

/* ---- Buttons -------------------------------------------------------------- */
.order-theme .btn-pay {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 18px; font-size: 1.05rem; font-weight: 600; white-space: nowrap;
  color: #fff; background: var(--c-blue); border: 1px solid var(--c-blue); border-radius: 6px;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.order-theme .btn-pay:hover { background: var(--c-blue-600); border-color: var(--c-blue-600); color: #fff; text-decoration: none; }
.order-theme .btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 6px;
  font-weight: 600; color: var(--c-blue); background: #fff; border: 1px solid var(--c-border);
}
.order-theme .btn-ghost:hover { border-color: var(--c-blue); text-decoration: none; }

/* ---- Misc ----------------------------------------------------------------- */
.order-theme .feature-block { margin-bottom: 4px; }
.order-theme .feature-block strong { display: block; margin-top: 12px; color: var(--c-navy); }
.order-theme .feature-block .f-text { color: var(--c-muted); }
.order-theme .group-head {
  display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--c-navy);
  margin: 26px 0 12px;
}
.order-theme .center-card {
  max-width: 520px; margin: 0 auto; background: #fff; border: 1px solid var(--c-border);
  border-radius: 10px; padding: 40px 32px; text-align: center;
}

/* ---- Form description (admin-authored rich HTML) -------------------------- */
.order-theme .form-desc { color: var(--c-navy); }
.order-theme .form-desc p { margin: 0 0 12px; }
.order-theme .form-desc a { color: var(--c-blue); }
.order-theme .form-desc h1, .order-theme .form-desc h2, .order-theme .form-desc h3, .order-theme .form-desc h4 {
  font-weight: 700; margin: 18px 0 8px; line-height: 1.25;
}
.order-theme .form-desc h1 { font-size: 1.3rem; }
.order-theme .form-desc h2 { font-size: 1.15rem; }
.order-theme .form-desc h3, .order-theme .form-desc h4 { font-size: 1rem; }
.order-theme .form-desc ul, .order-theme .form-desc ol { padding-left: 20px; margin: 0 0 12px; }
.order-theme .form-desc li { margin-bottom: 4px; }
.order-theme .form-desc img { max-width: 100%; height: auto; }

/* ---- Plan selector cards — measured 1:1 from the reference order form -------
   flex column, 24px padding, 4px radius, 12px gap; selector absolute top-right;
   name/price weight 500 navy, description weight 400 grey, all 14.4px / 1.5;
   selected state = blue border only (no shadow / no tint). */
.order-theme .plan-select { display: grid; gap: 12px; }
.order-theme .plan-opt {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  margin: 0; padding: 24px; cursor: pointer;
  background: #fff; border: 1px solid var(--c-border); border-radius: 4px;
  transition: border-color .15s;
}
.order-theme .plan-opt:hover { border-color: var(--c-blue); }
.order-theme .plan-opt:has(.plan-input:checked) { border-color: var(--c-blue); }
.order-theme .plan-input {
  position: absolute; top: 8px; right: 8px; width: 16px; height: 16px;
  margin: 0; accent-color: var(--c-blue); cursor: pointer;
}
.order-theme .plan-opt .po-body { min-width: 0; }
.order-theme .plan-opt .p-name { display: block; font-weight: 700; font-size: 1.1rem; line-height: 1.4; color: var(--c-navy); margin-bottom: 2px; }
.order-theme .plan-opt .p-desc { margin: 0; }
.order-theme .plan-opt .p-meta { display: block; color: var(--c-desc); font-size: 0.82rem; line-height: 1.5; margin-top: 4px; }
.order-theme .plan-opt .p-meta span { display: inline-block; margin-right: 12px; }
.order-theme .plan-opt .po-price { display: block; font-weight: 500; font-size: 0.9rem; line-height: 1.5; color: var(--c-navy); }
.order-theme .summary-lines:empty { display: none; }

/* ---- Flash messages ------------------------------------------------------- */
.order-theme .flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 12px; font-size: 0.9rem; }
.order-theme .flash-error { background: #fde8e8; color: #9b1c1c; border: 1px solid #f5c2c2; }
.order-theme .flash-success { background: #e6f6ec; color: #1c6b3a; border: 1px solid #b7e0c4; }
.order-theme .flash-info { background: #e8f0fe; color: #1c4c9b; border: 1px solid #c2d6f5; }
