/* Checkout configurator. Cream canvas + navy summary panel, tokens via
   global.css. Page-specific styles for pages/checkout.html. */

*, *::before, *::after { box-sizing: border-box; }
body { background: var(--cream); min-height: 100vh; font-family: 'Figtree', sans-serif; }

/* ── Nav (tan variant of the shared .site-nav) ──
   Same markup/behavior as the rest of the site; recolored for the cream
   checkout canvas. Navy-on-navy links would vanish on tan, so links, the logo,
   and the hamburger are remapped to navy. Floating dropdowns stay dark. */
.site-nav--tan {
  background: rgba(245,240,232,0.97);
  border-bottom: 1px solid rgba(11,31,58,0.1);
  backdrop-filter: blur(12px);
}
.site-nav--tan .nav-logo img { filter: brightness(0); }
.site-nav--tan .nav-link,
.site-nav--tan .nav-signin { color: rgba(11,31,58,0.62); }
.site-nav--tan .nav-link:hover,
.site-nav--tan .nav-signin:hover { color: var(--navy-deep); }
.site-nav--tan .nav-hamburger span { background: var(--navy-deep); }

/* "Edit configuration" back-link shown above the embedded Stripe checkout. */
.co-edit-back {
  background: none; border: none; cursor: pointer;
  padding: 0; margin-bottom: 1.5rem;
  font-size: 0.85rem; font-family: inherit;
  color: var(--navy-deep); opacity: 0.6;
  transition: opacity 0.2s;
}
.co-edit-back:hover { opacity: 1; }

/* ── Layout ── */
.co-body {
  padding-top: 6rem;
  padding-bottom: 6rem;
}
.co-header { margin-bottom: 2.75rem; }
.co-eyebrow {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.28em; color: var(--gold-dim); margin-bottom: 0.75rem;
}
.co-heading {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  font-weight: 600; color: var(--navy-deep); line-height: 1.15;
  margin-bottom: 0.6rem; text-wrap: balance;
}
.co-sub { font-size: 0.95rem; color: var(--navy-mid); line-height: 1.7; max-width: 520px; }

.co-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 3rem;
  align-items: stretch; /* summary panel matches column 1's height */
}
/* Narrow-screen stacking is handled by the flex-column rule further down. */

/* ── Config group (outlined container grouping the steps) ── */
.config-group {
  border: 1px solid rgba(11,31,58,0.14);
  border-radius: 0.875rem;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  background: rgba(255,255,255,0.35);
}
.config-group-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem; font-weight: 600; color: var(--navy-deep);
  margin-bottom: 1.5rem;
}

/* ── Config sections ── */
.co-section { margin-bottom: 2.5rem; }
.co-section-last { margin-bottom: 0; }
.co-section-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.24em; color: var(--navy-deep); opacity: 0.45;
  margin-bottom: 1rem;
}

