/* ============================================================
   California Injury Help — Design System
   Token-driven, accessibility-first (WCAG 2.2 AA, Pa11y 0).
   Palette/brand swaps live entirely in :root below.
   ============================================================ */

/* ---- Design tokens ---------------------------------------- */
:root {
  /* Brand palette */
  --ink:        #0c2138;   /* deep authoritative navy   */
  --ink-soft:   #18395c;
  --ink-line:   #21456b;
  --gold:       #f5a623;   /* bright accent — for text on DARK bg (passes AA on navy) */
  --gold-deep:  #8f6200;   /* dark accent — for text on LIGHT bg (passes AA on white ~5.4:1) */
  --gold-ink:   #2a1d02;   /* text on gold buttons        */

  /* Neutrals */
  --paper:      #ffffff;
  --mist:       #eef2f7;
  --mist-2:     #e3eaf2;
  --line:       #d6dfea;
  --body:       #283845;   /* body text — ~11:1 on white  */
  --muted:      #4c5d6e;   /* secondary text — ~4.7:1     */
  --ink-on-dark:#eaf1f9;   /* body text on navy           */
  --muted-dark: #aabfd4;   /* secondary text on navy ~4.6 */

  /* Status */
  --ok:         #1f7a4d;
  --err:        #c0392b;

  /* Type scale (fluid) */
  --f-step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.92rem);
  --f-step-0:  clamp(1rem, 0.96rem + 0.20vw, 1.13rem);
  --f-step-1:  clamp(1.20rem, 1.10rem + 0.50vw, 1.50rem);
  --f-step-2:  clamp(1.50rem, 1.30rem + 1.00vw, 2.10rem);
  --f-step-3:  clamp(1.95rem, 1.60rem + 1.75vw, 3.10rem);
  --f-step-4:  clamp(2.40rem, 1.85rem + 2.75vw, 4.20rem);

  /* Spacing / layout */
  --gutter:     clamp(1.1rem, 0.7rem + 2vw, 2.2rem);
  --maxw:       1180px;
  --maxw-prose: 68ch;
  --radius:     14px;
  --radius-sm:  9px;
  --shadow:     0 1px 2px rgba(12,33,56,.06), 0 8px 28px rgba(12,33,56,.10);
  --shadow-lg:  0 18px 60px rgba(12,33,56,.22);

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Georgia", "Times New Roman", serif;
}

/* ---- Reset / base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--f-step-0);
  line-height: 1.65;
  color: var(--body);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.15; color: var(--ink); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: var(--f-step-4); }
h2 { font-size: var(--f-step-3); }
h3 { font-size: var(--f-step-1); }
p { margin: 0 0 1rem; }
a { color: var(--gold-deep); }
a:hover { color: var(--ink); }
strong { font-weight: 700; color: var(--ink); }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin-bottom: .4rem; }

/* ---- Accessibility helpers -------------------------------- */
.skip-link {
  position: absolute; left: 8px; top: -60px;
  background: var(--ink); color: #fff; padding: .7rem 1.1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); z-index: 1000;
  font-weight: 600; text-decoration: none; transition: top .15s ease;
}
.skip-link:focus { top: 0; color: #fff; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 3px; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---- Layout primitives ------------------------------------ */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(2.6rem, 1.8rem + 4vw, 5rem); }
.section--mist { background: var(--mist); }
.section--ink { background: var(--ink); color: var(--ink-on-dark); }
.section--ink h2, .section--ink h3 { color: #fff; }
.lede { font-size: var(--f-step-1); color: var(--muted); max-width: var(--maxw-prose); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: var(--f-step--1); font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold-deep); margin: 0 0 .8rem;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--gold); display: inline-block; }
/* On dark surfaces the eyebrow + inline gold accents switch to the bright gold (AA on navy). */
.hero .eyebrow, .section--ink .eyebrow, .cta-band .eyebrow { color: var(--gold); }
.section-head { max-width: var(--maxw-prose); margin-bottom: clamp(1.6rem, 1rem + 2vw, 2.6rem); }

/* ---- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font: inherit; font-weight: 700; line-height: 1.1; text-decoration: none;
  padding: .95rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  min-height: 48px;
}
.btn:active { transform: translateY(1px); }
.btn--gold { background: var(--gold); color: var(--gold-ink); box-shadow: 0 6px 20px rgba(245,166,35,.35); }
.btn--gold:hover { background: #ffba3d; color: var(--gold-ink); }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: var(--ink-soft); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--on-dark { background: #fff; color: var(--ink); }
.btn--on-dark:hover { background: var(--mist); color: var(--ink); }
.btn--lg { padding: 1.1rem 1.9rem; font-size: var(--f-step-1); }
.btn--block { width: 100%; }

/* ---- Top bar + header ------------------------------------- */
.topbar {
  background: var(--ink); color: var(--ink-on-dark);
  font-size: var(--f-step--1); border-bottom: 1px solid var(--ink-line);
}
.topbar .wrap { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; align-items: center; justify-content: space-between; padding-block: .5rem; }
.topbar a { color: #fff; text-decoration: none; font-weight: 600; }
.topbar a:hover { color: var(--gold); }
.topbar__msg { display: inline-flex; align-items: center; gap: .5rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .7rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.18rem; letter-spacing: -.02em; }
.brand__mark { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--ink), var(--ink-soft)); color: var(--gold); display: grid; place-items: center; font-weight: 900; flex: none; }
.brand__mark svg { width: 22px; height: 22px; }
.brand small { display: block; font-size: .68rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }

