:root {
  --auth-bg: #070708;
  --auth-panel: #0d0d0f;
  --auth-raised: #121215;
  --auth-line: rgba(255, 255, 255, 0.09);
  --auth-line-strong: rgba(255, 255, 255, 0.16);
  --auth-text: #f7f7f8;
  --auth-muted: #8b8b94;
  --auth-accent: #8e7cff;
}

* { box-sizing: border-box; }
.ui-icon { width: 15px; height: 15px; flex: 0 0 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

html,
body.auth-page { min-height: 100%; }

body.auth-page {
  margin: 0;
  overflow-x: hidden;
  color: var(--auth-text);
  background:
    radial-gradient(720px 420px at 12% 88%, rgba(108, 83, 255, 0.12), transparent 68%),
    var(--auth-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.5), transparent 62%);
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(1160px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(390px, .78fr);
  align-items: center;
  gap: clamp(56px, 9vw, 128px);
  padding: 48px 0;
}

.auth-intro {
  min-height: min(640px, calc(100vh - 96px));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 0;
}

.auth-wordmark {
  width: max-content;
  color: #fff;
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 760;
  letter-spacing: -.05em;
}

.auth-wordmark span { color: var(--auth-muted); font-weight: 600; }

.auth-intro-copy { max-width: 620px; }

.auth-kicker {
  color: #a6a6ae;
  font-size: .71rem;
  font-weight: 680;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.auth-kicker > span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 8px 1px 0;
  border-radius: 50%;
  background: var(--auth-accent);
  box-shadow: 0 0 18px rgba(142, 124, 255, .8);
}

.auth-intro h1 {
  margin: 24px 0 20px;
  max-width: 650px;
  color: #fff;
  font-size: clamp(3.35rem, 6vw, 6.2rem);
  font-weight: 520;
  letter-spacing: -.075em;
  line-height: .91;
}

.auth-intro-copy p {
  max-width: 500px;
  margin: 0;
  color: var(--auth-muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.auth-signal {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #777780;
  font-size: .78rem;
}

.signal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #63d69b;
  box-shadow: 0 0 13px rgba(99, 214, 155, .5);
}

.auth-panel {
  padding: 30px;
  border: 1px solid var(--auth-line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 28%), var(--auth-panel);
  box-shadow: 0 30px 80px rgba(0,0,0,.34);
}

.auth-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.auth-panel h2 {
  margin: 8px 0 0;
  font-size: 1.55rem;
  letter-spacing: -.045em;
  line-height: 1.15;
}

.auth-form { display: grid; gap: 18px; }
.auth-form.is-hidden, .is-hidden { display: none !important; }

.auth-field { display: grid; gap: 8px; }

.auth-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-field label,
.auth-label-row label {
  color: #c8c8cd;
  font-size: .78rem;
  font-weight: 620;
}

.auth-field label span { margin-left: 5px; color: #66666f; font-weight: 500; }

.auth-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

body.auth-page input:not([type="checkbox"]) {
  width: 100%;
  height: 47px;
  padding: 0 14px;
  border: 1px solid var(--auth-line);
  border-radius: 10px;
  outline: 0;
  color: var(--auth-text);
  background: var(--auth-raised);
  box-shadow: none;
  font: inherit;
  font-size: .92rem;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

body.auth-page input:not([type="checkbox"])::placeholder { color: #55555e; }

body.auth-page input:not([type="checkbox"]):focus {
  border-color: rgba(142, 124, 255, .65);
  background: #141419;
  box-shadow: 0 0 0 3px rgba(142, 124, 255, .11);
}

.auth-check {
  display: flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  color: var(--auth-muted);
  font-size: .78rem;
  cursor: pointer;
}

.auth-check input { accent-color: var(--auth-accent); }

.auth-primary,
.auth-secondary {
  min-height: 47px;
  padding: 0 18px;
  border-radius: 10px;
  font: inherit;
  font-size: .86rem;
  font-weight: 680;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.auth-primary {
  border: 1px solid rgba(255,255,255,.92);
  color: #09090b;
  background: #f4f4f5;
}

.auth-primary:hover { background: #fff; transform: translateY(-1px); }
.auth-primary:active { transform: translateY(0) scale(.99); }
.auth-primary:disabled { cursor: wait; opacity: .72; transform: none; }
.auth-primary.is-busy::before { content: ""; width: 14px; height: 14px; border: 2px solid rgba(9,9,11,.25); border-top-color: #09090b; border-radius: 50%; animation: auth-spin .7s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-secondary {
  border: 1px solid var(--auth-line);
  color: #d1d1d5;
  background: #141417;
}

.auth-secondary:hover { border-color: var(--auth-line-strong); background: #18181c; }

.auth-actions { display: grid; grid-template-columns: .42fr 1fr; gap: 10px; }

.auth-text-link,
.auth-text-button,
.auth-switch a {
  color: #aaaab2;
  text-decoration: none;
}

.auth-text-link { font-size: .78rem; }
.auth-text-link:hover, .auth-switch a:hover { color: #fff; }

.auth-text-button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: .75rem;
  cursor: pointer;
}

.auth-text-button:hover { color: #fff; }
.auth-recovery-link { justify-self: center; margin-top: -2px; }

.auth-switch {
  margin: 26px 0 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.065);
  color: #6e6e77;
  font-size: .8rem;
  text-align: center;
}

.auth-hint, .auth-terms { color: #65656e; font-size: .72rem; line-height: 1.45; }
.auth-terms { margin: -6px 0 0; text-align: center; }

.auth-strength {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-strength progress {
  width: 100%;
  height: 3px;
  border: 0;
  border-radius: 99px;
  background: #222228;
}

.auth-strength progress::-webkit-progress-bar { border-radius: 99px; background: #222228; }
.auth-strength progress::-webkit-progress-value { border-radius: 99px; background: var(--auth-accent); }
.auth-strength progress::-moz-progress-bar { border-radius: 99px; background: var(--auth-accent); }
.auth-strength span { flex: 0 0 auto; color: #65656e; font-size: .7rem; }
.auth-strength strong { color: #aaaab2; }

.auth-step-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(142,124,255,.25);
  border-radius: 12px;
  color: #b6aaff;
  background: rgba(142,124,255,.08);
  font-weight: 800;
  letter-spacing: .08em;
}

.auth-step-copy h3 { margin: 0 0 6px; font-size: 1.08rem; letter-spacing: -.025em; }
.auth-step-copy p { margin: 0; color: var(--auth-muted); font-size: .8rem; line-height: 1.5; }

body.auth-page .err,
body.auth-page .ok {
  margin: -10px 0 18px;
  padding: 11px 12px;
  border-radius: 9px;
  font-size: .76rem;
  line-height: 1.45;
}

body.auth-page .err { border: 1px solid rgba(255,105,126,.2); color: #ff9bab; background: rgba(255,80,108,.07); }
body.auth-page .ok { border: 1px solid rgba(99,214,155,.2); color: #93e4ba; background: rgba(99,214,155,.07); }

@media (max-width: 840px) {
  .auth-shell { width: min(480px, calc(100% - 32px)); grid-template-columns: 1fr; gap: 28px; padding: 24px 0 40px; }
  .auth-intro { min-height: auto; gap: 48px; padding: 4px 4px 0; }
  .auth-intro-copy { display: none; }
  .auth-signal { display: none; }
}

@media (max-width: 500px) {
  .auth-shell { width: 100%; padding: 20px 14px; }
  .auth-intro { padding-left: 6px; }
  .auth-panel { padding: 24px 20px; border-radius: 15px; }
  .auth-field-grid { grid-template-columns: 1fr; }
}

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