/* Sign-in and registration pages.
 *
 * The front door uses the same paper-grey tokens as the maintainer view
 * (demo.css) so signing in and being signed in look like one product, but the
 * tokens are copied rather than imported: these pages must not pick up layout
 * rules meant for the app shell, and must keep rendering if demo.css moves.
 */

:root {
  color-scheme: light;
  --surface-0: #f4f4f2;
  --surface-1: #fcfcfb;
  --surface-2: #f0efec;
  --border: #dddcd7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #7c7b76;
  --accent: #2a78d6;
  --accent-hover: #1e64b8;
  --accent-soft: #e4eefb;
  --status-critical: #d03b3b;
  --critical-soft: #fbeae6;
}

/* theme.js resolves the theme (stored choice, else the system scheme) into
   html[data-theme] before first paint; the stylesheet never reads
   prefers-color-scheme itself. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-0: #121211;
  --surface-1: #1a1a19;
  --surface-2: #242422;
  --border: #383835;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #8f8e86;
  --accent: #3987e5;
  --accent-hover: #5c9cea;
  --accent-soft: #1d2c40;
  --status-critical: #ef6d6d;
  --critical-soft: #2d1917;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  width: 100%;
  max-width: 430px;
  padding: 24px 16px;
}

.auth-panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px 28px 24px;
}

/* ── Identity: a MAINTAINERS-style stanza ────────────────
   The audience reads this file format daily; three honest lines say what the
   site is better than a logo would. */

.auth-stanza {
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  margin: 0 0 10px;
  color: var(--text-secondary);
}

.auth-stanza-title {
  display: block;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-stanza-row { display: flex; gap: 0; padding: 1px 0; }
.auth-stanza-row .k { width: 3ch; flex: none; color: var(--text-muted); }

.auth-tagline {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.auth-rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.auth-panel h1 {
  margin: 0 0 14px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

/* ── Form ────────────────────────────────────────────── */

.auth-form,
.auth-result {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form label,
.auth-result label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-form label > span,
.auth-result label > span {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-secondary);
}

.auth-form input,
.auth-result input {
  font: inherit;
  color: var(--text-primary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
}

.auth-form input:focus-visible,
.auth-result input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.auth-result input[readonly] {
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px;
}

.auth-submit {
  margin-top: 4px;
  font: inherit;
  font-weight: 550;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
}

.auth-submit:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.auth-submit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── CAPTCHA ─────────────────────────────────────────── */

.auth-captcha {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.auth-captcha img {
  flex: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  /* The library draws dark glyphs on transparent; keep them legible if the
     surrounding theme ever goes dark. */
  background: #fff;
}

.auth-captcha input { flex: 1; min-width: 0; }

/* ── Notices ─────────────────────────────────────────── */

.auth-notice {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-notice.error {
  border-color: var(--status-critical);
  background: var(--critical-soft);
  color: var(--status-critical);
}

.auth-footnote {
  margin: 16px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.auth-footnote a { color: var(--accent); }

@media (max-width: 480px) {
  .auth-panel { padding: 20px 18px; }
}
