@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --minsa-blue: #5289c8;
    --minsa-dark-blue: #3d6a9c;
    --text-dark: #333333;
    --text-light: #6c757d;
    --border-color: #dee2e6;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Poppins', sans-serif; 
}

body { 
    background-color: #f8fafc; 
    height: 100vh; 
    overflow: hidden; /* Esto congela el fondo general */
}

/* =========================================
   PANTALLA DE LOGIN (SPLIT)
========================================= */
#login-overlay {
    display: flex;
    width: 100%;
    height: 100vh; /* Altura exacta de la ventana */
    background-color: #fff;
}

.login-left-panel {
    flex: 7.2; 
    background: linear-gradient(rgba(29, 137, 188, 0.85), rgba(29, 137, 188, 0.85)), url('bgg.jpg') center/cover;
    color: white;
    display: flex;
    align-items: flex-end; /* ✅ ESTO LO MANDA HACIA ABAJO */
    justify-content: center;
    /* El "80px" es la distancia desde el piso. Súbelo (ej: 120px) si lo quieres más arriba */
    padding: 50px 50px 80px 50px; 
}

.left-content { 
    max-width: 880px; 
    text-align: center; 
}

.left-content h2 { 
    /* 🔥 AQUÍ CAMBIAS EL TAMAÑO DEL TÍTULO (Portal de la Salud - MINSA) */
    /* Ej: bájalo a 2.2rem o súbelo a 3rem */
    font-size: 2.6rem; 
    margin-bottom: 20px; 
    font-weight: 400; 
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5); 
}

.left-content p { 
    /* 🔥 AQUÍ CAMBIAS EL TAMAÑO DEL PÁRRAFO (Las letras pequeñas) */
    /* Ej: bájalo a 1.1rem o 1rem si lo ves muy grande */
    font-size: 1.05rem; 
    line-height: 1.7; 
    font-weight: 400; 
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5); 
}

.login-right-panel {
    flex: 2.8; /* MÁS ANGOSTO EL PANEL BLANCO (28%) */
    display: flex;
    flex-direction: column;
    align-items: center; /* Centra horizontalmente */
    background: #fff;
    padding: 0 30px; 
    height: 100vh; 
    overflow-y: auto; 
}

.login-form-wrapper { 
    width: 100%; 
    max-width: 360px;
    margin: auto 0; 
    /* Aumenta el 100px a 120px o 150px si quieres que baje aún más */
    padding: 100px 0 60px 0; 
}

.right-header { 
    text-align: center; 
    margin-bottom: 25px; 
}

/* PRIMERA IMAGEN (Ministerio de Salud) */
.logo-minsa-top { 
    /* Cambia el 160px para agrandar o encoger la primera imagen */
    width: 250px; 
    display: block; 
    margin: 0 auto 15px; /* El '15px' es la separación con la imagen de abajo */
}

/* SEGUNDA IMAGEN (Portal de la Salud) */
.logo-promo-main { 
    /* Cambia el 190px para agrandar o encoger la segunda imagen */
    width: 190px; 
    display: block; 
    margin: 0 auto; 
}

.login-instruction { 
    text-align: center; 
    font-size: 0.9rem; /* Letra más pequeña */
    color: var(--minsa-blue); 
    margin-bottom: 20px; /* Menos espacio vacío */
    font-weight: 500; 
}

.form-group-clean { margin-bottom: 15px; position: relative; } /* Menos separación entre inputs */
.form-group-clean label { font-size: 0.85rem; color: var(--text-light); margin-bottom: 5px; display: block; font-weight: 500; }
.form-group-clean input { 
    width: 100%; 
    padding: 10px 14px; /* Inputs más delgados */
    border: 1.5px solid var(--border-color); 
    border-radius: 6px; 
    outline: none; 
    font-size: 0.95rem; 
    transition: border-color 0.2s;
}
.form-group-clean input:focus { border-color: var(--minsa-blue); }

.password-container { position: relative; }
.password-container i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--text-light); font-size: 1.1rem; }

.captcha-clean-container { 
    background: #f8f9fa; 
    border: 1.5px solid var(--border-color); 
    padding: 12px; /* Menos relleno en la caja del captcha */
    border-radius: 6px; 
    margin-bottom: 20px; 
}
.captcha-row { display: flex; justify-content: space-between; align-items: stretch; margin-bottom: 10px; gap: 8px; }
#captcha-code { 
    font-size: 1.4rem; /* Letras del captcha más chicas */
    font-weight: bold; 
    letter-spacing: 6px; 
    text-decoration: line-through; 
    color: #444; 
    background: #e9ecef; 
    padding: 8px 12px; 
    border-radius: 6px; 
    flex-grow: 1; 
    text-align: center; 
    display: flex; 
    align-items: center; 
    justify-content: center;
}
#reloadCaptchaBtn { 
    background: #fff; 
    border: 1.5px solid var(--border-color); 
    width: 45px; 
    border-radius: 6px; 
    cursor: pointer; 
    color: var(--text-light); 
    font-size: 1.1rem;
    display: flex; 
    align-items: center; 
    justify-content: center;
}
.captcha-clean-container input { 
    width: 100%; 
    padding: 10px 14px; 
    border: 1.5px solid var(--border-color); 
    border-radius: 6px; 
    outline: none; 
    font-size: 0.95rem;
}
.captcha-clean-container input:focus { border-color: var(--minsa-blue); }

