/* ==========================================
   LOGIN PAGE — Premium Glassmorphic 3D Design
   ========================================== */

/* Force app to center on login */
#app:has(.login-container) {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100vw;
  position: relative;
}

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

/* ===== PREMIUM ANIMATED BACKGROUND ===== */

/* Floating Particles */
.login-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.15;
  animation: particleFloat linear infinite;
}

.p1 { width: 6px; height: 6px; top: 15%; left: 10%; animation-duration: 15s; animation-delay: 0s; }
.p2 { width: 4px; height: 4px; top: 60%; left: 85%; animation-duration: 20s; animation-delay: -3s; }
.p3 { width: 8px; height: 8px; top: 80%; left: 25%; animation-duration: 18s; animation-delay: -6s; }
.p4 { width: 5px; height: 5px; top: 30%; left: 70%; animation-duration: 22s; animation-delay: -9s; }
.p5 { width: 3px; height: 3px; top: 50%; left: 40%; animation-duration: 16s; animation-delay: -12s; }
.p6 { width: 7px; height: 7px; top: 10%; left: 60%; animation-duration: 25s; animation-delay: -5s; }

@keyframes particleFloat {
  0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  10% { opacity: 0.2; }
  50% { transform: translateY(-200px) translateX(80px) scale(1.5); opacity: 0.15; }
  90% { opacity: 0.1; }
  100% { transform: translateY(-400px) translateX(-40px) scale(0.5); opacity: 0; }
}

/* === 3D Floating Glassmorphic Shapes === */
.login-bg-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  perspective: 1200px;
  overflow: hidden;
}

.glass-shape {
  position: absolute;
  border-radius: 20px;
  border: 1px solid rgba(42, 191, 191, 0.15);
  background: rgba(42, 191, 191, 0.03);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 
    0 8px 32px rgba(42, 191, 191, 0.06),
    inset 0 0 20px rgba(42, 191, 191, 0.02);
}

.glass-shape-1 {
  width: 180px; height: 180px;
  top: 10%; right: 15%;
  border-radius: 24px;
  transform: rotate(45deg);
  animation: shape3DFloat1 12s ease-in-out infinite;
  border-color: rgba(42, 191, 191, 0.2);
  background: linear-gradient(135deg, rgba(42, 191, 191, 0.06), rgba(124, 58, 237, 0.04));
}

.glass-shape-2 {
  width: 120px; height: 120px;
  bottom: 20%; left: 10%;
  border-radius: 50%;
  animation: shape3DFloat2 15s ease-in-out infinite;
  border-color: rgba(124, 58, 237, 0.18);
  background: radial-gradient(circle, rgba(124, 58, 237, 0.08), transparent);
}

.glass-shape-3 {
  width: 200px; height: 100px;
  top: 55%; right: 8%;
  border-radius: 50px;
  animation: shape3DFloat3 18s ease-in-out infinite;
  border-color: rgba(42, 191, 191, 0.12);
}

.glass-shape-4 {
  width: 80px; height: 80px;
  top: 25%; left: 18%;
  border-radius: 16px;
  animation: shape3DFloat4 10s ease-in-out infinite;
  border-color: rgba(16, 185, 129, 0.2);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), transparent);
}

.glass-shape-5 {
  width: 140px; height: 140px;
  bottom: 10%; right: 30%;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  animation: shape3DFloat5 20s ease-in-out infinite;
  border-color: rgba(59, 130, 246, 0.15);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(42, 191, 191, 0.03));
}

.glass-shape-6 {
  width: 60px; height: 60px;
  top: 70%; left: 35%;
  border-radius: 12px;
  animation: shape3DFloat6 8s ease-in-out infinite;
  border-color: rgba(245, 158, 11, 0.15);
  background: rgba(245, 158, 11, 0.04);
}

/* Glowing line accents */
.glow-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(42, 191, 191, 0.4), transparent);
  animation: glowLineMove 6s ease-in-out infinite;
  pointer-events: none;
}

.glow-line-1 { width: 300px; top: 30%; left: -50px; animation-delay: 0s; }
.glow-line-2 { width: 200px; bottom: 40%; right: -30px; animation-delay: -3s; transform: rotate(45deg); }
.glow-line-3 { width: 250px; top: 65%; left: 20%; animation-delay: -1.5s; transform: rotate(-20deg); }

@keyframes glowLineMove {
  0%, 100% { opacity: 0; transform: translateX(-100px); }
  50% { opacity: 1; transform: translateX(100px); }
}

/* 3D shape floating animations */
@keyframes shape3DFloat1 {
  0%, 100% { transform: rotate(45deg) translateY(0) translateZ(0) rotateX(0); }
  25% { transform: rotate(50deg) translateY(-20px) translateZ(30px) rotateX(5deg); }
  50% { transform: rotate(40deg) translateY(-10px) translateZ(15px) rotateX(-3deg); }
  75% { transform: rotate(48deg) translateY(-25px) translateZ(40px) rotateX(8deg); }
}

@keyframes shape3DFloat2 {
  0%, 100% { transform: scale(1) translateY(0) translateX(0); }
  33% { transform: scale(1.15) translateY(-30px) translateX(15px); }
  66% { transform: scale(0.9) translateY(15px) translateX(-10px); }
}

@keyframes shape3DFloat3 {
  0%, 100% { transform: rotate(0deg) translateY(0) skewX(0deg); }
  25% { transform: rotate(3deg) translateY(-15px) skewX(2deg); }
  50% { transform: rotate(-2deg) translateY(10px) skewX(-1deg); }
  75% { transform: rotate(4deg) translateY(-20px) skewX(3deg); }
}

