/* shadcn-style tokens (zinc/neutral palette) with automatic dark mode. */
:root {
  --bg: #fafafa;
  --card: #ffffff;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --text-muted: #71717a;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-fg: #ffffff;
  --ring: rgba(99, 102, 241, 0.35);
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --ok: #16a34a;
  --ok-bg: #f0fdf4;
  --radius: 12px;
  --shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05), 0 1px 3px 0 rgb(0 0 0 / 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --card: #18181b;
    --border: #27272a;
    --border-strong: #3f3f46;
    --text: #fafafa;
    --text-muted: #a1a1aa;
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --accent-fg: #0f172a;
    --ring: rgba(129, 140, 248, 0.4);
    --danger: #f87171;
    --danger-bg: #450a0a;
    --ok: #4ade80;
    --ok-bg: #052e16;
    --shadow: 0 1px 2px 0 rgb(0 0 0 / 0.3), 0 1px 3px 0 rgb(0 0 0 / 0.4);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  -webkit-font-smoothing: antialiased;
}

.page {
  width: 100%;
  max-width: 420px;
}

.brand {
  text-align: center;
  margin-bottom: 20px;
}

.brand h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 8px 0 4px;
}

.brand p {
  color: var(--text-muted);
  margin: 0;
  font-size: 13px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}

.tab {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font: inherit;
  font-weight: 500;
  padding: 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 120ms ease, border-color 120ms ease;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.panel {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hidden {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field span {
  font-size: 13px;
  font-weight: 500;
}

.field small {
  color: var(--text-muted);
  font-size: 11px;
}

input {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 9px 11px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

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

.show-password {
  align-self: flex-start;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 0;
  cursor: pointer;
}

.show-password:hover {
  text-decoration: underline;
}

.show-password:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* honeypot: invisible to humans, tempting to bots */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.captcha {
  display: flex;
  align-items: center;
  gap: 8px;
}

.captcha-q {
  flex: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  min-width: 96px;
  text-align: center;
}

.captcha input[name="captcha_answer"] {
  min-width: 0;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-fg);
  font: inherit;
  font-weight: 500;
  padding: 10px 14px;
  cursor: pointer;
  transition: background-color 120ms ease, opacity 120ms ease;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.msg {
  margin: 0;
  min-height: 18px;
  font-size: 13px;
  border-radius: 8px;
  padding: 8px 10px;
  display: none;
}

.msg.error {
  display: block;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
}

.msg.success {
  display: block;
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent);
}

.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin: 16px 0 0;
}
