/* Niles Desk — Modern Warm theme for the warranty-concierge codebase.
   Drop-in replacement for static/css/site.css.
   Preserves every class name and structural selector the templates emit,
   so tests and markup stay untouched. Pairs with Google Fonts:
   Fraunces (display/serif) + Inter (body/UI) loaded via base.html.

   Direction C — warm-neutral, contemporary, Aesop/Ramp-warm territory.
   Cream + cognac accent + deep ink. Strong typographic hierarchy.
   No ornament; rhythm comes from type, scale and airy spacing. */

:root {
  /* ── Palette ───────────────────────────────────────── */
  --nd-bg: #f6f0e4;            /* cream */
  --nd-paper: #ffffff;         /* card / panel */
  --nd-bg-soft: #ede5d2;       /* slightly deeper cream for alt rows */
  --nd-ink: #1f1c17;           /* near-black; body text */
  --nd-ink-soft: #3a3528;      /* secondary heading weight */
  --nd-muted: #6b6558;         /* supporting copy */
  --nd-muted-2: #8a8372;       /* captions / meta */
  --nd-line: #e4dcc8;          /* hairlines, borders */
  --nd-line-strong: #cfc4a8;   /* stronger divisions */

  --nd-accent: #8a5a2b;        /* cognac — primary accent */
  --nd-accent-hover: #6f4620;  /* cognac darker */
  --nd-accent-soft: #f0e3ce;   /* cognac tint for badges/fields on cream */

  --nd-success: #5f6b42;       /* sage — used sparingly for confirmations */
  --nd-danger: #9a3b2a;        /* muted terracotta for errors */

  --nd-focus: #8a5a2b;

  /* ── Type ──────────────────────────────────────────── */
  --nd-display: "Fraunces", "Tiempos Headline", Georgia, serif;
  --nd-serif: "Fraunces", "Tiempos Text", Georgia, serif;
  --nd-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --nd-mono: ui-monospace, "SF Mono", "Menlo", monospace;

  /* Scale — modern, generous, a bit tighter than the Deco */
  --nd-fs-xs: 12px;
  --nd-fs-sm: 13px;
  --nd-fs-base: 15px;
  --nd-fs-md: 17px;
  --nd-fs-lg: 20px;
  --nd-fs-xl: 26px;
  --nd-fs-2xl: 34px;
  --nd-fs-3xl: 44px;
  --nd-fs-4xl: 56px;

  /* ── Spacing (8px base) ────────────────────────────── */
  --nd-s-1: 4px;
  --nd-s-2: 8px;
  --nd-s-3: 12px;
  --nd-s-4: 16px;
  --nd-s-5: 24px;
  --nd-s-6: 32px;
  --nd-s-7: 48px;
  --nd-s-8: 64px;
  --nd-s-9: 96px;

  --nd-radius-sm: 4px;
  --nd-radius: 6px;
  --nd-radius-lg: 10px;
  --nd-radius-pill: 999px;

  --nd-maxw: 1120px;
  --nd-maxw-prose: 640px;

  --nd-shadow-sm: 0 1px 2px rgba(31, 28, 23, 0.04);
  --nd-shadow: 0 8px 24px -16px rgba(31, 28, 23, 0.22);
  --nd-shadow-lg: 0 24px 48px -28px rgba(31, 28, 23, 0.28);
}

