/* Pricing page: screenshot-referenced card layout, layered on the shared
   tokens.css palette. Scoped to .pricing-* so it never leaks into other
   pages. Loads after style.css. */

/* ---- Hero ---- */
.pricing-hero { padding: 72px 0 24px; text-align: center; position: relative; z-index: 1; }
.pricing-hero h1 { font-family: var(--font-display); font-weight: var(--fw-display); font-size: var(--fs-h1-page); margin: 16px 0 14px; letter-spacing: var(--ls-tight-xl); text-wrap: balance; }
.pricing-hero-sub { color: var(--text-muted); max-width: 600px; margin: 0 auto; font-size: var(--fs-lead); line-height: 1.6; }

/* ---- Cards section ---- */
.pricing-cards-section { padding: 0 0 16px; }


/* auto-fit + justify-content: center means the grid always hugs however
   many tier cards STANDARD_TIER_ENABLED (config/settings/base.py) leaves in
   `tiers` — 2 cards center as a pair instead of sitting flush-left with an
   empty third column, and it still reflows per-card on narrow screens. */
/* align-items: stretch (the grid default) so both cards share one height —
   combined with .pricing-features { flex: 1 } below, this anchors both
   CTAs to the same baseline regardless of how much price/caption content a
   card has above the feature list. Active and Always-On both carry the
   same price_caption shape (token allowance), so this mostly guards
   against future asymmetry rather than a live mismatch today. */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 400px)); justify-content: center; gap: 22px; padding: 48px 0 20px; }

.pricing-card {
  position: relative; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px 26px 26px; display: flex; flex-direction: column; gap: 18px;
  transition: transform var(--dur-2) var(--ease-out), border-color var(--dur-2) ease;
}
.pricing-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.pricing-card.is-featured {
  position: relative; border-color: transparent;
  background: linear-gradient(var(--bg-elevated), var(--bg-elevated)) padding-box,
              conic-gradient(from var(--spin-angle, 0deg), var(--accent), var(--voice), var(--accent)) border-box;
  border: 1px solid transparent;
  box-shadow: var(--shadow-glow);
  transform: translateY(-8px);
  animation: pricingSpinBorder 6s linear infinite;
}
.pricing-card.is-featured:hover { transform: translateY(-11px); }
@property --spin-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes pricingSpinBorder { to { --spin-angle: 360deg; } }
@media (prefers-reduced-motion: reduce) {
  .pricing-card.is-featured { animation: none; border-color: var(--accent); background: var(--bg-elevated); }
  .pricing-card, .pricing-card.is-featured { transform: none !important; }
}
@media (max-width: 900px) {
  .pricing-card.is-featured, .pricing-card.is-featured:hover { transform: none; }
}

/* Always-On's own premium identity — it's the higher-usage package, not
   the "most popular" one, so it gets a distinct (non-spinning, gold)
   treatment rather than competing with Active's badge/border. */
.pricing-card.is-premium {
  border-color: rgba(255, 181, 71, 0.35);
  background: linear-gradient(180deg, rgba(255, 181, 71, 0.07), transparent 45%), var(--bg-elevated);
  box-shadow: var(--shadow-glow-voice);
}
.pricing-card.is-premium:hover { border-color: rgba(255, 181, 71, 0.55); }

.pricing-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--ls-wide); text-transform: uppercase;
  color: var(--accent-strong); background: var(--bg-elevated); border: 1px solid var(--accent);
  border-radius: 999px; padding: 5px 14px; white-space: nowrap;
}
.pricing-badge--voice { color: var(--voice-strong); border-color: var(--voice); }

/* Card header: icon row + tagline */
.pricing-card-header { display: flex; flex-direction: column; gap: 6px; }

.pricing-tier-name-row { display: flex; align-items: center; gap: 10px; }
.pricing-tier-icon {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; font-size: var(--fs-body);
}
.pricing-tier-icon--accent { background: var(--accent-soft); color: var(--accent-strong); }
.pricing-tier-icon--voice { background: var(--voice-dim); color: var(--voice-strong); }
.pricing-tier-name { font-family: var(--font-display); font-weight: var(--fw-display); font-size: var(--fs-h3); letter-spacing: var(--ls-tight-lg); }
.pricing-tier-tagline { font-size: var(--fs-xs); color: var(--text-faint); margin: 0; line-height: 1.4; }

