/* CREST — the performance report form.
   The policy pages' stylesheet with a form on top of it. Copied rather than
   linked because Firebase publishes `report/` on its own: this site and
   `crest-privacy` are separate hosting targets and cannot share a file.
   Any change to the shared half belongs in `site/style.css` too. */
:root {
  --bg: #07090e;
  --panel: #10131b;
  --panel-2: #161a24;
  --line: rgba(255, 255, 255, 0.09);
  --text: #eceef3;
  --dim: #98a0b0;
  --red: #e10600;
  --good: #7fd3a3;
  --bad: #ff8078;
  --mono: 'SF Mono', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
a { color: #ff4d47; }
a:hover { color: #fff; }

header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px 22px;
  background: rgba(7, 9, 14, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
header img { height: 26px; width: auto; display: block; }
nav { display: flex; gap: 16px; flex-wrap: wrap; }
nav a {
  color: var(--dim); text-decoration: none;
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
nav a:hover { color: var(--text); }

.lang { margin-left: auto; display: flex; gap: 6px; }
.lang button {
  background: transparent; color: var(--dim);
  border: 1px solid var(--line); border-radius: 3px;
  padding: 5px 11px; font: 700 12px/1 inherit; letter-spacing: 0.1em; cursor: pointer;
}
.lang button[aria-pressed="true"] { color: #fff; border-color: var(--red); background: rgba(225, 6, 0, 0.16); }

main { max-width: 720px; margin: 0 auto; padding: 34px 22px 70px; }
h1 {
  font-size: clamp(28px, 6vw, 40px); font-weight: 900; font-style: italic;
  text-transform: uppercase; letter-spacing: -0.01em; margin: 0 0 6px;
}
h1 em { color: var(--red); font-style: italic; }
.updated { color: var(--dim); font-size: 13px; margin: 0 0 30px; font-family: var(--mono); }
h2 {
  font-size: 19px; font-weight: 800; margin: 40px 0 12px;
  padding-left: 12px; border-left: 3px solid var(--red);
}
p, li { color: #d3d8e2; }
ol { padding-left: 22px; }
li { margin: 8px 0; }
strong { color: #fff; }
code {
  font-family: var(--mono); font-size: 0.88em;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 3px; padding: 1px 5px; color: #cfd6e2;
}

.lede {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--red);
  padding: 18px 20px; margin: 0 0 34px;
}
.lede p:first-child { margin-top: 0; }
.lede p:last-child { margin-bottom: 0; }

.hint { color: var(--dim); font-size: 14px; }

/* ── the form ─────────────────────────────────────────────────────────────
   One field per row, always. A phone in portrait is the device most of these
   will be filled on, and a two-column form there is two half-width fields
   nobody can type into. */

form { margin: 34px 0 10px; }

.field { margin-bottom: 26px; }
.field label {
  display: block; font-weight: 800; font-size: 14px;
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 4px;
}
.field .req { color: var(--red); margin-left: 2px; }
.field .opt {
  color: var(--dim); font-weight: 400; font-size: 12px;
  letter-spacing: 0.04em; text-transform: none; margin-left: 6px;
}
.field .help { color: var(--dim); font-size: 13.5px; margin: 0 0 10px; line-height: 1.5; }

input, textarea {
  width: 100%;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 3px;
  padding: 12px 13px;
  /* 16px so iOS Safari does not zoom the page when the field takes focus, which
     on a form this long throws the reader's place away. */
  font: 16px/1.5 inherit;
}
textarea { font-family: var(--mono); font-size: 13px; line-height: 1.55; resize: vertical; }
input:focus, textarea:focus {
  outline: none; border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.16);
}
input.bad, textarea.bad { border-color: var(--bad); }
::placeholder { color: #5d6675; }

.counter {
  font-family: var(--mono); font-size: 12px; color: var(--dim);
  margin: 7px 0 0; min-height: 1.3em;
}
.counter.ok { color: var(--good); }
.counter.bad { color: var(--bad); }

.note {
  font-family: var(--mono); font-size: 13px; color: var(--dim);
  min-height: 1.4em; margin: 0 0 14px;
}
.note.bad { color: var(--bad); }
.note.good { color: var(--good); }

button[type="submit"] {
  width: 100%;
  background: var(--red); color: #fff;
  border: 1px solid var(--red); border-radius: 3px;
  padding: 15px 20px;
  font: 800 15px/1 inherit; letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer;
}
button[type="submit"]:hover:not(:disabled) { background: #ff1a14; border-color: #ff1a14; }
button[type="submit"]:disabled { opacity: 0.45; cursor: default; }
button[type="submit"]:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* The state the page ends in for most people, so it gets a real treatment
   rather than a line of text where the form used to be. */
#done { display: none; }
#done.on { display: block; }
.done-card {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--good);
  padding: 22px 24px; margin: 34px 0;
}
.done-card h2 { margin-top: 0; border-left: 0; padding-left: 0; }
.done-card .again {
  background: transparent; color: var(--dim);
  border: 1px solid var(--line); border-radius: 3px;
  padding: 10px 16px; font: 700 13px/1 inherit; letter-spacing: 0.08em;
  text-transform: uppercase; cursor: pointer; margin-top: 8px;
}
.done-card .again:hover { color: #fff; border-color: var(--dim); }

footer {
  border-top: 1px solid var(--line); margin-top: 50px;
  padding: 26px 22px 40px; text-align: center; color: var(--dim); font-size: 13px;
}

/* One document, two languages — the policy pages' rule, and the same reason:
   `revert` rather than `block`, because these markers sit on inline spans
   inside labels and on block divs in the body. */
[data-lang] { display: none; }
[data-lang].on { display: revert; }

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