/*===============================================*/
/* ESTILOS MODERNOS PARA LOGIN                   */
/*===============================================*/

:root {
  --primary-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
  --secondary-gradient: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  --success-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --accent-gradient: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  --dark-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0c4a6e 100%);
  --dark-card: rgba(15, 23, 42, 0.85);
  --light-bg: linear-gradient(135deg, #e0f2fe 0%, #bfdbfe 50%, #dbeafe 100%);
  --light-card: rgba(255, 255, 255, 0.95);
}

/* Reset para página de login */
body.login-page {
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  min-height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  transition: background 0.4s ease !important;
  position: relative !important;
  overflow: hidden !important;
}

body.login-page.dark-mode {
  background: var(--dark-bg) !important;
  position: relative;
}

body.login-page.dark-mode::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(14, 165, 233, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
  z-index: 0;
  animation: moveGradient 15s ease infinite;
}

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

body.login-page.light-mode {
  background: var(--light-bg) !important;
  position: relative;
}

body.login-page.light-mode::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 30% 30%, rgba(14, 165, 233, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
  z-index: 0;
}

/* Fondo animado con burbujas */
.background-animation {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.2) 0%, rgba(59, 130, 246, 0.05) 100%);
  animation: float 15s infinite ease-in-out;
  box-shadow: 0 8px 32px rgba(14, 165, 233, 0.1);
}

body.light-mode .bubble {
  background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, rgba(59, 130, 246, 0.03) 100%);
  box-shadow: 0 8px 32px rgba(14, 165, 233, 0.08);
}

.bubble:nth-child(1) { width: 80px; height: 80px; left: 10%; animation-delay: 0s; }
.bubble:nth-child(2) { width: 120px; height: 120px; left: 20%; animation-delay: 2s; }
.bubble:nth-child(3) { width: 60px; height: 60px; left: 60%; animation-delay: 4s; }
.bubble:nth-child(4) { width: 100px; height: 100px; left: 80%; animation-delay: 1s; }
.bubble:nth-child(5) { width: 90px; height: 90px; left: 40%; animation-delay: 3s; }

@keyframes float {
  0%, 100% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* Contenedor principal */
.login-container {
  position: relative !important;
  z-index: 1 !important;
  width: 100% !important;
  max-width: 450px !important;
  padding: 20px !important;
  animation: slideIn 0.6s ease-out !important;
}

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

/* Tarjeta de login - SOBRESCRIBE estilos.css */
body.dark-mode .login-card {
  background: var(--dark-card) !important;
  border-radius: 24px !important;
  padding: 48px 40px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  transition: all 0.4s ease !important;
}

body.light-mode .login-card {
  background: var(--light-card) !important;
  border-radius: 24px !important;
  padding: 48px 40px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  transition: all 0.4s ease !important;
}

/* Toggle mode button */
.mode-toggle {
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  width: 50px !important;
  height: 50px !important;
  border-radius: 50% !important;
  border: none !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.3rem !important;
  transition: all 0.3s ease !important;
  backdrop-filter: blur(10px) !important;
  z-index: 10 !important;
}

body.light-mode .mode-toggle {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #333 !important;
}

.mode-toggle:hover {
  transform: rotate(180deg) scale(1.1) !important;
  background: rgba(14, 165, 233, 0.3) !important;
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.4) !important;
}

/* Logo y título */
.login-header {
  text-align: center !important;
  margin-bottom: 40px !important;
}

.logo-container {
  width: 120px !important;
  height: 120px !important;
  margin: 0 auto 20px !important;
  background: white !important;
  border-radius: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 15px !important;
  box-shadow: 
    0 10px 40px rgba(14, 165, 233, 0.3),
    0 0 0 3px rgba(14, 165, 233, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.3) inset !important;
  animation: pulse 2s infinite !important;
  position: relative;
  overflow: hidden;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 2px 8px rgba(14, 165, 233, 0.2));
}

.logo-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(14, 165, 233, 0.1), transparent);
  animation: shine 3s infinite;
  z-index: 1;
}

