/* Sign-in page. Same tokens as the dashboard (web/src/index.css): black canvas,
   one near-black card, pill controls, white primary action. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: dark;
  --bg: #000;
  --card: #151515;
  --sunken: #1f1f1f;
  --border: #333;
  --fg: #fafafa;
  --fg-2: #bdbdbd;
  --fg-3: #8e8d88;
  --accent: oklch(0.72 0.15 252);
  --accent-soft: oklch(0.72 0.15 252 / 0.16);
  --bad: oklch(0.72 0.17 25);
  --pill: rgb(255 255 255 / 0.09);
  --pill-hover: rgb(255 255 255 / 0.14);
  --spring: cubic-bezier(0.28, 1.4, 0.36, 1);
}

html { font-size: 100%; background: var(--bg); }

body.auth-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: var(--bg);
  color: var(--fg);
  font: 400 0.9375rem/1.5 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-feature-settings: 'cv11', 'ss03';
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid oklch(0.72 0.15 252 / 0.6); outline-offset: 2px; }

.auth-card {
  width: 100%;
  max-width: 24rem;
  padding: 2rem 1.75rem 1.75rem;
  background: var(--card);
  border-radius: 1.75rem;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.04);
  animation: rise 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(6px) scale(0.985); } }

.auth-title { font-size: 1.75rem; line-height: 2.25rem; font-weight: 500; letter-spacing: -0.015em; }
.auth-sub { margin: 0.25rem 0 1.5rem; font-size: 0.9375rem; color: var(--fg-3); }

.auth-form { display: grid; gap: 1rem; }
.auth-form[hidden] { display: none; }

.form-field { display: grid; gap: 0.375rem; }
.form-label { font-size: 0.875rem; font-weight: 500; color: var(--fg-2); }
.form-input {
  width: 100%;
  height: 2.75rem;
  padding: 0 0.875rem;
  font: inherit;
  font-size: 1rem; /* 16px: no iOS zoom on focus */
  color: var(--fg);
  background: var(--sunken);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  transition: border-color 150ms, box-shadow 150ms;
}
.form-input:hover { border-color: #444; }
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-code { letter-spacing: 0.2em; font-variant-numeric: tabular-nums; }

.auth-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--fg-2); }
.auth-check input { width: 1rem; height: 1rem; accent-color: var(--fg); }

button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; transition: scale 200ms var(--spring), background-color 160ms, opacity 160ms; }
button:active:not(:disabled) { scale: 0.96; }
button:disabled { cursor: default; opacity: 0.5; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  padding: 0 1.25rem;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 500;
  font-size: 0.9375rem;
}
.btn-primary:hover { background: #e4e4e4; }
.auth-submit { width: 100%; margin-top: 0.25rem; }

.btn-link { color: var(--fg-3); font-size: 0.875rem; font-weight: 500; padding: 0.25rem 0.5rem; border-radius: 999px; }
.btn-link:hover { color: var(--fg); }
.btn-link[hidden] { display: none; }
.auth-alt { justify-self: center; }

.auth-methods { display: grid; gap: 0.5rem; }
.auth-method {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  padding: 0.875rem 1rem;
  text-align: left;
  background: var(--pill);
  border-radius: 1rem;
}
.auth-method:hover { background: var(--pill-hover); }
.auth-method > i:first-child { font-size: 1.375rem; width: 1.5rem; text-align: center; color: var(--fg-2); }
.auth-method.primary { box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.25); }
.auth-method.primary > i:first-child { color: var(--fg); }
.auth-method.waiting { opacity: 0.6; }
.auth-method-text { flex: 1; display: grid; gap: 0.0625rem; }
.auth-method-label { font-size: 0.9375rem; font-weight: 500; color: var(--fg); }
.auth-method-sub { font-size: 0.8125rem; color: var(--fg-3); }
.auth-method-go { color: var(--fg-3); font-size: 0.875rem; }

.form-error { min-height: 1.25rem; margin-top: 0.75rem; font-size: 0.875rem; color: var(--bad); text-align: center; }
.form-error:empty { margin-top: 0; min-height: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
