/* ==========================================================================
   GambaCodes Authentication - Midnight Observatory Theme
   Consistent vaporwave glassmorphism styling for all auth pages.
   ========================================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* --- CSS Custom Properties --- */
@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@property --glow-opacity {
  syntax: '<number>';
  initial-value: 0;
  inherits: false;
}

:root {
  /* Background */
  --void: #09090b;
  --void-surface: #0c0c0f;

  /* Primary Colors */
  --violet-electric: #7c3aed;
  --violet-soft: #a78bfa;
  --violet-deep: #5b21b6;
  --cyan-bright: #22d3ee;
  --cyan-soft: #67e8f9;
  --rose-vivid: #f43f5e;
  --rose-soft: #fb7185;
  --emerald-bright: #10b981;
  --emerald-soft: #34d399;
  --amber-bright: #f59e0b;
  --amber-soft: #fbbf24;

  /* Text */
  --text-primary: #fafafa;
  --text-secondary: rgba(250, 250, 250, 0.6);
  --text-muted: rgba(250, 250, 250, 0.35);
  --text-ghost: rgba(250, 250, 250, 0.2);

  /* Glass Effects */
  --glass-bg: rgba(255, 255, 255, 0.02);
  --glass-bg-hover: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-hover: rgba(255, 255, 255, 0.1);

  /* Glows */
  --glow-violet: rgba(124, 58, 237, 0.35);
  --glow-violet-subtle: rgba(124, 58, 237, 0.15);
  --glow-cyan: rgba(34, 211, 238, 0.35);
  --glow-cyan-subtle: rgba(34, 211, 238, 0.15);
  --glow-rose: rgba(244, 63, 94, 0.35);
  --glow-rose-subtle: rgba(244, 63, 94, 0.15);
  --glow-emerald: rgba(16, 185, 129, 0.35);
  --glow-emerald-subtle: rgba(16, 185, 129, 0.15);

  /* Spacing */
  --card-radius: 24px;
  --input-radius: 12px;
  --button-radius: 12px;

  /* Transitions */
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) var(--void);
}

html::-webkit-scrollbar {
  width: 6px;
}

html::-webkit-scrollbar-track {
  background: var(--void);
}

html::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::selection {
  background: rgba(124, 58, 237, 0.4);
  color: #fafafa;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--void);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ==========================================================================
   Background: Cosmic Aurora Layers
   ========================================================================== */

body::before {
  content: '';
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse 600px 400px at 20% 30%, rgba(124, 58, 237, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 500px 500px at 75% 70%, rgba(34, 211, 238, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 400px 600px at 60% 20%, rgba(244, 63, 94, 0.07) 0%, transparent 70%),
    radial-gradient(ellipse 700px 300px at 30% 80%, rgba(167, 139, 250, 0.06) 0%, transparent 60%);
  animation: auroraDrift 25s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

body::after {
  content: '';
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse 500px 350px at 80% 25%, rgba(34, 211, 238, 0.1) 0%, transparent 70%),
    radial-gradient(ellipse 600px 500px at 15% 65%, rgba(244, 63, 94, 0.06) 0%, transparent 60%);
  animation: auroraDrift2 30s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

@keyframes auroraDrift {
  0% { transform: translate(0%, 0%) rotate(0deg); }
  25% { transform: translate(5%, -3%) rotate(1deg); }
  50% { transform: translate(-3%, 5%) rotate(-0.5deg); }
  75% { transform: translate(4%, 2%) rotate(0.5deg); }
  100% { transform: translate(-2%, -4%) rotate(-1deg); }
}

@keyframes auroraDrift2 {
  0% { transform: translate(0%, 0%) rotate(0deg); }
  33% { transform: translate(-4%, 3%) rotate(-1deg); }
  66% { transform: translate(3%, -5%) rotate(0.8deg); }
  100% { transform: translate(5%, 2%) rotate(-0.5deg); }
}

/* Star Field Background */
.bg-stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 15% 25%, rgba(255, 255, 255, 0.3) 50%, transparent 50%),
    radial-gradient(1.2px 1.2px at 50% 15%, rgba(255, 255, 255, 0.25) 50%, transparent 50%),
    radial-gradient(1px 1px at 80% 45%, rgba(255, 255, 255, 0.2) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 35% 70%, rgba(255, 255, 255, 0.35) 50%, transparent 50%),
    radial-gradient(1px 1px at 70% 80%, rgba(255, 255, 255, 0.15) 50%, transparent 50%),
    radial-gradient(0.8px 0.8px at 92% 60%, rgba(255, 255, 255, 0.25) 50%, transparent 50%),
    radial-gradient(1px 1px at 5% 50%, rgba(255, 255, 255, 0.2) 50%, transparent 50%);
  background-size: 200px 200px;
  animation: starTwinkle 8s ease-in-out infinite alternate;
  opacity: 0.6;
}

@keyframes starTwinkle {
  0% { opacity: 0.5; }
  50% { opacity: 0.7; }
  100% { opacity: 0.5; }
}

.bg-aurora {
  position: fixed;
  inset: -30%;
  width: 160%;
  height: 160%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 500px 350px at 25% 35%, rgba(124, 58, 237, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 70% 65%, rgba(34, 211, 238, 0.08) 0%, transparent 70%);
  animation: bgAuroraDrift 22s ease-in-out infinite alternate;
}

@keyframes bgAuroraDrift {
  0% { transform: translate(0%, 0%) rotate(0deg); }
  50% { transform: translate(3%, -2%) rotate(0.5deg); }
  100% { transform: translate(-2%, 3%) rotate(-0.5deg); }
}

/* ==========================================================================
   Auth Container & Card
   ========================================================================== */

.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  padding: 20px;
}

