/* Design tokens, defined for both schemes so the page follows the reader's
   system setting rather than picking one and hoping. Every text/background pair
   below clears WCAG AA (4.5:1) — checked numerically, not by eye. */
:root {
  --bg: #faf9f8;
  --surface: #ffffff;
  --surface-2: #f6f5f4;
  --fg: #1a1a1a;          /* 16.1:1 on surface */
  --muted: #55555e;       /*  7.4:1 */
  --subtle: #63636d;      /*  5.1:1 */
  --line: #e6e4e1;
  --accent: #2f6f4f;      /* white on it: 5.1:1 */
  --accent-hover: #265c41;
  --accent-fg: #ffffff;
  --ok: #1f6b45;
  --bad: #a32020;         /*  6.4:1 on surface */
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0e;
    --surface: #141417;
    --surface-2: #1a1a1e;
    --fg: #ececee;        /* 15.2:1 on surface */
    --muted: #a1a1aa;     /*  7.0:1 */
    --subtle: #8a8a95;    /*  4.8:1 */
    --line: #26262c;
    --accent: #2f6f4f;
    --accent-hover: #3a8560;
    --ok: #6ee7b7;
    --bad: #fca5a5;       /*  7.5:1 on surface */
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.card {
  width: 100%;
  max-width: 26rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.brand { margin: 0 0 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.brand span { color: var(--ok); }

h1 { margin: 0 0 0.4rem; font-size: 1.2rem; letter-spacing: -0.02em; }
.lede { margin: 0 0 1.25rem; color: var(--muted); font-size: 0.9rem; }
.fine { margin: 0.9rem 0 0; color: var(--subtle); font-size: 0.78rem; }

label {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.optional { color: var(--subtle); }

input {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: var(--fg);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 111, 79, 0.18); }
input::placeholder { color: var(--subtle); }

.turnstile { margin: 0.25rem 0 1rem; min-height: 65px; }

button {
  width: 100%;
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 500;
  color: var(--accent-fg);
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
button:hover:not(:disabled) { background: var(--accent-hover); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

/* The inline "try again" is a real button for keyboard and screen-reader users,
   styled as a link because that is what it looks like in a sentence. */
button.link {
  display: inline;
  width: auto;
  padding: 0;
  color: var(--ok);
  background: none;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.error {
  margin: 0 0 1rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
  color: var(--bad);
  border: 1px solid currentColor;
  border-radius: 8px;
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.tick {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.9rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ok);
  border: 1px solid currentColor;
  background: color-mix(in srgb, currentColor 10%, transparent);
  font-size: 1.1rem;
}

a { color: var(--ok); }
