/* ============================================================
   LVRD Diagnostic Checkout — surface styles

   Four-step flow at /checkout-flow. Surface is its own visual
   register — quieter than the marketing site, dedicated to a
   single conversion action. Slim header, single-column reading
   width on steps 01-03, two-column on step 04 (summary +
   payment).

   Mobile-first. Inputs at 16px to suppress iOS auto-zoom.
   Express payment buttons render above the card form on every
   viewport — they do 30-50% of mobile conversions.
   ============================================================ */

@import url("../colors_and_type.css");

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- Slim checkout header ----------
   Wordmark on the left, "secure checkout" trust marker on the
   right. The marketing-site CTAs are intentionally absent —
   the prospect is mid-flow and the only path is forward. */
.dx-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
}
.dx-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.dx-header .wordmark {
  font-family: var(--font-sans);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-strong);
  text-decoration: none;
  border-bottom: 0;
  font-size: 18px;
  line-height: 1;
}
.dx-header-secure {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
}
.dx-header-secure svg { color: var(--fg-faint); }

/* ---------- Progress ----------
   Step 1 of 4 mono caption + accent-line fill bar. The bar
   fills proportionally as the user advances. */
.dx-progress {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 32px 0;
}
.dx-progress.dx-progress-wide {
  max-width: 1040px;
}
.dx-progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.dx-progress-step {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.dx-progress-step .n { color: var(--fg-faint); }
.dx-progress-step .name { color: var(--fg-strong); margin-left: 8px; }
.dx-progress-back {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong);
  transition: color var(--duration-fast) var(--easing-default);
}
.dx-progress-back:hover { color: var(--accent); }
.dx-progress-bar {
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
  position: relative;
}
.dx-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--windsor), var(--astronaut), var(--marian));
  border-radius: 1px;
  transition: width var(--duration-slow) var(--easing-default);
}

/* ---------- Step shell ---------- */
.dx-step {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 32px 96px;
}
.dx-step-wide {
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px 32px 96px;
}
.dx-step-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 18px;
}
.dx-step-eyebrow .breath-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: dx-breath 2200ms ease-in-out infinite;
}
@keyframes dx-breath {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.12); }
}
.dx-step-headline {
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.022em;
  font-weight: 600;
  color: var(--fg-strong);
  margin: 0 0 14px;
  text-wrap: balance;
  max-width: 18ch;
}
.dx-step-headline em {
  display: inline;
}
.dx-step-lede {
  font-size: 17px;
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 0 0 40px;
  max-width: 56ch;
  text-wrap: pretty;
}

/* ---------- Field group ---------- */
.dx-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}
.dx-field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-strong);
}
.dx-field-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-faint);
}
.dx-field-help {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.5;
  margin: 0;
}
.dx-field-error {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #b22222;
}

/* ---------- Inputs ---------- */
.dx-input,
.dx-textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 16px;       /* 16px+ prevents iOS auto-zoom */
  line-height: 1.5;
  color: var(--fg-strong);
  outline: none;
  transition: border-color var(--duration-fast) var(--easing-default),
              box-shadow var(--duration-fast) var(--easing-default);
}
.dx-input::placeholder,
.dx-textarea::placeholder {
  color: var(--fg-faint);
}
.dx-input:focus,
.dx-textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.dx-textarea {
  resize: vertical;
  min-height: 96px;
  font-family: var(--font-sans);
}
.dx-input[aria-invalid="true"],
.dx-textarea[aria-invalid="true"] {
  border-color: #b22222;
}

/* ---------- Chip group (single + multi select) ---------- */
.dx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dx-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--easing-default),
              color var(--duration-fast) var(--easing-default),
              background var(--duration-fast) var(--easing-default);
}
.dx-chip:hover { border-color: var(--border-strong); color: var(--fg-strong); }
.dx-chip[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 6%, var(--surface-2));
}
.dx-chip[aria-pressed="true"] .check {
  display: inline-flex;
}
.dx-chip .check {
  display: none;
  width: 12px;
  height: 12px;
  color: var(--accent);
}

/* ---------- Step footer (Continue / submit) ---------- */
.dx-step-foot {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  margin-top: 36px;
}
.dx-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  background: var(--accent);
  color: var(--fg-on-accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--duration-fast) var(--easing-default),
              border-color var(--duration-fast) var(--easing-default),
              gap var(--duration-fast) var(--easing-default);
}
.dx-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); gap: 14px; }
.dx-btn-primary:active { background: var(--accent-press); border-color: var(--accent-press); }
.dx-btn-primary[disabled] {
  background: var(--fg-disabled);
  border-color: var(--fg-disabled);
  cursor: not-allowed;
}
.dx-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: transparent;
  color: var(--fg-strong);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: border-color var(--duration-fast) var(--easing-default),
              color var(--duration-fast) var(--easing-default);
}
.dx-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.dx-foot-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-faint);
  line-height: 1.5;
}

/* ---------- Step 03 — reinforcement ---------- */
.dx-r-h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg-strong);
  margin: 48px 0 18px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-sans);
}
.dx-r-steps {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  border-top: 1px solid var(--border);
}
.dx-r-step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.dx-r-step .n {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
  padding-top: 2px;
}
.dx-r-step .body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dx-r-step .name {
  font-size: 17px;
  font-weight: 600;
  color: var(--fg-strong);
  line-height: 1.35;
  margin: 0;
}
.dx-r-step .desc {
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.5;
  margin: 0;
}