.primary-nav { display: flex; align-items: center; gap: .3rem; }
.primary-nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: var(--f-step--1); padding: .55rem .7rem; border-radius: 8px; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { background: var(--mist); color: var(--ink); }
.header-cta { display: flex; align-items: center; gap: .6rem; }
.lang-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-toggle a { padding: .4rem .7rem; font-size: var(--f-step--1); font-weight: 700; text-decoration: none; color: var(--muted); }
.lang-toggle a[aria-current="true"] { background: var(--ink); color: #fff; }

.nav-toggle { display: none; }

/* ---- Hero ------------------------------------------------- */
/* Solid background so contrast tooling can resolve every text color.
   Decorative glow is confined to the top-right corner only, kept clear of
   the text columns, so it never overlaps text boxes (which would make axe
   report contrast as "undeterminable"). */
.hero { position: relative; background: var(--ink); color: var(--ink-on-dark); overflow: hidden; }
.hero__glow { position: absolute; top: -30%; right: -10%; width: min(720px, 60%); height: 140%; background: radial-gradient(closest-side, #1c4674 0%, transparent 100%); opacity: .85; pointer-events: none; z-index: 0; }
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.6rem, 1rem + 3vw, 3.4rem); align-items: center; padding-block: clamp(2.6rem, 1.6rem + 5vw, 5.2rem); }
.hero h1 { color: #fff; max-width: 16ch; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero__sub { font-size: var(--f-step-1); color: var(--muted-dark); max-width: 46ch; margin-bottom: 1.6rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1.6rem; }
.trust-bar { display: flex; flex-wrap: wrap; gap: .55rem 1.3rem; list-style: none; padding: 0; margin: 1.4rem 0 0; font-size: var(--f-step--1); color: var(--muted-dark); }
.trust-bar li { display: inline-flex; align-items: center; gap: .45rem; margin: 0; }
.trust-bar svg { width: 17px; height: 17px; color: var(--gold); flex: none; }

/* ---- Lead form card --------------------------------------- */
.lead-card { background: var(--paper); color: var(--body); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: clamp(1.3rem, 1rem + 1.5vw, 2rem); border: 1px solid var(--line); }
.lead-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .25rem; }
.lead-card h2 { font-size: var(--f-step-1); margin: 0; }
.lead-card__free { font-weight: 800; color: var(--ok); font-size: var(--f-step--1); }
.lead-card p.fine { font-size: var(--f-step--1); color: var(--muted); margin: .2rem 0 1rem; }

.field { margin-bottom: .85rem; }
.field label { display: block; font-weight: 600; font-size: var(--f-step--1); color: var(--ink); margin-bottom: .3rem; }
.field .req { color: var(--err); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--body); background: #fff;
  padding: .7rem .8rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink-soft); box-shadow: 0 0 0 3px rgba(24,57,92,.12); outline: none; }
.field textarea { min-height: 92px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.consent { display: flex; gap: .6rem; align-items: flex-start; font-size: var(--f-step--1); color: var(--muted); margin: .4rem 0 1rem; }
.consent input { width: 20px; height: 20px; margin-top: .15rem; flex: none; }
.form-msg { font-size: var(--f-step--1); padding: .7rem .85rem; border-radius: var(--radius-sm); margin-bottom: .8rem; }
.form-msg[hidden] { display: none; }
.form-msg--err { background: #fdecea; color: var(--err); border: 1px solid #f3b9b3; }
.form-msg--ok { background: #e7f5ee; color: var(--ok); border: 1px solid #b4dfc7; }
.disclaimer-fine { font-size: .78rem; line-height: 1.5; color: var(--muted); }

/* ---- Cards / grids ---------------------------------------- */
.grid { display: grid; gap: clamp(1rem, .6rem + 1.5vw, 1.6rem); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.case-card {
  display: flex; flex-direction: column; gap: .5rem; text-decoration: none;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem 1.3rem; color: var(--body); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.case-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--mist-2); color: var(--body); }
.case-card__icon { width: 46px; height: 46px; border-radius: 12px; background: var(--mist); color: var(--ink); display: grid; place-items: center; }
.case-card__icon svg { width: 24px; height: 24px; }
.case-card h3 { margin: .2rem 0 0; font-size: var(--f-step-1); }
.case-card p { margin: 0; font-size: var(--f-step--1); color: var(--muted); }
.case-card__more { margin-top: auto; font-weight: 700; color: var(--gold-deep); font-size: var(--f-step--1); }

/* Hub-and-spoke pillar card: category-hub heading link + subcategory spokes */
.hub-card {
  display: flex; flex-direction: column; gap: .8rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem 1.3rem;
}
.hub-card__head { display: flex; align-items: center; gap: .7rem; }
.hub-card__icon { width: 40px; height: 40px; border-radius: 11px; background: var(--mist); color: var(--ink); display: grid; place-items: center; flex: none; }
.hub-card__icon svg { width: 22px; height: 22px; }
.hub-card h3 { margin: 0; font-size: var(--f-step-1); }
.hub-card h3 a { color: var(--ink); text-decoration: none; }
.hub-card h3 a:hover { color: var(--gold-deep); }
.hub-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem .9rem; }
.hub-card ul a { color: var(--gold-deep); text-decoration: none; font-weight: 600; font-size: var(--f-step--1); }
.hub-card ul a:hover { color: var(--ink); text-decoration: underline; }

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 1.3rem; }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; margin: 0; }
.steps li::before { counter-increment: step; content: counter(step); width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--gold); font-weight: 800; display: grid; place-items: center; flex: none; }
.steps h3 { margin: .25rem 0 .2rem; font-size: var(--f-step-1); }
.steps p { margin: 0; color: var(--muted); }

