/* =========================================================
   PROTAGON - LOGIN / REGISTRO STYLES
   ========================================================= */

/* Hacemos que el fondo herede el color del Core */
body.login-page {
    background-color: var(--bg-body);
    font-family: var(--font-main);
    display: flex;
    min-height: 100vh;
    margin: 0;
}

/* =========================================================
   1. SELECTOR DE IDIOMAS
   ========================================================= */
.lang-switcher {
    position: absolute;
    top: 25px;
    right: 25px;
    display: flex;
    gap: 5px;
    background: var(--bg-body);
    padding: 4px;
    border-radius: var(--r-sm);
    border: 1px solid var(--b-color);
    z-index: 100;
}

.lang-btn {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--t-muted);
    text-decoration: none;
    border-radius: 6px;
    transition: var(--transition);
    /* Agrega estas 4 líneas para resetear el estilo: */
    border: none; 
    background: transparent; 
    cursor: pointer; 
    font-family: inherit;
}

.lang-btn:hover { color: var(--c-primary); }
.lang-btn.active {
    background: var(--bg-surface);
    color: var(--c-primary);
    box-shadow: var(--shadow-sm);
}

/* =========================================================
   2. PASSWORD TOGGLE
   ========================================================= */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--t-light);
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}
.password-toggle:hover { color: var(--c-primary); }
input[type="password"], input.password-visible { padding-right: 40px !important; }

/* =========================================================
   3. LAYOUT SPLIT SCREEN (Pantalla Dividida)
   ========================================================= */