/* ── Reset / base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--nd-bg);
  color: var(--nd-ink);
  font-family: var(--nd-sans);
  font-size: var(--nd-fs-base);
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--nd-ink); text-decoration: underline; text-decoration-color: var(--nd-line-strong); text-underline-offset: 3px; }
a:hover { color: var(--nd-accent); text-decoration-color: var(--nd-accent); }

:focus-visible {
  outline: 2px solid var(--nd-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection { background: var(--nd-accent-soft); color: var(--nd-ink); }

/* ── Accessibility helpers ────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; top: -40px; left: var(--nd-s-4);
  background: var(--nd-ink); color: var(--nd-bg);
  padding: var(--nd-s-2) var(--nd-s-4);
  border-radius: var(--nd-radius);
  text-decoration: none;
  font-weight: 500;
  z-index: 1000;
}
.skip-link:focus { top: var(--nd-s-4); }

/* ── Typography ───────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--nd-display);
  font-weight: 400;
  color: var(--nd-ink);
  margin: 0 0 var(--nd-s-4);
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-wrap: balance;
}

h1 { font-size: clamp(var(--nd-fs-2xl), 4.5vw, var(--nd-fs-4xl)); letter-spacing: -0.025em; line-height: 1.02; }
h2 { font-size: clamp(var(--nd-fs-xl), 3vw, var(--nd-fs-2xl)); letter-spacing: -0.015em; }
h3 { font-size: var(--nd-fs-lg); }
h4 { font-size: var(--nd-fs-md); font-weight: 500; }

h1 em, h2 em, h3 em { font-style: italic; font-variation-settings: "opsz" 144; }

p { margin: 0 0 var(--nd-s-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

small, .small { font-size: var(--nd-fs-sm); color: var(--nd-muted); }

strong, b { font-weight: 600; color: var(--nd-ink); }
em, i { font-style: italic; }

hr {
  border: 0;
  border-top: 1px solid var(--nd-line);
  margin: var(--nd-s-7) 0;
}

ul, ol { padding-left: 1.3em; margin: 0 0 var(--nd-s-4); }
li { margin-bottom: var(--nd-s-2); }

code, pre { font-family: var(--nd-mono); font-size: 0.92em; }

/* ── Layout primitives ────────────────────────────────── */
.container, main, .main, .page {
  max-width: var(--nd-maxw);
  margin-inline: auto;
  padding-inline: clamp(var(--nd-s-5), 4vw, var(--nd-s-7));
}

main, .main {
  padding-block: var(--nd-s-7);
}

section { margin-bottom: var(--nd-s-8); }
section:last-child { margin-bottom: 0; }

/* ── Header / navigation ──────────────────────────────── */
.site-header, header.site-header, body > header {
  background: var(--nd-bg);
  border-bottom: 1px solid var(--nd-line);
  padding: var(--nd-s-4) 0;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(6px);
}

.site-header .container,
.site-header > nav,
.site-header-inner {
  max-width: var(--nd-maxw);
  margin-inline: auto;
  padding-inline: clamp(var(--nd-s-5), 4vw, var(--nd-s-7));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--nd-s-5);
}

.site-header a { text-decoration: none; }

.brand, .site-title, .logo {
  font-family: var(--nd-display);
  font-size: var(--nd-fs-lg);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--nd-ink);
  line-height: 1;
}
.brand em, .site-title em {
  font-style: italic;
  color: var(--nd-accent);
  font-variation-settings: "opsz" 144;
}

nav ul, .nav, .site-nav ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; gap: var(--nd-s-5);
  font-size: var(--nd-fs-sm);
}

nav a, .site-nav a {
  color: var(--nd-muted);
  text-decoration: none;
  padding: var(--nd-s-1) 0;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
nav a:hover, .site-nav a:hover {
  color: var(--nd-ink);
  border-bottom-color: var(--nd-accent);
}
nav a[aria-current="page"], .site-nav a.active {
  color: var(--nd-ink);
  border-bottom-color: var(--nd-accent);
}

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  padding-block: clamp(var(--nd-s-7), 8vw, var(--nd-s-9));
  max-width: var(--nd-maxw);
  margin-inline: auto;
  padding-inline: clamp(var(--nd-s-5), 4vw, var(--nd-s-7));
}

.hero-eyebrow, .eyebrow {
  font-size: var(--nd-fs-xs);
  color: var(--nd-accent);
  letter-spacing: 0.02em;
  margin-bottom: var(--nd-s-3);
  display: block;
}

.hero h1, h1.hero-title {
  /* Hero headline in Inter sans — utility/clarity; brand mark keeps Fraunces. */
  font-family: var(--nd-sans);
  font-weight: 500;
  font-size: clamp(var(--nd-fs-2xl), 5vw, var(--nd-fs-4xl));
  line-height: 1.12;
  letter-spacing: -0.025em;
  max-width: 22ch;
  margin-bottom: var(--nd-s-4);
  font-variation-settings: normal;
}

/* No italics anywhere in the hero headline — explicit override in case an
   <em> ever sneaks back in. */