/* ── Add Just in Time toggle ── */
.jit-group { padding: 0; }
.jit-toggle {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.5rem 1.75rem; cursor: pointer;
}
.jit-toggle input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.jit-toggle-box {
  flex-shrink: 0; width: 1.35rem; height: 1.35rem;
  border: 1.5px solid rgba(11,31,58,0.3); border-radius: 0.35rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.jit-toggle input:checked + .jit-toggle-box {
  background: linear-gradient(135deg, #c4a54e, #9c7b1f); border-color: #9c7b1f;
}
.jit-toggle input:checked + .jit-toggle-box::after {
  content: '✓'; color: #fff; font-size: 0.85rem; font-weight: 700;
}
.jit-toggle input:focus-visible + .jit-toggle-box { outline: 2px solid var(--gold); outline-offset: 2px; }
.jit-group.jit-active { border-color: var(--gold); }
.jit-toggle-text { flex: 1; display: flex; flex-direction: column; gap: 0.2rem; }
.jit-toggle-title { font-size: 0.95rem; font-weight: 600; color: var(--navy-deep); }
.jit-toggle-desc { font-size: 0.78rem; color: var(--navy-mid); line-height: 1.4; }
.jit-toggle-price { font-size: 0.85rem; font-weight: 700; color: var(--gold-dim); white-space: nowrap; }

/* ── Plan selector ── */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.875rem;
}
@media (max-width: 680px) { .plan-grid { grid-template-columns: 1fr; } }

.plan-grid { overflow: visible; }
.plan-card {
  position: relative;
  background: #fff;
  border: 1.5px solid rgba(11,31,58,0.12);
  border-radius: 0.875rem;
  padding: 1.5rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  user-select: none;
  display: flex; flex-direction: column;
}
.plan-card:hover { border-color: rgba(11,31,58,0.3); }
.plan-card.active {
  border-color: var(--navy-deep);
  box-shadow: 0 0 0 3px rgba(11,31,58,0.08);
}
.plan-card.active::before {
  content: '';
  position: absolute; top: 0; left: 1.25rem; right: 1.25rem;
  height: 3px; border-radius: 0 0 3px 3px;
  background: var(--gold);
}
.plan-badge {
  position: absolute; top: 0; left: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.18em; color: var(--gold-dim);
  background: var(--cream); border: 1.5px solid var(--gold-pale);
  border-radius: 4px; padding: 0.2em 0.6em;
}
.plan-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem; font-weight: 600;
  color: var(--navy-deep); margin-bottom: 0.5rem; line-height: 1.2;
  min-height: 3.8rem; display: flex; align-items: flex-start;
  padding-right: 2rem;
}
.plan-price-line {
  font-size: 0.82rem; color: var(--ink-muted); margin-bottom: 0.2rem;
  line-height: 1.4;
}
.plan-price-line strong { color: var(--navy-deep); font-size: 1.05rem; font-weight: 600; }
.plan-setup-note {
  font-size: 0.72rem; color: var(--ink-muted); margin-bottom: 0.875rem;
  line-height: 1.4;
}
.plan-setup-note:empty { display: none; }
.plan-desc {
  font-size: 0.8rem; color: var(--navy-mid); line-height: 1.55;
  margin-top: auto;
}
/* ── Term toggle ── */
.term-toggle {
  display: inline-flex;
  background: rgba(11,31,58,0.06);
  border-radius: 0.5rem;
  padding: 0.25rem;
  gap: 0.25rem;
}
.term-btn {
  font-family: 'Figtree', sans-serif;
  font-size: 0.875rem; font-weight: 500;
  color: var(--navy-mid);
  background: none; border: none;
  border-radius: 0.35rem;
  padding: 0.5rem 1.25rem;
  cursor: pointer; transition: background 0.2s, color 0.2s;
}
.term-btn.active {
  background: var(--navy-deep); color: #fff;
}
.term-btn:disabled { opacity: 0.4; cursor: default; }
.term-savings {
  font-size: 0.75rem; color: var(--gold-dim); margin-top: 0.625rem;
  font-weight: 600;
}

/* ── Add-ons ── */
.addon-rows { display: flex; flex-direction: column; gap: 1.25rem; }
.addon-row {
  display: flex; align-items: center;
  gap: 1.5rem; justify-content: space-between;
  background: #fff;
  border: 1px solid rgba(11,31,58,0.1);
  border-radius: 0.75rem;
  padding: 1.125rem 1.375rem;
}
.addon-info { flex: 1; }
.addon-name {
  font-size: 0.9rem; font-weight: 600; color: var(--navy-deep);
  margin-bottom: 0.2rem;
}
.addon-meta { font-size: 0.78rem; color: var(--ink-muted); line-height: 1.4; }

