/* =========================================
   1. RESET BÁSICO (Vital para responsividad)
   ========================================= */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: #28436b;
  display: flex;
  justify-content: center; /* Centrado vertical */
  align-items: center;     /* Centrado horizontal */
  flex-direction: column;
  min-height: 100vh;       /* Usar min-height para permitir scroll si hace falta */
  margin: 0;
  padding: 20px;           /* Espacio seguro en bordes para móviles */
}

/* =========================================
   2. CAJA DE LOGIN
   ========================================= */
.login-box {
  background: #ffffff;
  padding: 40px 30px;
  border-radius: 12px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  
  /* --- CAMBIO RESPONSIVO --- */
  width: 100%;             /* Ocupa todo el espacio disponible */
  max-width: 340px;        /* Pero detente en 340px */
  /* ------------------------- */
  
  color: #333;
  text-align: center;
  
  /* Margen inferior para no chocar con el footer fijo en PC */
  margin-bottom: 60px; 
  position: relative;
  z-index: 10;
}

.logo {
  margin-bottom: 25px;
}

.logo img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(40, 67, 107, 0.3);
  object-fit: cover;
}

h2 {
  margin-bottom: 25px;
  margin-top: 0;
  color: #28436b;
  font-size: 24px;
}

/* =========================================
   3. FORMULARIOS Y BOTONES
   ========================================= */
label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  text-align: left;
  color: #555;
  font-size: 14px;
}

input {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fdfdfd;
  font-size: 14px;
  transition: all 0.3s ease;
}

input:focus {
  outline: none;
  border-color: #28436b;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(40, 67, 107, 0.15);
}

button {
  width: 100%;
  padding: 12px;
  background: #28436b;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  color: #fff;
  font-size: 15px;
  margin-bottom: 20px;
}

button:hover {
  background: #1f3354;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.nav-cerrar {
  display: inline-block;
  padding: 10px 20px;
  background: linear-gradient(135deg, #d32f2f, #b71c1c);
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.nav-cerrar:hover {
  background: linear-gradient(135deg, #ff5252, #d32f2f);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(211, 47, 47, 0.3);
}

.nav-cerrar:active {
  transform: scale(0.98);
}

/* =========================================
   4. FOOTER
   ========================================= */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #1f3354;
  color: #fff;
  font-size: 13px;
  text-align: center;
  padding: 15px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.version {
  font-weight: bold;
  opacity: 0.9;
}

/* =========================================
   5. MEDIA QUERIES (RESPONSIVIDAD)
   ========================================= */

/* Para móviles pequeños (Menos de 480px) */
@media (max-width: 480px) {
  body {
    padding: 15px;
  }

  .login-box {
    padding: 30px 20px; /* Reducir padding interno para ganar espacio */
    margin-bottom: 20px;
  }
  
  h2 {
    font-size: 22px;
  }
}

/* Para pantallas con poca altura (Landscape en móviles) */
/* Esto es CRÍTICO: Si giras el móvil, el footer fijo tapa el botón de login */
@media (max-height: 600px) {
  body {
    justify-content: flex-start; /* Alinea al inicio para permitir scroll */
    padding-top: 40px;
    padding-bottom: 60px; /* Espacio para el footer si sigue fijo */
  }

  footer {
    /* Opción A: Mantener fijo pero asegurar que no tape contenido (con padding-bottom en body) */
    /* Opción B: Hacerlo estático para que se vaya al final del scroll (Recomendado) */
    position: static; 
    margin-top: 20px;
    width: 100%;
    box-shadow: none; /* Quitar sombra si ya no flota */
    background: transparent; /* Opcional: hacerlo transparente en móvil */
  }
  
  .login-box {
      margin-bottom: 10px;
  }
}