.hero h1 em, .hero-title em {
  font-style: normal;
  color: inherit;
  font-variation-settings: normal;
}

.hero .subtitle, .hero p.lede, .hero-lede {
  font-size: var(--nd-fs-md);
  color: var(--nd-ink-soft);
  max-width: 52ch;
  line-height: 1.55;
  margin-bottom: var(--nd-s-5);
}

.hero-meta, .meta {
  font-size: var(--nd-fs-sm);
  color: var(--nd-muted);
  margin-top: var(--nd-s-3);
}

/* ── Centered hero (home) ─────────────────────────────── */
.hero-centered .container { text-align: center; }

.hero-centered h1 {
  max-width: 24ch;
  margin-inline: auto;
  margin-bottom: var(--nd-s-7);
}

.hero-centered .cta-row {
  margin-top: var(--nd-s-6);
  margin-bottom: var(--nd-s-5);
}

.hero-centered .trust {
  list-style: none;
  padding: 0;
  margin: 0 auto var(--nd-s-5);
  max-width: 56ch;
  display: grid;
  gap: var(--nd-s-2);
  font-size: var(--nd-fs-sm);
  color: var(--nd-muted);
}

.hero-centered .learn-more-row {
  font-size: var(--nd-fs-sm);
  color: var(--nd-muted);
  margin-top: var(--nd-s-5);
}
.hero-centered .learn-more-label {
  color: var(--nd-muted-2);
  margin-right: var(--nd-s-2);
}
.hero-centered .learn-more-sep { color: var(--nd-line-strong); margin-inline: var(--nd-s-2); }
.hero-centered .learn-more-row a {
  color: var(--nd-ink);
  text-decoration-color: var(--nd-line-strong);
}
.hero-centered .learn-more-row a:hover { color: var(--nd-accent); text-decoration-color: var(--nd-accent); }

/* ── Brand lockup (primary SVG wordmark) ──────────────── */
/* Self-contained logo: wordmark + terracotta dot + horizon hills.
   Sized so the hills sit just above the H1 without dominating. */
.brand-mark {
  display: block;
  margin: 0 auto var(--nd-s-7);
  width: clamp(280px, 44vw, 560px);
  height: auto;
  max-width: 100%;
}

/* ── Coverage / how-it-works flow ─────────────────────── */
.coverage-flow {
  list-style: none;
  padding: 0;
  margin: var(--nd-s-6) auto var(--nd-s-6);
  max-width: 960px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: var(--nd-s-5);
  text-align: left;
}

.coverage-flow .flow-step {
  position: relative;
  background: var(--nd-paper);
  border: 1px solid var(--nd-line);
  border-radius: var(--nd-radius-lg);
  padding: var(--nd-s-5);
  box-shadow: var(--nd-shadow-sm);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--nd-s-1);
}

/* Connector arrow centered in the gap between each pair of steps. */
.coverage-flow .flow-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  left: 100%;
  margin-left: calc(var(--nd-s-5) / 2);
  transform: translate(-50%, -50%);
  color: var(--nd-accent);
  font-family: var(--nd-sans);
  font-size: var(--nd-fs-xl);
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}

.flow-step-label {
  display: block;
  font-family: var(--nd-sans);
  font-size: var(--nd-fs-md);
  font-weight: 600;
  color: var(--nd-ink);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.flow-step-sub {
  display: block;
  font-size: var(--nd-fs-xs);
  color: var(--nd-muted);
  line-height: 1.5;
}

@media (max-width: 820px) {
  .coverage-flow {
    grid-template-columns: 1fr;
    gap: var(--nd-s-5);
  }
  .coverage-flow .flow-step:not(:last-child)::after {
    content: "↓";
    top: 100%;
    left: 50%;
    margin-left: 0;
    margin-top: calc(var(--nd-s-5) / 2);
    transform: translate(-50%, -50%);
  }
}

/* ── Buttons / CTAs ───────────────────────────────────── */
.btn, button, input[type="submit"], input[type="button"],
a.button, a.btn, .cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--nd-s-2);
  font-family: var(--nd-sans);
  font-size: var(--nd-fs-sm);
  font-weight: 500;
  line-height: 1;
  padding: 14px 22px;
  border-radius: var(--nd-radius-pill);
  border: 1px solid transparent;
  background: var(--nd-ink);
  color: var(--nd-bg);
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
  letter-spacing: 0;
}