.auth-container.wide {
  max-width: 520px;
}

.auth-card {
  position: relative;
  background:
    repeating-conic-gradient(
      rgba(255, 255, 255, 0.008) 0% 25%,
      transparent 0% 50%
    ) 0 0 / 4px 4px,
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.03) 0%,
      rgba(255, 255, 255, 0.01) 100%
    );
  backdrop-filter: blur(40px) saturate(1.2);
  -webkit-backdrop-filter: blur(40px) saturate(1.2);
  border-radius: var(--card-radius);
  padding: 48px 44px;
  box-shadow:
    0 25px 60px -12px rgba(0, 0, 0, 0.6),
    0 8px 24px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 80px rgba(124, 58, 237, 0.03),
    inset 0 0 40px rgba(34, 211, 238, 0.02);
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

/* Animated rotating gradient border */
.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  padding: 1.5px;
  background: conic-gradient(
    from var(--border-angle),
    var(--violet-electric),
    var(--cyan-bright),
    var(--rose-vivid),
    var(--violet-soft),
    var(--violet-electric)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: borderRotate 6s linear infinite;
  pointer-events: none;
  opacity: 0.7;
}

/* Inner glow */
.auth-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(124, 58, 237, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(34, 211, 238, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

@keyframes borderRotate {
  to {
    --border-angle: 360deg;
  }
}

/* Fallback for browsers without @property support */
@supports not (background: paint(something)) {
  .auth-card::before {
    animation: borderRotateFallback 6s linear infinite;
  }

  @keyframes borderRotateFallback {
    0% { background: conic-gradient(from 0deg, #7c3aed, #22d3ee, #f43f5e, #a78bfa, #7c3aed); }
    25% { background: conic-gradient(from 90deg, #7c3aed, #22d3ee, #f43f5e, #a78bfa, #7c3aed); }
    50% { background: conic-gradient(from 180deg, #7c3aed, #22d3ee, #f43f5e, #a78bfa, #7c3aed); }
    75% { background: conic-gradient(from 270deg, #7c3aed, #22d3ee, #f43f5e, #a78bfa, #7c3aed); }
    100% { background: conic-gradient(from 360deg, #7c3aed, #22d3ee, #f43f5e, #a78bfa, #7c3aed); }
  }
}

/* ==========================================================================
   Typography
   ========================================================================== */

.auth-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text-primary);
  letter-spacing: 1.5px;
  position: relative;
  z-index: 1;
  text-shadow:
    0 0 20px rgba(124, 58, 237, 0.25),
    0 0 40px rgba(124, 58, 237, 0.12);
}

.auth-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  text-align: center;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.auth-subtitle strong {
  color: var(--cyan-bright);
  font-weight: 500;
}

.auth-step {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  text-align: center;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--input-radius);
  outline: none;
  transition:
    border-color var(--duration-normal) var(--transition-smooth),
    box-shadow var(--duration-normal) var(--transition-smooth),
    background var(--duration-normal) var(--transition-smooth);
}

.form-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.form-input:hover {
  border-color: var(--glass-border-hover);
  background: rgba(255, 255, 255, 0.04);
}

.form-input:focus {
  border-color: var(--violet-electric);
  background: rgba(255, 255, 255, 0.04);
  box-shadow:
    0 0 0 3px rgba(124, 58, 237, 0.15),
    0 0 20px rgba(124, 58, 237, 0.1);
}

.form-input.error {
  border-color: var(--rose-vivid);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1);
}

.form-input.success {
  border-color: var(--emerald-bright);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Input with icon */
.input-wrapper {
  position: relative;
}

.input-wrapper .form-input {
  padding-right: 44px;
}

.input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  pointer-events: none;
}

.input-icon svg {
  width: 18px;
  height: 18px;
}

.input-icon.success {
  color: var(--emerald-bright);
}

.input-icon.error {
  color: var(--rose-vivid);
}

.input-icon.loading {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* Toggle Password Visibility Button */
.toggle-password {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  pointer-events: auto;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.toggle-password:hover {
  color: var(--text-secondary);
}

.toggle-password:focus {
  outline: none;
  color: var(--violet-bright);
}

/* Eye icon for password toggle */
.eye-icon,
.eye-off-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.eye-off-icon {
  display: none;
}

.toggle-password.visible .eye-icon {
  display: none;
}

.toggle-password.visible .eye-off-icon {
  display: block;
}

/* ==========================================================================
   Password Strength Indicator
   ========================================================================== */

.password-strength {
  margin-top: 8px;
}

.strength-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width var(--duration-slow) var(--transition-smooth),
              background var(--duration-normal) var(--transition-smooth);
}

.strength-fill.weak {
  width: 25%;
  background: var(--rose-vivid);
}

.strength-fill.fair {
  width: 50%;
  background: var(--amber-bright);
}

.strength-fill.good {
  width: 75%;
  background: var(--cyan-bright);
}

.strength-fill.strong {
  width: 100%;
  background: var(--emerald-bright);
}

.strength-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.strength-text .label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.strength-text .value {
  font-weight: 600;
}

.strength-text .value.weak { color: var(--rose-vivid); }
.strength-text .value.fair { color: var(--amber-bright); }
.strength-text .value.good { color: var(--cyan-bright); }
.strength-text .value.strong { color: var(--emerald-bright); }

/* ==========================================================================
   OTP Input (6 boxes)
   ========================================================================== */

.otp-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 24px 0;
}

.otp-input {
  width: 52px;
  height: 64px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--glass-border);
  border-radius: var(--input-radius);
  outline: none;
  transition:
    border-color var(--duration-normal) var(--transition-smooth),
    box-shadow var(--duration-normal) var(--transition-smooth),
    transform var(--duration-fast) var(--transition-bounce);
  caret-color: var(--violet-electric);
}

.otp-input::placeholder {
  color: var(--text-ghost);
}

.otp-input:hover {
  border-color: var(--glass-border-hover);
}

.otp-input:focus {
  border-color: var(--violet-electric);
  box-shadow:
    0 0 0 3px rgba(124, 58, 237, 0.2),
    0 0 20px rgba(124, 58, 237, 0.15);
  transform: scale(1.05);
}

.otp-input.filled {
  border-color: var(--cyan-bright);
  background: rgba(34, 211, 238, 0.05);
}

.otp-input.error {
  border-color: var(--rose-vivid);
  animation: shake 0.4s var(--transition-smooth);
}

/* ==========================================================================
   QR Code Display
   ========================================================================== */

.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 24px 0;
}

.qr-wrapper {
  position: relative;
  padding: 16px;
  background: #fff;
  border-radius: 16px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 60px rgba(124, 58, 237, 0.1);
}

.qr-wrapper img,
.qr-wrapper canvas {
  display: block;
  width: 180px;
  height: 180px;
}

.qr-overlay {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--transition-smooth);
}

.qr-wrapper:hover .qr-overlay {
  opacity: 1;
  visibility: visible;
}

.manual-key-toggle {
  margin-top: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--transition-smooth);
}

.manual-key-toggle:hover {
  color: var(--cyan-bright);
}

.manual-key-container {
  margin-top: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--input-radius);
  display: none;
}

.manual-key-container.visible {
  display: block;
  animation: slideDown var(--duration-normal) var(--transition-smooth);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.manual-key-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.manual-key-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--cyan-bright);
  letter-spacing: 0.15em;
  word-break: break-all;
  user-select: all;
}

/* ==========================================================================
   Recovery Codes Grid
   ========================================================================== */

.recovery-codes-container {
  margin: 24px 0;
}

.recovery-codes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.recovery-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 12px 16px;
  text-align: center;
  letter-spacing: 0.1em;
  user-select: all;
  transition:
    background var(--duration-fast) var(--transition-smooth),
    border-color var(--duration-fast) var(--transition-smooth);
}

.recovery-code:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--glass-border-hover);
}

