/* ============================================
   AUTH PAGES - Login / 2FA
   ============================================ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  position: relative;
  z-index: 1;
}

/* Animated orbs background */
.auth-bg-orbs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.auth-bg-orbs .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: orbFloat 20s ease-in-out infinite;
}

.auth-bg-orbs .orb-1 {
  width: 400px;
  height: 400px;
  background: rgba(99, 102, 241, 0.12);
  top: -10%;
  left: -5%;
  animation-delay: 0s;
}

.auth-bg-orbs .orb-2 {
  width: 300px;
  height: 300px;
  background: rgba(139, 92, 246, 0.1);
  bottom: -5%;
  right: -5%;
  animation-delay: -7s;
  animation-duration: 25s;
}

.auth-bg-orbs .orb-3 {
  width: 200px;
  height: 200px;
  background: rgba(6, 182, 212, 0.08);
  top: 40%;
  right: 20%;
  animation-delay: -14s;
  animation-duration: 30s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(15px, 30px) scale(1.02); }
}

/* Auth container */
.auth-container {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

/* Logo / Brand */
.auth-brand {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.auth-brand .brand-logo {
  width: 56px;
  height: 56px;
  background: var(--gradient-accent);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-glow-lg);
  position: relative;
}

.auth-brand .brand-logo::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius-lg) + 4px);
  background: var(--gradient-accent);
  opacity: 0.2;
  z-index: -1;
}

.auth-brand h1 {
  font-size: var(--text-2xl);
  letter-spacing: -0.03em;
  margin-bottom: 0.2rem;
}

.auth-brand .brand-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Auth card */
.auth-card {
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

/* Top glow line */
.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
}

.auth-card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.3rem;
}

.auth-card-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--space-xl);
}

/* Form layout */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.auth-form .input-group { gap: 0.4rem; }

.auth-form .input {
  padding: 0.8rem 1rem;
  font-size: var(--text-base);
}

.auth-form .input-icon-wrapper .input {
  padding-left: 3rem;
}

.auth-form .input-icon-wrapper .icon {
  left: 1rem;
}

/* Password toggle */
.password-toggle {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}
.password-toggle:hover { color: var(--text-primary); }
.password-toggle svg { width: 18px; height: 18px; }

/* Submit button */
.auth-form .btn-primary {
  padding: 0.85rem;
  font-size: var(--text-base);
  font-weight: 600;
  margin-top: var(--space-sm);
  width: 100%;
}

/* Error message */
.auth-error {
  display: none;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1rem;
  background: var(--danger-subtle);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--danger);
}

.auth-error.show { display: flex; }

.auth-error svg { width: 18px; height: 18px; flex-shrink: 0; }

/* 2FA Section */
.twofa-section {
  display: none;
  animation: slideUp 0.4s ease-out;
}

.twofa-section.active { display: block; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* OTP Input (6 digits) */
.otp-inputs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: var(--space-lg) 0;
}

.otp-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: var(--text-xl);
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
  caret-color: var(--accent);
}

.otp-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-input-focus);
}

.otp-input.filled {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

/* Challenge Numbers */
.challenge-numbers {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin: var(--space-xl) 0;
}

.challenge-number {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--bg-input);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.challenge-number:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.challenge-number:active {
  transform: scale(0.95);
}

.challenge-number.selected {
  border-color: var(--accent);
  background: var(--gradient-accent);
  color: white;
  box-shadow: var(--shadow-glow-lg);
}

/* Telegram hint */
.tg-hint {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.85rem 1rem;
  background: var(--info-subtle);
  border: 1px solid var(--info-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--info);
}

.tg-hint svg { width: 20px; height: 20px; flex-shrink: 0; }

/* Timer */
.auth-timer {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-md);
}

.auth-timer .timer-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--warning);
}

/* Resend link */
.resend-link {
  text-align: center;
  margin-top: var(--space-md);
}

.resend-link a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: color var(--transition-fast);
}
.resend-link a:hover { color: var(--accent); }
.resend-link a.disabled {
  pointer-events: none;
  opacity: 0.4;
}

/* Footer text */
.auth-footer {
  text-align: center;
  margin-top: var(--space-xl);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Pulse animation for waiting state */
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* Step indicator */
.auth-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.auth-step {
  width: 32px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--border-default);
  transition: all var(--transition-base);
}

.auth-step.active {
  background: var(--accent);
  width: 48px;
}

.auth-step.completed {
  background: var(--success);
}

/* Responsive */
@media (max-width: 480px) {
  .auth-card { padding: var(--space-xl) var(--space-lg); }
  .otp-input { width: 42px; height: 50px; font-size: var(--text-lg); }
  .challenge-number { width: 70px; height: 70px; font-size: var(--text-xl); }
}