.btn:hover, button:hover, input[type="submit"]:hover,
a.button:hover, a.btn:hover, .cta:hover {
  background: var(--nd-accent);
  color: var(--nd-paper);
}

.btn:active, button:active { transform: translateY(1px); }

/* The pill-button rule above sets display: inline-flex on every button,
   which overrides the UA [hidden] → display: none. Restore it. */
[hidden] { display: none !important; }

.btn-primary, .cta-primary, .btn.primary {
  background: var(--nd-ink);
  color: var(--nd-bg);
}
.btn-primary:hover { background: var(--nd-accent); }

.btn-secondary, .cta-secondary, .btn.secondary {
  background: transparent;
  color: var(--nd-ink);
  border-color: var(--nd-line-strong);
}
.btn-secondary:hover {
  background: var(--nd-paper);
  border-color: var(--nd-accent);
  color: var(--nd-accent);
}

.btn-link, a.link {
  background: none;
  color: var(--nd-ink);
  padding: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--nd-ink);
  border-top: 0; border-left: 0; border-right: 0;
  font-weight: 500;
}
.btn-link:hover, a.link:hover {
  color: var(--nd-accent);
  border-bottom-color: var(--nd-accent);
  background: none;
}

/* ── Pricing badge / inline pill ──────────────────────── */
.badge, .pill, .price-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--nd-radius-pill);
  background: var(--nd-accent-soft);
  color: var(--nd-accent-hover);
  font-size: var(--nd-fs-xs);
  font-weight: 500;
  letter-spacing: 0;
}

/* ── Cards / panels ───────────────────────────────────── */
.card, .panel, .box {
  background: var(--nd-paper);
  border: 1px solid var(--nd-line);
  border-radius: var(--nd-radius-lg);
  padding: var(--nd-s-6);
  box-shadow: var(--nd-shadow-sm);
}

.card h2, .card h3, .panel h3 { margin-top: 0; }

/* Coverage-layer / how-it-works grid card variant */
.step, .feature, .coverage-item {
  background: var(--nd-bg-soft);
  border: 1px solid var(--nd-line);
  border-radius: var(--nd-radius);
  padding: var(--nd-s-5);
}

.step-num, .feature-num {
  font-family: var(--nd-display);
  font-size: var(--nd-fs-sm);
  color: var(--nd-accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  margin-bottom: var(--nd-s-2);
}

.step h3, .feature h3 {
  font-size: var(--nd-fs-md);
  font-weight: 500;
  margin-bottom: var(--nd-s-2);
  font-family: var(--nd-display);
}

.step p, .feature p {
  font-size: var(--nd-fs-sm);
  color: var(--nd-muted);
  margin: 0;
  line-height: 1.55;
}

/* Horizontal timeline rows (how-it-works alt layout) */
.timeline-row, .step-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--nd-s-5);
  padding: var(--nd-s-4) 0;
  border-bottom: 1px solid var(--nd-line);
}
.timeline-row:first-child, .step-row:first-child {
  border-top: 1px solid var(--nd-line);
}

