/* EstilosLoginAnimado.css - VERSIÓN CORREGIDA */

/* --- Reseteo y Fuentes --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  height: 100%;
  width: 100%;
  overflow: hidden; /* Evita barras de scroll innecesarias */
  font-family: 'Roboto', sans-serif;
}

@keyframes fadeInScaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* --- Estilos del Body y Partículas --- */
body {
  /* El body ya no centra nada, solo existe. El fondo lo pone tsParticles. */
  position: relative;
}

#tsparticles {
  /* Ocupa todo y se queda al fondo de todo. */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1; /* Lo mandamos al fondo del todo */
}

/* --- CORRECCIÓN: Nuevo contenedor principal --- */
/* Este div es ahora el responsable de centrar el formulario.
   Se coloca por encima de todo lo demás. */
.main-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10; /* Lo ponemos en una capa muy superior */
}

/* --- Contenedor Principal del Login (AHORA SIN Z-INDEX) --- */
/* Ya no necesita z-index porque su padre (.main-container) lo gestiona. */
.login-container {
  display: flex;
  width: 850px;
  height: 500px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: fadeInScaleUp 0.6s ease-out forwards;
}

/* --- El resto del CSS se mantiene igual --- */

/* --- Sección Izquierda (Branding UNAM) --- */
.login-image-section {
  flex: 1;
  background-color: #DDBE80;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  position: relative;
  overflow: hidden;
}

.login-image-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../img/UNAM black.png');
  background-size: 80%;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.15;
  z-index: 1;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.login-image-section:hover::before {
  opacity: 0.3;
  transform: scale(1.05);
}

.image-overlay {
  color: #ffffff;
  position: relative;
  z-index: 2;
}

.login-image-section h1 {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 5px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.login-image-section p {
  font-size: 1.1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 500;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

/* --- Sección Derecha (Formulario) --- */
.login-form-section {
  flex: 1;
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.login-form {
  width: 100%;
  max-width: 380px;
}

.form-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #262F61;
  margin-bottom: 40px;
  text-align: center;
  text-transform: uppercase;
}

.input-box {
  margin-bottom: 25px;
}

.detalles {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
  font-size: 0.9rem;
}

input[type="text"], 
input[type="password"] {
  width: 100%;
  height: 50px;
  border-radius: 8px;
  background-color: #dcdff2;
  padding: 0 20px;
  font-size: 1rem;
  color: #262F61;
  outline: none;
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  border: 2px solid transparent;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
  box-shadow: 0 0 0 3px rgba(38, 47, 97, 0.3);
  border-color: #DDBE80;
}

.btn-login {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 8px;
  background-color: #262F61;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  margin-top: 15px;
  font-family: 'Roboto', sans-serif;
}

.btn-login:hover {
  background-color: #354075;
  transform: translateY(-2px);
}

.btn-login:active {
  transform: translateY(0) scale(0.98);
  background-color: #1c244d;
}

.flash-data {
  display: none;
}

/* --- Responsive para pantallas pequeñas --- */
@media (max-width: 980px) {
  .login-container {
    flex-direction: column;
    width: 90%;
    max-width: 450px;
    height: auto;
  }
  
  .login-image-section {
    min-height: 250px;
    border-radius: 15px 15px 0 0;
  }
  
  .login-form-section {
     border-radius: 0 0 15px 15px;
  }
}