.recovery-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.recovery-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 10px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition:
    all var(--duration-normal) var(--transition-smooth);
}

.recovery-btn svg {
  width: 16px;
  height: 16px;
}

.recovery-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--glass-border-hover);
}

.recovery-btn.copied {
  color: var(--emerald-bright);
  border-color: var(--emerald-bright);
  background: rgba(16, 185, 129, 0.1);
}

/* ==========================================================================
   Checkbox
   ========================================================================== */

.checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 20px 0;
  cursor: pointer;
}

.checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 22px;
  height: 22px;
  min-width: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--glass-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    all var(--duration-normal) var(--transition-smooth);
}

.checkbox-custom svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--duration-fast) var(--transition-bounce);
  color: #fff;
}

.checkbox-input:checked + .checkbox-custom {
  background: var(--violet-electric);
  border-color: var(--violet-electric);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

.checkbox-input:checked + .checkbox-custom svg {
  opacity: 1;
  transform: scale(1);
}

.checkbox-input:focus + .checkbox-custom {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.checkbox-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn-primary {
  width: 100%;
  padding: 16px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--violet-electric) 0%, var(--rose-vivid) 100%);
  border: none;
  border-radius: var(--button-radius);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  overflow: hidden;
  transition:
    transform var(--duration-normal) var(--transition-smooth),
    box-shadow var(--duration-normal) var(--transition-smooth);
  box-shadow:
    0 4px 20px -4px rgba(124, 58, 237, 0.4),
    0 2px 8px rgba(124, 58, 237, 0.15);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 255, 255, 0.12) 40%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0.12) 60%,
    transparent 80%
  );
  transition: left 0.6s var(--transition-smooth);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 8px 30px -4px rgba(124, 58, 237, 0.5),
    0 4px 12px rgba(244, 63, 94, 0.2),
    0 0 40px rgba(124, 58, 237, 0.15);
}

