:root {
  color-scheme: light;
  --auth-bg: #f7f5f9;
  --auth-bg-2: #efe9f4;
  --auth-surface: rgba(255, 255, 255, .93);
  --auth-surface-solid: #ffffff;
  --auth-line: #ded3e4;
  --auth-ink: #261d2b;
  --auth-muted: #796b80;
  --auth-label: #594960;
  --auth-input: #ffffff;
  --auth-primary: #9810fa;
  --auth-primary-2: #7510c2;
  --auth-accent: #ff4f78;
  --auth-danger: #b92f50;
  --auth-danger-bg: #fff1f5;
  --auth-shadow: 0 28px 80px rgba(65, 35, 78, .16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --auth-bg: #130f18;
  --auth-bg-2: #1a1320;
  --auth-surface: rgba(28, 22, 35, .94);
  --auth-surface-solid: #1c1623;
  --auth-line: #3b2d47;
  --auth-ink: #f7f2fb;
  --auth-muted: #aaa0b5;
  --auth-label: #d9d0e1;
  --auth-input: #16111b;
  --auth-primary: #bb7cff;
  --auth-primary-2: #9554d7;
  --auth-accent: #ff6488;
  --auth-danger: #ffb3c1;
  --auth-danger-bg: rgba(255, 94, 124, .09);
  --auth-shadow: 0 28px 90px rgba(0, 0, 0, .40);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 12%, rgba(152, 16, 250, .13), transparent 31%),
    radial-gradient(circle at 88% 88%, rgba(255, 79, 120, .09), transparent 28%),
    linear-gradient(145deg, var(--auth-bg), var(--auth-bg-2));
  color: var(--auth-ink);
  transition: background-color .22s ease, color .22s ease;
}
body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(2px);
  opacity: .75;
}
body::before {
  width: 360px;
  height: 360px;
  left: -180px;
  bottom: -170px;
  border: 1px solid rgba(152, 16, 250, .18);
  box-shadow: 0 0 0 56px rgba(152, 16, 250, .035), 0 0 0 112px rgba(152, 16, 250, .025);
}
body::after {
  width: 260px;
  height: 260px;
  right: -130px;
  top: -130px;
  border: 1px solid rgba(255, 79, 120, .14);
  box-shadow: 0 0 0 48px rgba(255, 79, 120, .025);
}

.auth-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 78px 32px 40px;
}
.auth-card {
  width: min(440px, 100%);
  border: 1px solid color-mix(in srgb, var(--auth-line) 86%, transparent);
  border-radius: 24px;
  background: var(--auth-surface);
  box-shadow: var(--auth-shadow);
  padding: 36px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}
.auth-mark {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  object-fit: contain;
  box-shadow: 0 8px 24px rgba(152, 16, 250, .20);
}
.auth-brand-copy { display: grid; gap: 1px; }
.auth-brand-copy strong { font-size: 24px; line-height: 1; letter-spacing: -.035em; }
.auth-brand-copy span { color: var(--auth-muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.auth-eyebrow { display: block; color: var(--auth-primary-2); font-size: 10px; font-weight: 850; letter-spacing: .16em; }
.auth-copy h1 { font-size: 31px; line-height: 1.1; margin: 9px 0 8px; letter-spacing: -.04em; }
.auth-copy p { color: var(--auth-muted); margin: 0 0 27px; font-size: 14px; line-height: 1.55; }
.auth-form { display: grid; gap: 16px; }
.auth-form label { display: grid; gap: 7px; }
.auth-form label span { font-size: 12px; font-weight: 750; color: var(--auth-label); }
.auth-form input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  background: var(--auth-input);
  color: var(--auth-ink);
  padding: 0 14px;
  font: inherit;
  outline: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .65) inset;
  transition: .16s border-color, .16s box-shadow, .16s background-color;
}
body[data-theme="dark"] .auth-form input { box-shadow: none; }
.auth-form input:hover { border-color: color-mix(in srgb, var(--auth-primary) 48%, var(--auth-line)); }
.auth-form input:focus { border-color: var(--auth-primary); box-shadow: 0 0 0 3px rgba(152, 16, 250, .13); }
.auth-submit {
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #ad25ff, #8c10e2 70%, #7a0ec8);
  color: #fff;
  box-shadow: 0 12px 26px rgba(137, 16, 220, .24);
  font: inherit;
  font-weight: 820;
  cursor: pointer;
  margin-top: 3px;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.auth-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 15px 30px rgba(137, 16, 220, .30); filter: brightness(1.03); }
.auth-submit:active:not(:disabled) { transform: translateY(0); }
.auth-submit:disabled { opacity: .62; cursor: wait; }
.auth-error { padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--auth-danger) 28%, transparent); border-radius: 10px; background: var(--auth-danger-bg); color: var(--auth-danger); font-size: 12px; }
.auth-note { margin: 23px 0 0; padding-top: 18px; border-top: 1px solid color-mix(in srgb, var(--auth-line) 76%, transparent); color: var(--auth-muted); font-size: 11px; text-align: center; }
.auth-theme-toggle {
  position: fixed;
  z-index: 4;
  top: 20px;
  right: 22px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--auth-line) 88%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--auth-surface-solid) 86%, transparent);
  color: var(--auth-ink);
  box-shadow: 0 8px 24px rgba(54, 29, 65, .10);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}
.auth-theme-toggle:hover { border-color: color-mix(in srgb, var(--auth-primary) 48%, var(--auth-line)); transform: translateY(-1px); }
.auth-theme-toggle:focus-visible { outline: 3px solid rgba(152, 16, 250, .18); outline-offset: 2px; }
.auth-theme-icon { width: 16px; font-size: 17px; line-height: 1; text-align: center; }

@media (max-width: 520px) {
  .auth-page { padding: 72px 18px 24px; }
  .auth-card { padding: 27px 22px; border-radius: 20px; }
  .auth-copy h1 { font-size: 28px; }
  .auth-theme-toggle { top: 14px; right: 14px; width: 42px; min-height: 42px; padding: 0; border-radius: 11px; }
  .auth-theme-toggle > span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