/* Price block */
.pricing-price-block { display: flex; flex-direction: column; }
.pricing-price-row { display: flex; align-items: baseline; gap: 4px; }
.pricing-price { font-family: var(--font-display); font-weight: var(--fw-display); font-size: var(--fs-display); letter-spacing: var(--ls-normal); }
.pricing-period { color: var(--text-faint); font-size: var(--fs-sm); }
/* Default spacing; the tight -10px only applies when billing-note sits
   directly under the price row (Pro's case) — see override below. Studio's
   case has a badge/caption between them, so it keeps this normal gap
   without needing a second special-case rule per combination. */
.pricing-billing-note { font-family: var(--font-mono); font-size: var(--fs-label); color: var(--text-faint); margin-top: 6px; }
.pricing-price-row + .pricing-billing-note { margin-top: -10px; }

/* Usage-based pricing (Studio) isn't a number, so it doesn't get the same
   46px numeral treatment as a real "+$30" — that made it read as an
   oversized, unclear price. Standardized down a step, with a plain-language
   caption doing the job the missing digits can't. */
.pricing-price--usage { font-size: var(--fs-xl); letter-spacing: var(--ls-normal); }

/* Short, scannable cost stat as an actual single-line pill (Studio's own
   --voice gold). Keep this copy short — a badge that wraps to two lines
   stops reading as a badge and starts reading as an alert box. The fuller
   explanation goes in .pricing-usage-caption right below instead. */
.pricing-savings-badge {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; white-space: nowrap;
  font-family: var(--font-mono); font-size: var(--fs-label); font-weight: var(--fw-strong); letter-spacing: var(--ls-wide);
  color: var(--voice-strong); background: var(--voice-dim); border: 1px solid rgba(255, 181, 71, 0.35);
  border-radius: var(--radius-pill); padding: 6px 14px; margin-top: 8px;
}
.pricing-savings-badge .icon { width: 13px; height: 13px; stroke: var(--voice-strong); fill: none; stroke-width: 2.5; flex-shrink: 0; }
.pricing-usage-caption { font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.5; margin-top: 8px; }

/* Header for the feature checklist — "Every package includes:" (both
   Active and Always-On grant identical voice/tool access, per the
   2026-09-04 package rearchitecture) so every remaining line in the list
   is an actual differentiator. */
.pricing-includes-note {
  font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--ls-wide); text-transform: uppercase;
  color: var(--text-muted); margin: 0;
}

.pricing-divider { border-top: 1px solid var(--border); margin: 2px 0; }

.pricing-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.pricing-features li { display: flex; gap: 10px; font-size: var(--fs-sm); color: var(--text); line-height: 1.4; }
.pricing-features li .check { color: var(--data); flex-shrink: 0; }
.pricing-features li .check .icon { width: 16px; height: 16px; margin-top: 2px; }

/* CTA block: groups the button + alt-payment so they stay visually
   together at the bottom of every card regardless of feature list length. */
.pricing-ctas { display: flex; flex-direction: column; }
.pricing-cta { width: 100%; justify-content: center; border-radius: var(--radius-pill); }
.pricing-card.is-featured .pricing-cta { background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: var(--text); border: none; }
/* pricing.js: the member's current package's own card, and any button
   disabled mid-request while waiting on a checkout/billing-portal redirect. */
.pricing-cta:disabled { opacity: .55; cursor: default; }
.pricing-cta-msg { font-size: var(--fs-label); color: var(--data-down); margin-top: 8px; text-align: center; }

/* Visually separates the alternative payment path (stake ZPZ instead of
   paying the package fee) from the primary CTA above it — previously just a
   small "OR" label with no structural break, so it read as more content in
   the same list rather than a distinct fork in the decision. */
.pricing-alt-payment { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; padding-top: 18px; border-top: 1px dashed var(--border); }

.pricing-or { text-align: center; font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-faint); letter-spacing: var(--ls-wide); margin: 0; }

.pricing-stake { text-align: center; display: flex; flex-direction: column; gap: 10px; }
.pricing-stake p { font-size: var(--fs-sm); color: var(--text-faint); margin: 0; line-height: 1.5; }
.pricing-stake a { color: var(--voice-strong); text-decoration: underline; text-underline-offset: 2px; }
.pricing-stake-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(155,107,255,0.14); border: 1px solid var(--accent); color: var(--accent-strong);
  border-radius: var(--radius-pill); padding: 10px 16px; font-size: var(--fs-xs); font-weight: var(--fw-strong);
  text-decoration: none; cursor: pointer; transition: background var(--dur-1) ease, border-color var(--dur-1) ease;
}
.pricing-stake-btn:hover { background: rgba(155,107,255,0.24); border-color: var(--accent-strong); }