/* ── Generic grids ────────────────────────────────────── */
.grid, .grid-3, .features, .steps, .coverage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--nd-s-5);
  margin-bottom: var(--nd-s-6);
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 820px) {
  .grid, .grid-3, .features, .steps, .coverage-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Section heading utility ──────────────────────────── */
.section-head, .section-title {
  margin-bottom: var(--nd-s-5);
}
.section-head .eyebrow { margin-bottom: var(--nd-s-2); }
.section-head h2, .section-title h2 {
  max-width: 22ch;
  margin-bottom: 0;
}

/* ── Alt background section ───────────────────────────── */
.section-alt, section.alt, .bg-paper {
  background: var(--nd-paper);
  border-top: 1px solid var(--nd-line);
  border-bottom: 1px solid var(--nd-line);
  margin-inline: calc(-1 * clamp(var(--nd-s-5), 4vw, var(--nd-s-7)));
  padding: var(--nd-s-8) clamp(var(--nd-s-5), 4vw, var(--nd-s-7));
}

/* ── Forms ────────────────────────────────────────────── */
form, .form { margin: 0; }

fieldset {
  border: 1px solid var(--nd-line);
  border-radius: var(--nd-radius-lg);
  padding: var(--nd-s-6);
  margin: 0 0 var(--nd-s-5);
  background: var(--nd-paper);
}

legend {
  float: left;
  width: 100%;
  padding: 0;
  margin: 0 0 var(--nd-s-4);
  font-family: var(--nd-display);
  font-size: var(--nd-fs-lg);
  color: var(--nd-ink);
  font-weight: 400;
  line-height: 1.25;
}

fieldset > legend + * { clear: both; }
fieldset::after { content: ""; display: block; clear: both; }

label, .label {
  display: block;
  font-size: var(--nd-fs-sm);
  font-weight: 500;
  color: var(--nd-ink);
  margin-bottom: var(--nd-s-2);
}

.field, .form-field, .form-row {
  margin-bottom: var(--nd-s-5);
}

.field .help, .field small, .help-text, .hint {
  display: block;
  font-size: var(--nd-fs-xs);
  color: var(--nd-muted);
  margin-top: var(--nd-s-1);
  line-height: 1.5;
}

input[type="text"], input[type="email"], input[type="tel"],
input[type="number"], input[type="url"], input[type="search"],
input[type="date"], input[type="password"],
select, textarea {
  width: 100%;
  font-family: var(--nd-sans);
  font-size: var(--nd-fs-base);
  color: var(--nd-ink);
  background: var(--nd-paper);
  border: 1px solid var(--nd-line-strong);
  border-radius: var(--nd-radius);
  padding: 10px 12px;
  line-height: 1.4;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
  appearance: none;
  -webkit-appearance: none;
}

input:hover, select:hover, textarea:hover { border-color: var(--nd-muted-2); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--nd-accent);
  box-shadow: 0 0 0 3px var(--nd-accent-soft);
  background: var(--nd-paper);
}

textarea { min-height: 120px; resize: vertical; }

select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--nd-muted) 50%),
    linear-gradient(135deg, var(--nd-muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

input[type="checkbox"], input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: var(--nd-accent);
  margin-right: var(--nd-s-2);
  vertical-align: -2px;
}

.checkbox-row, .radio-row, label.inline {
  display: flex;
  align-items: flex-start;
  gap: var(--nd-s-2);
  font-weight: 400;
  font-size: var(--nd-fs-sm);
  color: var(--nd-ink-soft);
  line-height: 1.5;
  margin-bottom: var(--nd-s-2);
}
.checkbox-row input, .radio-row input { margin-top: 3px; }

/* Errors and validation */
.error, .form-error, .errors {
  color: var(--nd-danger);
  font-size: var(--nd-fs-sm);
  margin-top: var(--nd-s-2);
}
input.invalid, select.invalid, textarea.invalid,
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--nd-danger);
  box-shadow: 0 0 0 3px rgba(154, 59, 42, 0.12);
}

/* Inline non-blocking warnings below individual fields (e.g. Q3, Q5, Q6) */
.warn {
  margin-top: var(--nd-s-3);
  padding: var(--nd-s-3) var(--nd-s-4);
  background: var(--nd-accent-soft);
  border-left: 3px solid var(--nd-accent);
  border-radius: var(--nd-radius);
  color: var(--nd-ink-soft);
  font-size: var(--nd-fs-sm);
  line-height: 1.55;
}
.warn p { margin: 0; }
.warn-confirm p { margin-bottom: var(--nd-s-3); }
.warn-actions {
  display: flex;
  gap: var(--nd-s-3);
  flex-wrap: wrap;
}
.warn-actions button {
  padding: 8px 16px;
  font-size: var(--nd-fs-sm);
}

.form-exit, .exit-note {
  background: var(--nd-accent-soft);
  border: 1px solid var(--nd-line-strong);
  border-radius: var(--nd-radius);
  padding: var(--nd-s-4) var(--nd-s-5);
  color: var(--nd-ink-soft);
  font-size: var(--nd-fs-sm);
  margin-bottom: var(--nd-s-5);
}

