/* Sign-in and setup pages. Tokens copied from page/index.html (light, dark, and the data-theme overrides). */
:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --surface-2: #e8e8ed;
  --line: #d2d2d7;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0071e3;
  --accent-fg: #ffffff;
  --primary: #0071e3;
  --primary-hover: #0062c4;
  --mk-red: #c9372c;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #1d1d1f;
    --surface-2: #2c2c2e;
    --line: #424245;
    --fg: #f5f5f7;
    --muted: #86868b;
    --accent: #2997ff;
    --accent-fg: #ffffff;
    --primary: #0066cc;
    --primary-hover: #0058b0;
    --mk-red: #ff6961;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #1d1d1f;
  --surface-2: #2c2c2e;
  --line: #424245;
  --fg: #f5f5f7;
  --muted: #86868b;
  --accent: #2997ff;
  --accent-fg: #ffffff;
  --primary: #0066cc;
  --primary-hover: #0058b0;
  --mk-red: #ff6961;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
.gutter {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); }
.error { color: var(--mk-red); margin: 0; }

.auth { min-height: 100vh; min-height: 100dvh; display: flex; align-items: flex-start; justify-content: center; padding-top: max(48px, 10vh); padding-bottom: 48px; }
.panel { width: 100%; max-width: 440px; min-width: 0; }
.brand { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 24px; }
h1 { font-size: 34px; line-height: 1.12; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 12px; }
h2 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 8px; display: flex; align-items: center; gap: 10px; }
h2 .num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: 14px; flex: none; }
p { margin: 0 0 12px; }

.stack { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 13px; color: var(--muted); }
input[type="password"], input[type="text"] {
  min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px;
  background: var(--surface-2); color: var(--fg); width: 100%; font-size: 17px;
}
input:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; }

.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px;
  font-size: 17px; cursor: pointer; text-decoration: none;
}
.pill:hover { text-decoration: none; }
.pill.primary { background: var(--primary); color: var(--accent-fg); }
.pill.primary:hover { background: var(--primary-hover); }
.pill.quiet { background: var(--surface-2); color: var(--fg); }
.pill.quiet:hover { background: var(--line); }
.pill:disabled { opacity: 0.4; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }

.step { background: var(--surface); border-radius: var(--radius); padding: 20px; margin-top: 20px; min-width: 0; }
.step .stack { margin-top: 12px; }
.step input[type="password"], .step input[type="text"] { background: var(--bg); }
.qr { width: 220px; max-width: 100%; margin: 8px 0 16px; border-radius: 12px; overflow: hidden; background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }
.secret { font-size: 17px; letter-spacing: 0.04em; word-break: break-all; user-select: all; -webkit-user-select: all; }
.codes { margin: 16px 0 24px; padding: 16px 16px 16px 44px; background: var(--surface); border-radius: var(--radius); font-size: 17px; line-height: 1.8; }
.codes li { user-select: all; -webkit-user-select: all; }

@media (max-width: 480px) {
  h1 { font-size: 28px; }
  .auth { padding-top: 32px; }
}