/* Always-On's stake button stays purple (--accent) by default like
   Active's, which clashes with the rest of its gold (--voice) card
   identity — border glow, CTA, badge. Give it the same gold treatment so
   the card reads as one consistent accent instead of two. */
.pricing-stake-btn--voice {
  background: var(--voice-dim); border-color: var(--voice); color: var(--voice-strong);
}
.pricing-stake-btn--voice:hover { background: rgba(255, 181, 71, 0.24); border-color: var(--voice-strong); }

/* ---- FAQ section: the shared .faq-item accordion (style.css) in a
   reading-width column; only the link colour is pricing-specific. ---- */
.pricing-faq-section { padding: 64px 0 48px; }
.pricing-faq-list { max-width: var(--prose-max); margin: 0 auto; }
.pricing-faq-list .faq-answer a { color: var(--voice-strong); text-decoration: underline; text-underline-offset: 2px; }

/* ---- Footnote ---- */
.pricing-footnote { max-width: var(--prose-max); margin: 36px auto 64px; color: var(--text-faint); font-size: var(--fs-label); text-align: center; line-height: 1.7; }
.pricing-footnote a { color: var(--text-muted); }

/* ===== Token allowance (added 2026-09-15) =====
   The allowance is the ONLY thing that differs between the two packages, so
   it gets its own line under the price rather than being one clause inside
   `price_caption` and then repeated again as a checklist tick — the card used
   to state the same figure twice, the second time under a header promising
   what every package has in common. The number is mono + tabular so the two
   cards' figures align optically down the grid. */
.pricing-allowance { display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-2); }
.pricing-allowance-figure {
  font-family: var(--font-mono); font-size: var(--fs-md); font-weight: var(--fw-strong);
  letter-spacing: var(--ls-normal); font-variant-numeric: tabular-nums; color: var(--text);
}
.pricing-allowance-unit { font-size: var(--fs-xs); color: var(--text-faint); }

/* ===== EZPZ-data add-on switch (added 2026-09-15) =====
   Named `.pricing-data-*` so it is not confused with the retired
   "Add-ons" / "One exception" section (removed 2026-09-15). Two unrelated
   components sharing a prefix on one page is how the next edit lands in
   the wrong rule.
   Replaced a two-tab segmented control above the grid that swapped two whole
   sets of cards. Each card now toggles between its own two prices in place,
   so the +$100 difference is read in the same glance as the price it applies
   to. Built on the shared .tvx-toggle switch (style.css) — only this row's
   layout is page-scoped; the switch itself is never restyled. */
.pricing-data-switch {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--bg-card); border: 1px solid var(--border-hair);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-2) ease;
}
.pricing-data-switch:hover { border-color: var(--border); }
/* Lifts the switch onto the label's first text line rather than the top of
   the whole two-line block. */
.pricing-data-switch .tvx-toggle { margin-top: 1px; }
.pricing-data-switch-text { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.pricing-data-switch-label {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  font-size: var(--fs-body-sm); font-weight: var(--fw-emphasis); color: var(--text);
  cursor: pointer; line-height: 1.35;
}
/* The delta, not the total — stated because flipping this used to triple the
   price with nothing saying why. Gold because it is the one number on the
   card that changes when you act. */
.pricing-data-delta {
  font-family: var(--font-mono); font-size: var(--fs-label); font-weight: var(--fw-strong);
  letter-spacing: var(--ls-wide); white-space: nowrap;
  color: var(--voice-strong); background: var(--voice-dim);
  border: 1px solid var(--border-voice); border-radius: var(--radius-pill); padding: 2px 8px;
}
.pricing-data-switch-help { margin: 0; font-size: var(--fs-label); color: var(--text-faint); line-height: 1.5; }
.pricing-data-switch-help a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }

/* ===== Assurance row (added 2026-09-15) =====
   "Switch or cancel anytime" was row 37 of a 38-row table and the top-up
   behaviour was in the footnote — both are objections that need answering at
   the moment of the decision, not 3000px below it. */
