/* =========================================
   1. FUENTES LOCALES (Andika)
   ========================================= */
@font-face { font-family: 'Andika'; font-style: normal; font-weight: 400; src: local(''), url('./assets/fonts/andika-v27-latin-regular.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Andika'; font-style: normal; font-weight: 700; src: local(''), url('./assets/fonts/andika-v27-latin-700.woff2') format('woff2'); font-display: swap; }

/* =========================================
   2. ESTILOS GLOBALES
   ========================================= */
body, button, input { margin: 0; font-family: 'Andika', sans-serif; background-color: #f0f4f8; padding-bottom: 50px; }

/* =========================================
   3. ENCABEZADO Y MENÚ LATERAL
   ========================================= */
header { position: relative; display: flex; justify-content: flex-start; align-items: center; padding: 15px 20px; background: white; box-shadow: 0 4px 10px rgba(0,0,0,0.05); border-bottom: 3px solid #e2e8f0; }
.logo-principal { width: 190px; max-width: 70%; object-fit: contain; }
.btn-menu { position: absolute; right: 20px; background: none; border: none; font-size: 32px; cursor: pointer; color: #004F9F; transition: transform 0.2s; }
.btn-menu:active { transform: scale(0.9); }

#sidebar { position: fixed; top: 0; right: -300px; width: 250px; height: 100vh; background: white; box-shadow: -5px 0 15px rgba(0,0,0,0.1); transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); z-index: 1000; padding: 20px 20px 40px 20px; border-left: 4px solid #004F9F; display: flex; flex-direction: column; overflow-y: auto; }
#sidebar.activo { right: 0; }
.cerrar-menu { background: transparent; border: none; font-size: 28px; cursor: pointer; color: #ef4444; align-self: flex-end; font-weight: bold; margin-bottom: 10px; padding: 0; }

/* =========================================
   4. CUADRÍCULA Y MÓDULOS
   ========================================= */
main { padding: 25px 15px; max-width: 700px; margin: 0 auto; text-align: center; }

.caja-primeros-pasos { display: block; color: inherit; border: 4px solid #F9A159; border-radius: 25px; padding: 20px 10px; margin-bottom: 30px; background: #fffaf4; box-shadow: 0 8px 0 #e6893e; transition: transform 0.1s, box-shadow 0.1s; cursor: pointer; }
.caja-primeros-pasos:active { transform: translateY(6px); box-shadow: 0 2px 0 #e6893e; }
.caja-primeros-pasos h2 { color: #F9A159; margin: 0 0 15px 0; font-size: 26px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

/* CORRECCIÓN: Ajustes para la cuadrícula de 2 columnas (Módulos Avanzados) */
.grid-2 { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: clamp(15px, 3vw, 30px); 
    row-gap: clamp(40px, 8vw, 60px); /* Aumenta el margen vertical para separar el letrero del botón de abajo */
}

.btn-modulo { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; border: 4px solid #e2e8f0; border-radius: 22px; padding: 20px 10px; min-height: 90px; background: white; box-shadow: 0 6px 0 #cbd5e1; transition: all 0.1s ease-in-out; text-decoration: none; }
.btn-modulo:hover, .btn-modulo:active { z-index: 100; border-color: #004F9F; background-color: #f0f7ff; transform: translateY(4px); box-shadow: 0 2px 0 #004F9F; }

.btn-cuadrado { aspect-ratio: 1 / 1; min-height: auto; padding: 10px; }
.grid-4 .btn-modulo img { width: 45px; height: 45px; object-fit: contain; }

/* CORRECCIÓN: Tamaños de imagen ajustados para abarcar el alto del botón */
.grid-2 .btn-modulo {
    height: clamp(80px, 20vw, 140px);
    padding: 5px; /* Menos relleno interno para dar espacio a la imagen */
}
.grid-2 .btn-modulo img { 
    width: auto; 
    height: 90%; /* La imagen ocupa casi todo el botón de alto */
    max-height: 100%; 
    object-fit: contain; 
}

.btn-modulo span { position: absolute; bottom: -40px; background: #004F9F; border: 2px solid #003366; color: white; padding: 8px 14px; border-radius: 12px; font-size: 15px; font-weight: bold; opacity: 0; pointer-events: none; transition: 0.2s; transform: translateY(-5px); white-space: nowrap; box-shadow: 0 4px 0 #003366; }
.btn-modulo:hover span, .btn-modulo:active span { opacity: 1; transform: translateY(0); }

.caja-primeros-pasos .btn-modulo:active { transform: translateY(2px); box-shadow: 0 1px 0 #004F9F; }

/* =========================================
   5. MODAL DE AUTENTICACIÓN
   ========================================= */
#modal-login { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(15, 23, 42, 0.8); display: flex; justify-content: center; align-items: center; z-index: 2000; }
.oculto { display: none !important; }
.modal-contenido { background: white; padding: 30px 25px; border-radius: 25px; text-align: center; max-width: 90%; width: 340px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); border: 5px solid #004F9F; }
.input-form { width: 85%; padding: 14px; margin-bottom: 15px; border: 3px solid #e2e8f0; border-radius: 15px; font-family: 'Andika', sans-serif; font-size: 16px; transition: 0.2s; }
.input-form:focus { outline: none; border-color: #F9A159; background: #fffaf4; }
.btn-auth { background: #004F9F; color: white; border: none; padding: 15px; border-radius: 15px; cursor: pointer; width: 100%; font-size: 18px; font-weight: bold; box-shadow: 0 5px 0 #003366; transition: 0.1s; margin-bottom: 15px; }
.btn-auth:active { transform: translateY(3px); box-shadow: 0 2px 0 #003366; }
.btn-google { background: white; color: #333; border: 3px solid #e2e8f0; padding: 14px; border-radius: 15px; cursor: pointer; width: 100%; font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: bold; box-shadow: 0 4px 0 #cbd5e1; transition: 0.1s; }
.btn-google:active { transform: translateY(3px); box-shadow: 0 1px 0 #cbd5e1; }
.toggle-link { color: #F9A159; cursor: pointer; font-size: 15px; text-decoration: underline; margin-bottom: 20px; display: block; font-weight: bold; }
