/* ============================================
   MaxYourStats — Auth Page Styles
   Gold/Amber Neutral Color Scheme
   ============================================ */

:root {
  --bg-deep: #0a0a0f;
  --bg-dark: #111118;
  --bg-card: #141420;
  --accent-primary: #3b82f6;
  --accent-secondary: #06b6d4;
  --accent-gold: var(--accent-primary);
  --accent-amber: var(--accent-secondary);
  --accent-warm: #6366f1;
  --accent-success: #10b981;
  --accent-error: #ef4444;
  --glow-primary: rgba(59, 130, 246, 0.3);
  --glow-gold: var(--glow-primary);
  --glow-amber: rgba(6, 182, 212, 0.3);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-input: rgba(255, 255, 255, 0.12);
  --text-primary: rgba(255, 255, 255, 0.98);
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background: var(--bg-deep);
  overflow-x: hidden;
}

/* ============================================
   UNIVERSAL LOADING SCREEN
   ============================================ */

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
}

.loading-screen.hidden {
  display: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(212, 168, 83, 0.2);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spinSmooth 1s linear infinite;
  filter: drop-shadow(0 0 8px var(--glow-gold));
  will-change: transform;
}

@keyframes spinSmooth {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.loading-dots {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}

.loading-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-gold);
  animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotPulse {

  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================
   BACKGROUND LAYERS
   ============================================ */

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: -3;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 30%, transparent 100%);
}

.bg-gradient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(212, 168, 83, 0.1), transparent 50%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(245, 166, 35, 0.06), transparent 50%),
    linear-gradient(180deg, var(--bg-deep), var(--bg-dark));
  pointer-events: none;
  z-index: -2;
}

.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.2;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E");
}

/* ============================================
   GLOW ORBS
   ============================================ */

.glow-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--glow-gold), transparent 70%);
  top: -150px;
  right: -100px;
}

.orb-2 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, var(--glow-amber), transparent 70%);
  bottom: -100px;
  left: -100px;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */

.auth-main {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
}

/* ============================================
   BACK LINK
   ============================================ */

.back-link {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  transition: all 0.3s ease;
  text-decoration: none;
}

.back-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 168, 83, 0.3);
}

.back-link svg {
  transition: transform 0.3s ease;
}

.back-link:hover svg {
  transform: translateX(-3px);
}

/* ============================================
   AUTH CONTAINER
   ============================================ */

.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 32px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

@media (min-width: 640px) {
  .auth-container {
    padding: 40px 36px;
  }
}

/* ============================================
   LOGO
   ============================================ */

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}

.logo-icon {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-dot {
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-amber));
  border-radius: 50%;
  box-shadow: 0 0 20px var(--glow-gold);
  animation: logoPulse 2s ease-in-out infinite;
}

.logo-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(212, 168, 83, 0.3);
  border-radius: 50%;
  animation: logoRing 3s ease-in-out infinite;
}

@keyframes logoPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

@keyframes logoRing {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.3;
  }

  50% {
    transform: scale(1.4);
    opacity: 0;
  }
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* ============================================
   AUTH HEADER
   ============================================ */

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

@media (min-width: 640px) {
  .auth-title {
    font-size: 28px;
  }
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================================
   FORM
   ============================================ */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.3s ease;
}

.form-input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-input);
  border-radius: 12px;
  outline: none;
  transition: all 0.3s ease;
}

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

.form-input:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.form-input:focus {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
}

.form-input:focus+.input-icon,
.form-input:focus~.input-icon {
  color: var(--accent-gold);
}

/* Password toggle */
.password-toggle {
  position: absolute;
  right: 14px;
  padding: 4px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

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

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.form-hint.text-green-400 {
  color: #4ade80;
}

.form-hint.text-amber-400 {
  color: var(--accent-amber);
}

.form-hint.text-red-400 {
  color: var(--accent-error);
}

/* ============================================
   ERROR MESSAGE
   ============================================ */

.auth-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--accent-error);
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: 10px;
}

.auth-error.hidden {
  display: none;
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */

.submit-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-amber));
  border: none;
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow:
    0 4px 20px rgba(212, 168, 83, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 8px 30px rgba(212, 168, 83, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: left 0.5s ease;
}

.submit-btn:hover:not(:disabled)::before {
  left: 100%;
}

/* Loader */
.loader {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: var(--bg-deep);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loader.hidden {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   DIVIDER
   ============================================ */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth-divider span {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   SOCIAL AUTH
   ============================================ */

.social-auth {
  display: flex;
  gap: 12px;
}

.social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-input);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.social-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.social-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.social-btn svg {
  flex-shrink: 0;
}

/* ============================================
   TOGGLE MODE
   ============================================ */

.auth-toggle {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.toggle-btn {
  margin-left: 4px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent-gold);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

.toggle-btn:hover {
  color: var(--accent-amber);
  text-decoration: underline;
}

/* ============================================
   TRUST INDICATORS
   ============================================ */

.trust-indicators {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 32px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.trust-item svg {
  color: var(--accent-success);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
  .back-link {
    top: 12px;
    left: 12px;
    padding: 8px 12px;
    font-size: 12px;
  }

  .auth-container {
    padding: 28px 20px;
    border-radius: 20px;
  }

  .auth-title {
    font-size: 22px;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-container {
  animation: fadeIn 0.5s ease-out;
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}