/* ==========================================================================
   American Title Abstract Corp — Design System
   Brand colors sampled from ATAC_logo_color.svg: navy #3c3b6e, red #b22234
   ========================================================================== */

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 4.5rem);

  /* Spacing */
  --space-1: 0.25rem;  --space-2: 0.5rem;   --space-3: 0.75rem;
  --space-4: 1rem;     --space-5: 1.25rem;  --space-6: 1.5rem;
  --space-8: 2rem;     --space-10: 2.5rem;  --space-12: 3rem;
  --space-16: 4rem;    --space-20: 5rem;    --space-24: 6rem;
  --space-32: 8rem;

  --font-display: 'Zodiak', Georgia, serif;
  --font-body: 'Satoshi', -apple-system, system-ui, sans-serif;

  --wrap: 1240px;
  --wrap-narrow: 760px;
  --radius: 3px;
  --header-h: 76px;
}

/* ---------- Light theme (default) ---------- */
:root,
[data-theme='light'] {
  --navy: oklch(35% 0.09 285);
  --navy-deep: oklch(26% 0.075 285);
  --navy-ink: oklch(20% 0.05 285);

  /* --red / --navy are TEXT accents (contrast against page bg).
     --*-fill are SOLID BACKGROUNDS that must keep white text legible.
     Keeping these separate is what lets dark mode invert the text accent
     without breaking every white-on-red button. */
  --red: oklch(45% 0.17 25);
  --red-hover: oklch(39% 0.17 25);
  --red-fill: oklch(48% 0.18 25);
  --red-fill-hover: oklch(41% 0.18 25);
  --navy-fill: oklch(33% 0.09 285);

  --bg: oklch(99% 0.003 285);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(96.5% 0.006 285);
  --surface-3: oklch(93% 0.009 285);
  --border: oklch(88% 0.01 285);
  --border-strong: oklch(78% 0.015 285);

  --text: oklch(22% 0.02 285);
  --text-2: oklch(42% 0.017 285);
  --text-3: oklch(50% 0.015 285);
  --on-navy: oklch(97% 0.008 285);
  --on-navy-2: oklch(82% 0.02 285);

  --shadow-sm: 0 1px 2px oklch(25% 0.05 285 / 0.07);
  --shadow: 0 2px 4px oklch(25% 0.05 285 / 0.06), 0 8px 24px oklch(25% 0.05 285 / 0.07);
  --shadow-lg: 0 4px 8px oklch(25% 0.05 285 / 0.07), 0 20px 48px oklch(25% 0.05 285 / 0.11);
  --logo-invert: 0;
}

/* ---------- Dark theme ---------- */
[data-theme='dark'] {
  --navy: oklch(72% 0.075 285);
  --navy-deep: oklch(82% 0.05 285);
  --navy-ink: oklch(90% 0.02 285);
  --red: oklch(72% 0.14 25);
  --red-hover: oklch(79% 0.12 25);
  --red-fill: oklch(47% 0.18 25);
  --red-fill-hover: oklch(54% 0.18 25);
  --navy-fill: oklch(38% 0.085 285);

  --bg: oklch(17% 0.016 285);
  --surface: oklch(21% 0.018 285);
  --surface-2: oklch(25% 0.02 285);
  --surface-3: oklch(29% 0.022 285);
  --border: oklch(32% 0.022 285);
  --border-strong: oklch(42% 0.025 285);

  --text: oklch(95% 0.005 285);
  --text-2: oklch(77% 0.012 285);
  --text-3: oklch(63% 0.015 285);
  --on-navy: oklch(96% 0.006 285);
  --on-navy-2: oklch(78% 0.018 285);

  --shadow-sm: 0 1px 2px oklch(0% 0 0 / 0.3);
  --shadow: 0 2px 4px oklch(0% 0 0 / 0.3), 0 8px 24px oklch(0% 0 0 / 0.35);
  --shadow-lg: 0 4px 8px oklch(0% 0 0 / 0.35), 0 20px 48px oklch(0% 0 0 / 0.45);
  --logo-invert: 1;
}

/* Navy panel surface — must live at :root so .page-head, .calc-out and
   .panel-navy can all reference it regardless of which class they carry. */