@keyframes shape3DFloat4 {
  0%, 100% { transform: rotate(0) scale(1); box-shadow: 0 0 15px rgba(16,185,129,0.1); }
  50% { transform: rotate(90deg) scale(1.2); box-shadow: 0 0 30px rgba(16,185,129,0.2); }
}

@keyframes shape3DFloat5 {
  0%, 100% { transform: rotate(0deg) translateY(0); border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
  25% { transform: rotate(5deg) translateY(-20px); border-radius: 50% 50% 30% 70% / 60% 40% 60% 40%; }
  50% { transform: rotate(-3deg) translateY(-10px); border-radius: 40% 60% 50% 50% / 50% 50% 50% 50%; }
  75% { transform: rotate(8deg) translateY(-30px); border-radius: 60% 40% 40% 60% / 40% 60% 40% 60%; }
}

@keyframes shape3DFloat6 {
  0%, 100% { transform: rotate(0deg) translateY(0) scale(1); opacity: 0.6; }
  50% { transform: rotate(180deg) translateY(-30px) scale(1.3); opacity: 1; }
}

/* === Animated grid overlay === */
.login-grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(42,191,191,0.02) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(124,58,237,0.02) 0%, transparent 50%);
}

/* === Login Card === */
.login-card {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 2;
  background: rgba(10, 15, 30, 0.75);
  backdrop-filter: blur(40px) saturate(1.4);
  -webkit-backdrop-filter: blur(40px) saturate(1.4);
  border: 1px solid rgba(42, 191, 191, 0.15);
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow:
    0 0 80px rgba(42, 191, 191, 0.06),
    0 32px 64px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: loginCardEntry 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.login-card:hover {
  border-color: rgba(42, 191, 191, 0.25);
  box-shadow:
    0 0 100px rgba(42, 191, 191, 0.1),
    0 32px 64px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@keyframes loginCardEntry {
  0% {
    opacity: 0;
    transform: translateY(40px) rotateX(8deg) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0) scale(1);
  }
}

/* Glow Ring */
.login-glow-ring {
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  border-radius: 26px;
  background: conic-gradient(
    from 0deg,
    transparent,
    rgba(42, 191, 191, 0.3),
    transparent,
    rgba(124, 58, 237, 0.2),
    transparent,
    rgba(42, 191, 191, 0.15),
    transparent
  );
  z-index: -1;
  animation: glowRingSpin 8s linear infinite;
  opacity: 0.5;
}

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

/* Logo Section */
.login-logo-section {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 20px;
}

.login-logo {
  height: 56px;
  width: auto;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 4px 12px rgba(42, 191, 191, 0.3));
  animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.login-logo-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(42, 191, 191, 0.2), transparent 70%);
  border-radius: 50%;
  z-index: 1;
  animation: glowPulse 3s ease-in-out infinite;
}

.login-title {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}

/* Form Fields */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-label svg { color: var(--primary); opacity: 0.7; }

.login-input-wrapper { position: relative; }

.login-input {
  width: 100%;
  padding: 14px 18px;
  padding-right: 48px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(42, 191, 191, 0.12);
  border-radius: 14px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  transition: all 0.3s ease;
}

.login-input:focus {
  border-color: var(--primary);
  background: rgba(42, 191, 191, 0.04);
  box-shadow: 0 0 0 4px rgba(42, 191, 191, 0.1), 0 0 24px rgba(42, 191, 191, 0.08);
}

.login-input::placeholder { color: var(--text-muted); font-size: 14px; }

.login-input-glow {
  position: absolute;
  bottom: -1px; left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.login-input:focus ~ .login-input-glow { width: 80%; }

/* Eye Toggle */
.eye-toggle {
  position: absolute;
  right: 14px; 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;
  border-radius: 8px; transition: all 0.2s ease; z-index: 2;
}
.eye-toggle:hover { color: var(--primary); background: rgba(42, 191, 191, 0.1); }

/* Error Message */
.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  animation: fadeInUp 0.3s ease;
}

/* Login Button */
.login-btn {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  margin-top: 4px;
}

.login-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; right: 0; bottom: 0;
  width: 300%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s ease;
}

.login-btn:hover::before { left: 100%; }

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 32px rgba(42, 191, 191, 0.35),
    0 0 48px rgba(42, 191, 191, 0.15);
}

.login-btn:active { transform: translateY(0); }
.login-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none !important; }
.login-btn-arrow { transition: transform 0.3s ease; }
.login-btn:hover .login-btn-arrow { transform: translateX(4px); }
.login-btn-loader { display: flex; align-items: center; justify-content: center; }

/* Footer */
.login-footer { margin-top: 32px; text-align: center; }

.login-divider { position: relative; margin-bottom: 16px; }
.login-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.login-divider span {
  position: relative;
  background: rgba(10, 15, 30, 0.9);
  padding: 0 16px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.login-copyright { font-size: 12px; color: var(--text-muted); opacity: 0.6; }

/* Shake Animation */
.shake { animation: shakeCard 0.5s ease-in-out; }
@keyframes shakeCard {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-8px); }
  30% { transform: translateX(8px); }
  45% { transform: translateX(-6px); }
  60% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
  90% { transform: translateX(3px); }
}

/* Mobile */
@media (max-width: 480px) {
  .login-card { padding: 36px 24px; border-radius: 20px; }
  .login-title { font-size: 22px; }
  .login-logo { height: 48px; }
  .glass-shape { display: none; }
}
