* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.login-page {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f5f8ff 0%, #e8f2ff 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Fondo animado */
.fondo-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  opacity: 0.1;
  animation: floatBackground 20s ease-in-out infinite;
}

@keyframes floatBackground {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-20px) scale(1.02); }
}

/* Container principal */
.login-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 
    0 20px 40px rgba(42, 109, 210, 0.1),
    0 0 0 1px rgba(42, 109, 210, 0.05);
  width: 100%;
  max-width: 400px;
  position: relative;
  animation: slideInUp 0.8s ease-out;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #2a6dd2, #4a8ef5, #2a6dd2);
  background-size: 200% 100%;
  animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Logo */
.logo {
  display: block;
  margin: 0 auto 30px;
  max-width: 120px;
  height: auto;
  animation: logoFadeIn 1s ease-out 0.3s both;
  filter: drop-shadow(0 4px 8px rgba(42, 109, 210, 0.1));
}

@keyframes logoFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Formulario */
form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

form h2 {
  color: #2a6dd2;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
  animation: titleFadeIn 1s ease-out 0.5s both;
  position: relative;
}

form h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #2a6dd2, #4a8ef5);
  border-radius: 2px;
  animation: underlineGrow 0.8s ease-out 0.8s both;
}

@keyframes titleFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes underlineGrow {
  from {
    width: 0;
  }
  to {
    width: 60px;
  }
}

/* Inputs */
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid rgba(42, 109, 210, 0.1);
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  position: relative;
  animation: inputSlideIn 0.6s ease-out both;
}

input[type="text"] {
  animation-delay: 0.6s;
}

input[type="password"] {
  animation-delay: 0.7s;
}

@keyframes inputSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: #2a6dd2;
  background: rgba(255, 255, 255, 1);
  box-shadow: 
    0 0 0 3px rgba(42, 109, 210, 0.1),
    0 4px 12px rgba(42, 109, 210, 0.15);
  transform: translateY(-2px);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: #999;
  font-weight: 400;
}

/* Botón */
button[type="submit"] {
  width: 100%;
  padding: 16px 20px;
  background: linear-gradient(135deg, #2a6dd2 0%, #1e5bb8 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: buttonSlideIn 0.6s ease-out 0.8s both;
}

@keyframes buttonSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

button[type="submit"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.2), 
    transparent
  );
  transition: left 0.6s ease;
}

button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 25px rgba(42, 109, 210, 0.3),
    0 4px 12px rgba(42, 109, 210, 0.2);
}

button[type="submit"]:hover::before {
  left: 100%;
}

button[type="submit"]:active {
  transform: translateY(0);
}

button[type="submit"]:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Enlace recuperar contraseña */
.recuperar {
  text-align: center;
  animation: linkFadeIn 0.6s ease-out 0.9s both;
}

@keyframes linkFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.recuperar a {
  color: #2a6dd2;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
}

.recuperar a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #2a6dd2, #4a8ef5);
  transition: width 0.3s ease;
}

.recuperar a:hover {
  color: #1e5bb8;
  transform: translateY(-1px);
}

.recuperar a:hover::after {
  width: 100%;
}

/* Efectos de partículas de fondo */
.login-container::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at 25% 25%, 
    rgba(42, 109, 210, 0.03) 0%, 
    transparent 50%
  );
  animation: rotate 30s linear infinite;
  z-index: -1;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .login-container {
    margin: 20px;
    padding: 30px 25px;
    max-width: 350px;
  }
  
  .logo {
    max-width: 100px;
    margin-bottom: 25px;
  }
  
  form h2 {
    font-size: 20px;
  }
  
  input[type="text"],
  input[type="password"],
  button[type="submit"] {
    padding: 14px 16px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .login-container {
    margin: 15px;
    padding: 25px 20px;
    border-radius: 16px;
  }
  
  .logo {
    max-width: 80px;
    margin-bottom: 20px;
  }
  
  form h2 {
    font-size: 18px;
  }
  
  input[type="text"],
  input[type="password"],
  button[type="submit"] {
    padding: 12px 14px;
    font-size: 14px;
    border-radius: 10px;
  }
  
  form {
    gap: 16px;
  }
}

/* Animaciones adicionales para estados de carga */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fa-spinner {
  animation: spin 1s linear infinite;
}

/* Mejoras adicionales para accesibilidad */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Estados de focus mejorados para accesibilidad */
input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid #2a6dd2;
  outline-offset: 2px;
}


