:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  --accent: #e67326;
  --background: #0f0f12;
  --surface: #242426;
  --text: #f2f2f5;
  --muted: #b3b3b8;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--background);
  color: var(--text);
}
main { width: min(100%, 440px); padding: 28px; border-radius: 8px; background: var(--surface); }
header { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; font-size: 15px; font-weight: 600; }
header img { display: block; }
h1 { margin: 0 0 16px; font-size: 21px; font-weight: 600; }
p { margin: 12px 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.hint { margin-top: 24px; padding-top: 16px; border-top: 1px solid #39393d; font-size: 12px; }
.loading { display: flex; gap: 7px; align-items: center; height: 26px; margin-top: 20px; }
.loading span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: bounce 1s ease-in-out infinite; }
.loading span:nth-child(2) { animation-delay: .15s; }
.loading span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
button { padding: 10px 16px; border: 0; border-radius: 4px; background: var(--accent); color: white; font: inherit; font-size: 14px; cursor: pointer; }
button:hover { background: #f08234; }
button:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { .loading span { animation: none; } }

.auth-page {
  --bg: #fbfbfb;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --border: rgba(0, 0, 0, 0.08);
  --link: #0070f3;
  --link-hover: #0051bb;
  --shadow-card: 0 0 0 1px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.03);
  --success-text: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  color-scheme: light;
  margin: 0; min-height: 100svh;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4rem 1rem 2rem;
}
[data-theme="dark"] .auth-page {
  --bg: #030303;
  --surface: #1c1c1f;
  --text: #ececec;
  --muted: #8f8f9d;
  --border: rgba(255, 255, 255, 0.08);
  --link: #60a5fa;
  --link-hover: #93c5fd;
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  color-scheme: dark;
}
#theme-btn {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; padding: .5rem;
  color: var(--muted); cursor: pointer; border-radius: 4px;
}
#theme-btn:hover { background: var(--border); color: var(--text); }
#theme-btn svg { width: 20px; height: 20px; display: none; }
html[data-theme-mode="light"] #theme-btn .icon-sun,
html[data-theme-mode="dark"] #theme-btn .icon-moon,
html[data-theme-mode="system"] #theme-btn .icon-system { display: block; }
.auth-card {
  width: 100%; max-width: 580px; padding: 0;
  border-radius: 16px; background: var(--surface);
  box-shadow: var(--shadow-card); text-align: center; overflow: hidden;
}
.hero { padding: 2.75rem 2rem 2.5rem; }
.success-brand {
  display: flex; align-items: center; justify-content: center; gap: .75rem;
  margin-bottom: 1.5rem; font-size: 1.875rem; font-weight: 600;
  line-height: 1.2; letter-spacing: -.04em;
}
.success-brand img { display: block; flex: 0 0 auto; }
.auth-page h1 {
  font-size: 1.375rem; margin: 0 0 .875rem; font-weight: 400;
  line-height: 1.4; letter-spacing: -.02em; text-wrap: balance;
}
.auth-page p { color: var(--muted); margin: 0; font-size: .875rem; line-height: 1.6; }
.auth-page hr { border: none; border-top: 1px solid var(--border); margin: 0; }
.footer-links {
  padding: 1.125rem 1.5rem; font-size: .75rem; color: var(--muted);
  display: flex; justify-content: center; align-items: center; gap: .4rem; flex-wrap: wrap;
}
.footer-links a { color: var(--muted); text-decoration: none; font-weight: 400; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.footer-links a:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }
.footer-links .dot { color: var(--muted); opacity: .55; }
.close-hint { margin-top: 1rem; color: var(--muted); font-size: .75rem; }
.close-hint p { font-size: inherit; }
@media (max-width: 400px) {
  .hero { padding: 2.25rem 1.25rem 2rem; }
  .success-brand { font-size: 1.5rem; gap: .625rem; }
  .success-brand img { width: 40px; height: 40px; }
  .auth-page h1 { font-size: 1.25rem; }
}

.auth-page .loading { justify-content: center; margin: 0 0 1rem; }
.auth-page .next-step { margin-top: .625rem; }
