/* Truckee Community Cares. Plain, large, high contrast. Mobile first. */
:root {
  /* Truckee Community Cares brand: sage green box, gold bow. Buttons use the darker
     green so white text passes contrast; gold carries dark text. */
  --bg: #fdfcf9; --fg: #22302a; --muted: #5b665f; --line: #d9d9d2;
  --brand: #6c8a71; --brand-dark: #4d6b53; --accent: #d9bd4f; --accent-dark: #c2a531; --accent-text: #2a2410;
  --card: #f1f3ec; --ok: #4d6b53; --err: #b3261e; --focus: #e8c84a;
  --radius: 12px; --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151a17; --fg: #f2f2f2; --muted: #b8bfba; --line: #3a423d; --card: #1f2723;
          --brand: #8fb094; --brand-dark: #6c8a71; --accent: #e2c765; --accent-dark: #d9bd4f; --accent-text: #1f1a05; --err: #ff6b6b; }
}
* { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--fg); line-height: 1.5; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 16px; padding-bottom: 32px; }
a { color: var(--brand); }
h1 { font-size: 1.8rem; line-height: 1.2; margin: 0.4em 0; }
h2 { font-size: 1.3rem; margin: 1.2em 0 0.4em; }
p { margin: 0.5em 0 1em; }
.muted { color: var(--muted); }
.error { color: var(--err); font-weight: 600; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--focus); color: #000; padding: 8px; }
.skip:focus { left: 8px; z-index: 10; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); font-weight: 700; font-size: 1.05rem; }
.brand img { height: 44px; width: auto; }
.lang-switch { padding: 10px 14px; min-height: 44px; display: inline-flex; align-items: center; border: 2px solid var(--brand-dark); border-radius: 999px; text-decoration: none; font-weight: 700; color: var(--brand-dark); }
nav { display: flex; flex-wrap: wrap; gap: 4px 6px; padding-bottom: 10px; }
nav a { padding: 8px 10px; min-height: 40px; display: inline-flex; align-items: center; text-decoration: none; border-radius: 8px; }
nav a[aria-current="page"] { background: var(--card); font-weight: 700; }
nav .nav-apply { background: var(--brand-dark); color: #fff; font-weight: 700; }
.announcement { margin-top: 12px; padding: 12px 16px; background: #fff3cd; color: #3d2f00; border: 2px solid #e0b100; border-radius: var(--radius); font-weight: 600; }
.announcement p { margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px;
       border-radius: var(--radius); border: 2px solid transparent; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--brand-dark); color: #fff; }
.btn-primary:hover { background: #3f5944; }
.btn-secondary { background: var(--accent); color: var(--accent-text); }
.btn-secondary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--fg); }
.btn-help { background: var(--card); border-color: var(--brand-dark); color: var(--fg); }
.btn-big { font-size: 1.15rem; min-height: 56px; width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.hero { position: relative; margin: 0 -16px; padding: 40px 16px 32px; text-align: center; color: #fff;
        background: linear-gradient(rgba(34, 48, 42, 0.45), rgba(34, 48, 42, 0.6)), url("../img/hero.jpg") center 40% / cover no-repeat; }
.hero .logo-big { background: rgba(255, 255, 255, 0.92); display: inline-block; padding: 14px 22px; border-radius: 14px; margin-bottom: 14px; }
.hero .logo-big img { width: min(360px, 80vw); height: auto; display: block; }
.hero h1 { color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }
.hero .lead { font-size: 1.15rem; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); max-width: 620px; margin: 0 auto 14px; }
.hero .btn-hero { max-width: 420px; margin: 0 auto; font-size: 1.35rem; min-height: 68px; }
.hero .hero-sub { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); margin: 10px 0 0; }
.help-card { text-align: center; }
.help-card .help-links { justify-content: center; }
.help-card .btn { min-width: 110px; }
.donate-card { text-align: center; }
.donate-card .btn { max-width: 320px; margin: 0 auto; }
.hero .cta p { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.hero .btn-secondary { background: var(--accent); color: var(--accent-text); }
@media (min-width: 720px) { .hero { margin: 0; border-radius: 16px; overflow: hidden; } }
h2.section { text-transform: uppercase; letter-spacing: 0.14em; font-size: 1.05rem; color: var(--brand-dark); text-align: center; margin-top: 1.8em; }
.photo-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 4px; }
.photo-strip img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: block; }
@media (max-width: 560px) { .photo-strip { grid-template-columns: repeat(2, 1fr); } }
.cta-row { display: grid; gap: 16px; margin: 16px 0; }
@media (min-width: 560px) { .cta-row { grid-template-columns: 1fr 1fr; } }
.cta p { text-align: center; margin-top: 8px; }
.steps-grid ol { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 12px; }
.steps-grid li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; gap: 4px 12px; padding: 12px; background: var(--card); border-radius: var(--radius); }
.steps-grid li::before { content: counter(step); grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-dark); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.steps-grid li strong { display: block; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin: 20px 0; }
.card h2 { margin-top: 0; }
.stats ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: center; }
.stats .n { display: block; font-size: 1.8rem; font-weight: 800; color: var(--brand-dark); }
.prose section { margin-bottom: 1.5em; }