.form-actions, .actions {
  display: flex;
  gap: var(--nd-s-3);
  align-items: center;
  margin-top: var(--nd-s-6);
}

/* ── Multi-service wizard extras ──────────────────────── */
/* Service selector — each option renders as a full-width card-like row. */
.service-option {
  display: flex;
  align-items: flex-start;
  gap: var(--nd-s-3);
  padding: var(--nd-s-4) var(--nd-s-5);
  border: 1px solid var(--nd-line);
  border-radius: var(--nd-radius-lg);
  background: var(--nd-paper);
  cursor: pointer;
  margin-bottom: var(--nd-s-3);
  font-size: var(--nd-fs-base);
  line-height: 1.5;
  transition: border-color 120ms ease, background 120ms ease;
}
.service-option:hover { border-color: var(--nd-accent); }
.service-option input[type="radio"] { margin-top: 4px; flex: 0 0 auto; }
.service-option:has(input[type="radio"]:checked) {
  border-color: var(--nd-accent);
  background: var(--nd-accent-soft);
}

/* Screen-2 variants — hidden by default, JS reveals the chosen one. */
.wizard-variant[hidden] { display: none !important; }
.variant-headline {
  font-family: var(--nd-display);
  font-size: var(--nd-fs-xl);
  margin: 0 0 var(--nd-s-3);
  font-weight: 400;
  color: var(--nd-ink);
}
.variant-framing {
  color: var(--nd-ink-soft);
  margin-bottom: var(--nd-s-5);
  font-size: var(--nd-fs-base);
  line-height: 1.6;
}
.prompt-help {
  font-size: var(--nd-fs-sm);
  color: var(--nd-muted);
  margin: var(--nd-s-4) 0 var(--nd-s-2);
}
.prompt-list {
  margin: 0 0 var(--nd-s-5);
  padding-left: 1.2em;
  color: var(--nd-ink-soft);
  font-size: var(--nd-fs-sm);
  line-height: 1.6;
}
.prompt-list li { margin-bottom: var(--nd-s-2); }

/* Fee disclosure — one visible, the other hidden, depending on service_type. */
.fee-disclosure[hidden] { display: none !important; }
.fee-disclosure {
  margin: var(--nd-s-5) 0;
  padding: var(--nd-s-4) var(--nd-s-5);
  background: var(--nd-bg-soft);
  border-left: 3px solid var(--nd-accent);
  border-radius: var(--nd-radius);
  color: var(--nd-ink-soft);
  font-size: var(--nd-fs-sm);
  line-height: 1.6;
}
.fee-disclosure p { margin: 0; }

/* ── Intake wizard ────────────────────────────────────── */
/* Before wizard.js activates, every fieldset + checkpoint is visible
   (no-JS fallback). Once the form carries data-wizard-active, only the
   step flagged active is shown. If wizard.js errors mid-run, the user
   still sees the in-progress step — never an empty page. */
.case-form[data-wizard-active] .wizard-step { display: none; }
.case-form[data-wizard-active] .wizard-step.wizard-step-active { display: block; }

.wizard-step-heading {
  font-family: var(--nd-display);
  font-size: var(--nd-fs-xl);
  margin: 0 0 var(--nd-s-5);
  color: var(--nd-ink);
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* When the wizard is active, the horizontal stepper at the top owns the
   current-section heading — hide the per-section <h2> visually but keep
   it in the DOM for semantic structure and the no-JS fallback. */
.case-form[data-wizard-active] .wizard-step-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wizard-checkpoint {
  background: var(--nd-accent-soft);
  border: 1px solid var(--nd-line-strong);
  border-left: 3px solid var(--nd-accent);
  border-radius: var(--nd-radius-lg);
  padding: var(--nd-s-5) var(--nd-s-6);
  margin: 0 0 var(--nd-s-5);
}
.wizard-checkpoint h2 {
  font-family: var(--nd-display);
  font-size: var(--nd-fs-lg);
  margin: 0 0 var(--nd-s-3);
  color: var(--nd-ink);
  font-weight: 500;
}
.wizard-checkpoint p {
  margin: 0 0 var(--nd-s-3);
  color: var(--nd-ink-soft);
  font-size: var(--nd-fs-sm);
  line-height: 1.6;
}
.wizard-checkpoint p:last-child { margin-bottom: 0; }

.case-form[data-wizard-active] .wizard-checkpoint { display: none; }
.case-form[data-wizard-active] .wizard-checkpoint.wizard-step-active { display: block; }

/* ── Wizard stepper (horizontal progress tracker) ─────── */
.wizard-progress {
  margin: 0 0 var(--nd-s-7);
}
.wizard-stepper {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.wizard-stepper-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--nd-s-2);
  position: relative;
  padding: 0 var(--nd-s-2);
  text-align: center;
}
/* Connector line between steps */
.wizard-stepper-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 13px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 1px;
  background: var(--nd-line);
  z-index: 0;
}
.wizard-stepper-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--nd-paper);
  border: 1px solid var(--nd-line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--nd-display);
  font-size: var(--nd-fs-sm);
  color: var(--nd-muted);
  font-variant-numeric: tabular-nums;
  position: relative;
  z-index: 1;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}
