.auth-bg {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(0, 212, 255, 0.06) 0%, transparent 70%),
    var(--bg);
  z-index: 0;
}

.auth-logo {
  position: fixed; top: 28px; left: 48px;
  font-family: var(--font-head);
  font-size: 20px; font-weight: 800;
  color: var(--text); text-decoration: none;
  z-index: 10;
}
.auth-logo span { color: var(--accent); }

.auth-container {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  position: relative; z-index: 1;
}

.auth-card {
  width: 100%; max-width: 400px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  box-shadow: 0 0 80px rgba(0, 212, 255, 0.04), 0 32px 64px rgba(0,0,0,0.5);
}

.auth-step { display: none; }
.auth-step.active { display: block; }

.auth-card h2 {
  font-family: var(--font-head);
  font-size: 28px; font-weight: 800;
  margin-bottom: 8px;
}
.auth-sub {
  color: var(--text-mid); font-size: 13px;
  margin-bottom: 32px; line-height: 1.6;
}
.auth-sub span { color: var(--accent); }

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.form-group input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--accent); }
.form-group input::placeholder { color: var(--text-dim); }

.input-error {
  color: var(--red); font-size: 12px;
  margin-top: 8px; min-height: 16px;
}

.btn-primary.full { width: 100%; text-align: center; }

.auth-note {
  text-align: center; display: block;
  color: var(--text-dim); font-size: 12px;
  margin-top: 16px;
}

/* Code inputs */
.code-inputs {
  display: flex; gap: 10px; justify-content: center;
  margin-bottom: 8px;
}
.code-digit {
  width: 48px; height: 56px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-head);
  font-size: 22px; font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
  caret-color: var(--accent);
}
.code-digit:focus { border-color: var(--accent); }
.code-digit.filled { border-color: var(--border2); background: var(--bg3); }

/* Resend */
.resend-row {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 20px; flex-wrap: wrap;
}
.resend-btn {
  background: none; border: none;
  color: var(--accent); font-family: var(--font-mono);
  font-size: 12px; cursor: pointer;
  display: none;
}
.resend-btn.visible { display: block; }
.resend-timer { color: var(--text-dim); font-size: 12px; }

.back-btn {
  background: none; border: none;
  color: var(--text-dim); font-family: var(--font-mono);
  font-size: 12px; cursor: pointer;
  padding: 0; margin-bottom: 24px;
  transition: color 0.2s;
}
.back-btn:hover { color: var(--text); }

/* Loader */
.loader-ring {
  width: 48px; height: 48px;
  border: 3px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }

#step-loading .auth-sub { text-align: center; margin-bottom: 0; }

/* Loading state on button */
.btn-primary.loading {
  opacity: 0.7; pointer-events: none;
  position: relative;
}
.btn-primary.loading::after {
  content: '';
  position: absolute; right: 16px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
