/* Neurvance plans and billing pages.
   Flat black, hairline rules, square corners. Served with style-src 'self':
   no inline styles, no external fonts or images. */

:root {
  color-scheme: dark;
  --bg: #000;
  --surface: #0a0a0a;
  --ink: #f5f5f5;
  --ink-2: #c8c8c8;
  --ink-3: #9a9a9a;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.28);
  --ok: #34d399;
  --warn: #ffd60a;
  --bad: #ff453a;
  --shell: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --font: var(--nv-font, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }

main { flex: 1 0 auto; }

.shell {
  width: 100%;
  max-width: calc(var(--shell) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 50;
  padding: 10px 16px;
  background: #fff;
  color: #000;
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus-visible { transform: none; }

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* The old decorative backdrop is not used. */
.backdrop { display: none; }

/* -------------------------------------------------------------- header */
.site-header { position: relative; z-index: 2; padding-block: 24px; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-decoration: none;
  text-transform: uppercase;
}
.brand-mark { width: 26px; height: 26px; color: #fff; }
.brand-mark path + path { display: none; }

.header-nav { display: flex; align-items: center; gap: 4px; }
.header-nav a {
  padding: 8px 12px;
  color: var(--ink-2);
  font-size: 14px;
  text-decoration: none;
}
.header-nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }

/* ---------------------------------------------------------------- hero */
.hero { padding-block: clamp(56px, 9vw, 120px) clamp(32px, 5vw, 64px); }
.hero-compact { padding-block: clamp(40px, 6vw, 80px) clamp(24px, 4vw, 40px); }

.eyebrow,
.panel-eyebrow,
.plan-brand {
  display: block;
  margin-bottom: 20px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 14ch;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero-compact h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }

.lede {
  max-width: 44ch;
  margin-top: 24px;
  color: var(--ink-2);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

/* ------------------------------------------------------------- surfaces */
.glass,
.plan {
  border: 1px solid var(--line);
  background: var(--bg);
}

.message {
  min-height: 1.4em;
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.4;
}
.message:empty { min-height: 0; margin: 0; }
.message.is-error { color: var(--bad); }
.message.is-ok { color: var(--ok); }
.message-page { margin: 0 0 24px; max-width: 60ch; }
.message-page:empty { margin: 0; }

/* -------------------------------------------------------------- banner */
.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin: 0 0 32px;
  padding: 20px 24px;
}
.banner-text { font-size: 1rem; color: var(--ink); }
.banner-text:focus-visible { outline-offset: 6px; }
.banner-text strong { font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }
.banner-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.banner .message { flex-basis: 100%; margin-top: 0; }

/* --------------------------------------------------------------- plans */
.plans {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--line);
}

.plan {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 36px 28px 28px;
  border: 0;
}
.plan + .plan { border-top: 1px solid var(--line); }
.plan.is-targeted { outline: 2px solid #fff; outline-offset: -2px; background: var(--surface); }
.plan:hover { background: var(--surface); }

.plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.plan-title { line-height: 1.1; }
.plan-brand { margin-bottom: 8px; }
.plan-tier { display: block; font-size: 2.2rem; font-weight: 500; letter-spacing: -0.03em; }

.plan-mult {
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.plan-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 10px; margin: 32px 0 0; }
.plan-amount { font-size: 3rem; font-weight: 500; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.plan-interval { color: var(--ink-3); font-size: 0.95rem; }

.plan-credit { display: flex; align-items: center; gap: 10px; margin: 18px 0 20px; }
.plan-credit svg { flex: none; width: 18px; height: 18px; color: #fff; }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 24px; }
.chip,
.chips li {
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.chips .chip-label { padding-inline: 0; border: 0; color: var(--ink-3); }

.plan-body {
  flex: 1 1 auto;
  margin-bottom: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.95rem;
}
.plan-body p + p { margin-top: 0.85em; }

.plan-cta { display: flex; flex-direction: column; }
.plan-message { margin-top: 12px; }

.market-exclusion { margin-top: 20px; color: var(--ink-3); font-size: 0.9rem; }
.market-exclusion strong { color: var(--ink); font-weight: 500; }
.market-exclusion a { text-underline-offset: 3px; }

/* ------------------------------------------------------------- buttons */
.btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: 0;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-block { width: 100%; }

.btn-primary { background: #fff; border-color: #fff; color: #000; }
.btn-primary:hover:not(:disabled) { background: #000; color: #fff; }

.btn-secondary { background: transparent; border-color: #fff; color: #fff; }
.btn-secondary:hover:not(:disabled) { background: #fff; color: #000; }

.btn:disabled { cursor: not-allowed; opacity: 0.5; }
.btn[aria-busy="true"] { cursor: progress; opacity: 0.85; }
.btn[aria-busy="true"]::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.free-note {
  max-width: 580px;
  margin: 24px auto 0;
  color: var(--ink-3);
  font-size: 0.85rem;
  text-align: center;
}
.free-note + p {
  max-width: 580px;
  margin: 12px auto 0;
  color: var(--ink-3);
  font-size: 0.85rem;
  text-align: center;
}
.free-note + p a { color: var(--ink-2); text-underline-offset: 3px; }
.free-note + p a:hover { color: #fff; }

/* ------------------------------------------------------------- contact */
.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  margin-top: 64px;
  padding: 32px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.contact h2 { margin-bottom: 8px; font-size: 1.6rem; font-weight: 500; letter-spacing: -0.03em; }
.contact p { max-width: 58ch; color: var(--ink-2); }
.contact-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid #fff;
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background 0.15s, color 0.15s;
}
.contact-link:hover { background: #fff; color: #000; }

/* -------------------------------------------------------------- footer */
.site-footer { margin-top: 64px; padding-block: 28px 36px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.site-footer a { color: var(--ink-2); text-underline-offset: 3px; }
.site-footer a:hover { color: #fff; }

/* ------------------------------------------------------------- billing */
.billing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--line);
}
.billing-grid > .glass { border: 0; }
.billing-grid > .glass + .glass { border-top: 1px solid var(--line); }

.panel { padding: 32px 28px; min-width: 0; }
.plan-heading { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }
.status-row { margin-top: 16px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.pill::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok { color: var(--ok); border-color: var(--ok); }
.pill-warn { color: var(--warn); border-color: var(--warn); }
.pill-bad { color: var(--bad); border-color: var(--bad); }

.facts { margin-top: 24px; }
.fact { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.fact dt { color: var(--ink-3); }
.fact dd { color: var(--ink); font-weight: 500; text-align: right; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.help { margin-top: 14px; color: var(--ink-3); font-size: 0.88rem; }
.muted { color: var(--ink-3); }

.metric { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.metric-of { color: var(--ink-3); font-size: 0.6em; font-weight: 400; letter-spacing: -0.01em; }
.fact-inline { margin-top: 14px; color: var(--ink-2); font-size: 0.92rem; }
.fact-inline strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.meter { height: 6px; margin: 20px 0 4px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.meter-fill {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
  transition: width 0.6s ease;
}
.meter.is-warn .meter-fill { background: var(--warn); }
.meter.is-full .meter-fill { background: var(--bad); }

.state-card { max-width: 560px; padding: 36px 32px; }
.state-card h2 { margin-bottom: 8px; font-size: 1.5rem; font-weight: 500; letter-spacing: -0.03em; }
.state-card p { margin-bottom: 24px; color: var(--ink-2); }

.sk { display: block; background: rgba(255, 255, 255, 0.1); animation: pulse 1.6s ease-in-out infinite; }
.sk-eyebrow { width: 96px; height: 12px; margin-bottom: 20px; }
.sk-title { width: 58%; height: 30px; margin-bottom: 24px; }
.sk-line { height: 14px; margin-bottom: 12px; }
.sk-short { width: 55%; }
.sk-bar { height: 6px; margin: 8px 0 20px; }
.sk-button { width: 170px; height: 46px; margin-top: 22px; }

/* ----------------------------------------------------------- animation */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* -------------------------------------------------------------- layout */
@media (min-width: 980px) {
  .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plan + .plan { border-top: 0; border-left: 1px solid var(--line); }
  .billing-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .billing-grid > .glass + .glass { border-top: 0; }
  .billing-grid > :first-child { grid-row: span 2; border-right: 1px solid var(--line); }
  #credit-panel:not([hidden]) + #usage-panel,
  #state-loading > .glass:nth-child(3) { border-top: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .site-header { padding-block: 18px; }
  .header-nav a { padding: 8px 10px; }
  .plan { padding: 28px 22px 24px; }
  .plan-amount { font-size: 2.6rem; }
  .contact { padding-top: 26px; }
  .contact-link { width: 100%; justify-content: center; }
  .banner { padding: 18px 20px; }
  .panel { padding: 26px 22px; }
  .state-card { padding: 30px 22px; }
  .fact { flex-direction: column; gap: 4px; }
  .fact dd { text-align: left; }
  .actions .btn { width: 100%; }
}

/* ------------------------------------------- purchase review and forms
   Live-only markup: the purchase dialog on /subscribe, the purchases list on
   /billing, and the plain pages that reuse this stylesheet (privacy requests,
   updated documents, refund and withdrawal). Same flat black spec. */
main > .glass.panel { margin-top: 24px; }
main > .glass.panel h2 { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.03em; }
main > .glass.panel p { margin-top: 12px; color: var(--ink-2); }
main > .glass.panel a { text-underline-offset: 3px; }
#purchase-list li { padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
#purchase-list:empty { display: none; }

/* A plain button with no variant is the primary action. */
.btn:not(.btn-primary):not(.btn-secondary) { background: #fff; border-color: #fff; color: #000; }
.btn:not(.btn-primary):not(.btn-secondary):hover:not(:disabled) { background: #000; color: #fff; }
#close-purchase,
#cancel-earlier-checkout { background: transparent; border-color: #fff; color: #fff; }
#close-purchase:hover:not(:disabled),
#cancel-earlier-checkout:hover:not(:disabled) { background: #fff; color: #000; }

dialog {
  max-width: min(48rem, 94vw);
  max-height: 90vh;
  overflow: auto;
  padding: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.8); }
dialog h2 { margin-bottom: 20px; font-size: 1.5rem; font-weight: 500; letter-spacing: -0.03em; }
dialog p { margin-top: 12px; color: var(--ink-2); }
dialog a { text-underline-offset: 3px; }
dialog .btn { margin-top: 16px; margin-right: 8px; }
dialog label { color: var(--ink-2); font-size: 0.92rem; }

input,
select,
textarea {
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #000;
  color: var(--ink);
  font: inherit;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
dialog input[type="checkbox"] { width: auto; margin-right: 8px; accent-color: #fff; }
textarea { width: 100%; }
#quote-contract { white-space: pre-wrap; }
#declaration { white-space: pre-wrap; overflow-wrap: anywhere; }
#withdraw-form,
#confirmation { max-width: 46rem; padding: 16px 0; }

/* Plain pages (privacy requests, updated documents) have no header. */
main.shell > h1 { margin: 32px 0 20px; font-size: clamp(2rem, 5vw, 3rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
main.shell > h2 { margin: 32px 0 12px; font-size: 1.4rem; font-weight: 500; letter-spacing: -0.03em; }
main.shell > h3,
main.shell > section > h3 { margin: 24px 0 8px; font-size: 1rem; font-weight: 500; }
main.shell > p,
main.shell > form,
main.shell > section > p,
main.shell > section > form { margin-top: 12px; }
main.shell > p:first-child { margin-top: 24px; color: var(--ink-3); font-size: 0.9rem; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .glass, .plan { border: 1px solid CanvasText; }
  .btn { border-color: ButtonText; }
  .meter { border: 1px solid CanvasText; }
  .meter-fill { background: Highlight; }
}