.split-screen {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* Panel Izquierdo (Hero) */
.left-pane {
    flex: 1;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.left-pane::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: var(--hero-bg, url('../img/default-bg.jpg')); 
    background-size: cover; background-position: center;
    opacity: 0.3; mix-blend-mode: overlay; z-index: 0;
}

.pane-content { position: relative; z-index: 1; max-width: 550px; }
.hero-title { font-weight: 800; margin-bottom: 25px; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); font-size: 2rem; }
.hero-desc { opacity: 0.95; margin-bottom: 40px; line-height: 1.6; color: #f1f5f9; }

.features-list { list-style: none; padding: 0; }
.features-list li { margin-bottom: 18px; display: flex; align-items: center; gap: 15px; font-weight: 500; }
.features-list i {
    color: var(--c-primary);
    background: var(--c-primary-glow);
    border: 1px solid rgba(96, 165, 250, 0.4);
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
}

/* Panel Derecho (Formulario) */
.right-pane {
    width: 500px;
    background: var(--bg-surface);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 40px; position: relative; z-index: 10;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
}

.auth-box { width: 100%; }
.logo-login { height: 40px; margin-bottom: 25px; display: block; }

.form-header { margin-bottom: 30px; }
.form-title { font-size: 1.75rem; font-weight: 800; color: var(--t-main); margin: 0 0 5px 0; letter-spacing: -0.5px; }
.form-subtitle { color: var(--t-muted); font-size: 0.95rem; margin: 0; }

.form-grupo { margin-bottom: 20px; }
.form-grupo label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--t-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.input-wrapper { position: relative; }

.form-switch { margin-top: 25px; text-align: center; font-size: 0.95rem; color: var(--t-muted); }
.form-switch a { color: var(--c-primary); font-weight: 700; cursor: pointer; padding: 0 5px; text-decoration: none; }
.form-switch a:hover { text-decoration: underline; }

.legal-links { text-align: center; margin-top: 30px; border-top: 1px solid var(--b-color); padding-top: 20px; }
.legal-links a { font-size: 0.8rem; color: var(--t-light); text-decoration: none; transition: var(--transition); }
.legal-links a:hover { color: var(--c-primary); }

.logo-blanco { display: none; }

/* =========================================================
   4. RESPONSIVE MOBILE
   ========================================================= */
@media (max-width: 900px) {
    .split-screen { flex-direction: column; background: #0f172a; }
    
    .left-pane {
        flex: none; height: 35vh; padding: 10px; justify-content: flex-start;
        padding-top: 20px; text-align: center;
    }
    .pane-content { margin: 0 auto; margin-top: 30px !important; }
    .hero-title { font-size: 1rem; letter-spacing: 1px; line-height: 26px; font-weight: 100; padding: 10px; margin-bottom: 0px; }
    .hero-desc, .features-list { display: none; }
    
    .right-pane {
        flex: 1; width: 100%; border-radius: 30px 30px 0 0;
        margin-top: -35px; padding: 40px 25px; justify-content: flex-start;
    }
    
    .logo-login { display: none; }
    .logo-blanco { display: block; width: 100%; text-align: center; }
    .logo-blanco img { width: 40%; }
}


/* =========================================================
   5. EXTENSIÓN PARA FORMULARIO DE REGISTRO
   ========================================================= */

/* Grillas del Registro */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row-2-special {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 18px;
}

.date-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.mb-0 { margin-bottom: 0 !important; }

/* =========================================================
   VALIDACIONES EN TIEMPO REAL (CORRECCIÓN)
   ========================================================= */

/* Obligamos al contenedor a ser el "ancla" del ícono */
.input-wrapper {
    position: relative !important;
    display: block;
    width: 100%;
}

/* El ícono flotante adentro a la derecha */
.validation-icon {
    position: absolute !important;
    right: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 16px !important;
    display: none; /* Oculto por defecto, jQuery lo muestra */
    pointer-events: none; /* Para que no estorbe si le das clic por error */
    z-index: 10;
}

/* Estados del input (Abre espacio para que el texto no pise el ícono) */
.input-valid {
    border-color: var(--c-success) !important;
    padding-right: 40px !important;
}

.input-invalid {
    border-color: var(--c-danger) !important;
    padding-right: 40px !important;
}

/* Colores de los íconos */
.icon-valid {
    color: var(--c-success) !important;
}

.icon-invalid {
    color: var(--c-danger) !important;
}

.validation-msg {
    font-size: 0.75rem;
    margin-top: 4px;
    display: none;
    font-weight: 600;
}

.msg-error {
    color: var(--c-danger) !important;
    display: block;
}

/* Ajuste responsive extra para registro */
@media (max-width: 900px) {
    .form-row-2 { grid-template-columns: 1fr; gap: 0; }
    .form-row-2-special { grid-template-columns: 1fr !important; gap: 18px !important; }
}


/* =========================================================
   6. LAYOUT CENTRADO (RECOVER / RESET PASSWORD)
   ========================================================= */
.centered-auth-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    background: var(--bg-body);
    position: relative; /* Para anclar el selector de idioma */
    padding: 20px;
}

.auth-card-simple {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    padding: 40px;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-glass);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.auth-card-simple h1 {
    margin-bottom: 10px;
    color: var(--t-main);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.auth-card-simple p {
    color: var(--t-muted);
    margin-bottom: 30px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-card-simple .back-link {
    display: inline-block;
    margin-top: 25px;
    color: var(--t-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.auth-card-simple .back-link:hover {
    color: var(--c-primary);
}



/* =========================================================
   7. CAJAS DE ALERTA (RESET PASSWORD)
   ========================================================= */
.error-box {
    background: #fee2e2;
    color: #b91c1c;
    padding: 15px;
    border-radius: var(--r-sm);
    margin-bottom: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid #fca5a5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}


/* =========================================================
   8. CORRECCIÓN DE SCROLL (PARA FORMULARIOS LARGOS)
   ========================================================= */

/* Liberamos a las pantallas de Auth de la restricción del Core */
body.login-page, 
html:has(.login-page) {
    overflow-y: auto !important; 
    height: auto !important;
}

.split-screen {
    overflow-y: visible !important; 
}

/* En Escritorio: El panel derecho (Formulario) tiene su propio scroll elegante */
.right-pane {
    max-height: 100vh;
    overflow-y: auto;
}

/* En Móvil: El panel derecho crece libremente y la página completa hace scroll */
@media (max-width: 900px) {
    .right-pane {
        max-height: none;
        overflow-y: visible;
    }
}