:root, [data-theme='light'] { --panel-bg: oklch(26% 0.075 285); }
[data-theme='dark'] { --panel-bg: oklch(22% 0.03 285); }

/* ==========================================================================
   Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--navy-ink);
  text-wrap: balance;
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); font-family: var(--font-body); font-weight: 700; letter-spacing: -0.01em; }
h4 { font-size: var(--text-base); font-family: var(--font-body); font-weight: 700; letter-spacing: 0; }
p { text-wrap: pretty; }

/* In a narrow split column, `balance` produces ragged short lines on long
   headings. `pretty` keeps the measure even and only guards the last line. */
.split > div > h2 { text-wrap: pretty; font-size: clamp(1.75rem, 1rem + 2vw, 2.75rem); }

a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red-hover); }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

::selection { background: var(--red); color: #fff; }

/* ==========================================================================
   Layout primitives
   ========================================================================== */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--space-6); }
.wrap-narrow { max-width: var(--wrap-narrow); margin-inline: auto; }
.section { padding-block: clamp(var(--space-16), 8vw, var(--space-32)); }
.section-sm { padding-block: clamp(var(--space-12), 5vw, var(--space-20)); }
.section-alt { background: var(--surface-2); }

.grid { display: grid; gap: var(--space-8); }
.stack > * + * { margin-top: var(--space-4); }

/* Eyebrow / kicker — the repeating emphasis device */
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-3);
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--red); margin-bottom: var(--space-5);
}
.eyebrow::before {
  content: ''; width: 28px; height: 2px; background: var(--red); flex: none;
}
.eyebrow.on-dark { color: oklch(78% 0.13 25); }
.eyebrow.on-dark::before { background: oklch(78% 0.13 25); }

.lede { font-size: var(--text-lg); line-height: 1.5; color: var(--text-2); max-width: 62ch; }
.muted { color: var(--text-2); }
.small { font-size: var(--text-sm); color: var(--text-2); }
.fine { font-size: var(--text-xs); color: var(--text-3); line-height: 1.55; }

/* ==========================================================================
   Buttons — squared geometry (legal/institutional, not playful pills)
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase;
  padding: var(--space-4) var(--space-6);
  border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--red-fill); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--red-fill-hover); color: #fff; box-shadow: var(--shadow); }

.btn-navy { background: var(--navy-deep); color: var(--on-navy); }
.btn-navy:hover { background: var(--navy-ink); color: var(--on-navy); }
[data-theme='dark'] .btn-navy { background: var(--surface-3); color: var(--text); }
[data-theme='dark'] .btn-navy:hover { background: var(--border-strong); }

.btn-outline { background: transparent; color: var(--navy-ink); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--navy); color: var(--navy-ink); }

.btn-ghost-light { background: transparent; color: var(--on-navy); border-color: oklch(100% 0 0 / .38); }
.btn-ghost-light:hover { background: oklch(100% 0 0 / .1); color: var(--on-navy); border-color: oklch(100% 0 0 / .6); }

.btn-lg { padding: var(--space-5) var(--space-8); font-size: var(--text-sm); }
.btn-sm { padding: var(--space-3) var(--space-4); font-size: var(--text-xs); }
.btn-block { width: 100%; }

.btn-group { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.btn svg { width: 16px; height: 16px; flex: none; }

/* Text link with drawn underline */
.link-arrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-sm); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; text-decoration: none; color: var(--red);
}
.link-arrow svg { transition: transform .2s ease; }
.link-arrow:hover svg { transform: translateX(4px); }

/* ==========================================================================
   Header
   ========================================================================== */
