/* Shared layout for the public forms (forms/).

   Managed by ostrom/ostrom-dashboard-standards (assets/_forms.css).
   Edit there, not here: the sync overwrites this file.

   Loaded after /_subpage.css, which owns every token: nothing here is a hex
   value. A form page links both files and adds nothing of its own beyond a
   `<style>` block for genuinely page-specific bits. The markup _forms.js
   renders is what these classes style, so a page never writes field markup
   by hand. Every rule works at <= 720px; the media block at the end is the
   only place that changes anything for a phone. */

body { padding: 24px 16px 48px; }
main.form-shell { max-width: 640px; }

/* ── header ─────────────────────────────────────────────────────────────── */
.form-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.form-top .logo { display: inline-flex; align-items: center; }
.form-top .logo img { height: 28px; width: auto; display: block; }
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; background: var(--card); padding: 2px; }
.lang-switch button {
  background: transparent; border: 0; border-radius: 999px; padding: 5px 11px;
  font: 700 12px/1 "Inter", sans-serif; color: var(--muted); cursor: pointer; letter-spacing: .04em;
}
.lang-switch button[aria-pressed="true"] { background: var(--navy); color: var(--card); }
.form-shell h1 { font-size: 28px; line-height: 1.2; }
.form-shell p.sub { font-size: 15px; margin-bottom: 20px; }

/* ── progress ───────────────────────────────────────────────────────────── */
.progress { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.progress .track { flex: 1; height: 4px; border-radius: 999px; background: var(--border); overflow: hidden; }
.progress .fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .25s ease; }
.progress .count { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }

/* ── the step card ──────────────────────────────────────────────────────── */
.step { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px 24px 20px; }
.step h2 { font-size: 19px; font-weight: 800; color: var(--navy); margin: 0 0 6px; line-height: 1.3; }
.step .lead { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.step .lead:last-child { margin-bottom: 0; }
.step .body p { margin: 0 0 12px; font-size: 15px; }
.step .body ul { margin: 0 0 12px; padding-left: 20px; font-size: 15px; }
.step .body li { margin-bottom: 6px; }
.step .body a { font-weight: 700; }

/* ── fields ─────────────────────────────────────────────────────────────── */
.field { display: block; margin-bottom: 18px; }
.field.compact { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; column-gap: 12px; row-gap: 6px; }
.field.compact > .label { margin-bottom: 0; }
.field.compact input[type="date"] { width: 11.5rem; flex: 0 0 auto; }
.field.compact .hint, .field.compact .err { flex: 1 0 100%; }
.field:last-child { margin-bottom: 0; }
.field > .label { display: block; font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.field > .label .opt { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 6px; }
.field .hint { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.field .err { display: none; color: var(--bad-ink); font-size: 12.5px; font-weight: 600; margin: 6px 0 0; }
.field.invalid .err { display: block; }
.field.invalid input, .field.invalid select, .field.invalid textarea, .field.invalid .picker-btn { border-color: var(--bad); }
.field.invalid .choice { border-color: var(--bad-line); }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="date"], select, textarea {
  width: 100%; font: 500 15px/1.4 "Inter", sans-serif; color: var(--ink);
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 13px; min-height: 46px; appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--border); }
input[type="date"] { -webkit-appearance: none; }
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23384150' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px;
}
/* Custom menu for type=select. The open list matches the choice tiles:
   card surface, the same radius, accent on the chosen row. */