/* Cities */
.city-list { display: flex; flex-wrap: wrap; gap: .55rem; list-style: none; padding: 0; margin: 0; }
.city-list a { display: inline-block; padding: .55rem 1rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: var(--f-step--1); background: #fff; }
.city-list a:hover { border-color: var(--ink); background: var(--ink); color: #fff; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; text-align: center; }
.stat__num { font-size: var(--f-step-3); font-weight: 800; color: var(--gold); line-height: 1; }
.stat__lbl { font-size: var(--f-step--1); color: var(--muted-dark); }

/* FAQ */
.faq { max-width: var(--maxw-prose); }
.faq details { border-bottom: 1px solid var(--line); padding: .3rem 0; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); padding: .9rem 2rem .9rem 0; position: relative; list-style: none; font-size: var(--f-step-0); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--gold-deep); font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--muted); padding-bottom: .6rem; }

/* Disclaimer band */
.disclaimer-band { background: var(--mist); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.disclaimer-band p { font-size: var(--f-step--1); color: var(--muted); margin: 0; max-width: 90ch; }

/* CTA band */
.cta-band { background: var(--ink-soft); color: #fff; border-radius: var(--radius); padding: clamp(1.8rem, 1.2rem + 3vw, 3.2rem); text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: var(--muted-dark); max-width: 50ch; margin-inline: auto; }
.cta-band .hero__actions { justify-content: center; }

/* ---- Money-page extras ------------------------------------ */
.breadcrumb { font-size: var(--f-step--1); color: var(--muted); padding-block: .9rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0; }
.breadcrumb li { margin: 0; }
.breadcrumb a { color: var(--gold-deep); text-decoration: none; }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; color: var(--line); }
.split { display: grid; grid-template-columns: 1.4fr .9fr; gap: clamp(1.6rem, 1rem + 3vw, 3rem); align-items: start; }
.sidebar-form { position: sticky; top: 88px; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: grid; grid-template-columns: auto 1fr; gap: .7rem; margin-bottom: .7rem; }
.checklist li::before { content: ""; width: 22px; height: 22px; border-radius: 50%; background: var(--ok); flex: none; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/16px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/16px no-repeat; background-color: var(--ok); }
.prose > * + * { margin-top: 1rem; }
.prose h2 { margin-top: 2rem; }

/* ---- Footer ----------------------------------------------- */
.site-footer { background: var(--ink); color: var(--muted-dark); padding-block: clamp(2.4rem, 1.6rem + 3vw, 3.6rem); font-size: var(--f-step--1); }
.site-footer a { color: var(--ink-on-dark); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 1.8rem; margin-bottom: 2rem; }
.footer-grid h3 { color: #fff; font-size: var(--f-step-0); margin-bottom: .8rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .5rem; }
.footer-brand { color: var(--ink-on-dark); }
.footer-bottom { border-top: 1px solid var(--ink-line); padding-top: 1.4rem; display: flex; flex-wrap: wrap; gap: .8rem 1.6rem; justify-content: space-between; }
.footer-disclaimer { max-width: 95ch; line-height: 1.6; }

/* ---- Responsive ------------------------------------------- */
@media (max-width: 920px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .lead-card { order: -1; }
  .split { grid-template-columns: 1fr; }
  .sidebar-form { position: static; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .primary-nav, .header-cta .btn { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; gap: .5rem; background: var(--ink); color: #fff; border: 0; border-radius: 8px; padding: .6rem .8rem; font: inherit; font-weight: 700; cursor: pointer; }
  .primary-nav.is-open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); padding: .6rem var(--gutter) 1rem; gap: .1rem; box-shadow: var(--shadow); }
  .primary-nav.is-open a { padding: .8rem .6rem; border-radius: 8px; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; gap: 1.6rem; }
}
@media (max-width: 480px) {
  .grid--4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
