/* ═══════════════════════════════════════════════════════
   ThumbLion — Auth Animation Layer
   Load AFTER style.css on login.php / register.php
═══════════════════════════════════════════════════════ */

/* ── Canvas background ── */
#auth-bg-canvas {
  position: fixed; inset: 0;
  z-index: 0; pointer-events: none;
}

/* ── Page ── */
.auth-page {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 18% 22%, rgba(99,102,241,.2)  0%, transparent 48%),
    radial-gradient(ellipse at 82% 76%, rgba(139,92,246,.16) 0%, transparent 45%),
    radial-gradient(ellipse at 60%  8%, rgba(6,182,212,.1)   0%, transparent 38%),
    #070e1c;
}

/* ── Glass card ── */
.auth-card {
  position: relative; z-index: 10;
  background: rgba(10, 18, 36, 0.78) !important;
  backdrop-filter: blur(30px) saturate(175%) !important;
  -webkit-backdrop-filter: blur(30px) saturate(175%) !important;
  border: 1px solid rgba(99,102,241,.28) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 28px 72px rgba(0,0,0,.65),
    0 0 0 1px rgba(99,102,241,.16),
    0 0 60px rgba(99,102,241,.07) !important;

  animation:
    cardEnter .88s cubic-bezier(0.22, 1, 0.36, 1) both,
    cardAura   6s  ease-in-out 1.6s infinite;
}

@keyframes cardEnter {
  0%  { opacity: 0; transform: translateY(64px) scale(.86); filter: blur(8px); }
  60% { opacity: 1; filter: blur(0); }
  80% { transform: translateY(-6px) scale(1.008); }
  100%{ transform: translateY(0) scale(1); }
}

@keyframes cardAura {
  0%,100% {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.06),
      0 28px 72px rgba(0,0,0,.65),
      0 0 0 1px rgba(99,102,241,.18),
      0 0 60px rgba(99,102,241,.07);
  }
  33% {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.06),
      0 28px 72px rgba(0,0,0,.65),
      0 0 0 1px rgba(139,92,246,.38),
      0 0 90px rgba(139,92,246,.13);
  }
  66% {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.06),
      0 28px 72px rgba(0,0,0,.65),
      0 0 0 1px rgba(6,182,212,.3),
      0 0 80px rgba(6,182,212,.1);
  }
}

/* Hover: neon focus ring */
.auth-card:hover {
  border-color: rgba(99,102,241,.55) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 28px 80px rgba(0,0,0,.7),
    0 0 0 2px rgba(99,102,241,.45),
    0 0 110px rgba(99,102,241,.16),
    inset 0 0 40px rgba(99,102,241,.04) !important;
  transition: border-color .35s, box-shadow .35s;
}

/* ── Logo ── */
.auth-logo-icon {
  animation:
    logoBurst .78s cubic-bezier(0.34, 1.56, 0.64, 1) .08s both,
    logoPulse  3.8s ease-in-out 1.2s infinite;
}

@keyframes logoBurst {
  0%  { transform: scale(0) rotate(-45deg); opacity: 0; }
  55% { transform: scale(1.25) rotate(8deg); }
  75% { transform: scale(0.92) rotate(-3deg); }
  100%{ transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes logoPulse {
  0%,100% {
    box-shadow: 0 0 0 0   rgba(99,102,241,.55),
                0 4px 20px rgba(99,102,241,.3);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(99,102,241,0),
                0 4px 34px rgba(99,102,241,.55);
  }
}

/* ── Staggered content entrances ── */
.auth-logo     { animation: aUp .62s cubic-bezier(0.22,1,0.36,1) .04s  both; }
.auth-title    { animation: aUp .62s cubic-bezier(0.22,1,0.36,1) .16s  both; }
.auth-subtitle { animation: aUp .62s cubic-bezier(0.22,1,0.36,1) .24s  both; }
.alert         { animation: aLeft .5s cubic-bezier(0.34,1.4,0.64,1) 0s both; }
.auth-card form{ animation: aUp .62s cubic-bezier(0.22,1,0.36,1) .31s  both; }
.auth-footer   { animation: aUp .62s cubic-bezier(0.22,1,0.36,1) .44s  both; }

@keyframes aUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes aLeft {
  from { opacity: 0; transform: translateX(-18px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

/* ── Inputs ── */
.form-control {
  background: rgba(6, 13, 28, .65) !important;
  border: 1px solid rgba(99,102,241,.18) !important;
  color: var(--text) !important;
  transition: background .25s, border-color .25s, box-shadow .28s, transform .2s !important;
}
.form-control:focus {
  background: rgba(6, 13, 28, .92) !important;
  border-color: var(--primary) !important;
  transform: translateY(-2px) !important;
  box-shadow:
    0 0 0 3px  rgba(99,102,241,.24),
    0 0 28px   rgba(99,102,241,.2),
    0 8px 24px rgba(0,0,0,.35) !important;
  outline: none !important;
}
.form-control:focus::placeholder { opacity: .35; }
.form-group:focus-within .form-label {
  color: var(--primary-light) !important;
  transition: color .25s;
}

/* ── Button — animated gradient ── */
.btn-primary {
  position: relative !important;
  overflow: hidden !important;
  background: linear-gradient(110deg, #6366f1 0%, #8b5cf6 40%, #06b6d4 80%, #6366f1 100%) !important;
  background-size: 260% 100% !important;
  transition: transform .15s, box-shadow .2s !important;
  animation: btnShift 3.5s linear infinite;
}

@keyframes btnShift {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.018) !important;
  box-shadow: 0 12px 40px rgba(99,102,241,.6), 0 0 55px rgba(99,102,241,.22) !important;
}
.btn-primary:active:not(:disabled) {
  transform: scale(.97) !important;
  transition: transform .07s !important;
}

/* Shimmer sweep */
.btn-primary::before {
  content: '';
  position: absolute; top: 0; left: -130%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.34), transparent);
  transform: skewX(-22deg);
  transition: left .72s ease;
  pointer-events: none;
}
.btn-primary:hover::before { left: 170%; }

/* Ripple (DOM span injected by JS) */
.auth-ripple {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.32);
  transform: scale(0);
  animation: rippleOut .72s ease-out forwards;
  pointer-events: none;
}
@keyframes rippleOut { to { transform: scale(4); opacity: 0; } }

/* ── Footer link animated underline ── */
.auth-footer a {
  position: relative;
  display: inline-block;
  transition: color .25s;
}
.auth-footer a::after {
  content: '';
  position: absolute; left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
  border-radius: 2px;
  transition: width .38s cubic-bezier(0.22,1,0.36,1);
}
.auth-footer a:hover::after { width: 100%; }

/* ── Forgot password link ── */
a[href*='forgot'] { transition: color .22s, letter-spacing .25s; }
a[href*='forgot']:hover { letter-spacing: .04em; }

/* ── Selection color ── */
.auth-page ::selection { background: rgba(99,102,241,.38); color: #fff; }
