/* First Line Legal Services - site styles. Tokens match the brand design system. */
:root {
  --surface: #f5f7fa; --surface-raised: #ffffff; --ink: #142033; --ink-muted: #4f5d72;
  --line: #d5dce6; --line-strong: #7a879a; --civic-blue: #1d4b8f; --on-civic-blue: #ffffff;
  --civic-blue-tint: #e3ebf7; --poppy-gold: #e8a317; --on-poppy-gold: #142033;
  --status-done: #0e6b78; --status-alert: #b42318; --notice: #fff4dc; --on-notice: #5c3f00;
  --font-sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
/* Night mode: set by assets/theme.js (dark 6pm-8am visitor's local time, light 8am-6pm). */
:root[data-theme="dark"] {
  --surface: #0f1620; --surface-raised: #17212e; --ink: #e7ecf3; --ink-muted: #a3afc0;
  --line: #2a3748; --line-strong: #6b7a90; --civic-blue: #8ab0ee; --on-civic-blue: #0b1422;
  --civic-blue-tint: #1c2c45; --poppy-gold: #f2b83a; --on-poppy-gold: #142033;
  --status-done: #5fc4d0; --status-alert: #ff8a7a; --notice: #2b2412; --on-notice: #f0d58f;
  color-scheme: dark;
}
.theme-btn { font: inherit; font-size: 14px; font-weight: 600; background: none; border: 1px solid var(--line-strong); color: var(--ink); border-radius: 999px; padding: 4px 12px; min-height: 36px; cursor: pointer; }
.theme-btn:hover { border-color: var(--civic-blue); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font-sans); font-size: 17px; line-height: 1.6; }
img, svg { max-width: 100%; }
a { color: var(--civic-blue); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--civic-blue); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--civic-blue); color: var(--on-civic-blue); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.wrap { max-width: 1160px; margin: 0 auto; padding-left: max(16px, 4vw); padding-right: max(16px, 4vw); }
.narrow { max-width: 760px; }

/* Preview banner */
.preview { background: var(--ink); color: var(--surface); font-size: 14px; line-height: 20px; text-align: center; }
.preview .wrap { padding-block: 8px; }
.preview a { color: var(--surface); text-decoration: underline; font-weight: 600; }
.preview a:focus-visible { outline-color: var(--surface); }

/* Header */
header.site { background: var(--surface-raised); border-bottom: 1px solid var(--line); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; min-height: 72px; flex-wrap: wrap; padding-block: 10px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 19px; letter-spacing: -0.2px; }
.logo span { color: var(--civic-blue); }
.logo svg, .logo img { width: 34px; height: 34px; flex: none; }
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo .logo-text, .logo .logo-text .nm { color: var(--ink); }
.logo em { font-style: normal; color: var(--civic-blue); }
.logo-text small { font-size: 12px; font-weight: 500; color: var(--ink-muted); letter-spacing: 0; }
nav.main { display: flex; gap: 6px 22px; flex-wrap: wrap; align-items: center; font-size: 15px; font-weight: 500; }
nav.main a { color: var(--ink); text-decoration: none; padding: 6px 0; }
nav.main a:hover, nav.main a[aria-current="page"] { color: var(--civic-blue); text-decoration: underline; }
.lang { font-weight: 600; }
.hdr-tools { display: flex; align-items: center; gap: 8px; order: 3; flex: none; }
nav.main { order: 2; }
@media (min-width: 1061px) { .topbar { flex-wrap: nowrap; } .logo { flex: none; } nav.main { margin-left: auto; flex-wrap: nowrap; white-space: nowrap; } }
.menu-btn { display: none; font: inherit; font-size: 15px; font-weight: 600; background: none; border: 1px solid var(--line-strong); color: var(--ink); border-radius: 999px; padding: 4px 14px; min-height: 40px; cursor: pointer; align-items: center; gap: 6px; }
@media (max-width: 1060px) {
  .topbar { gap: 10px; }
  .hdr-tools { order: 2; width: 100%; }
  .menu-btn { display: inline-flex; }
  .hdr-tools .theme-btn { margin-left: auto; }
  .langmenu summary, .hdr-tools .theme-btn { min-height: 40px; }
  nav.main { order: 3; width: 100%; flex-direction: column; align-items: stretch; gap: 0; font-size: 17px; border-top: 1px solid var(--line); }
  nav.main a { padding: 13px 4px; border-bottom: 1px solid var(--line); }
  nav.main a:last-child { border-bottom: 0; }
  html.js nav.main:not(.open) { display: none; }
  .langmenu > div { left: 0; right: auto; max-width: calc(100vw - 32px); }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 8px; font-weight: 600; font-size: 16px; text-decoration: none; border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--ink); }