.picker { position: relative; }
.picker-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  text-align: left; cursor: pointer;
  font: 500 15px/1.4 "Inter", sans-serif; color: var(--ink);
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 13px; min-height: 46px;
}
.picker-btn.placeholder { color: var(--muted); }
.picker-btn:focus, .picker.open .picker-btn { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--border); }
.picker-btn::after {
  content: ""; flex: 0 0 auto; width: 8px; height: 8px; margin-right: 4px;
  border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy);
  transform: rotate(45deg) translateY(-3px);
}
.picker.open .picker-btn::after { transform: rotate(225deg) translateY(1px); }
.picker-menu {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  margin: 0; padding: 6px; max-height: 280px; overflow: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
}
.picker-menu[hidden] { display: none; }
.picker-opt {
  display: block; width: 100%; text-align: left; cursor: pointer;
  font: 500 15px/1.4 "Inter", sans-serif; color: var(--ink);
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: 10px 12px;
}
.picker-opt:hover, .picker-opt:focus { background: var(--chip); outline: none; }
.picker-opt.selected { background: var(--chip); border-color: var(--accent); color: var(--navy); font-weight: 700; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2 .field { margin-bottom: 18px; }

/* Choice tiles: one radio per card, the whole card clickable. */
.choices { display: grid; gap: 8px; }
.choices.cols2 { grid-template-columns: 1fr 1fr; }
.choice {
  display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; cursor: pointer; background: var(--card); transition: border-color .15s, background .15s;
}
.choice:hover { border-color: var(--accent); }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.choice .mark {
  flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--inactive);
  margin-top: 2px; position: relative; transition: border-color .15s;
}
.choice.checkbox .mark { border-radius: 5px; }
.choice input:checked ~ .mark { border-color: var(--accent); }
.choice input:checked ~ .mark::after {
  content: ""; position: absolute; inset: 3px; border-radius: inherit; background: var(--accent);
}
.choice input:focus-visible ~ .mark { box-shadow: 0 0 0 3px var(--border); }
.choice.selected { border-color: var(--accent); background: var(--chip); }
.choice .text { flex: 1; min-width: 0; }
.choice .title { display: block; font-weight: 700; font-size: 14.5px; color: var(--ink); }
.choice .desc { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.choice.yn { justify-content: center; text-align: center; }
.choice.yn .mark { display: none; }
.choice.yn .title { font-size: 15px; }

/* ── notices inside a step ──────────────────────────────────────────────── */
.notice { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 0 0 16px; background: var(--chip); }
.notice.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.notice.bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-ink); }
.notice.good { background: var(--good-bg); border-color: var(--good-line); color: var(--good-ink); }
.notice p:last-child { margin-bottom: 0; }

/* ── review list on the last step ───────────────────────────────────────── */
.review { margin: 6px 0 18px; }
.review h3 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.review dl { margin: 0; display: grid; grid-template-columns: minmax(120px, 38%) 1fr; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.review dt { padding: 9px 12px; color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; border-top: 1px solid var(--border); background: var(--chip); }
.review dd { padding: 9px 12px; margin: 0; border-top: 1px solid var(--border); font-size: 14px; overflow-wrap: anywhere; white-space: pre-line; }
.review dt:first-of-type, .review dd:first-of-type { border-top: 0; }

/* ── turnstile and consent ──────────────────────────────────────────────── */
.turnstile { margin: 6px 0 14px; min-height: 65px; }
.consent { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }

/* ── navigation ─────────────────────────────────────────────────────────── */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.nav .spacer { flex: 1; }
.btn { font-size: 15px; padding: 12px 20px; border-radius: 12px; min-height: 46px; }
.btn:hover:not([disabled]) { background: var(--accent-dk); }
.btn.ghost { background: transparent; color: var(--accent-dk); border: 1px solid var(--border); }
.btn.ghost:hover:not([disabled]) { background: var(--chip); color: var(--accent-dk); }
.btn.link { background: transparent; color: var(--accent-dk); padding-left: 0; padding-right: 0; }
.btn.link:hover:not([disabled]) { background: transparent; text-decoration: underline; }
.btn .spin {
  display: none; width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; margin-right: 8px; vertical-align: -2px; opacity: .85; animation: spin .7s linear infinite;
}
.btn.busy .spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.actions-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.actions-stack .btn { width: 100%; text-align: center; }

/* ── the ending (success or info) ───────────────────────────────────────── */
.ending { text-align: center; padding: 34px 24px 30px; }
.ending .icon {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 16px; display: flex; align-items: center;
  justify-content: center; background: var(--good-bg); color: var(--good-ink); font-size: 26px; font-weight: 800;
}
.ending.info .icon { background: var(--chip); color: var(--accent-dk); }
.ending h2 { margin-bottom: 8px; }
.ending p { color: var(--ink); font-size: 15px; margin: 0 0 10px; }
.ending .ref { color: var(--muted); font-size: 12px; margin-top: 14px; font-family: ui-monospace, monospace; }

/* ── page-level banner (network error etc.) ─────────────────────────────── */
.banner { display: none; border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }
.banner.show { display: block; }
.banner.bad { background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad-ink); }

/* Honeypot: off-screen, never display:none so a bot cannot tell it apart. */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

footer { text-align: center; }
footer a { margin: 0 8px; }

@media (max-width: 720px) {
  body { padding: 14px 10px 36px; }
  .form-shell h1 { font-size: 23px; }
  .step { padding: 18px 16px 16px; border-radius: 14px; }
  .row2, .choices.cols2 { grid-template-columns: 1fr; }
  .review dl { grid-template-columns: 1fr; }
  .review dt { border-top: 1px solid var(--border); padding-bottom: 2px; }
  .review dd { border-top: 0; padding-top: 2px; }
  .review dt:first-of-type { border-top: 0; }
  .nav { flex-direction: column-reverse; align-items: stretch; }
  .nav .spacer { display: none; }
  .nav .btn { width: 100%; text-align: center; }
}
