/* Sign-in page. Same tokens as the app (assets/style.css), copied here because the app's CSS is behind the login. */
:root {
  --page: #e9eaef; --paper: #f6f7f9; --surface: #ffffff; --tint: #eceef2; --line: #e2e4ea;
  --ink: #1a1a1a; --muted: #5a5e6b; --control: #7c8090;
  --accent: #3a4fa3; --accent-press: #2c3d86; --accent-soft: #e9ecf8; --on-accent: #ffffff;
  --danger: #a3262a;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --r-m: 12px; --r-l: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", "Segoe UI", Roboto, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--page); }
body {
  margin: 0 auto; max-width: 480px; min-height: 100vh; min-height: 100dvh; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.45; box-shadow: 0 0 0 1px var(--line);
  -webkit-font-smoothing: antialiased;
}
h1, p { margin: 0; }
::selection { background: var(--accent-soft); color: var(--ink); }
input { caret-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.si { padding: calc(env(safe-area-inset-top, 0px) + 72px) 20px calc(env(safe-area-inset-bottom, 0px) + 32px); }
.si h1 { font-size: 34px; line-height: 1.1; letter-spacing: -0.025em; font-weight: 700; }
.lede { margin-top: 8px; color: var(--muted); max-width: 34ch; text-wrap: pretty; }

.card { margin-top: 28px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.card form { display: grid; gap: 14px; }
.card form[hidden] { display: none; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
input[type="email"], input[type="text"] {
  width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--control); border-radius: var(--r-m); background: var(--surface);
  font: inherit; font-size: 16px; font-weight: 400; color: var(--ink);
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input.code { font-size: 28px; letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; padding-left: 0.35em; }
.sent { color: var(--muted); font-size: 15px; text-wrap: pretty; }
.sent b { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: var(--r-m);
  border: 1px solid var(--line); background: var(--surface); font: inherit; font-weight: 600; font-size: 15px; color: var(--ink); text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.btn:active { background: var(--tint); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:active { background: var(--accent-press); }
.btn[disabled] { opacity: 0.6; cursor: default; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--accent); min-height: 44px; }
.btn-quiet:hover { background: var(--tint); }
.row { display: flex; flex-wrap: wrap; gap: 4px 8px; justify-content: space-between; margin-top: -4px; }

.msg { margin-top: 14px; min-height: 1.45em; font-size: 15px; color: var(--muted); text-wrap: pretty; }
.msg.err { color: var(--danger); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
.msg:empty { margin: 0; min-height: 0; }

.field-err { margin-top: -6px; min-height: 0; font-size: 15px; font-weight: 600; color: var(--danger); text-wrap: pretty; }
.field-err:empty { display: none; }
input[aria-invalid="true"] { border-color: var(--danger); }
.card form.is-locked .row { flex-direction: column; margin-top: 0; }
.card form.is-locked #again { width: 100%; }
.btn[hidden] { display: none; }
