:root {
  color-scheme: dark;
  --bg: #1b1b1e;
  --card: #28282b;
  --field: #202023;
  --text: #f4f4f6;
  --muted: #a9a9b0;
  --line: #414146;
  --tabs: #323236;
  --accent: #1b73d1;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f7;
  --card: #fff;
  --field: #fff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d9d9df;
  --tabs: #f0f0f3;
  --accent: #0071e3;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: default; }
button:focus-visible, input:focus-visible { outline: 3px solid #64aeff80; outline-offset: 2px; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px; }
.auth-card { display: grid; gap: 22px; width: min(460px, 100%); padding: 40px; border: 1px solid var(--line); border-radius: 28px; background: var(--card); box-shadow: 0 16px 48px #0002; }
.auth-brand-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.auth-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; font-size: 26px; font-weight: 750; letter-spacing: -.045em; white-space: nowrap; }
.auth-brand img { width: 54px; height: 54px; flex: 0 0 54px; object-fit: cover; border-radius: 25%; }
.brand-accent { color: #9bcaff; }
html[data-theme="light"] .brand-accent { color: #2676ce; }
.theme-toggle { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border: 0; background: transparent; color: var(--muted); font-size: 26px; }
.theme-toggle:hover { color: var(--text); }
.theme-sun { display: none; }
html[data-theme="dark"] .theme-moon { display: none; }
html[data-theme="dark"] .theme-sun { display: inline; }
.auth-intro { margin: 6px 0 0; }
.auth-intro h1 { margin: 0; font-size: clamp(30px, 5vw, 34px); font-weight: 700; letter-spacing: -.04em; line-height: 1.25; }
.auth-intro p { margin: 18px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.auth-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--tabs); }
.auth-tabs button { flex: 1; min-height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; }
.auth-tabs button.active { background: var(--card); color: var(--text); box-shadow: 0 1px 5px #0002; }
.auth-card label { display: grid; gap: 9px; font-size: 13px; font-weight: 600; }
.auth-card input { width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--field); color: var(--text); outline: none; font-size: 15px; }
.auth-card input::placeholder { color: #92929a; }
.auth-card input:focus { border-color: #4c9ef1; box-shadow: 0 0 0 3px #4c9ef122; }
.auth-hint { margin: -12px 0 0; color: var(--muted); font-size: 12px; }
.auth-submit { min-height: 48px; margin-top: 2px; border: 1px solid var(--accent); border-radius: 13px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 650; }
.auth-submit:hover:not(:disabled) { filter: brightness(1.1); }
.auth-error { min-height: 0; margin: -10px 0 0; color: #ff9b9b; font-size: 13px; }
.auth-error:empty { display: none; }
.registration-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace !important; letter-spacing: 1px; }
@media (max-width: 520px) { .auth-card { gap: 20px; padding: 28px 24px; border-radius: 24px; } .auth-brand { font-size: 22px; } .auth-brand img { width: 46px; height: 46px; flex-basis: 46px; } }