.wizard-stepper-label {
  font-size: var(--nd-fs-xs);
  line-height: 1.3;
  color: var(--nd-muted);
  max-width: 14ch;
}
/* Completed step */
.wizard-stepper-item-done .wizard-stepper-num {
  background: var(--nd-accent);
  border-color: var(--nd-accent);
  color: var(--nd-paper);
}
.wizard-stepper-item-done .wizard-stepper-label {
  color: var(--nd-ink-soft);
}
.wizard-stepper-item-done:not(:last-child)::after {
  background: var(--nd-accent);
}
/* Active step */
.wizard-stepper-item-active .wizard-stepper-num {
  background: var(--nd-paper);
  border-color: var(--nd-accent);
  color: var(--nd-accent);
  font-weight: 500;
  box-shadow: 0 0 0 3px var(--nd-accent-soft);
}
.wizard-stepper-item-active .wizard-stepper-label {
  color: var(--nd-ink);
  font-weight: 500;
}

/* Mobile: hide labels, keep numbered dots + connectors */
@media (max-width: 640px) {
  .wizard-stepper-label { display: none; }
  .wizard-stepper-item { gap: 0; }
  .wizard-stepper-item:not(:last-child)::after { top: 13px; }
}

/* The "Step N of M" text and the progress bar are accessibility duplicates
   of the stepper; both are .sr-only so screen readers read the count while
   sighted users see the stepper. Keep .wizard-bar style so the hidden
   <progress> element still validates as a progress bar visually if ever
   revealed via dev tooling. */
.wizard-bar {
  display: block;
  width: 100%;
  height: 3px;
  border: none;
  appearance: none;
  -webkit-appearance: none;
  background: var(--nd-line);
  border-radius: var(--nd-radius-pill);
  overflow: hidden;
}
.wizard-bar::-webkit-progress-bar { background: var(--nd-line); border-radius: var(--nd-radius-pill); }
.wizard-bar::-webkit-progress-value { background: var(--nd-accent); border-radius: var(--nd-radius-pill); }
.wizard-bar::-moz-progress-bar { background: var(--nd-accent); border-radius: var(--nd-radius-pill); }