.btn-primary:hover:not(:disabled)::before {
  left: 120%;
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  transition-duration: 0.1s;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary:focus-visible {
  outline: 2px solid var(--violet-soft);
  outline-offset: 3px;
}

/* Loading state */
.btn-primary.loading {
  pointer-events: none;
  color: transparent;
}

.btn-primary.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top-color: #fff;
  border-right-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Secondary button */
.btn-secondary {
  width: 100%;
  padding: 14px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--button-radius);
  cursor: pointer;
  transition:
    all var(--duration-normal) var(--transition-smooth);
}

.btn-secondary:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--glass-border-hover);
  background: rgba(255, 255, 255, 0.04);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================================================
   Error & Success Messages
   ========================================================================== */

.message {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  text-align: center;
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 16px;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity var(--duration-normal) var(--transition-smooth),
    transform var(--duration-normal) var(--transition-smooth);
}

.message:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}

.message.error {
  color: var(--rose-soft);
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  text-shadow: 0 0 12px rgba(244, 63, 94, 0.3);
}

.message.success {
  color: var(--emerald-soft);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  text-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.field-error {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--rose-soft);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-error svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ==========================================================================
   Resend Code Link
   ========================================================================== */

.resend-container {
  text-align: center;
  margin-top: 24px;
}

.resend-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.resend-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--cyan-bright);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--transition-smooth);
}

