/* Shared styling for the pages outside the app shell: sign in, create account,
   page not found, and the System Manager. Uses the same tokens as style.css so
   the two never drift apart. */

:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --card-bg: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: #d2d2d7;
  --field-bg: #ffffff;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.08);
  --accent-text: #ffffff;
  --danger: #c0392b;
  --success: #1e8e3e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;
    --card-bg: #2c2c2e;
    --text: #f5f5f7;
    --muted: #9a9a9e;
    --border: #3a3a3c;
    --field-bg: #1c1c1e;
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --accent-soft: rgba(10, 132, 255, 0.12);
    --danger: #ff453a;
    --success: #30d158;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
}

.card {
  width: 400px;
  max-width: 100%;
  padding: 28px 26px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-bg);
}

.card.wide { width: 440px; }

/* The wordmark is finely detailed, so it needs room to read. Sized to sit a
   little wider than the headings beneath it, and capped so it never crowds a
   narrow card on a phone. */
.brand {
  display: block;
  width: 195px;
  max-width: 62%;
  height: auto;
  margin: 0 auto 20px;
}

h1 {
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 4px;
  text-align: center;
  letter-spacing: -0.01em;
}

.sub {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  margin: 0 0 18px;
  line-height: 1.45;
}

label.f {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 14px 0 6px;
}

input[type=text], input[type=password], input[type=email], input[type=number] {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type=checkbox] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  margin: 0;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--field-bg);
  cursor: pointer;
  position: relative;
  transition: 0.12s;
}

input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }

input[type=checkbox]:checked::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

button {
  width: 100%;
  padding: 11px;
  margin-top: 12px;
  font: inherit;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: none;
  border-radius: 9px;
  cursor: pointer;
}

button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.5; cursor: default; }

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
button.ghost:hover { background: var(--accent-soft); }

button.done { background: var(--success); }
button.danger { background: var(--danger); }

/* A sign-in method the user can switch on during sign-up. */
.method {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-top: 12px;
  transition: border-color 0.12s, background 0.12s;
}
.method.on { border-color: var(--accent); background: var(--accent-soft); }
.method .row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.method h3 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.25; }
.method .d { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.4; display: block; }
.method .body { margin-top: 12px; }

.err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 10px 0 0; line-height: 1.45; }
.ok { color: var(--success); font-size: 13px; line-height: 1.45; margin: 8px 0 0; }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0; line-height: 1.45; text-align: center; }

.sep { height: 1px; background: var(--border); margin: 16px 0; }

a { color: var(--accent); text-decoration: none; font-size: 13px; }
a:hover { text-decoration: underline; }

.links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.links .dot { color: var(--muted); font-size: 13px; }

.qr {
  display: block;
  width: 180px;
  height: 180px;
  margin: 12px auto 8px;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}

.secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  text-align: center;
  color: var(--muted);
  word-break: break-all;
}

.hidden { display: none; }
