/* LeadAlign — shared tokens and controls.
   Visual language: US road signage. Guide-sign green, warning-sign yellow,
   Overpass (an open-source descendant of Highway Gothic) everywhere. */

@font-face { font-family: 'Overpass'; font-weight: 400; font-display: swap; src: url('/vendor/fonts/overpass-400.woff2') format('woff2'); }
@font-face { font-family: 'Overpass'; font-weight: 600; font-display: swap; src: url('/vendor/fonts/overpass-600.woff2') format('woff2'); }
@font-face { font-family: 'Overpass'; font-weight: 800; font-display: swap; src: url('/vendor/fonts/overpass-800.woff2') format('woff2'); }

:root {
  --green: #00653A;        /* guide sign */
  --green-deep: #004B2B;
  --green-wash: #E3EFE7;
  --yellow: #FFC629;       /* warning sign */
  --yellow-deep: #E9AA00;
  --red: #C8231B;          /* stop sign */
  --ink: #24282B;          /* asphalt */
  --paper: #F5F6F3;        /* reflective white, cooled */
  --surface: #FFFFFF;
  --line: #D4D8D1;
  --muted: #5D655E;
  --focus: #2E86DE;

  --font: 'Overpass', 'Highway Gothic', 'Roboto Condensed', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-xs: 0.8125rem; --fs-sm: 0.9375rem; --fs-md: 1.0625rem; --fs-lg: 1.375rem; --fs-xl: 1.75rem; --fs-2xl: 2.5rem; --fs-3xl: 3.75rem;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px;
  --shadow: 0 1px 2px rgba(36, 40, 43, .12), 0 6px 18px rgba(36, 40, 43, .14);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --green: #1E8A57; --green-deep: #0F6B40; --green-wash: #183A2A;
    --ink: #ECEFEA; --paper: #17191B; --surface: #212427; --line: #3A4044; --muted: #9EA69F;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: var(--fs-md); line-height: 1.45; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-xl); } h2 { font-size: var(--fs-lg); } h3 { font-size: var(--fs-md); }
p { margin: 0 0 .7em; }
a { color: var(--green); text-underline-offset: 3px; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.warn { color: var(--red); }
.label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r-md);
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn.wide { width: 100%; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-deep); border-color: var(--green-deep); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--green-wash); border-color: transparent; }
.btn.danger { color: var(--red); }
.btn.link { background: none; border: 0; color: var(--green); min-height: 36px; padding: 0; text-decoration: underline; font-weight: 600; }

/* inputs */
input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: var(--r-sm);
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); outline: none; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 32px; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--green); }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; }

/* segmented control */
.seg { display: flex; background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-md); padding: 3px; gap: 3px; }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; font-size: var(--fs-sm); cursor: pointer; padding: 0 10px; }
.seg button[aria-checked=true], .seg button[aria-selected=true] { background: var(--green); color: #fff; }
.seg.small button { min-height: 34px; }

/* switch rows */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; cursor: pointer; }
.switch-row small { display: block; color: var(--muted); font-size: var(--fs-sm); line-height: 1.35; margin-top: 2px; }
input[role=switch] { appearance: none; flex: none; width: 52px; height: 30px; border-radius: 15px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; }
input[role=switch]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
input[role=switch]:checked { background: var(--green); }
input[role=switch]:checked::after { transform: translateX(22px); }

/* chips */
.chips { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { margin-bottom: 6px; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-flex; min-height: 40px; align-items: center; padding: 0 14px; border-radius: 20px; border: 2px solid var(--line); font-weight: 600; font-size: var(--fs-sm); cursor: pointer; }
.chip input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px rgba(0,0,0,.15); flex: none; }
.swatch.big { width: 18px; height: 18px; }

/* dialogs */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgba(20, 22, 24, .45); }
dialog.modal { width: min(440px, calc(100% - 32px)); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
