/* ============================================================
   checkout.html — page-specific styles
   Loads after styles.css (shared tokens, banner-bar, site-header, footer).
   ============================================================ */

/* Base reset, :root variables, body defaults, banner-bar, site-header,
   and footer now live in styles.css (shared across all pages). */

/* No .top-bar a rule here — unlike index.html, this page's banner text
   has no link in it, so there's nothing for one to style. */

/* ── MAIN LAYOUT ── */
.checkout-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 65px 24px 65px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

/* ── LEFT COLUMN — FORM ── */
/* flex + gap (rather than margin-bottom on .section-block) means spacing
   only ever appears BETWEEN visible children, never trailing after the
   last one. #formBlock and #successBlock are mutually exclusive (only one
   is ever visible — see showSuccess() in the script below), so this also
   means whichever one is showing never carries a stray bottom margin of
   its own into the gap above the footer. */
.checkout-form-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-block {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 28px 30px;
}

.section-block__title {
  font-family: var(--font-d);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}
.section-block__sub {
  font-size: 13.5px;
  color: var(--stone);
  margin-bottom: 20px;
}

/* Step badge */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  margin-right: 10px;
  flex-shrink: 0;
  vertical-align: middle;
}
.block-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}
.block-header-text {}
.block-header-text .section-block__title { margin-bottom: 0; }
.block-header-text .section-block__sub { margin-bottom: 0; margin-top: 2px; }

/* Form fields */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.field { display: flex; flex-direction: column; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.required { color: var(--danger); }
.field input {
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 11px 13px;
  font-family: var(--font-b);
  font-size: 15px;
  color: var(--ink);
  background: var(--cream);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.field input:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(92,123,106,.14);
  background: var(--white);
}
.field input.has-error { border-color: var(--danger); }
.field input::placeholder { color: #bbb; }
.field-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 5px;
  display: none;
}
.field-error.show { display: block; }

/* Stripe payment element container */
#payment-element {
  margin-bottom: 4px;
}
#card-errors {
  font-size: 13px;
  color: var(--danger);
  margin-top: 8px;
  min-height: 18px;
}

/* ── CONSENT CHECKBOX ── */
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
}
.consent-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--sage);
  cursor: pointer;
}
.consent-row label {
  font-size: 13.5px;
  color: var(--ink-mid);
  line-height: 1.5;
  cursor: pointer;
}
.consent-row + .field-error {
  margin-top: 6px;
}

/* ── SUBMIT BUTTON ── */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--sage);
  color: var(--white);
  font-family: var(--font-b);
  font-size: 17px;
  font-weight: 700;
  padding: 17px 40px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 10px;
  text-align: center;
}
.btn-submit:hover:not(:disabled) { background: var(--sage-dark); }
.btn-submit:disabled { background: #aaa; cursor: not-allowed; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.submit-sub {
  text-align: center;
  font-size: 13px;
  color: var(--stone);
  margin-top: 10px;
}

/* ── SECURE BADGES ── */
.secure-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--stone);
  margin-top: 16px;
}
.secure-row svg { flex-shrink: 0; }

/* ── SUCCESS STATE ── */
.success-block {
  display: none;
  text-align: center;
  padding: 48px 30px;
}
.success-block.show { display: block; }
.success-icon {
  width: 64px;
  height: 64px;
  background: var(--sage-light);
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}
.success-block h2 {
  font-family: var(--font-d);
  font-size: 26px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 10px;
}
.success-block p {
  font-size: 15.5px;
  color: var(--ink-mid);
  line-height: 1.65;
  max-width: 380px;
  margin: 0 auto;
}

/* ── RIGHT COLUMN — ORDER SUMMARY ── */
.order-summary {
  position: sticky;
  top: 24px;
}

.summary-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}

.summary-header {
  background: #5c7b6a;
  padding: 20px 24px;
}
.summary-header__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  margin-bottom: 4px;
}
.summary-header__name {
  font-family: var(--font-d);
  font-size: 20px;
  font-weight: 500;
  color: var(--white);
  line-height: 1.2;
}

.summary-body { padding: 22px 24px; }

.price-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 14px;
}
.price-display__amount {
  font-family: var(--font-d);
  font-size: 48px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}
.price-display__period {
  font-size: 14px;
  color: var(--stone);
}
.price-anchor {
  display: inline-block;
  background: var(--sage-light);
  color: var(--sage);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.summary-divider {
  height: 1px;
  background: var(--rule);
  margin: 16px 0;
}

/* Base list/check styles now shared in styles.css — these are just this
   page's size deltas. */
.includes-list { gap: 10px; margin-bottom: 20px; }
.includes-list li { gap: 10px; font-size: 14.5px; line-height: 1.45; }
.includes-list li .check { width: 18px; height: 18px; font-size: 10px; }

/* Base look (background/border/radius) and shared sub-element rules now
   live in styles.css — these are just this page's spacing/size deltas. */
.bonus-strip { padding: 14px 16px; margin-bottom: 16px; }
.bonus-strip__label { margin-bottom: 8px; }
.bonus-strip__item { gap: 12px; margin-bottom: 14px; }
.bonus-strip__icon { font-size: 18px; line-height: 1.3; }
.bonus-strip__text { min-width: 0; }
.bonus-strip__title { font-weight: 700; color: var(--ink); line-height: 1.3; }
.bonus-strip__desc { font-size: 12.5px; line-height: 1.35; }

.guarantee-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-mid);
  line-height: 1.4;
}
.guarantee-strip__icon {
  font-size: 22px;
  flex-shrink: 0;
}

/* Footer styling now lives in styles.css */

/* ── RESPONSIVE ──
   700px is the shared "tablet/two-column" tier used site-wide (paired
   with the 560px small/mobile tier in index.css and thank-you.css). */
@media (max-width: 700px) {
  .checkout-wrap {
    grid-template-columns: 1fr;
    padding: 16px 16px 48px;
  }
  .order-summary { position: static; order: -1; }
  .field-row { grid-template-columns: 1fr; }
  .section-block { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}