.stepper {
  display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0;
}
.stepper-btn {
  width: 2rem; height: 2rem;
  border-radius: 50%;
  border: 1.5px solid var(--navy-rule);
  background: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1.1rem; line-height: 1;
  color: var(--navy-deep);
  transition: border-color 0.15s, background 0.15s;
}
.stepper-btn:hover:not(:disabled) { border-color: var(--navy-deep); background: rgba(11,31,58,0.04); }
.stepper-btn:disabled { opacity: 0.3; cursor: default; }
.stepper-val {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; font-weight: 600;
  color: var(--navy-deep);
  min-width: 2rem; text-align: center;
  font-variant-numeric: tabular-nums;
}
input.stepper-val {
  width: 4rem; border: 1.5px solid rgba(11,31,58,0.15);
  border-radius: 0.35rem; padding: 0.2rem 0.4rem;
  background: none; outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
  transition: border-color 0.2s;
}
input.stepper-val:focus { border-color: var(--gold); }
input.stepper-val::-webkit-inner-spin-button,
input.stepper-val::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ── Summary panel ── */
.summary-panel {
  background: var(--navy-deep);
  border-radius: 1.125rem;
  padding: 2rem;
  color: var(--cream);
  /* Fill the grid cell so the panel matches column 1's height; the CTA block
     is pushed to the bottom via margin-top:auto on .summary-total-block. */
  display: flex; flex-direction: column;
}
/* Everything below the totals sits at the bottom of the stretched panel. */
.summary-total-block { margin-top: auto; }
@media (max-width: 900px) {
  .summary-panel { display: block; }
  .summary-total-block { margin-top: 1.25rem; }
}
.summary-plan-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem; font-weight: 600;
  color: var(--cream); margin-bottom: 0.2rem;
}
.summary-term-label {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.2em; color: var(--gold); margin-bottom: 1.5rem;
}
.summary-divider {
  border: none; border-top: 1px solid rgba(245,240,232,0.12);
  margin: 1.125rem 0;
}
.summary-section-label {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.22em; color: rgba(245,240,232,0.7);
  margin-bottom: 0.75rem;
}
.line-item {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.85rem; color: var(--cream-strong);
  margin-bottom: 0.5rem; gap: 1rem;
}
.line-item .li-label { flex: 1; }
.line-item .li-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap; color: var(--cream);
  font-weight: 500;
}
.line-item.muted .li-value { color: var(--cream-soft); }
/* "Included" rows read at a solid, legible weight rather than a faded whole-row
   opacity (which compounds with the already-soft label color). */
.line-item.zero { color: var(--cream-soft); }
.line-item.zero .li-value { color: var(--cream-soft); }

.summary-total-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.2em; color: var(--gold); margin-bottom: 0.3rem;
}
.summary-total-amount {
  font-family: 'Playfair Display', serif;
  font-size: 2.1rem; font-weight: 700;
  color: var(--gold); line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.2rem;
}
.summary-total-note {
  font-size: 0.75rem; color: rgba(245,240,232,0.7); margin-bottom: 1rem;
}
/* Small explanatory note under a summary line (e.g. the JIT 3-year note). */
.summary-subnote {
  font-size: 0.72rem; color: rgba(245,240,232,0.55);
  line-height: 1.45; margin: -0.15rem 0 0.5rem;
}
.summary-renewal {
  font-size: 0.82rem; color: var(--cream-soft);
  margin-bottom: 1.5rem;
}
.summary-renewal strong { color: var(--cream-strong); font-weight: 600; }

.summary-cta {
  display: block; width: 100%; text-align: center;
  font-family: 'Figtree', sans-serif;
  font-size: 0.9375rem; font-weight: 600;
  background: var(--gold); color: var(--navy-deep);
  border: none; border-radius: 0.5rem;
  padding: 0.875rem 1.5rem;
  cursor: pointer; text-decoration: none;
  transition: opacity 0.2s;
}
.summary-cta:hover:not(:disabled) { opacity: 0.88; }
.summary-cta:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Terms agreement checkbox ── */
.tos-row {
  display: flex; align-items: flex-start; gap: 0.625rem;
  margin-bottom: 1rem;
}
.tos-row input[type="checkbox"] {
  margin-top: 0.15rem; width: 1rem; height: 1rem; flex-shrink: 0;
  accent-color: var(--gold); cursor: pointer;
}
.tos-row label {
  font-size: 0.78rem; line-height: 1.5; color: var(--cream-faint);
  cursor: pointer;
}
.tos-row label a { color: var(--gold); text-decoration: underline; }

.summary-note {
  font-size: 0.72rem; color: rgba(245,240,232,0.6);
  text-align: center; margin-top: 0.875rem; line-height: 1.5;
}
/* Contextual gold note under the setup fee (explains a fee change). */
.setup-note {
  font-size: 0.72rem; color: var(--gold); line-height: 1.45;
  margin: 0.35rem 0 0.25rem;
}
.setup-note:empty { display: none; }

/* ── Included tag ── */
.included-tag {
  display: inline-block; font-size: 0.65rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: rgba(11,31,58,0.45);
  background: rgba(11,31,58,0.06);
  border-radius: 4px; padding: 0.15em 0.45em;
  margin-left: 0.4em; vertical-align: middle;
}

/* Mobile summary ordering */
@media (max-width: 900px) {
  /* Single column: config first, then the summary as a full-width checkout
     confirmation below it (natural configure-then-confirm order). The summary
     is no longer a stretched sidebar, so it sits squat and full-width. */
  .co-grid { display: flex; flex-direction: column; }
  .co-config { order: 1; }
  .summary-panel { order: 2; }
}
