/* Daily Footprint Survey: single narrow column of question blocks.
   Deliberately light-only: always a white page, whatever the viewer's theme. */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --fg: #1c2a22;
  --muted: #5a6b60;
  --line: #d9e3d3;
  --chip-line: #c9d3c5;
  --accent: #3b8a55;
  --accent-soft: #e2f0df;
  --on-accent: #ffffff;
  --ink: #1f4d3a;
  --ok: #2f7a4f;
  --warn: #b4532a;
  --deep: #173d2e;
  --on-deep: #f1f7ef;
  --on-deep-70: #b0bfb5;   /* on-deep mixed 70% into deep */
  --on-deep-80: #c5d2c8;   /* on-deep mixed 80% into deep */
  --track: #3e5e51;        /* on-deep mixed 18% into deep */
  --hill-1: #1f5039;
  --hill-2: #2c6a4a;
  --hill-3: #3f855c;
  --pale: #a9d3b1;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}
[hidden] { display: none !important; }

html { scroll-padding-top: env(safe-area-inset-top, 0px); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 17px; line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.wrap {
  max-width: 720px; margin: 0 auto; padding-block: 0 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Page header: a dark green band running the full width of the window */
header {
  position: relative;
  background: var(--deep); color: var(--on-deep);
  padding-block: calc(40px + env(safe-area-inset-top, 0px)) 30px;
  box-shadow: 0 0 0 100vmax var(--deep); clip-path: inset(0 -100vmax);
}
header h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2rem, 5.5vw, 2.8rem); line-height: 1.1;
  margin: 0 0 8px; padding-right: 70px; text-wrap: balance; color: var(--on-deep);
}
header p { margin: 0; max-width: 60ch; }
.progress { margin-top: 22px; height: 4px; background: var(--track); border-radius: 2px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--pale); transition: width .25s; }
.progress-label { font-size: .85rem; color: var(--on-deep-70); margin-top: 8px; font-variant-numeric: tabular-nums; }

.site { margin: 4px 0 0; color: var(--on-deep-80); }
.site strong { color: var(--on-deep); margin-left: 4px; }

/* Questions */
form { display: grid; margin-top: 12px; }
fieldset { border: 0; border-bottom: 1px solid var(--line); padding: 30px 0 32px; margin: 0; min-width: 0; }
legend { padding: 0; float: left; width: 100%; margin-bottom: 16px; }
legend + * { clear: both; }
.code { display: block; font-family: var(--font-display); font-size: .95rem; color: var(--accent); margin-bottom: 4px; }
.q { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; line-height: 1.3; color: var(--ink); }
.hint { display: block; font-size: .88rem; color: var(--muted); margin-top: 2px; }

/* Answer chips: real radio / checkbox inputs, drawn as buttons */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips span {
  display: inline-block; padding: 9px 16px;
  border: 1px solid var(--chip-line); border-radius: 6px; background: var(--bg);
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.chips input:checked + span { background: var(--deep); border-color: var(--deep); color: var(--on-deep); }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips label:hover span { border-color: var(--ink); }
.chips.days span { min-width: 3.2em; text-align: center; font-variant-numeric: tabular-nums; }

.km { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.km input[type=number] {
  width: 7em; font: inherit; font-size: 1.1rem; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.km input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.km .rt { font-size: .88rem; color: var(--muted); }

/* Bot trap: kept off-screen rather than display:none, which some bots skip */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Buttons and status line */
.actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
button { font: inherit; font-weight: 600; border-radius: 6px; padding: 13px 26px; cursor: pointer; border: 1px solid transparent; }
button.primary { background: var(--deep); color: var(--on-deep); }
button.primary:hover:not(:disabled) { background: var(--hill-1); }
button.primary:disabled { opacity: .5; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--ink); border-color: var(--line); padding: 8px 14px; font-weight: 400; }
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
button.link { background: none; border: 0; padding: 0 0 0 10px; font-weight: 400; color: var(--pale); text-decoration: underline; }
.status { font-size: .95rem; color: var(--muted); }
.status.ok { color: var(--ok); font-weight: 700; }
.status.err { color: var(--warn); }

/* Country pop-up */
.intro {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center;
  background: rgba(28, 42, 34, .45);
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.intro-card {
  position: relative;
  background: var(--surface); color: var(--fg); border-radius: 6px;
  max-width: 540px; max-height: 100%; overflow-y: auto; width: 100%;
  padding: 28px 26px 24px; box-shadow: 0 4px 16px rgba(28, 42, 34, .2);
}
.intro-card h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; line-height: 1.2; margin: 0 0 10px; padding-right: 70px; color: var(--ink); }
.intro-card p { margin: 0 0 22px; color: var(--muted); }
.intro-card .chips { margin: 10px 0 24px; }
.intro-label { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--fg); }

/* Welcome screen: dark green, serif headline, layered hills along the bottom */
.welcome {
  position: fixed; inset: 0; z-index: 30; overflow-y: auto;
  display: grid; align-items: center;
  background: var(--deep); color: var(--on-deep);
  padding: calc(64px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(30vh, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.w-inner { position: relative; z-index: 1; width: 100%; max-width: 660px; margin: 0 auto; }
.w-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.4rem, 7vw, 3.8rem); line-height: 1.05; margin: 0 0 22px; color: var(--on-deep); }
.w-lead { font-size: 1.15rem; line-height: 1.6; margin: 0 0 14px; max-width: 54ch; }
.w-note { margin: 0 0 30px; color: var(--pale); }
.w-go { background: var(--on-deep); color: var(--deep); font-size: 1.05rem; padding: 14px 30px; }
.w-go:hover { background: #ffffff; }
.w-go:focus-visible { outline: 3px solid var(--on-deep); outline-offset: 3px; }
.w-hills { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; height: 28vh; display: block; }
.w-hills .h1 { fill: var(--hill-1); }
.w-hills .h2 { fill: var(--hill-2); }
.w-hills .h3 { fill: var(--hill-3); }
.w-hills .road { fill: none; stroke: var(--pale); stroke-width: 3; stroke-linecap: round; opacity: .7; }

/* Language switch, top right of the welcome screen, the country pop-up and the header */
.lang { position: absolute; top: 14px; right: 14px; z-index: 2; display: flex; align-items: center; gap: 2px; font-size: .9rem; color: inherit; }
header .lang { top: calc(14px + env(safe-area-inset-top, 0px)); right: 0; }
.welcome .lang { top: max(18px, env(safe-area-inset-top, 0px)); right: max(18px, env(safe-area-inset-right, 0px)); }
.intro-card .lang { color: var(--ink); }
.lang span { opacity: .5; }
.lang button { background: none; border: 0; color: inherit; padding: 4px 6px; font-weight: 400; opacity: .65; }
.lang button[aria-pressed="true"] { opacity: 1; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.lang button:hover { opacity: 1; }

/* Results page (admin) */
.results { margin-top: 32px; }
.results .sub { color: var(--muted); margin: 0 0 16px; font-size: .92rem; }
.table-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; font-size: .88rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-weight: 700; color: var(--muted); background: var(--bg); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
.empty { padding: 20px; color: var(--muted); white-space: normal; }
.res-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
/* The delete column stays visible on the right while the table scrolls sideways */
.act { position: sticky; right: 0; box-shadow: inset 1px 0 0 var(--line); }
td.act { padding: 4px 8px; text-align: right; background: var(--surface); }
th.act { z-index: 1; }
button.danger { color: var(--warn); padding: 4px 10px; font-size: .85rem; }
button.danger:hover:not(:disabled) { border-color: var(--warn); }
.signout { color: var(--pale); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