.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--nd-s-3);
  margin: var(--nd-s-6) 0 var(--nd-s-4);
}
.wizard-nav .wizard-prev,
.wizard-nav .wizard-next {
  font-family: var(--nd-sans);
  font-size: var(--nd-fs-sm);
  font-weight: 500;
  line-height: 1;
  padding: 12px 22px;
  border-radius: var(--nd-radius-pill);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.wizard-nav .wizard-prev {
  background: transparent;
  color: var(--nd-ink);
  border: 1px solid var(--nd-line-strong);
}
.wizard-nav .wizard-prev:hover {
  border-color: var(--nd-accent);
  color: var(--nd-accent);
  background: var(--nd-paper);
}
.wizard-nav .wizard-next {
  background: var(--nd-ink);
  color: var(--nd-bg);
  border: 1px solid var(--nd-ink);
  margin-left: auto;
}
.wizard-nav .wizard-next:hover {
  background: var(--nd-accent);
  border-color: var(--nd-accent);
  color: var(--nd-paper);
}
/* Submit button shares the nav row on the final step. Sits right-aligned
   opposite Previous. Reuses the pill styling from the global button rule
   — only the positional override is needed here. */
.wizard-nav button[type="submit"] {
  margin-left: auto;
}
.wizard-nav button[hidden] { display: none; }

/* ── Tables (e.g. FAQ or fee breakdown) ───────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--nd-fs-sm);
  margin-bottom: var(--nd-s-5);
}
th, td {
  text-align: left;
  padding: var(--nd-s-3) var(--nd-s-4);
  border-bottom: 1px solid var(--nd-line);
  vertical-align: top;
}
th {
  font-weight: 500;
  color: var(--nd-ink);
  background: var(--nd-bg-soft);
  font-size: var(--nd-fs-xs);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ── FAQ / details ────────────────────────────────────── */
details {
  border-bottom: 1px solid var(--nd-line);
  padding: var(--nd-s-4) 0;
}
details[open] summary { color: var(--nd-accent); }
summary {
  font-family: var(--nd-display);
  font-size: var(--nd-fs-md);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--nd-s-4);
}
summary::after {
  content: "+";
  font-family: var(--nd-sans);
  color: var(--nd-accent);
  font-size: var(--nd-fs-lg);
  line-height: 1;
  transition: transform 200ms ease;
}
details[open] summary::after { content: "−"; }
details > *:not(summary) {
  margin-top: var(--nd-s-3);
  color: var(--nd-muted);
  font-size: var(--nd-fs-sm);
  line-height: 1.65;
}

/* ── Legal / placeholder content ──────────────────────── */
.legal, .placeholder, .prose {
  max-width: var(--nd-maxw-prose);
  margin-inline: auto;
  color: var(--nd-ink-soft);
  font-size: var(--nd-fs-base);
  line-height: 1.7;
}
.legal h1, .legal h2, .placeholder h1, .placeholder h2, .prose h1, .prose h2 {
  margin-top: var(--nd-s-7);
  margin-bottom: var(--nd-s-3);
}
.legal h1:first-child, .placeholder h1:first-child, .prose h1:first-child { margin-top: 0; }
.legal p, .placeholder p, .prose p {
  margin-bottom: var(--nd-s-4);
}

.placeholder {
  text-align: center;
  padding-block: var(--nd-s-9);
}
.placeholder h1 { font-size: var(--nd-fs-2xl); }

/* ── About page: founder signoff ──────────────────────── */
.signoff {
  margin-top: var(--nd-s-6);
  font-family: var(--nd-display);
  font-style: italic;
  font-size: var(--nd-fs-md);
  color: var(--nd-ink);
  line-height: 1.5;
  font-variation-settings: "opsz" 144;
}

/* ── Footer ───────────────────────────────────────────── */
.site-footer, footer.site-footer, body > footer {
  background: var(--nd-bg-soft);
  border-top: 1px solid var(--nd-line);
  color: var(--nd-muted);
  font-size: var(--nd-fs-sm);
  padding: var(--nd-s-7) 0;
  margin-top: var(--nd-s-9);
}

.site-footer .container,
.site-footer-inner {
  max-width: var(--nd-maxw);
  margin-inline: auto;
  padding-inline: clamp(var(--nd-s-5), 4vw, var(--nd-s-7));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--nd-s-5);
  align-items: flex-start;
}

.footer-links, .site-footer nav ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; gap: var(--nd-s-5);
  flex-wrap: wrap;
}

.footer-links a, .site-footer a {
  color: var(--nd-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
.footer-links a:hover, .site-footer a:hover {
  color: var(--nd-ink);
  border-bottom-color: var(--nd-accent);
}

.disclaimers {
  font-size: var(--nd-fs-xs);
  color: var(--nd-muted-2);
  line-height: 1.6;
  max-width: 60ch;
}

.copyright {
  font-size: var(--nd-fs-xs);
  color: var(--nd-muted-2);
}

/* ── Print ────────────────────────────────────────────── */
@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .skip-link, nav { display: none; }
  a { color: #000; text-decoration: underline; }
  .card, .panel, fieldset { box-shadow: none; border-color: #ccc; }
}

/* ── Reduced motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