@keyframes shine {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

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

.login-title {
  font-size: 2rem !important;
  font-weight: 700 !important;
  color: white !important;
  margin-bottom: 8px !important;
  background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 50%, #06b6d4 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  text-shadow: 0 2px 10px rgba(14, 165, 233, 0.3);
}

body.light-mode .login-title {
  background: linear-gradient(135deg, #0c4a6e 0%, #1e40af 50%, #0369a1 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

.login-subtitle {
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 0.95rem !important;
}

body.light-mode .login-subtitle {
  color: rgba(0, 0, 0, 0.5) !important;
}

/* Formulario */
.form-group {
  margin-bottom: 24px !important;
  position: relative !important;
}

.login-card .form-label {
  display: block !important;
  margin-bottom: 8px !important;
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  transition: color 0.3s ease !important;
}

body.light-mode .login-card .form-label {
  color: rgba(0, 0, 0, 0.7) !important;
}

.input-group {
  position: relative !important;
}

.input-icon {
  position: absolute !important;
  left: 16px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: rgba(255, 255, 255, 0.4) !important;
  font-size: 1.1rem !important;
  z-index: 2 !important;
  transition: color 0.3s ease !important;
  pointer-events: none !important;
}

body.light-mode .input-icon {
  color: rgba(0, 0, 0, 0.4) !important;
}

.login-card .form-control {
  width: 100% !important;
  padding: 14px 16px 14px 48px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 2px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  color: white !important;
  font-size: 1rem !important;
  transition: all 0.3s ease !important;
}

body.light-mode .login-card .form-control {
  background: rgba(0, 0, 0, 0.03) !important;
  border: 2px solid rgba(0, 0, 0, 0.1) !important;
  color: #1a1a1a !important;
}

.login-card .form-control:focus {
  outline: none !important;
  border-color: #0ea5e9 !important;
  background: rgba(14, 165, 233, 0.1) !important;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15) !important;
}

.login-card .form-control:focus ~ .input-icon {
  color: #0ea5e9 !important;
}

.login-card .form-control::placeholder {
  color: rgba(255, 255, 255, 0.3) !important;
}

body.light-mode .login-card .form-control::placeholder {
  color: rgba(0, 0, 0, 0.3) !important;
}

/* Botón de envío */
.btn-login {
  width: 100% !important;
  padding: 16px !important;
  background: var(--secondary-gradient) !important;
  border: none !important;
  border-radius: 12px !important;
  color: white !important;
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: 
    0 10px 30px rgba(14, 165, 233, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
  position: relative !important;
  overflow: hidden !important;
}

.btn-login::before {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 0 !important;
  height: 0 !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.2) !important;
  transform: translate(-50%, -50%) !important;
  transition: width 0.6s, height 0.6s !important;
}

.btn-login:hover {
  transform: translateY(-2px) !important;
  box-shadow: 
    0 15px 40px rgba(14, 165, 233, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset !important;
  background: linear-gradient(135deg, #0284c7 0%, #1d4ed8 100%) !important;
}

.btn-login:hover::before {
  width: 400px !important;
  height: 400px !important;
}

.btn-login:active {
  transform: translateY(0) !important;
}

/* Mensajes flash */
.login-card .alert {
  padding: 14px 18px !important;
  border-radius: 12px !important;
  margin-bottom: 24px !important;
  border: none !important;
  animation: slideDown 0.4s ease-out !important;
}

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

.login-card .alert-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #dc2626 !important;
  border-left: 4px solid #dc2626 !important;
}

.login-card .alert-success {
  background: rgba(6, 182, 212, 0.15) !important;
  color: #0891b2 !important;
  border-left: 4px solid #0891b2 !important;
}

.login-card .alert-info {
  background: rgba(14, 165, 233, 0.15) !important;
  color: #0284c7 !important;
  border-left: 4px solid #0284c7 !important;
}

/* Responsive */
@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px !important;
  }

  .login-title {
    font-size: 1.6rem !important;
  }

  .logo-container {
    width: 60px !important;
    height: 60px !important;
    font-size: 2rem !important;
  }
}