.resend-link:hover:not(:disabled) {
  color: var(--cyan-soft);
}

.resend-link:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  text-decoration: none;
}

.resend-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ==========================================================================
   Footer Links
   ========================================================================== */

.auth-footer {
  margin-top: 28px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.auth-footer-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-footer-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--violet-soft);
  text-decoration: none;
  transition: color var(--duration-fast) var(--transition-smooth);
}

.auth-footer-link:hover {
  color: var(--cyan-bright);
}

/* ==========================================================================
   Step Indicator
   ========================================================================== */

.step-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--glass-border);
  transition: all var(--duration-normal) var(--transition-smooth);
}

.step-dot.active {
  background: var(--violet-electric);
  border-color: var(--violet-electric);
  box-shadow: 0 0 15px var(--glow-violet);
}

.step-dot.completed {
  background: var(--emerald-bright);
  border-color: var(--emerald-bright);
  box-shadow: 0 0 15px var(--glow-emerald);
}

.step-line {
  width: 40px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1px;
  transition: background var(--duration-normal) var(--transition-smooth);
}

.step-line.completed {
  background: linear-gradient(90deg, var(--emerald-bright), var(--violet-electric));
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 50%, 90% { transform: translateX(-6px); }
  30%, 70% { transform: translateX(6px); }
  20%, 60% { transform: translateX(4px); }
  40%, 80% { transform: translateX(-4px); }
}

.auth-card.shake {
  animation: shake 0.45s var(--transition-smooth);
}

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

.auth-card {
  animation: fadeIn var(--duration-slow) var(--transition-smooth);
}

@keyframes successPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.success-pulse {
  animation: successPulse 1s ease-out;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 520px) {
  .auth-container {
    padding: 16px;
    max-width: 100%;
  }

  .auth-card {
    padding: 36px 24px;
    border-radius: 20px;
  }

  .auth-title {
    font-size: 1.5rem;
    letter-spacing: 1px;
  }

  .auth-subtitle {
    font-size: 0.8rem;
  }

  .otp-container {
    gap: 8px;
  }

  .otp-input {
    width: 44px;
    height: 56px;
    font-size: 1.3rem;
  }

  .recovery-codes-grid {
    grid-template-columns: 1fr;
  }

  .recovery-actions {
    flex-direction: column;
  }

  .recovery-btn {
    width: 100%;
    justify-content: center;
  }

  .btn-primary {
    padding: 14px 20px;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
  }
}

@media (max-width: 380px) {
  .otp-container {
    gap: 6px;
  }

  .otp-input {
    width: 40px;
    height: 50px;
    font-size: 1.2rem;
    border-radius: 8px;
  }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

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

  body::before,
  body::after,
  .bg-stars,
  .bg-aurora {
    animation: none;
  }

  .auth-card::before {
    animation: none;
    background: conic-gradient(from 135deg, #7c3aed, #22d3ee, #f43f5e, #a78bfa, #7c3aed);
  }

  .btn-primary::before {
    display: none;
  }
}

@media (prefers-contrast: high) {
  :root {
    --glass-bg: rgba(0, 0, 0, 0.9);
    --glass-border: #fff;
    --text-primary: #fff;
    --text-secondary: #ccc;
    --text-muted: #aaa;
  }

  body {
    background-color: #000;
  }

  body::before,
  body::after,
  .bg-stars,
  .bg-aurora {
    display: none;
  }

  .auth-card {
    background: #000;
    border: 2px solid #fff;
    backdrop-filter: none;
  }

  .auth-card::before,
  .auth-card::after {
    display: none;
  }

  .form-input,
  .otp-input {
    border: 2px solid #fff;
    background: #000;
  }

  .btn-primary {
    background: #fff;
    color: #000;
    font-weight: 700;
  }
}