.topbar {
  background: var(--navy-ink); color: var(--on-navy-2);
  font-size: var(--text-xs); letter-spacing: 0.04em;
}
[data-theme='dark'] .topbar { background: oklch(13% 0.015 285); }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding-block: var(--space-2); }
.topbar svg { width: 13px; height: 13px; flex: none; display: inline-block; vertical-align: -2px; }
.topbar-items > span, .topbar-items > a { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; }
.topbar a { color: var(--on-navy-2); text-decoration: none; }
.topbar a:hover { color: #fff; }
.topbar-items { display: flex; gap: var(--space-6); align-items: center; }
@media (max-width: 860px) { .topbar-items span:not(.keep) { display: none; } }
/* On phones the tagline wrapped to three lines and pushed the hero down.
   Keep the bar to a single line: email only. */
@media (max-width: 600px) {
  .topbar .keep { display: none; }
  .topbar .wrap { justify-content: center; }
  .topbar-items { gap: var(--space-4); }
}

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in oklch, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .2s ease;
}
.site-header.is-stuck { box-shadow: var(--shadow); }
.site-header .wrap {
  display: flex; align-items: center; gap: var(--space-5);
  min-height: var(--header-h);
  max-width: 1400px;
}
.topbar .wrap { max-width: 1400px; }
.brand { flex: none; display: flex; align-items: center; text-decoration: none; }
.brand img { width: 200px; }

/* Theme-aware logo. Inverting the colour logo turned the brand navy olive,
   so dark mode gets a purpose-built SVG (white wordmark, brighter red star). */
.logo-dark { display: none; }
[data-theme='dark'] .logo-light { display: none; }
[data-theme='dark'] .logo-dark { display: block; }
@media (max-width: 480px) { .brand img { width: 168px; } }

.nav { margin-left: auto; display: flex; align-items: center; gap: 0; }
.nav a {
  font-size: var(--text-sm); font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
  color: var(--text-2); text-decoration: none;
  padding: var(--space-2) clamp(var(--space-2), 0.85vw, var(--space-3)); border-radius: var(--radius);
  position: relative;
}
.nav a:hover, .nav a[aria-current='page'] { color: var(--navy-ink); }
.nav a[aria-current='page']::after {
  content: ''; position: absolute; left: var(--space-2); right: var(--space-2); bottom: 2px;
  height: 2px; background: var(--red);
}
.header-actions { display: flex; align-items: center; gap: var(--space-3); flex: none; }
@media (max-width: 1180px) { .nav { display: none; } }
@media (max-width: 1320px) { .header-actions .btn-outline { display: none; } }
@media (max-width: 560px) { .header-actions .btn-primary { display: none; } }

.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-2); cursor: pointer; transition: background .16s, color .16s, border-color .16s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--navy-ink); border-color: var(--border-strong); }
.nav-toggle { display: none; }
@media (max-width: 1180px) { .nav-toggle { display: grid; } }

/* Mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; flex-direction: column;
  padding: var(--space-6);
  transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
}
.drawer.is-open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-8); }
.drawer nav { display: flex; flex-direction: column; }
.drawer nav a {
  font-family: var(--font-display); font-weight: 400; font-size: var(--text-lg); color: var(--navy-ink);
  text-decoration: none; padding: var(--space-4) 0; border-bottom: 1px solid var(--border);
}
.drawer nav a:hover { color: var(--red); }
.drawer .btn-group { margin-top: var(--space-8); flex-direction: column; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; background: var(--surface); overflow: hidden; }
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, var(--border) 0 1px, transparent 1px 100px);
  opacity: .5;
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.08fr 0.92fr; gap: clamp(var(--space-8), 5vw, var(--space-20));
  align-items: center;
  padding-block: clamp(var(--space-16), 6vw, var(--space-24));
}
@media (max-width: 900px) { .hero-inner { grid-template-columns: 1fr; } }

.hero h1 .hl { display: block; }
.hero h1 .accent { color: var(--red); font-style: italic; }
.hero-figure { position: relative; }
.hero-figure img {
  width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.hero-badge {
  position: absolute; left: calc(-1 * var(--space-6)); bottom: var(--space-10);
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  padding: var(--space-4) var(--space-5); box-shadow: var(--shadow-lg);
  max-width: 235px;
}
.hero-badge .n { font-family: var(--font-display); font-weight: 400; font-size: var(--text-xl); color: var(--navy-ink); line-height: 1; }
.hero-badge .l { font-size: var(--text-xs); color: var(--text-2); letter-spacing: .06em; text-transform: uppercase; margin-top: var(--space-2); }
@media (max-width: 900px) { .hero-badge { left: var(--space-4); } }

/* Trust strip */
.trustbar { background: var(--navy-ink); color: var(--on-navy); }
[data-theme='dark'] .trustbar { background: oklch(22% 0.03 285); border-block: 1px solid var(--border); }
.trustbar .wrap {
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding-block: var(--space-8); gap: var(--space-6);
}
@media (max-width: 800px) { .trustbar .wrap { grid-template-columns: repeat(2, 1fr); } }
.trust-item { display: flex; flex-direction: column; gap: var(--space-1); }
.trust-item + .trust-item { border-left: 1px solid oklch(100% 0 0 / .14); padding-left: var(--space-6); }
@media (max-width: 800px) { .trust-item:nth-child(3) { border-left: none; padding-left: 0; } }
.trust-item .n { font-family: var(--font-display); font-weight: 400; font-size: var(--text-xl); line-height: 1; color: #fff; }
.trust-item .l { font-size: var(--text-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--on-navy-2); }

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.card-link { text-decoration: none; color: inherit; }
.card-link:hover { border-color: var(--navy); transform: translateY(-3px); box-shadow: var(--shadow); color: inherit; }
.card h3 { color: var(--navy-ink); }
.card p { font-size: var(--text-sm); color: var(--text-2); margin: 0; }
.card .card-cta svg { width: 14px; height: 14px; flex: none; }
.card .card-cta { margin-top: auto; padding-top: var(--space-4); font-size: var(--text-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red); display: flex; align-items: center; gap: var(--space-2); }
.card-link:hover .card-cta svg { transform: translateX(4px); }
.card .card-cta svg { transition: transform .2s ease; }

.card-icon {
  width: 44px; height: 44px; display: grid; place-items: center; flex: none;
  background: var(--red-fill); color: #fff; border-radius: var(--radius); margin-bottom: var(--space-2);
}
.card-icon svg { width: 22px; height: 22px; }

.cards-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.cards-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
@media (max-width: 1000px) { .cards-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px)  { .cards-3 { grid-template-columns: 1fr; } .cards-2 { grid-template-columns: 1fr; } }
@media (max-width: 560px)  { .cards-4 { grid-template-columns: 1fr; } }

/* Numbered process steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); counter-reset: s; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step { counter-increment: s; border-top: 2px solid var(--border-strong); padding-top: var(--space-5); }
.step::before {
  content: counter(s, decimal-leading-zero);
  font-family: var(--font-display); font-weight: 400; font-size: var(--text-lg); color: var(--red); display: block; margin-bottom: var(--space-3);
}
.step h3 { margin-bottom: var(--space-2); }
.step p { font-size: var(--text-sm); color: var(--text-2); }

/* Split panel */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(var(--space-8), 5vw, var(--space-20)); align-items: center; }
.split-media img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* Navy panel */
.panel-navy { background: var(--panel-bg); color: var(--on-navy); }
.panel-navy h2, .panel-navy h3, .panel-navy h4 { color: #fff; }
.panel-navy p { color: var(--on-navy-2); }
.panel-navy .lede { color: var(--on-navy-2); }

/* Checklist */
.checklist { list-style: none; padding: 0; display: grid; gap: var(--space-4); }
.checklist li { display: flex; gap: var(--space-3); font-size: var(--text-sm); line-height: 1.55; }
.checklist svg { flex: none; width: 20px; height: 20px; color: var(--red); margin-top: 2px; }
.panel-navy .checklist svg { color: oklch(78% 0.13 25); }
.checklist strong { color: var(--navy-ink); }
.panel-navy .checklist strong { color: #fff; }
.checklist span { color: var(--text-2); }
.panel-navy .checklist span { color: var(--on-navy-2); }

/* ==========================================================================
   Reviews
   ========================================================================== */
.reviews { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
@media (max-width: 900px) { .reviews { grid-template-columns: 1fr; } }
.review {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4);
}
.stars { display: flex; gap: 2px; color: #E8A33D; }
.stars svg { width: 16px; height: 16px; }
.review blockquote { font-size: var(--text-sm); line-height: 1.6; color: var(--text); flex: 1; }
.review footer { display: flex; align-items: center; gap: var(--space-3); border-top: 1px solid var(--border); padding-top: var(--space-4); }
.avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: var(--navy-fill); color: #fff; display: grid; place-items: center;
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .02em;
}
.review .who { font-size: var(--text-sm); font-weight: 700; color: var(--navy-ink); line-height: 1.3; }
.review .role { font-size: var(--text-xs); color: var(--text-3); line-height: 1.35; }

.rating-summary {
  display: inline-flex; align-items: center; gap: var(--space-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
}
.rating-summary .score { font-family: var(--font-display); font-weight: 400; font-size: var(--text-xl); color: var(--navy-ink); line-height: 1; }

/* ==========================================================================
   Forms
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field label, .flabel {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text-2);
}
.field label .req { color: var(--red); }
input[type='text'], input[type='email'], input[type='tel'], input[type='number'],
input[type='date'], select, textarea {
  font-family: var(--font-body); font-size: var(--text-sm); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: var(--space-3) var(--space-4); width: 100%;
  transition: border-color .16s ease, box-shadow .16s ease;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--space-3) center; background-size: 18px;
  padding-right: var(--space-10);
}
textarea { min-height: 108px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in oklch, var(--red) 18%, transparent);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
@media (max-width: 700px) { .field-row, .field-row-3 { grid-template-columns: 1fr; } }
.field-hint { font-size: var(--text-xs); color: var(--text-3); }
.field-error { font-size: var(--text-xs); color: var(--red); font-weight: 600; display: none; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.field.has-error .field-error { display: block; }

fieldset { border: none; padding: 0; margin: 0; }
.form-section {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(var(--space-5), 3vw, var(--space-8));
}
.form-section + .form-section { margin-top: var(--space-5); }
.form-section-head {
  display: flex; align-items: center; gap: var(--space-4);
  padding-bottom: var(--space-5); margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}
.form-section-num {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: var(--navy-fill); color: #fff; display: grid; place-items: center;
  font-size: var(--text-xs); font-weight: 700;
}
.form-section-num svg { width: 15px; height: 15px; }
.fields { display: grid; gap: var(--space-5); }

.check {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: border-color .16s, background .16s;
}
.check:hover { border-color: var(--border-strong); background: var(--surface-2); }
.check input { width: 18px; height: 18px; flex: none; margin-top: 2px; accent-color: var(--red); }
.check .t { font-size: var(--text-sm); font-weight: 600; color: var(--text); }
.check .d { font-size: var(--text-xs); color: var(--text-3); }
.check:has(input:checked) { border-color: var(--red); background: color-mix(in oklch, var(--red) 5%, var(--surface)); }

.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  padding: var(--space-8); text-align: center; cursor: pointer;
  transition: border-color .16s, background .16s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--red); background: color-mix(in oklch, var(--red) 4%, var(--surface)); }
.dropzone svg { width: 28px; height: 28px; color: var(--text-3); margin: 0 auto var(--space-3); }
.file-list { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
.file-item {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: var(--text-xs); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-2) var(--space-3);
}
.file-item svg { width: 15px; height: 15px; color: var(--red); flex: none; }
.file-item .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }

.form-success {
  display: none; text-align: center; padding: clamp(var(--space-8), 5vw, var(--space-16));
  background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--red); border-radius: var(--radius);
}
.form-success.is-shown { display: block; }
.success-mark {
  width: 60px; height: 60px; margin: 0 auto var(--space-6); border-radius: 50%;
  background: color-mix(in oklch, var(--red) 12%, var(--surface));
  display: grid; place-items: center; color: var(--red);
}
.success-mark svg { width: 30px; height: 30px; }
.ref-no {
  display: inline-block; font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: var(--text-sm); background: var(--surface-2); border: 1px dashed var(--border-strong);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius); color: var(--navy-ink);
}

/* ==========================================================================
   Calculator
   ========================================================================== */
.calc { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: var(--space-8); align-items: start; }
@media (max-width: 960px) { .calc { grid-template-columns: 1fr; } }
.calc-out {
  background: var(--panel-bg); color: var(--on-navy); border-radius: var(--radius);
  padding: clamp(var(--space-5), 3vw, var(--space-8)); position: sticky; top: calc(var(--header-h) + var(--space-5));
}
@media (max-width: 960px) { .calc-out { position: static; } }
.calc-out h3 { color: #fff; }
.calc-total {
  border-bottom: 1px solid oklch(100% 0 0 / .18); padding-bottom: var(--space-6); margin-bottom: var(--space-6);
}
.calc-total .l { font-size: var(--text-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--on-navy-2); }
.calc-total .v { font-family: var(--font-display); font-weight: 400; font-size: var(--text-2xl); color: #fff; line-height: 1.05; margin-top: var(--space-2); }
.lines { display: grid; gap: var(--space-1); }
.calc-row { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; font-size: var(--text-sm); border-bottom: 1px solid oklch(100% 0 0 / .09); }
.calc-row .k { color: var(--on-navy-2); }
.calc-row .v { font-variant-numeric: tabular-nums; color: #fff; font-weight: 600; flex: none; }
.calc-row.is-sub .k { padding-left: var(--space-4); font-size: var(--text-xs); }
.calc-row.is-total { border-bottom: none; border-top: 2px solid oklch(100% 0 0 / .3); margin-top: var(--space-2); padding-top: var(--space-4); }
.calc-row.is-total .k { color: #fff; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: var(--text-xs); }
.calc-row.is-total .v { font-family: var(--font-display); font-weight: 400; font-size: var(--text-lg); }

.seg { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; text-align: center; padding: var(--space-3) var(--space-2);
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-2); cursor: pointer; transition: background .16s, color .16s;
}
.seg label + label span { border-left: 1px solid var(--border-strong); }
.seg input:checked + span { background: var(--navy-fill); color: #fff; }
.seg span:hover { background: var(--surface-2); }
.seg input:checked + span:hover { background: var(--navy-fill); }

/* ==========================================================================
   Accordion / FAQ
   ========================================================================== */
.acc { border-top: 1px solid var(--border); }
.acc details { border-bottom: 1px solid var(--border); }
.acc summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-5);
  padding: var(--space-5) 0; cursor: pointer; list-style: none;
  font-size: var(--text-base); font-weight: 700; color: var(--navy-ink);
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary:hover { color: var(--red); }
.acc summary .ico { flex: none; width: 22px; height: 22px; position: relative; }
.acc summary .ico::before, .acc summary .ico::after {
  content: ''; position: absolute; background: var(--red); transition: transform .22s ease;
}
.acc summary .ico::before { top: 50%; left: 2px; right: 2px; height: 2px; margin-top: -1px; }
.acc summary .ico::after { left: 50%; top: 2px; bottom: 2px; width: 2px; margin-left: -1px; }
.acc details[open] summary .ico::after { transform: scaleY(0); }
.acc .acc-body { padding-bottom: var(--space-5); font-size: var(--text-sm); color: var(--text-2); max-width: 78ch; }
.acc .acc-body p + p { margin-top: var(--space-3); }

/* ==========================================================================
   Counties / links grid
   ========================================================================== */
.county-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
@media (max-width: 900px) { .county-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .county-grid { grid-template-columns: 1fr; } }
.county {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-4); text-decoration: none; font-size: var(--text-sm); font-weight: 600; color: var(--navy-ink);
  transition: border-color .18s, background .18s, transform .18s;
}
.county:hover { border-color: var(--red); background: var(--surface-2); color: var(--navy-ink); transform: translateY(-2px); }
.county svg { width: 15px; height: 15px; color: var(--red); flex: none; }
.county .tag { font-size: var(--text-xs); color: var(--text-3); font-weight: 500; }

/* Fee table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: var(--text-sm); background: var(--surface); }
th, td { text-align: left; padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); font-size: var(--text-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); font-weight: 700; white-space: nowrap; }
td { color: var(--text-2); }
td:first-child { color: var(--text); font-weight: 600; }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Alert / notice
   ========================================================================== */
.notice {
  display: flex; gap: var(--space-4); align-items: flex-start;
  background: color-mix(in oklch, var(--red) 6%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--red) 28%, var(--border));
  border-left: 3px solid var(--red);
  border-radius: var(--radius); padding: var(--space-5);
}
.notice svg { flex: none; width: 22px; height: 22px; color: var(--red); margin-top: 1px; }
.notice .t { font-weight: 700; font-size: var(--text-sm); color: var(--navy-ink); margin-bottom: var(--space-1); }
.notice p { font-size: var(--text-sm); color: var(--text-2); margin: 0; }

.demo-note {
  background: var(--surface-3); border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: var(--space-4) var(--space-5); font-size: var(--text-xs); color: var(--text-2); line-height: 1.6;
}
.demo-note strong { color: var(--navy-ink); }

/* ==========================================================================
   Page header (interior pages)
   ========================================================================== */
.page-head { background: var(--panel-bg); color: var(--on-navy); padding-block: clamp(var(--space-12), 6vw, var(--space-20)); position: relative; overflow: hidden; }
.page-head::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, oklch(100% 0 0 / .05) 0 1px, transparent 1px 100px);
}
.page-head > .wrap { position: relative; z-index: 1; }
.page-head h1 { color: #fff; max-width: 22ch; }
.page-head .lede { color: var(--on-navy-2); margin-top: var(--space-5); }
.crumbs { display: flex; gap: var(--space-2); align-items: center; font-size: var(--text-xs); color: var(--on-navy-2); margin-bottom: var(--space-6); letter-spacing: .04em; }
.crumbs a { color: var(--on-navy-2); text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }

/* ==========================================================================
   CTA band
   ========================================================================== */
.cta-band { background: var(--red-fill); color: #fff; }
.cta-band .wrap { padding-block: clamp(var(--space-12), 6vw, var(--space-20)); text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: oklch(100% 0 0 / .96); margin: var(--space-5) auto 0; max-width: 58ch; }
.cta-band .fine { color: oklch(100% 0 0 / .9) !important; }
.cta-band .btn-group { justify-content: center; margin-top: var(--space-8); }
.cta-band .btn-primary { background: #fff; color: oklch(42% 0.18 25); }
.cta-band .btn-primary:hover { background: oklch(94% 0.01 25); color: oklch(38% 0.18 25); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--navy-ink); color: var(--on-navy-2); }
[data-theme='dark'] .site-footer { background: oklch(13% 0.015 285); border-top: 1px solid var(--border); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: var(--space-10); padding-block: var(--space-20) var(--space-12); }
@media (max-width: 960px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-top { grid-template-columns: 1fr; } }
.site-footer img.flogo { width: 230px; filter: brightness(0) invert(1); margin-bottom: var(--space-5); }
.site-footer h4 { color: #fff; font-size: var(--text-xs); letter-spacing: .12em; text-transform: uppercase; margin-bottom: var(--space-5); }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: var(--space-3); }
.site-footer a { color: var(--on-navy-2); text-decoration: none; font-size: var(--text-sm); }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer p { font-size: var(--text-sm); color: var(--on-navy-2); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap;
  padding-block: var(--space-6); border-top: 1px solid oklch(100% 0 0 / .14);
  font-size: var(--text-xs); color: oklch(70% 0.02 285);
}
.alta-badge { display: flex; align-items: center; gap: var(--space-4); }
.alta-badge img { width: 74px; }

/* ==========================================================================
   Sticky mobile action bar
   ========================================================================== */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: none; gap: 1px; background: var(--border);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px oklch(20% 0.03 285 / .12);
}
.mobile-bar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: var(--space-3) var(--space-2); background: var(--surface);
  font-size: var(--text-xs); font-weight: 700; text-decoration: none; color: var(--navy-ink);
  letter-spacing: .04em; text-transform: uppercase;
}
.mobile-bar a.is-primary { background: var(--red-fill); color: #fff; }
.mobile-bar svg { width: 17px; height: 17px; }
@media (max-width: 720px) {
  .mobile-bar { display: flex; }
  body { padding-bottom: 68px; }
}

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.4,0,.2,1), transform .6s cubic-bezier(.4,0,.2,1); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .07s; } .reveal-d2 { transition-delay: .14s; }
.reveal-d3 { transition-delay: .21s; } .reveal-d4 { transition-delay: .28s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

.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;
}