.site-footer { border-top: 1px solid var(--line); padding: 20px 0 40px; margin-top: 24px; font-size: 0.95rem; }
.help-links { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Application form ---------- */
.apply { max-width: 560px; margin: 0 auto; }
.apply-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
@media (max-width: 480px) { .apply-top .brand-text { display: none; } }
.lang-toggle { display: inline-flex; border: 2px solid var(--brand-dark); border-radius: 999px; overflow: hidden; }
.lang-toggle button { font: inherit; font-weight: 700; padding: 8px 12px; min-height: 44px; background: transparent; color: var(--brand-dark); border: 0; cursor: pointer; white-space: nowrap; overflow: hidden; }
.lang-toggle { flex-shrink: 1; min-width: 0; max-width: 60%; }
.lang-toggle button[aria-pressed="true"] { background: var(--brand-dark); color: #fff; }
.progress { margin: 8px 0 16px; }
.progress .bar { height: 10px; background: var(--card); border-radius: 999px; overflow: hidden; }
.progress .bar > div { height: 100%; background: var(--brand-dark); transition: width 0.3s; }
.progress .label { font-size: 0.95rem; color: var(--muted); margin-top: 6px; }
.step h1 { font-size: 1.5rem; }
.step .why { background: var(--card); padding: 10px 12px; border-radius: 8px; font-size: 0.95rem; }
.field { margin: 0 0 18px; }
.field label, .field .legend { display: block; font-weight: 700; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: 0.95rem; margin: -2px 0 6px; }
.field input[type=text], .field input[type=tel], .field input[type=email], .field input[type=number], .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1.1rem; padding: 12px 14px; min-height: 52px; border: 2px solid var(--line);
  border-radius: 10px; background: var(--bg); color: var(--fg); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand-dark); }
.field.invalid input, .field.invalid select { border-color: var(--err); }
.field .msg { color: var(--err); font-weight: 600; margin-top: 6px; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 16px; border: 2px solid var(--line);
                 border-radius: 999px; cursor: pointer; font-weight: 600; }
.choices input { width: 22px; height: 22px; margin: 0; accent-color: var(--brand); }
.choices label:has(input:checked) { border-color: var(--brand-dark); background: var(--card); }
.choices.stack { flex-direction: column; }
.choices.stack label { border-radius: 10px; }
.child-card { border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; position: relative; }
.child-card h3 { margin: 0 0 10px; font-size: 1.1rem; }
.child-card .remove { position: absolute; right: 10px; top: 10px; background: transparent; border: 0; color: var(--err); font: inherit; font-weight: 700; cursor: pointer; min-height: 40px; }
.nav-row { display: flex; gap: 10px; margin-top: 20px; }
.nav-row .btn-primary { flex: 2; }
.nav-row .btn-ghost { flex: 1; }
.summary dl { display: grid; grid-template-columns: 1fr 2fr; gap: 6px 12px; margin: 0 0 16px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; }
.summary .edit { font-size: 0.95rem; }
.done { text-align: center; padding: 24px 0; }
.done .code { font-size: 2rem; font-weight: 800; letter-spacing: 2px; background: var(--card); display: inline-block; padding: 12px 20px; border-radius: var(--radius); margin: 12px 0; }
.help-bar { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); padding: 8px 0; margin-top: 24px; display: flex; gap: 6px; justify-content: center; }
.help-bar .btn { min-height: 52px; flex: 1; padding: 5px 2px; font-size: 0.8rem; border-radius: 10px; flex-direction: column; gap: 1px; line-height: 1.1; white-space: nowrap; min-width: 0; overflow: hidden; }
.help-bar .ico { font-size: 1.15rem; line-height: 1.2; }
.help-bar .btn > span:not(.ico) { text-align: center; line-height: 1.05; }
@media (min-width: 480px) { .help-bar .btn { font-size: 0.9rem; flex-direction: row; gap: 6px; } }
.closed { text-align: center; padding: 24px 0; }
@media (max-width: 400px) { html { font-size: 106%; } .summary dl { grid-template-columns: 1fr; } }
@media print { .site-header, .site-footer, .help-bar, .nav-row, .lang-toggle { display: none !important; } }

