:root {
  color-scheme: dark;
  --auth-bg: #15151b;
  --auth-card: #1b1b25;
  --auth-field: #171721;
  --auth-border: #383746;
  --auth-text: #f1eff8;
  --auth-muted: #b5b1c6;
  --auth-lavender: #c3b4ff;
  --auth-green: #c1fa72;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 12%, #211d31, transparent 56%), var(--auth-bg);
  color: var(--auth-text);
  font: 16px/1.5 system-ui, sans-serif;
}

.auth-card {
  width: min(100%, 424px);
  padding: clamp(20px, 6vw, 34px);
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  border-radius: 20px;
  box-shadow: 0 20px 60px #0b0b1373;
}

.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; }
.auth-brand img { display: block; border-radius: 10px; }

h1 {
  margin: 22px 0 20px;
  font-size: clamp(27px, 7vw, 34px);
  line-height: 1.17;
  letter-spacing: -.035em;
}

p { margin: 0; }
input, button { font: inherit; }
button { cursor: pointer; }

.auth-form, .auth-field { display: grid; min-width: 0; }
.auth-form { gap: 15px; }
.auth-field { gap: 6px; color: var(--auth-muted); font-size: 14px; font-weight: 600; }
.auth-field input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--auth-border);
  border-radius: 11px;
  background: var(--auth-field);
  color: var(--auth-text);
  font-size: 16px;
  font-weight: 400;
}

:is(input, button, a):focus-visible { outline: 2px solid var(--auth-lavender); outline-offset: 3px; }
.auth-field input:focus { border-color: var(--auth-lavender); outline: none; }
.auth-password { position: relative; }
.auth-password.auth-can-reveal input { padding-inline-end: 48px; }
.auth-reveal {
  position: absolute;
  inset: 2px 2px 2px auto;
  display: grid;
  place-items: center;
  width: 44px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--auth-muted);
}

.auth-reveal:focus-visible { outline-offset: -3px; }
.auth-reveal[aria-pressed="true"] { color: var(--auth-lavender); }
.auth-reveal svg { width: 19px; height: 19px; }
.auth-eye-off { display: none; }
.auth-reveal[aria-pressed="true"] .auth-eye-off { display: inline; }
.auth-hint { margin-top: -8px; color: var(--auth-muted); font-size: 13px; }

.auth-submit {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--auth-lavender);
  color: #221938;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background-color 140ms ease, filter 140ms ease;
}

.auth-submit[aria-disabled="true"] { cursor: progress; filter: saturate(.72); }
.auth-danger { background: #f6b6c0; color: #33171d; }
.auth-link { color: var(--auth-lavender); font-weight: 650; text-underline-offset: .18em; }
.auth-forgot { justify-self: end; padding-block: 4px; font-size: 14px; }
.auth-footer { margin-top: 17px; color: var(--auth-muted); text-align: center; font-size: 14px; }
.auth-footer .auth-link { display: inline-block; padding-block: 6px; }
.auth-copy { margin-bottom: 16px; color: var(--auth-muted); }
.auth-confirm { display: flex; gap: 8px; align-items: flex-start; color: var(--auth-muted); }
.auth-confirm input { margin-top: 5px; accent-color: var(--auth-lavender); }

.auth-notice {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid #49425e;
  border-radius: 10px;
  background: #292439;
  color: var(--auth-text);
  font-size: 14px;
}

.auth-notice[role="alert"] { border-color: #784b5a; background: #34242d; color: #ffd2d9; }
.auth-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.auth-steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-block: 9px 0;
  border-top: 2px solid var(--auth-border);
  color: var(--auth-muted);
  font-size: 13px;
}

.auth-steps li:is([aria-current="step"], .auth-step-done) { border-color: var(--auth-green); }
.auth-steps li[aria-current="step"] { color: var(--auth-text); font-weight: 650; }
.auth-steps i, .auth-dots i { display: block; flex: none; width: 6px; height: 6px; border-radius: 50%; }
.auth-steps i { border: 1px solid currentColor; }
.auth-steps [aria-current="step"] i, .auth-dots i { background: var(--auth-green); border-color: var(--auth-green); }
.auth-steps .auth-step-done i { border-color: var(--auth-green); }
.auth-activity {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  color: var(--auth-muted);
  font-size: 13px;
}

.auth-activity.is-loading { margin-top: 12px; }
.auth-dots { display: flex; gap: 4px; }
.auth-dots i { animation: auth-pulse 980ms ease-in-out infinite; }
.auth-dots i:nth-child(2) { animation-delay: 110ms; }
.auth-dots i:nth-child(3) { animation-delay: 220ms; }

@keyframes auth-pulse {
  0%, 70%, 100% { opacity: .4; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-2px); }
}

@media (hover: hover) {
  .auth-submit:not([aria-disabled="true"]):hover { filter: brightness(1.09); }
  .auth-reveal:hover { background: #ffffff10; color: var(--auth-text); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-dots i { animation: none; }
  .auth-submit { transition: none; }
}