.btn:hover { color: var(--ink); border-color: var(--civic-blue); }
.btn.gold { background: var(--poppy-gold); border-color: var(--poppy-gold); color: var(--on-poppy-gold); }
.btn.gold:hover { filter: brightness(0.96); }
.btn.on-blue { background: var(--surface-raised); color: var(--ink); border-color: transparent; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* Type */
h1 { font-size: clamp(34px, 5vw, 48px); line-height: 1.1; letter-spacing: -0.8px; margin: 0; text-wrap: balance; }
h2 { font-size: 28px; line-height: 1.2; margin: 0; text-wrap: balance; }
h3 { font-size: 20px; line-height: 1.35; margin: 0; }
.eyebrow { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--ink-muted); }
.lead { font-size: 19px; line-height: 1.55; color: var(--ink-muted); max-width: 58ch; margin: 0; }
.muted { color: var(--ink-muted); }
.small { font-size: 14px; line-height: 20px; }
.form { font-family: var(--font-mono); font-size: 13px; color: var(--civic-blue); border: 1px solid var(--line); border-radius: 4px; padding: 1px 7px; background: var(--surface-raised); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Sections */
section { padding-block: 56px; }
section.tight { padding-block: 32px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 28px; }
.hero { padding-block: 64px; }
.hero-grid { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.hero-grid > * { flex: 1 1 400px; min-width: 0; }
.page-head { padding-block: 48px 8px; }

/* Notice */
.notice { background: var(--notice); color: var(--on-notice); }
.notice .wrap { padding-block: 16px; font-size: 15px; line-height: 22px; }
.notice a { color: var(--on-notice); font-weight: 600; }
.callout { background: var(--notice); color: var(--on-notice); border-radius: 8px; padding: 14px 16px; font-size: 15px; line-height: 22px; }
.callout a { color: var(--on-notice); font-weight: 600; }
.info { background: var(--civic-blue-tint); border-radius: 14px; padding: 18px 20px; }

/* Cards */
.card { background: var(--surface-raised); border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.card p { margin: 0; color: var(--ink-muted); font-size: 16px; line-height: 1.5; }
.card .grow { flex-grow: 1; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.price { font-weight: 700; font-size: 16px; }

/* Case path */
.path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.path li { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.dot { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.dot.done { background: var(--status-done); color: var(--surface-raised); }
.dot.now { background: var(--poppy-gold); border: 3px solid var(--surface-raised); box-shadow: 0 0 0 2px var(--poppy-gold); }
.dot.next { border: 2px solid var(--line-strong); }
.path .lbl { font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.path .sub { font-family: var(--font-mono); font-size: 11px; color: var(--ink-muted); }
@media (max-width: 520px) { .path { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 16px; } }

/* Steps */
ol.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 960px) { ol.steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { ol.steps { grid-template-columns: minmax(0, 1fr); } }
ol.steps li { border-top: 3px solid var(--civic-blue); padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
ol.steps .n { font-family: var(--font-mono); font-size: 13px; color: var(--civic-blue); }
ol.steps b { font-size: 18px; }
ol.steps span:last-child { color: var(--ink-muted); font-size: 16px; line-height: 1.5; }
ol.list { margin: 0; padding: 0; list-style: none; counter-reset: s; }
ol.list li { counter-increment: s; display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
ol.list li:last-child { border-bottom: 0; }
ol.list li::before { content: "Step " counter(s); font-family: var(--font-mono); font-size: 13px; color: var(--civic-blue); min-width: 60px; padding-top: 3px; }
:lang(es) ol.list li::before { content: "Paso " counter(s); }
ul.clean { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }

/* Layout with sidebar */
.split { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.split .main { flex: 999 1 540px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.split aside { flex: 1 1 300px; min-width: 0; position: sticky; top: 16px; }
@media (max-width: 900px) { .split aside { position: static; } }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-raised); }
table { width: 100%; border-collapse: collapse; min-width: 520px; font-size: 16px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; letter-spacing: .8px; text-transform: uppercase; color: var(--ink-muted); background: var(--surface); }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* FAQ */
details.q { background: var(--surface-raised); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
details.q summary { font-weight: 600; cursor: pointer; }
details.q p { margin: 10px 0 0; color: var(--ink-muted); }

/* Blue band */
.band { background: var(--civic-blue); color: var(--on-civic-blue); }
.band .wrap { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; padding-block: 44px; }
.band p { margin: 6px 0 0; max-width: 60ch; }

/* Footer */
footer.site { background: var(--surface-raised); border-top: 1px solid var(--line); font-size: 14px; line-height: 21px; color: var(--ink-muted); }
footer.site .wrap { padding-block: 36px 44px; display: flex; flex-direction: column; gap: 14px; }
footer.site .cols { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
footer.site nav a { display: inline-block; padding-block: 6px; }
footer.site b { color: var(--ink); }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media print { .preview, header.site nav, .band, footer.site nav { display: none; } }

/* Language menu */
.langmenu { position: relative; font-weight: 600; }
.langmenu summary { cursor: pointer; list-style: none; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 999px; min-height: 36px; display: inline-flex; align-items: center; }
.langmenu summary::-webkit-details-marker { display: none; }
.langmenu > div { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface-raised); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; min-width: 160px; z-index: 20; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.langmenu > div a { padding: 10px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.langmenu > div a:hover, .langmenu > div a[aria-current] { background: var(--civic-blue-tint); }

/* ---- FW-001 self-fill worksheet */
.fw { gap: 16px; display: flex; flex-direction: column; }
.fw-progress { margin: 0; font-weight: 600; color: var(--ink-muted); min-height: 1.4em; }
.fw-step { display: flex; flex-direction: column; gap: 18px; }
.fw-step[hidden] { display: none; }
.fw-step h2 { font-size: 26px; margin: 0; outline: none; }
.fw-item { background: var(--surface-raised); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.fw-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fw-item-head h3 { margin: 0; font-size: 19px; }
.fw-item .form, .fw .chips .form { font-family: var(--font-mono); font-size: 13px; }
.fw-explain, .fw-hint { margin: 0; color: var(--ink-muted); line-height: 1.5; }
.fw-hint { font-size: 14px; }
.fw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fw-grid .wide { grid-column: 1 / -1; }
.fw-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fw-field label { font-weight: 600; }
.fw input[type="text"], .fw input[type="tel"], .fw textarea { font: inherit; font-size: 16px; padding: 10px 12px; min-height: 48px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-raised); color: var(--ink); width: 100%; box-sizing: border-box; min-width: 0; }
.fw textarea { min-height: 110px; resize: vertical; }
.fw input:focus-visible, .fw textarea:focus-visible { outline: 3px solid var(--civic-blue); outline-offset: 1px; }
.fw-dollar { display: flex; align-items: center; gap: 6px; min-width: 0; }
.fw-dollar span { color: var(--ink-muted); font-weight: 600; }
.fw-check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; line-height: 1.4; }
.fw-check input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--civic-blue); }
.fw-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; margin-top: 6px; }
.fw-sub { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.fw-rows { display: flex; flex-direction: column; gap: 8px; }
.fw-row { display: grid; grid-template-columns: 34px repeat(var(--cols), minmax(0, 1fr)); gap: 8px; align-items: center; }
.fw-rowhead span { font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.fw-n { font-family: var(--font-mono); font-size: 13px; color: var(--ink-muted); }
.fw-total { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-top: 2px solid var(--line-strong); padding-top: 10px; font-weight: 600; }
.fw-total output { font-family: var(--font-mono); font-size: 18px; white-space: nowrap; }
.fw-warn { background: var(--notice); color: var(--on-notice); border-radius: 10px; padding: 14px 16px; }
.fw-warn ul { margin: 6px 0 0; padding-left: 20px; }
.fw-sheet { display: flex; flex-direction: column; gap: 8px; }
.fw-sheet h3 { margin: 12px 0 0; font-size: 17px; }
.fw-sheet-title { font-size: 22px; margin: 0; }
table.fw-copy { width: 100%; border-collapse: collapse; }
table.fw-copy th, table.fw-copy td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
table.fw-copy th { width: 76px; text-transform: none; letter-spacing: 0; color: var(--ink); font-family: var(--font-mono); font-size: 13px; font-weight: 500; white-space: nowrap; }
.fw-nav { justify-content: space-between; }
.fw-nav [hidden] { display: none; }
@media (max-width: 600px) {
  .fw-grid, .fw-checks { grid-template-columns: minmax(0, 1fr); }
  .fw-row { grid-template-columns: 26px minmax(0, 1fr); }
  .fw-row > :not(.fw-n) { grid-column: 2; }
  .fw-rowhead { display: none; }
  .fw-row input { min-height: 44px; }
  .fw-row input::placeholder { color: var(--ink-muted); }
  .fw-item { padding: 16px; }
}
@media print {
  body.fw-printing header.site, body.fw-printing .notice, body.fw-printing footer.site, body.fw-printing .fw-noprint, body.fw-printing .skip { display: none !important; }
  .fw-noprint { display: none !important; }
  .fw-sheet, .fw-next { color: #000; }
  table.fw-copy th, table.fw-copy td { border-color: #999; }
}
.fw .table-wrap table { min-width: 0; }
table.fw-copy { min-width: 0; table-layout: fixed; }

/* Free form helper */
.form-help textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-raised); color: var(--ink); width: 100%; min-height: 64px; }
.help-log { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.help-msg { padding: 10px 12px; border-radius: 10px; white-space: pre-wrap; line-height: 1.5; }
.help-me { background: var(--civic-blue-tint); align-self: flex-end; max-width: 90%; }
.help-ai { background: var(--surface); border: 1px solid var(--line); }

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

/* Printable flyer */
.flyer-sheet { background: #fff; color: #13233a; border: 1px solid var(--line); border-radius: 12px; padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.flyer-head { display: flex; gap: 12px; align-items: center; }
.flyer-head span { display: block; font-size: 14px; color: #47566b; }
.flyer-name { font-size: 22px; }
.flyer-title { font-size: 34px; line-height: 1.15; margin: 4px 0 0; color: #13233a; }
.flyer-lead { font-size: 18px; margin: 0; color: #13233a; }
.flyer-list { margin: 0; padding-left: 22px; font-size: 18px; line-height: 1.6; color: #13233a; }
.flyer-qr { display: flex; gap: 18px; align-items: center; border-top: 1px solid #d6dbe3; padding-top: 16px; }
.flyer-qr b { display: block; font-size: 20px; }
.flyer-qr span { font-size: 15px; color: #47566b; }
.flyer-small { font-size: 12.5px; color: #47566b; margin: 0; }
@media print {
  header.site, footer.site, .notice, .preview, .skip, .fw-noprint { display: none !important; }
  .flyer-page { padding: 0 !important; } .flyer-sheet { border: 0; padding: 0; }
}
