/* Pricing page: grid backdrop, CSS-only audience toggle, notched founding card, halo button, compare table,
   calculator and the one-open FAQ cards. Patterns from Atomato (toggle, notch, halo, FAQ) and Supaste (FAQ cards). */

.pricing-hero { padding-bottom: clamp(32px, 4vw, 56px); text-align: center; }
.pricing-hero__inner { position: relative; z-index: 2; display: grid; justify-items: center; }
.pricing-hero h1 { max-width: 13em; margin-inline: auto; }
.pricing-hero .lede { margin-inline: auto; }
.price-grid-bg {
  position: absolute; inset: 0 0 auto; height: 520px; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px; background-position: center top;
  mask-image: radial-gradient(70% 80% at 50% 0%, #000, transparent 75%);
}

/* ---------- Audience toggle (no JS: radios + :has) ---------- */
.plans-section { padding-bottom: var(--section); }
.seg { position: relative; display: flex; justify-content: center; gap: 6px; width: fit-content; margin: 0 auto clamp(28px, 4vw, 44px); padding: 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); }
.seg label { min-height: 44px; display: grid; place-items: center; padding: 0 22px; border-radius: 999px; font-weight: 500; color: var(--fg-2); cursor: pointer; transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out); }
.seg input:checked + label { background: var(--gold); color: var(--on-gold); }
.seg input:focus-visible + label { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
.tiers { display: grid; gap: 16px; align-items: stretch; }
.tiers--agents { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 880px; margin-inline: auto; }
.tiers--agencies { grid-template-columns: repeat(3, minmax(0, 1fr)); display: none; }
.plans-section:has(#aud-agencies:checked) .tiers--agents { display: none; }
.plans-section:has(#aud-agencies:checked) .tiers--agencies { display: grid; }
.plans-section:has(#aud-agencies:checked) .tiers--agencies .tier { animation: slide-in 500ms var(--ease-out) both; }
.tiers__foot { grid-column: 1 / -1; text-align: center; color: var(--fg-3); font-size: var(--step--1); }
.tiers__foot a { color: var(--fg-2); text-underline-offset: 3px; }

/* ---------- Tiers ---------- */
.tier { display: flex; flex-direction: column; }
.tier__body { flex: 1; display: flex; flex-direction: column; padding: 28px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-strong); transition: border-color 150ms var(--ease-out); }
.tier__body:hover { border-color: oklch(0.8 0.135 86 / 0.45); }
.tier h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 1.25rem; letter-spacing: -0.02em; }
.tier__price { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.tier__price > :first-child { font-size: var(--step-4); font-weight: 650; letter-spacing: -0.05em; line-height: 1; }
.tier__price > :last-child { color: var(--fg-3); }
.tier__lock { margin-top: 8px; color: var(--gold-hi); font-size: 0.9375rem; }
.tier .ticks { flex: 1; margin-bottom: 28px; }
.tier__note { margin-top: 12px; color: var(--fg-3); font-size: 0.875rem; text-align: center; }
.tier--featured .tier__body { border-color: oklch(0.8 0.135 86 / 0.4); }
/* Notched tab on the founding card */
.tier--founding .tier__tab {
  justify-self: start; align-self: flex-start; padding: 8px 18px; margin-bottom: -2px; border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: oklch(0.8 0.135 86 / 0.16); border: 2px solid var(--gold); border-bottom: 0; color: var(--gold-hi); font-size: 0.875rem; font-weight: 600;
}
.tier--founding .tier__body {
  border: 2px solid var(--gold); border-radius: 0 var(--r-lg) var(--r-lg) var(--r-lg);
  background: linear-gradient(oklch(0.8 0.135 86 / 0.13), var(--surface) 45%);
  box-shadow: 0 0 40px -6px oklch(0.8 0.15 86 / 0.35);
}
@media (max-width: 900px) { .tiers--agents, .plans-section:has(#aud-agencies:checked) .tiers--agencies { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Halo button: light follows the pointer; a gold ring spins on hover ---------- */
@property --hx { syntax: "<percentage>"; inherits: false; initial-value: 50%; }
@property --hy { syntax: "<percentage>"; inherits: false; initial-value: 50%; }
.btn--halo { position: relative; isolation: isolate; overflow: visible; background-image: radial-gradient(120px circle at var(--hx) var(--hy), oklch(0.97 0.08 95 / 0.65), transparent 60%); }
@media (any-hover: hover) {
  .btn--halo::before {
    content: ""; position: absolute; inset: -4px; border-radius: inherit; padding: 2px; z-index: -1; opacity: 0;
    background: conic-gradient(from var(--a), transparent 0, var(--gold-hi) 40deg, transparent 100deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    transition: opacity 200ms var(--ease-out);
  }
  .btn--halo:hover::before { opacity: 1; animation: spin-border 2s linear infinite; }
}

/* ---------- Compare table ---------- */
.compare { margin-top: 28px; border-top: 1px solid var(--line-strong); }
.compare summary { list-style: none; cursor: pointer; width: fit-content; margin: -22px auto 0; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 20px; border-radius: 999px; background: var(--canvas); border: 1px solid var(--line-strong); color: var(--fg-2); font-weight: 500; }
.compare summary::-webkit-details-marker { display: none; }
.compare summary::after { content: "+"; font: 500 1.125rem var(--mono); color: var(--gold); transition: transform var(--t-state) var(--ease-out); }
.compare[open] summary::after { transform: rotate(45deg); }
.compare summary:hover { color: var(--fg); border-color: var(--gold); }
.compare__scroll { overflow-x: auto; margin-top: 24px; }
.compare table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 0.9375rem; }
.compare th, .compare td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.compare thead th { color: var(--fg-3); font-weight: 500; font-size: 0.8125rem; }
.compare tbody th { font-weight: 500; color: var(--fg); }
.compare td { color: var(--fg-2); }
.compare td:nth-child(2) { color: var(--gold-hi); }

/* ---------- Calculator ---------- */
.calc-section { background: var(--surface); border-block: 1px solid var(--line); }
.calc-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.calc { display: grid; gap: 20px; padding: clamp(20px, 3vw, 32px); border-radius: calc(var(--r-lg) + 8px); background: var(--canvas); border: 1px solid var(--line-strong); box-shadow: var(--shadow-2); }
.calc__field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; color: var(--fg-2); font-size: 0.9375rem; }
.calc__field output { font: 500 1.125rem var(--mono); color: var(--fg); }
.calc__field input { grid-column: 1 / -1; accent-color: var(--gold); min-height: 44px; }
.calc__plan { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.calc__plan legend { width: 100%; color: var(--fg-3); font-size: 0.8125rem; margin-bottom: 8px; padding: 0; }
.calc__plan label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--fg-2); cursor: pointer; font-size: 0.9375rem; }
.calc__plan label:has(input:checked) { border-color: var(--gold); color: var(--fg); background: oklch(0.8 0.135 86 / 0.1); }
.calc__plan input { accent-color: var(--gold); width: 24px; height: 24px; margin: 0; }
.calc__result { display: grid; gap: 6px; padding: 20px; border-radius: var(--r-lg); background: linear-gradient(oklch(0.8 0.135 86 / 0.12), transparent); border: 1px solid oklch(0.8 0.135 86 / 0.3); }
.calc__big { font: 600 var(--step-4) var(--mono); letter-spacing: -0.05em; line-height: 1; color: var(--gold-hi); }
.calc__sub { color: var(--fg-3); font-size: 0.875rem; }
@media (max-width: 900px) { .calc-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- FAQ cards: one open at a time (<details name>), smooth height where supported ---------- */
.faq-cards__head { margin-inline: auto; text-align: center; }
.faq-cards__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: clamp(28px, 4vw, 44px); align-items: start; }
.faq-cards__col { display: grid; gap: 12px; }
.faq-cards details { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); transition: border-color var(--t-state) var(--ease-out); interpolate-size: allow-keywords; }
.faq-cards details[open] { border-color: oklch(0.8 0.135 86 / 0.4); }
.faq-cards summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 14px; align-items: center;
  min-height: 62px; padding: 14px 20px; font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em;
}
.faq-cards summary::-webkit-details-marker { display: none; }
.faq-cards summary::before {
  content: ""; width: 16px; height: 16px; grid-row: 1;
  background: linear-gradient(var(--gold), var(--gold)) center / 16px 2px no-repeat, linear-gradient(var(--gold), var(--gold)) center / 2px 16px no-repeat;
  transition: transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.faq-cards details[open] summary::before { transform: rotate(45deg); }
.faq-cards summary:hover { color: var(--gold-hi); }
.faq-cards details p { padding: 0 20px 20px 52px; color: var(--fg-2); }
.faq-cards details::details-content { block-size: 0; overflow: clip; transition: block-size 360ms cubic-bezier(0.2, 0.8, 0.2, 1), content-visibility 360ms allow-discrete; }
.faq-cards details[open]::details-content { block-size: auto; }
@media (max-width: 760px) { .faq-cards__cols { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .faq-cards details::details-content { transition: none; } }
