:root {
    --primary: #1e3a8a;
    --accent: #3b82f6;
    --success: #10b981;
    --bg: #f8fafc;
    --text-main: #1e293b;
    --white: #ffffff;
    --gray-light: #e2e8f0;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Poppins', sans-serif; 
    -webkit-tap-highlight-color: transparent; /* Elimina flash azul en móviles */
}

body {
    background-color: var(--bg);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 15px; /* Menos padding en los bordes para móviles */
}

/* Contenedor del Login */
.login-container {
    width: 100%;
    max-width: 420px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-box {
    background: var(--white);
    padding: 35px 25px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(30, 58, 138, 0.08);
    text-align: center;
}

.header { margin-bottom: 25px; }
.logo-icon { font-size: 3.5rem; margin-bottom: 10px; display: block; }
h1 { color: var(--primary); font-size: 1.8rem; font-weight: 700; letter-spacing: -1px; }

/* Formularios */
.input-group { text-align: left; margin-bottom: 18px; }
label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.8rem; color: #475569; }

input {
    width: 100%;
    padding: 14px 16px; /* Padding más grande para facilitar el toque */
    border: 1.5px solid var(--gray-light);
    border-radius: 12px;
    font-size: 16px; /* Evita zoom automático en iOS (debe ser 16px) */
    transition: all 0.3s ease;
    background: #fdfdfd;
}

input:focus { 
    outline: none; 
    border-color: var(--accent); 
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); 
    background: white;
}

/* Botones */
.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}

.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    width: 100%;
    background: #f1f5f9;
    color: #64748b;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

.footer-links { margin-top: 25px; }
.footer-links a { display: block; font-size: 0.85rem; color: var(--accent); text-decoration: none; margin-bottom: 10px; }
.footer-links #show-register { color: var(--primary); font-weight: 700; cursor: pointer; }

/* Modal de Registro Adaptable */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 24px;
    width: 100%;
    max-width: 450px;
    max-height: 90vh; /* No permite que el modal sea más alto que la pantalla */
    overflow-y: auto; /* Permite scroll si hay muchos campos */
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.input-grid input { margin-bottom: 12px; }

.hidden { display: none !important; }

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 480px) {
    body { padding: 10px; align-items: flex-start; padding-top: 40px; } /* En móviles pequeños empieza desde arriba */
    .login-box { padding: 30px 20px; border-radius: 25px; }
    h1 { font-size: 1.5rem; }
    .modal-content { padding: 25px 20px; }
}