/* ==========================================================================
   Funnel page components. Layered AFTER brand.css + marketing.css, and built
   only from tokens those two files already define, so the subpages inherit the
   shell instead of inventing a second design system.

   Covers: subpage hero, breadcrumbs, the pricing grid, honest status badges,
   spec tables, legal prose, callouts, forms, and the closing CTA band.
   Includes the mobile and accessibility pass for every component here.

   No em dashes in any comment or string.
   ========================================================================== */

/* ---------------------------------------------------------------- a11y ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* Visible keyboard target on the whole nav, which marketing.css does not set. */
.nav-links a:focus-visible,
.nav-mobile a:focus-visible,
.footer-col a:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* ------------------------------------------------------------ subpage hero -- */
.page-hero {
  padding-block: clamp(40px, 6vw, 76px) clamp(28px, 4vw, 48px);
  position: relative;
  overflow: hidden;
}
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.3rem);
  max-width: 18ch;
  margin: 0 0 18px;
  text-wrap: balance;
}
.page-hero .t-lead { max-width: 62ch; }
.page-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-bottom: 22px;
}
.crumbs a { color: var(--ink-muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.crumbs .sep { color: var(--ink-xfaint); }

/* ------------------------------------------------------------ pricing grid -- */
.price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 22px);
  align-items: stretch;
}
.price-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
.price-card.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-raise);
}
.price-flag {
  position: absolute;
  top: -11px;
  left: clamp(16px, 2.4vw, 28px);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-ink);
}
.price-name {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.price-amt {
  font-size: clamp(2.1rem, 4vw, 2.9rem);
  font-weight: 660;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.price-amt .per {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-muted);
  margin-left: 6px;
}
.price-credits {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--ink-muted);
}
.price-blurb { color: var(--ink-muted); font-size: 0.95rem; line-height: 1.55; }
.price-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--ink-muted);
}
.price-meta li { display: flex; align-items: flex-start; gap: 9px; }
.price-meta .mk { flex: 0 0 auto; margin-top: 2px; color: var(--ok); font-weight: 700; }
.price-meta .mk.no { color: var(--ink-faint); }
.price-card .btn { margin-top: auto; justify-content: center; }

/* Custom top-up strip under the grid. */
.price-custom {
  margin-top: clamp(16px, 2vw, 22px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.price-custom .t-label { display: block; margin-bottom: 4px; }

/* ------------------------------------------------- honest status badges ---- */
/* The we-have / we-do-not-have-yet table. Three explicit states so nothing is
   left to inference, and a pending state for anything shipping in a later
   wave. Never a vague tick. */
.claims { width: 100%; border-collapse: collapse; }
.claims caption {
  text-align: left;
  color: var(--ink-muted);
  font-size: 0.95rem;
  padding-bottom: 14px;
}
.claims th,
.claims td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.claims thead th {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--border-strong);
}
.claims tbody th { font-weight: 600; color: var(--ink); }
.claims td { color: var(--ink-muted); }
.claims td:first-of-type { width: 1%; white-space: nowrap; }
.claims tbody tr:last-child th,
.claims tbody tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 7px;
}
.badge-yes { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-border); }
.badge-no { color: var(--ink-faint); background: transparent; border-color: var(--border); border-style: dashed; }
.badge-pending { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-border); }

/* ----------------------------------------------------------- callouts ------ */
.callout {
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: clamp(14px, 2vw, 20px);
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}
.callout p { margin: 0 0 10px; }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--ink); font-weight: 600; }
.callout-honest { border-left-color: var(--ok); background: var(--ok-soft); }
.callout-caution { border-left-color: var(--warn); background: var(--warn-soft); }
.callout-info { border-left-color: var(--info); background: var(--info-soft); }
.callout + .callout { margin-top: 12px; }

/* ---------------------------------------------------------------- prose ---- */
/* Long-form legal and policy copy. One measure, comfortable leading, real
   heading order so a screen reader can navigate it. */
.prose { max-width: 74ch; }
.prose h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  margin: clamp(34px, 5vw, 48px) 0 12px;
  scroll-margin-top: 96px;
}
.prose h3 {
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  margin: 26px 0 8px;
}
.prose p,
.prose li { color: var(--ink-muted); line-height: 1.68; }
.prose p { margin: 0 0 14px; }
.prose ul,
.prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--accent); }
.prose dl { margin: 0 0 18px; }
.prose dt { font-weight: 600; color: var(--ink); margin-top: 14px; }
.prose dd { margin: 4px 0 0; color: var(--ink-muted); line-height: 1.6; }
.prose a { color: var(--accent); text-underline-offset: 2px; }
.prose a:hover { color: var(--accent-hover); }
.prose .doc-meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 8px;
}