.dx-r-guarantees {
  margin-top: 8px;
}
.dx-guar {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.dx-guar:first-child { border-top: 1px solid var(--border); }
.dx-guar-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 10px;
}
.dx-guar-h {
  font-size: 18px;
  font-weight: 600;
  color: var(--fg-strong);
  margin: 0 0 8px;
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.dx-guar-body {
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg);
  margin: 0;
  max-width: 60ch;
}

/* ---------- Step 04 — Secure your spot ----------
   Two columns on desktop (summary left, payment right).
   Stacked on mobile (summary on top, payment below). */
.dx-pay-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: start;
}

/* Order summary */
.dx-summary {
  position: sticky;
  top: 100px;
}
.dx-summary-h {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin: 0 0 18px;
}
.dx-summary-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.dx-summary-line:first-of-type { border-top: 1px solid var(--border); }
.dx-summary-line .label {
  font-size: 16px;
  font-weight: 500;
  color: var(--fg-strong);
}
.dx-summary-line .label-sub {
  display: block;
  font-size: 13px;
  color: var(--fg-muted);
  margin-top: 4px;
  font-weight: 400;
}
.dx-summary-line .amount {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--fg-strong);
  font-weight: 500;
}
.dx-summary-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 24px;
  font-weight: 600;
}
.dx-summary-total .label { font-size: 16px; color: var(--fg-strong); }
.dx-summary-total .amount {
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--fg-strong);
  font-weight: 600;
}
.dx-summary-block {
  padding: 24px 0 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-muted);
}
.dx-summary-block-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 10px;
}
.dx-fineprint {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dx-fineprint p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--fg-muted);
  line-height: 1.55;
}

/* Payment column */
.dx-pay-h {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin: 0 0 18px;
}

/* Express checkout element — Stripe renders brand-approved
   buttons for Apple Pay, Google Pay, Link, etc. */
#express-checkout-element {
  margin-bottom: 16px;
  min-height: 52px;
}

.dx-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-faint);
}
.dx-divider::before,
.dx-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Stripe Payment Element container */
#payment-element {
  padding: 22px 0 0;
}

/* Mock card form — shown when Stripe keys are absent (dev mode) */
.dx-pmt-mock {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  background: var(--surface-2);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--fg-muted);
  text-align: center;
  margin-top: 16px;
}
.dx-pmt-mock strong {
  display: block;
  color: var(--fg-strong);
  font-weight: 600;
  margin-bottom: 6px;
}

/* Pay button */
.dx-pay-cta {
  margin-top: 18px;
}
.dx-pay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 17px 28px;
  background: var(--accent);
  color: var(--fg-on-accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  transition: background var(--duration-fast) var(--easing-default);
}
.dx-pay-btn:hover { background: var(--accent-hover); }
.dx-pay-btn[disabled] {
  background: var(--fg-disabled);
  border-color: var(--fg-disabled);
  cursor: not-allowed;
}
.dx-pay-btn .spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1.5px solid color-mix(in oklab, #fff 35%, transparent);
  border-top-color: #fff;
  border-radius: 50%;
  animation: dx-spin 700ms linear infinite;
}
@keyframes dx-spin {
  to { transform: rotate(360deg); }
}
.dx-pay-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-faint);
}
.dx-pay-trust svg { color: var(--fg-faint); }

/* Stripe element error message */
.dx-stripe-error {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #b22222;
  margin-top: 8px;
}

/* Guarantee restatement above the pay button */
.dx-pay-restate {
  background: color-mix(in oklab, var(--accent) 4%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--accent) 15%, var(--border));
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 18px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--fg);
}
.dx-pay-restate strong { color: var(--fg-strong); font-weight: 600; }

/* Stripe loading state */
.dx-stripe-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 32px 0;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.dx-stripe-loading .spinner {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: dx-spin 700ms linear infinite;
}

/* ---------- Footer (slim) ---------- */
.dx-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 32px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--border);
}
.dx-footer .wordmark {
  font-family: var(--font-sans);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-size: 14px;
  text-decoration: none;
}
.dx-footer-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-faint);
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .dx-pay-grid { grid-template-columns: 1fr; gap: 36px; }
  .dx-summary { position: static; }
}

@media (max-width: 720px) {
  .dx-header-inner { padding: 16px 20px; }
  .dx-header-secure span:not(.label-only) { display: none; }
  .dx-progress { padding: 24px 20px 0; }
  .dx-step { padding: 32px 20px 88px; }
  .dx-step-wide { padding: 32px 20px 88px; }
  .dx-step-lede { font-size: 16px; margin-bottom: 32px; }
  .dx-footer { padding: 24px 20px 36px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .dx-step-foot { width: 100%; }
  .dx-btn-primary,
  .dx-btn-ghost {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .dx-step-headline { font-size: 26px; }
  .dx-r-step { grid-template-columns: 40px 1fr; gap: 14px; padding: 18px 0; }
}