.btn-primary-login { 
    width: 100%; 
    background: var(--minsa-blue); 
    color: white; 
    border: none; 
    padding: 12px; /* Botón menos alto */
    font-size: 1rem; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: 500; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 8px; 
    transition: background 0.3s; 
    margin-top: 5px;
}
.btn-primary-login:hover { background: var(--minsa-dark-blue); }

.login-error-message { color: #dc3545; text-align: center; margin-top: 8px; font-size: 0.85rem; min-height: 18px; font-weight: 500; }

.login-footer-contact { margin-top: 25px; text-align: center; border-top: 1px solid var(--border-color); padding-top: 15px; } /* Footer más pegado arriba */
.copyright-text { font-size: 0.75rem; color: var(--text-light); margin-bottom: 5px; }
.admin-link { color: var(--minsa-blue); text-decoration: none; font-size: 0.85rem; font-weight: 500; }
/* =========================================
   UTILIDADES
========================================= */
.hidden { display: none !important; }

/* =========================================
   PANEL PRINCIPAL (INTERNO)
========================================= */

/* Contenedor principal centrado */
#main-content {
    padding: 40px 20px;
    max-width: 1000px; /* Ancho máximo para que no se estire por toda la pantalla */
    margin: 0 auto; /* Centrado horizontal */
    width: 100%;
}

/* Animación de entrada suave */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#main-content:not(.hidden) {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Tarjeta blanca del panel */
.registration-panel {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08); /* Sombra elegante */
    padding: 40px;
    border: 1px solid var(--border-color);
}

/* Diseño de los botones de navegación (Pestañas) */
.nav-btn {
    transition: all 0.2s ease;
    color: var(--text-dark);
}

.nav-btn i {
    color: var(--minsa-blue);
    margin-right: 5px;
}

.nav-btn:hover {
    background-color: #e9ecef !important;
    border-color: #ced4da !important;
    transform: translateY(-1px);
}

/* Diseño del botón ACTIVO (El que está seleccionado) */
.nav-btn.active {
    background-color: var(--minsa-blue) !important;
    color: #ffffff !important;
    border-color: var(--minsa-blue) !important;
    box-shadow: 0 4px 10px rgba(82, 137, 200, 0.3);
}

.nav-btn.active i {
    color: #ffffff !important;
}

/* Títulos y textos dentro de cada pestaña */
.tab-panel h2 {
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 1.5rem;
    font-weight: 600;
}

.tab-panel p {
    color: var(--text-light);
    margin-bottom: 25px;
    font-size: 0.95rem;
}

/* =========================================
   MODO MÓVIL (RESPONSIVE PARA CELULARES)
========================================= */
@media (max-width: 768px) {
    /* Permitir hacer scroll en celular */
    body {
        overflow-y: auto !important; 
        height: auto;
    }
    
    /* El contenedor principal se apila hacia abajo */
    #login-overlay {
        flex-direction: column; 
        height: auto;
        min-height: 100vh;
    }

    /* Ajustar el panel izquierdo (azul) */
    .login-left-panel {
        flex: none;
        width: 100%;
        padding: 40px 20px;
    }
    .left-content h2 {
        font-size: 1.8rem; /* Título más pequeño en móvil */
        margin-bottom: 15px;
    }
    .left-content p {
        font-size: 1rem;
    }

    /* Ajustar el panel derecho (blanco) */
    .login-right-panel {
        flex: none;
        width: 100%;
        height: auto;
        padding: 30px 20px;
        overflow-y: visible;
    }
    .login-form-wrapper {
        padding: 20px 0;
        margin: 0 auto;
    }
    
    /* Ajustes para el panel interno (Formularios de recetas) */
    #main-content {
        padding: 20px 10px;
    }
    .registration-panel {
        padding: 20px 15px;
    }
    
    /* Que los inputs se pongan uno debajo del otro en celular */
    .form-group-clean, 
    .med-row > div {
        min-width: 100% !important; 
        flex: none !important;
    }
    .med-row {
        flex-direction: column;
        align-items: stretch !important;
    }
    .nav-row {
        flex-direction: column;
        gap: 15px !important;
    }
}