/* ---------------------------------------------------------------- forms ---- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(14px, 2vw, 18px);
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field > label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}
.field .req { color: var(--danger); margin-left: 2px; }
.field input,
.field select,
.field textarea {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 11px 12px;
  min-height: 44px; /* comfortable touch target on a phone */
  width: 100%;
}
.field textarea { min-height: 132px; resize: vertical; line-height: 1.55; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%2370645B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
.field .hint { font-size: 0.82rem; color: var(--ink-faint); line-height: 1.5; }
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-xfaint); }
.field .err {
  font-size: 0.82rem;
  color: var(--danger);
  font-weight: 500;
  min-height: 1.2em;
}
.field[data-invalid="1"] input,
.field[data-invalid="1"] select,
.field[data-invalid="1"] textarea {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
.form-status { font-size: 0.9rem; color: var(--ink-muted); }
.form-status[data-tone="ok"] { color: var(--ok); font-weight: 500; }
.form-status[data-tone="bad"] { color: var(--danger); font-weight: 500; }
/* The signup page reveals this note when arriving from a pricing card. */
#packNote { margin-bottom: 20px; }
#signupDone h2 { margin-top: 0; }
#signupDone .btn { margin-top: 4px; margin-right: 8px; }

/* ------------------------------------------------------------- key list ---- */
.kv {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
}
.kv > div {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--ink-muted);
}
.kv > div:nth-last-child(1),
.kv > div:nth-last-child(2) { border-bottom: 0; }
.kv .k { font-weight: 600; color: var(--ink); background: var(--surface-muted); }

/* ------------------------------------------------------------- cta band ---- */
.cta-band { border-top: 1px solid var(--border); background: var(--surface-muted); }
.cta-band-inner {
  padding-block: clamp(40px, 6vw, 64px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.cta-band h2 { font-size: clamp(1.4rem, 2.8vw, 2rem); margin: 0 0 8px; }
.cta-band p { color: var(--ink-muted); margin: 0; max-width: 52ch; }
.cta-band-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* --------------------------------------------------------- page spacing ---- */
.page-body { padding-block: clamp(36px, 5vw, 64px) clamp(48px, 7vw, 88px); }
/* A subpage hero already carries the top padding, so the block under it does
   not need to repeat it. */
.flush-top { padding-top: 0; }

/* Two column page body, form beside an aside. Collapses before the columns get
   narrow enough to squeeze the form fields. */
.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(20px, 3vw, 34px);
  align-items: start;
}
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
}
.stack-lg > * + * { margin-top: clamp(28px, 4vw, 44px); }
.stack-md > * + * { margin-top: clamp(18px, 2.4vw, 26px); }
.mt-md { margin-top: clamp(20px, 3vw, 32px); }
.center-narrow { max-width: 820px; margin-inline: auto; }

/* A visible only-to-screen-reader page h1 fallback is never needed, but the
   footer on subpages gets a heading so the landmark is named. */
.footer-extra { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.footer-extra .t-label { display: block; margin-bottom: 10px; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-legal a {
  font-size: 0.9rem;
  color: var(--ink-dim, var(--ink-muted));
  text-decoration: none;
}
.footer-legal a:hover { color: var(--ink); text-decoration: underline; }

/* ================================================================ mobile === */
@media (max-width: 1000px) {
  .price-grid { grid-template-columns: 1fr 1fr; }
  .price-card.featured { grid-column: 1 / -1; order: -1; }
}

@media (max-width: 760px) {
  .page-hero h1 { max-width: 100%; }
  .price-grid { grid-template-columns: 1fr; }
  .price-card.featured { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv .k { border-bottom: 0; padding-bottom: 2px; }
  .kv > div { border-bottom: 1px solid var(--border); }
  .kv > div:nth-last-child(1) { border-bottom: 0; }
  .cta-band-inner { flex-direction: column; align-items: flex-start; }
  .cta-band-actions .btn { width: 100%; justify-content: center; }
  .page-hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .crumbs { font-size: 0.78rem; }
}

@media (max-width: 460px) {
  .claims th,
  .claims td { padding: 10px 8px; font-size: 0.88rem; }
  .claims thead th { font-size: 0.66rem; letter-spacing: 0.06em; }
  .badge { font-size: 0.7rem; padding: 2px 7px; }
  .price-amt { font-size: 2rem; }
  .footer-legal { gap: 6px 14px; }
}

/* Tables scroll rather than overflow the viewport on a small phone. */
@media (max-width: 760px) {
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll .claims { min-width: 520px; }
}

@media (prefers-reduced-motion: reduce) {
  .cta-band-inner,
  .price-card { transition: none; }
  .magnetic { transition: none; }
}