.pricing-assurances {
  list-style: none; margin: var(--sp-5) 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--sp-4) var(--sp-7);
}
.pricing-assurances li {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-body-sm); color: var(--text-faint);
}
.pricing-assurances .icon {
  width: 15px; height: 15px; flex-shrink: 0;
  stroke: var(--data); fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ===== What's included (rebuilt 2026-09-15) =====
   Was a single 38-row table with a tick column per package, 34 of whose rows
   printed the same tick twice — so it read as a comparison of two identical
   things and invited the question "what am I meant to be looking at". Split
   into a four-row differences table and a shared-inventory grid. */
.pricing-compare-section { padding: 64px 0; }

.pricing-diff-wrap {
  overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border);
  max-width: 760px; margin: 0 auto;
}
.pricing-diff-table {
  width: 100%; border-collapse: collapse; font-size: var(--fs-sm);
  background: var(--bg-elevated);
}
/* A real <caption>. Safe here (unlike the old per-route table label, which was
   clipped against its scroll container's rounded border) because this caption
   is laid out as a block at the top of the table with its own padding, not
   floated against the border radius. */
.pricing-diff-caption {
  caption-side: top; text-align: left; padding: 14px 20px;
  font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: var(--fw-strong);
  letter-spacing: var(--ls-wide); text-transform: uppercase; color: var(--text-faint);
  background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.pricing-diff-table th {
  padding: 14px 20px; text-align: left; font-weight: var(--fw-strong);
  font-size: var(--fs-body-sm); letter-spacing: var(--ls-tight); color: var(--text);
  font-family: var(--font-display);
}
.pricing-diff-table thead tr { background: var(--bg-card); }
.pricing-diff-table thead th { border-bottom: 1px solid var(--border); white-space: nowrap; }
.pricing-diff-table th.compare-col-feature { width: 40%; }
.pricing-diff-table th.compare-col-tier { text-align: center; }
.pricing-diff-table th.compare-col-active { color: var(--accent-strong); }
.pricing-diff-table th.compare-col-always-on { color: var(--voice-strong); }
.pricing-diff-table tbody tr { border-top: 1px solid var(--border); }
.pricing-diff-table tbody th {
  font-family: var(--font-body); font-weight: var(--fw-body);
  color: var(--text-muted); font-size: var(--fs-body-sm);
  vertical-align: top;
}
.pricing-diff-table tbody tr:hover { background: var(--bg-row-hover); }
.pricing-diff-table .compare-value {
  padding: 14px 20px; text-align: center; vertical-align: top;
  font-family: var(--font-mono); font-size: var(--fs-body-sm); font-weight: var(--fw-strong);
  letter-spacing: var(--ls-normal); font-variant-numeric: tabular-nums; color: var(--text);
}
.pricing-diff-table .compare-value--accent { color: var(--accent-strong); }
.pricing-diff-table .compare-value--voice { color: var(--voice-strong); }

/* Full-sentence gloss under a row label that would otherwise jam two ideas
   onto one wrapping line (the stake row: "— EZPZ Elite, linked"). */
.pricing-diff-hint {
  display: block;
  margin-top: var(--sp-1);
  font-size: var(--fs-label);
  font-weight: var(--fw-body);
  letter-spacing: var(--ls-normal);
  color: var(--text-faint);
  line-height: 1.45;
}

/* --- Pillars (rebuilt 2026-09-15, second pass) ---------------------------
 * Was eight equal cards of bare checkmarks. Two problems: the captions were
 * the old TABLE's section labels rather than value claims, and the grid's
 * default `align-items: stretch` padded a 3-item card to the height of a
 * 12-item one — the dead space visible in the 2026-09-15 screenshots.
 * Now: four pillars that each LEAD with the claim, item lists collapsed
 * behind a <details>, and `align-items: start` so a card is only ever as tall
 * as its own content. */
.pricing-incl-lead {
  max-width: var(--prose-max); margin: var(--sp-7) auto var(--sp-5);
  text-align: center; font-family: var(--font-mono); font-size: var(--fs-2xs);
  letter-spacing: var(--ls-wide); text-transform: uppercase; color: var(--text-faint);
}

.pricing-incl-pillars {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px; align-items: start;
}

.pricing-incl-pillar {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 22px;
  display: flex; flex-direction: column; gap: var(--sp-3);
  transition: border-color var(--dur-2) ease, transform var(--dur-2) var(--ease-out);
}
.pricing-incl-pillar:hover { border-color: var(--border-strong); transform: translateY(-2px); }

/* Source-coloured icon badge. The `voice` pillar carries no modifier and
   keeps the neutral default below on purpose — gold is the voice colour but is
   already used by the Finn/TradingView pillar on this row, and no source
   colour is correct for "product mechanics". See INCLUDED_PILLARS' comment. */
.pricing-incl-icon {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); color: var(--text-faint);
}
.pricing-incl-icon .icon { width: 20px; height: 20px; }
.pricing-incl-pillar--accent .pricing-incl-icon { background: var(--accent-soft); color: var(--accent-strong); }
.pricing-incl-pillar--data .pricing-incl-icon { background: var(--data-dim); color: var(--data); }
.pricing-incl-pillar--voice .pricing-incl-icon { background: var(--voice-dim); color: var(--voice-strong); }