.assist { position: sticky; bottom: 66px; z-index: 5; box-shadow: 0 -4px 20px rgba(0,0,0,0.15); }
.assist .small { min-height: 36px; padding: 4px 12px; }
.assist-log { max-height: 40vh; overflow-y: auto; margin-bottom: 8px; }
.assist-log p { margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: var(--bg); }
.assist-log p.user { background: transparent; }
.assist-form { display: flex; gap: 8px; }
.assist-form input { flex: 1; font: inherit; font-size: 1.05rem; padding: 10px 12px; min-height: 48px; border: 2px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); }
.speak-inline { background: transparent; border: 0; font-size: 1.1rem; cursor: pointer; min-height: 32px; padding: 0 6px; vertical-align: middle; }
.btn.recording { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(200, 87, 26, 0.5); } 50% { box-shadow: 0 0 0 10px rgba(200, 87, 26, 0); } }

/* ---------- Voice mode ---------- */
.voice { text-align: center; padding: 8px 0 20px; }
.voice .q { font-size: 1.35rem; font-weight: 700; line-height: 1.35; margin: 10px 0 18px; }
.voice .big { width: 100%; min-height: 84px; font-size: 1.3rem; border-radius: 18px; margin: 8px 0; }
.voice .big.rec { animation: pulse 1.2s ease-in-out infinite; background: var(--accent); color: var(--accent-text); }
.voice .transcript { background: var(--card); border-radius: 12px; padding: 12px; text-align: left; margin: 10px 0; font-size: 1.05rem; }
.voice .readback { font-size: 1.2rem; line-height: 1.4; margin: 12px 0; }
.voice .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.voice .row2 .btn { min-height: 72px; font-size: 1.15rem; }
.voice .small-links { margin-top: 18px; }
.voice .step-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 6px; }
.voice .step-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.voice .step-dots span.on { background: var(--brand-dark); }

/* ---------- Recording overlay ---------- */
.rec-overlay { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 16px; }
.rec-sheet { width: 100%; max-width: 420px; text-align: center; }
.rec-title { font-size: 1.6rem; font-weight: 800; margin: 0 0 8px; }
.rec-prompt { font-size: 1.1rem; color: var(--muted); margin: 0 0 12px; }
.rec-meter { width: 100%; max-width: 320px; height: 110px; display: block; margin: 8px auto; }
.rec-hint { font-size: 1.05rem; margin: 6px 0; min-height: 1.4em; }
.rec-time { color: var(--muted); font-variant-numeric: tabular-nums; margin: 4px 0 16px; }
.rec-done { width: 100%; min-height: 84px; font-size: 1.4rem; border-radius: 18px; margin-bottom: 10px; }
.rec-cancel { width: 100%; min-height: 52px; }
.rec-spinner { width: 44px; height: 44px; border: 5px solid var(--line); border-top-color: var(--brand-dark); border-radius: 50%; margin: 16px auto; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
body.rec-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .rec-spinner { animation: none; border-top-color: var(--line); } }

/* ---------- One-decision screens, help sheet ---------- */
.q-title { font-size: 1.5rem; line-height: 1.25; margin: 6px 0 14px; }
.welcome .lead-short { font-size: 1.15rem; margin: 0 0 18px; }
.welcome .btn-hero { font-size: 1.35rem; min-height: 72px; }
.help-bar.two .btn { font-size: 0.95rem; flex-direction: row; gap: 6px; min-height: 56px; }
.help-bar.two .btn-help { flex: 1.4; font-weight: 800; }
.help-sheet { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.45); display: flex; align-items: flex-end; justify-content: center; }
.help-sheet-inner { background: var(--bg); width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; padding: 18px 16px 24px; display: grid; gap: 10px; }
.help-sheet .big { min-height: 64px; font-size: 1.15rem; width: 100%; }
.help-sheet .q-title { text-align: center; margin: 0 0 6px; font-size: 1.2rem; }

/* Big statement choices: one full-width card per option, generous spacing. */
.choices.big { gap: 12px; margin: 6px 0 4px; }
.choices.big label { min-height: 68px; padding: 14px 18px; font-size: 1.1rem; border-radius: 14px; line-height: 1.3; }
.choices.big input { width: 26px; height: 26px; flex-shrink: 0; }
.step .q-title { margin-top: 14px; }
.step .why { margin: 14px 0 0; }
.nav-row { margin-top: 28px; }

.status-card { text-align: left; }
.status-card .help-links { margin: 8px 0 0; }

/* Quiet text actions under the nav row: start over, cancel. Never compete with Next. */
.text-action { text-align: center; margin: 14px 0 0; }
.text-action button { background: none; border: 0; padding: 8px 12px; color: var(--muted, #555); font: inherit; font-size: 0.95rem; text-decoration: underline; cursor: pointer; min-height: 44px; }
