/* Pre-login pages (#621, #950): /login, /privacy, /terms.

   These pages are server-rendered and public, so they cannot import the design system:
   Vite emits theme.css as a hashed bundle asset with no stable URL to link. The sage
   palette is therefore copied here VERBATIM from frontend/src/theme.css (same token names,
   same values), and frontend/scripts/check-tokens.mjs fails if any value here stops
   matching. It lives in one file shared by every public page (#950) rather than inlined in
   each template, so there is one copy to guard, not one per page. */
:root {
  --canvas: #f7faf7;
  --bg-elevated: #ffffff;
  --ink: #1e3a28;
  --muted: #7a9e83;
  --accent: #4a7c59;
  --on-accent: #ffffff;
  --border: #b8d4bc;
  --err: #c5221f;
  --err-bg: #fce8e6;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; display: flex; align-items: center;
  justify-content: center; background: var(--canvas); color: var(--ink);
  font-family: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  padding: 24px;
}
.card {
  background: var(--bg-elevated); border: 0.5px solid var(--border);
  border-radius: 14px; padding: 40px 36px; width: 100%; max-width: 380px;
  /* --ink at 6%, matching the card shadows in intro.css. Written out because a
     box-shadow needs the channels, and CSS cannot decompose a hex token. */
  box-shadow: 0 1px 3px rgba(30, 58, 40, 0.06);
}
/* The wordmark, matching .nav-logo in the SPA exactly: Sora ExtraLight at 22px/0.18em,
   and lowercase. The values are duplicated on purpose and the SPA is the source of truth
   for them. The fallback is a light SANS, not a serif: it is what shows if the font ever
   fails to load (same reasoning as runtime/email.py). */
.wordmark {
  font-family: 'Sora', 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  font-weight: 200;
  font-size: 22px; letter-spacing: 0.18em; text-align: center;
  margin: 0 0 4px;
}
/* .doc .wordmark a, not .wordmark a: the link-colour rule below (.doc a) would otherwise
   win on the long pages and turn the wordmark green. */
.wordmark a, .doc .wordmark a { color: inherit; text-decoration: none; }
.tagline { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 28px; }

/* /login */
label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
input[type=email] {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 15px;
  border: 0.5px solid var(--border); border-radius: 8px; background: var(--canvas);
  color: var(--ink); margin-bottom: 16px;
}
input[type=email]:focus { outline: none; border-color: var(--accent); }
/* #991: the sign-in code */
.code-label { margin-top: 18px; }
input.code {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 22px; letter-spacing: 0.3em;
  text-align: center; border: 0.5px solid var(--border); border-radius: 8px;
  background: var(--canvas); color: var(--ink); margin: 0 0 16px;
}
input.code:focus { outline: none; border-color: var(--accent); }
.alt { margin-top: 16px; font-size: 13px; text-align: center; color: var(--muted); }
.alt form { display: inline; }
.alt a, .alt button.link {
  width: auto; padding: 0; font-size: 13px; font-weight: 400; color: var(--accent);
  background: none; border: 0; cursor: pointer; text-decoration: underline;
}
.notice { font-size: 13px; color: var(--muted); text-align: center; margin: 10px 0 0; }
button {
  width: 100%; padding: 12px; font: inherit; font-size: 15px; font-weight: 500;
  color: var(--on-accent); background: var(--accent); border: 0; border-radius: 8px;
  cursor: pointer; transition: opacity 0.15s;
}
button:hover { opacity: 0.92; }
/* #993: "or", then a sign-in provider's button, outlined so the email path stays primary. */
.or {
  display: flex; align-items: center; gap: 10px; margin: 20px 0;
  font-size: 12px; color: var(--muted);
}
.or::before, .or::after { content: ""; flex: 1; border-top: 0.5px solid var(--border); }
a.provider {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 12px; font-size: 15px; font-weight: 500; color: var(--ink);
  background: var(--bg-elevated); border: 0.5px solid var(--border); border-radius: 8px;
  text-decoration: none; transition: border-color 0.15s;
}
a.provider:hover { border-color: var(--accent); }
.msg { font-size: 14px; line-height: 1.5; color: var(--muted); text-align: center; }
.msg strong { color: var(--ink); }
.error {
  font-size: 13px; color: var(--err); background: var(--err-bg);
  border-radius: 8px; padding: 10px 12px; margin-bottom: 18px; text-align: center;
}
.fine { margin-top: 22px; font-size: 12px; color: var(--muted); text-align: center; }
.legal-links { margin-top: 18px; font-size: 12px; text-align: center; }
.legal-links a, .doc a { color: var(--accent); }

/* /privacy and /terms: the same card, widened for reading. */
body.doc-page { display: block; }
.card.doc {
  max-width: 680px; margin: 24px auto; padding: 44px 48px;
  font-size: 15px; line-height: 1.6;
}
.doc h2 { font-size: 17px; font-weight: 500; margin: 32px 0 8px; }
.doc h3 { font-size: 15px; font-weight: 500; margin: 20px 0 4px; }
.doc p, .doc li { margin: 0 0 10px; }
.doc ul { padding-left: 20px; margin: 0 0 10px; }
.doc .version { font-size: 13px; color: var(--muted); }
.doc .updated { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 28px; }
.doc blockquote {
  margin: 0 0 10px; padding: 10px 14px; border-left: 2px solid var(--border);
  color: var(--ink); background: var(--canvas); border-radius: 4px;
}
@media (max-width: 560px) {
  body { padding: 12px; }
  .card.doc { padding: 28px 22px; margin: 8px auto; }
}
