/* Public pages: the homepage, contractor pages and the start flow.
   Every color and size used more than once is a token here. An undefined custom
   property resolves to nothing instead of failing, so `make lint` checks that each
   custom property used in static/ and templates/ is defined (see scripts/check_tokens.py). */
:root {
  --accent: #1F6B4A;
  --accent-dark: #164F37;
  --accent-tint: #E6F0EB;
  --brand: var(--accent);
  --ink: #111111;
  --ink-2: #3D3D3A;
  --muted: #5F5F5A;
  --ground: #FAFAF8;
  --panel: #FFFFFF;
  --well: #E9E9E4;
  --line: #D4D4CE;
  --line-soft: #E4E4DF;
  --field: #8C8C86;
  --warn: #8A4B00;
  --warn-tint: #F6E9DF;
  --ok: #1E5B3A;
  --error: #9B1C1C;
  --error-tint: #FBEAEA;
  --font: 'Instrument Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 18px; line-height: 1.55; }
a { color: var(--ink); }
a:hover { color: #000000; }
img { max-width: 100%; }
summary { cursor: pointer; }
summary::-webkit-details-marker { display: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 10; background: var(--panel); padding: 8px 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }

/* ---- start flow ---------------------------------------------------------------- */
.flow { min-height: 100vh; line-height: 1.5; }
.flow-head { max-width: 1180px; margin: 0 auto; padding: 16px 5%; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 20px; letter-spacing: -0.02em; }
.logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; background: var(--accent); flex: none; }
.logo .ai { font-weight: 400; color: var(--muted); }
.stages { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.stages li { padding: 6px 12px; font-size: 14px; background: #EDEDE8; color: var(--muted); }
.stages li.done { background: var(--accent-tint); color: var(--ink); }
.stages li.now { background: var(--accent); color: #FFFFFF; font-weight: 600; }
.flow-main { max-width: 1180px; margin: 0 auto; padding: 8px 5% 56px; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.flow-col { flex: 2 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.flow h1 { margin: 0; font-weight: 500; font-size: 36px; line-height: 1.1; letter-spacing: -0.03em; }
.flow h2 { margin: 0; font-weight: 600; font-size: 22px; }
.flow p { margin: 0; }
.lead { color: var(--ink-2); }
.small { font-size: 15px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 28px; background: var(--accent); color: #FFFFFF; border: 0; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent-dark); color: #FFFFFF; }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn-lg { min-height: 56px; font-size: 19px; }
.btn-link { min-height: 52px; padding: 0 20px; background: none; color: var(--ink); border: 0; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.drop { background: var(--panel); border: 1px dashed var(--field); padding: 28px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.drop.over { border-color: var(--accent); background: var(--accent-tint); }
.review { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 1px solid var(--line); }
.review.warn { background: var(--warn-tint); border: 1.5px solid var(--warn); }
.review.good { background: var(--accent-tint); border: 1.5px solid var(--ok); }
.review strong { font-weight: 600; }
.areas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 8px; }
.areas li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); font-size: 16px; }
.areas .covered { font-weight: 600; color: var(--ok); }
.areas .cut_off, .areas .missing { font-weight: 600; color: var(--warn); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.log { display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; }
.msg.me { justify-content: flex-end; }
.bubble { max-width: 82%; padding: 12px 16px; background: var(--accent-tint); color: var(--ink); }
.msg.me .bubble { background: var(--accent); color: #FFFFFF; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-height: 48px; padding: 0 18px; font: inherit; font-weight: 600; cursor: pointer; text-align: left; background: var(--panel); color: var(--ink); border: 1.5px solid var(--ink); }
.opt:hover { background: var(--accent-tint); }
.opt:has(.swatch) { display: inline-flex; align-items: center; gap: 10px; padding-top: 8px; padding-bottom: 8px; }
.opt .swatch { width: 28px; height: 28px; flex: none; border: 1px solid var(--ink); }
.opt.primary { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }
.opt[disabled] { opacity: 0.55; cursor: progress; }
.box { background: var(--panel); border: 1.5px solid var(--ink); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.say { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 12px; flex-direction: row; }
.say .field { flex: 1 1 260px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, legend { font-weight: 600; }
.field .opt-note { font-weight: 400; color: var(--muted); }
.field input { font: inherit; color: var(--ink); min-height: 48px; padding: 0 14px; border: 1px solid var(--field); width: 100%; background: var(--panel); }
fieldset { margin: 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
legend { padding: 0; }
.errors { background: var(--error-tint); border: 1.5px solid var(--error); color: var(--error); padding: 12px 16px; }
.errors ul { margin: 0; padding-left: 20px; }
.side { flex: 1 1 300px; min-width: 0; background: var(--panel); border: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.side h3 { margin: 0; font-size: 14px; font-weight: 500; color: var(--muted); }
.thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 4 / 3; background: var(--well); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 0; right: 0; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; display: flex; align-items: flex-start; justify-content: flex-end; padding: 4px; }
.thumb button span { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; background: var(--ink); color: #FFFFFF; font-size: 16px; line-height: 1; }
.choices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.choices li { display: flex; flex-direction: column; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.choices strong { font-weight: 600; }
.choices span { color: var(--ink-2); }