.pricing-incl-title {
  margin: 0; font-family: var(--font-display); font-weight: var(--fw-strong);
  font-size: var(--fs-h4); letter-spacing: var(--ls-tight); color: var(--text);
}
.pricing-incl-blurb {
  margin: 0; font-size: var(--fs-body-sm); color: var(--text-muted); line-height: 1.55;
  /* Pushes the disclosure to the card's bottom edge so every pillar's "See
     what's in it" row sits on one line across the row, even though the blurbs
     differ in length. */
  flex: 1;
}

/* --- Disclosure ---------------------------------------------------------
 * Native <details>/<summary>, deliberately NOT the shared .faq-item accordion:
 * that component is built for prose Q&A at reading width, this is a compact
 * inventory with a count badge. Same disclosure mechanism, no JS, and no
 * second *scripted* accordion on the site — which is what the design system's
 * "one accordion" rule is actually protecting against. */
.pricing-incl-detail { border-top: 1px solid var(--border-hair); padding-top: var(--sp-3); }
.pricing-incl-detail summary {
  display: flex; align-items: center; gap: var(--sp-2);
  cursor: pointer; list-style: none;
  font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--ls-wide);
  text-transform: uppercase; color: var(--text-faint);
  transition: color var(--dur-1) ease;
}
.pricing-incl-detail summary::-webkit-details-marker { display: none; }
.pricing-incl-detail summary:hover { color: var(--text); }
.pricing-incl-detail summary:focus-visible { outline: 2px solid var(--voice); outline-offset: 3px; border-radius: var(--radius-sm); }
.pricing-incl-count {
  font-weight: var(--fw-strong); font-variant-numeric: tabular-nums;
  letter-spacing: var(--ls-normal); color: var(--text);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 2px 8px; min-width: 26px; text-align: center;
}
.pricing-incl-summary-label { flex: 1; }
.pricing-incl-chevron {
  width: 14px; height: 14px; flex-shrink: 0;
  transition: transform var(--dur-2) var(--ease-out);
}
.pricing-incl-detail[open] .pricing-incl-chevron { transform: rotate(180deg); }

.pricing-incl-list {
  list-style: none; margin: var(--sp-4) 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
  animation: pricingInclOpen var(--dur-2) var(--ease-out) both;
}
.pricing-incl-list li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: var(--fs-body-sm); color: var(--text-muted); line-height: 1.45;
}
.pricing-incl-list li .check { color: var(--data); flex-shrink: 0; }
.pricing-incl-list li .check .icon { width: 15px; height: 15px; margin-top: 2px; stroke-width: 2.5; }

@keyframes pricingInclOpen {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Kept from the old table: the one inline badge COMPARE_INCLUDED's markup
   carries, marking an item that only the Trading Desk Vox Mode exposes. */
.compare-badge {
  display: inline-block;
  font-family: var(--font-mono); font-size: var(--fs-3xs); font-weight: var(--fw-strong);
  letter-spacing: var(--ls-wide); text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent-strong); border: 1px solid var(--border-accent);
  border-radius: var(--radius-pill); padding: 2px 7px; vertical-align: middle; white-space: nowrap;
  margin-left: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .pricing-incl-pillar:hover { transform: none; }
  .pricing-incl-list { animation: none; }
  .pricing-incl-chevron { transition: none; }
}

@media (max-width: 640px) {
  .pricing-assurances { gap: var(--sp-3) var(--sp-5); }
  .pricing-assurances li { font-size: var(--fs-label); }
  .pricing-data-switch { padding: var(--sp-3); }
}
