:root {
    /* --- Identidad UPIICSA --- */
    --primary: #1A8C14;
    --primary-dark: #136b10;
    --primary-light: #e8f5e9;
    --accent: #10b981; /* Tu --success anterior */

    /* --- Superficies (Claves para Dark Mode) --- */
    --bg-main: #ffffff;           /* Fondo general */
    --bg-panel: #ffffff;          /* Fondo del panel de formulario */
    --bg-input: #f8fafc;          /* Fondo de inputs y toggles */
    --bg-overlay: #1A8C14;        /* Color del overlay del branding */
    --bg-modal: #ffffff;          /* Fondo de tarjetas modales */
    
    /* --- Textos --- */
    --text-main: #1f2937;         /* Títulos y texto fuerte */
    --text-muted: #6b7280;        /* Párrafos y etiquetas suaves */
    --text-on-brand: #ffffff;     /* Texto sobre fondos oscuros/verdes */
    --text-link: #1A8C14;         /* Color de enlaces */
    --white: #ffffff;

    /* --- Bordes y Sombras --- */
    --border-color: #d1d5db;
    --border-focus: #1A8C14;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 15px 30px rgba(0, 0, 0, 0.15);
    --shadow-brand: rgba(26, 140, 20, 0.15); /* Sombra de botones verdes */

    /*STYLE.CSS*/
    --shadow-brand-logo: rgba(0,0,0,0.2);
    --shadow-brand-overlay: rgba(0,0,0,0.5);

    /* --- Estados --- */
    --error: #ef4444;
    --success: #10b981;
    --toggle-off: #cbd5e1;
}


* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background: var(--white);
    height: 100vh;
    overflow: hidden; /* Evitar scroll global */
}

/* --- LAYOUT PRINCIPAL --- */
.split-layout {
    display: flex;
    height: 100%;
    width: 100%;
}

/* LADO IZQUIERDO: BRANDING (Más ancho) */
.brand-panel {
    flex: 0 0 55%; /* 55% del ancho */
    background: url('Imagenes/fondo.png') no-repeat center center/cover;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.brand-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Opacidad sólida (sin transparencia) */
    background: var(--bg-overlay); /* Color de fondo sólido */
    opacity: 0.60; /* Un toque mínimo para que se funda con la imagen de fondo si se desea, o pon 1 para sólido total */
}

.brand-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    max-width: 600px;
}

.logos-container {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 2rem;
}

.brand-logo { height: 90px; filter: drop-shadow(0 4px 6px var(--shadow-brand-logo)); }

.brand-content h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.1; }
.brand-content p { font-size: 1.1rem; opacity: 0.95; font-weight: 400; line-height: 1.5; }
.brand-footer { position: absolute; bottom: 1.5rem; width: 100%; text-align: center; opacity: 0.7; font-size: 0.8rem; }

/* LADO DERECHO: FORMULARIOS */
.form-panel {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--white);
    position: relative;
    padding: 1rem;
}

.form-wrapper {
    width: 100%;
    max-width: 850px; /* Ancho amplio para acomodar 3 columnas */
    padding: 0 2rem;
    /* Intentar que quepa sin scroll */
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

/* --- VISTAS --- */
.auth-view { display: none; animation: fadeIn 0.4s ease; width: 100%; }
.auth-view.active-view { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.view-header { margin-bottom: 1.5rem; text-align: center; }
.view-header h2 { font-size: 1.8rem; color: var(--primary-dark); font-weight: 800; margin-bottom: 0.2rem; }
.view-header p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

/* HEADER COMPACTO PARA REGISTRO (Para ahorrar espacio vertical) */
#registro-view .view-header { margin-bottom: 1rem; }
#registro-view .view-header h2 { font-size: 1.5rem; }

/* --- INPUTS --- */
.input-group-modern { margin-bottom: 0.6rem; text-align: left; }
.input-group-modern label {
    font-size: 0.7rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.2rem;
    text-transform: uppercase; letter-spacing: 0.02em;
}

.input-group-modern input, .input-group-modern select {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 0.4rem;
    background: var(--bg-input);
    font-size: 0.85rem;
    color: var(--text-main);
    height: 36px; /* Altura compacta */
    transition: all 0.2s;
}
.input-group-modern input:focus, .input-group-modern select:focus {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
    outline: none;
}

/* GRILLAS PERSONALIZADAS */
.row-grid { display: flex; gap: 0.8rem; margin-bottom: 0.2rem; }
.col-1-3 { flex: 1; } /* 33% */
.col-1-2 { flex: 1; } /* 50% */
.col-full { width: 100%; }

/* --- TOGGLE SOY EGRESADO --- */
.toggle-container {
    display: flex;
    align-items: center;
    height: 33px; /* Igualar altura input */
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 0.4rem;
    padding: 0 0.8rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}
.toggle-container:hover { border-color: var(--primary); background: var(--white); }
.toggle-container input { display: none; }

.toggle-switch {
    position: relative; width: 34px; height: 18px; background: var(--toggle-off); border-radius: 20px; transition: 0.3s; margin-right: 10px; flex-shrink: 0;
}
.toggle-switch::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: var(--white); border-radius: 50%; transition: 0.3s;
}

.toggle-container input:checked + .toggle-switch { background: var(--primary); }
.toggle-container input:checked + .toggle-switch::after { transform: translateX(16px); }

.toggle-label { font-size: 0.8rem; font-weight: 700; color: var(--text-main); user-select: none; }

/* --- BOTONES --- */
.btn-primary-lg {
    width: 100%; padding: 0.8rem; background: var(--primary); color: var(--white); border: none; border-radius: 0.5rem;
    font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: all 0.2s; margin-top: 1.2rem;
    box-shadow: 0 4px 6px var(--shadow-brand);
}
.btn-primary-lg:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-secondary-lg {
    width: 100%; padding: 0.8rem; background: var(--white); color: var(--text-muted); border: 1px solid var(--border-color);
    border-radius: 0.5rem; font-weight: 600; cursor: pointer; margin-top: 0.5rem; font-size: 0.85rem;
}
.btn-secondary-lg:hover { color: var(--text-main); border-color: var(--text-muted); }

.view-footer { margin-top: 1rem; text-align: center; font-size: 0.85rem; color: var(--text-muted); }
.view-footer a { color: var(--primary); font-weight: 700; text-decoration: none; }

.forgot-link { display: block; text-align: right; color: var(--primary); font-weight: 600; text-decoration: none; font-size: 0.85rem; margin-bottom: 1rem; }

/* MODALES */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--shadow-brand-overlay); backdrop-filter: blur(3px);
    display: none; justify-content: center; align-items: center; z-index: 2000;
}
.modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
.modal-card { background: var(--white); padding: 2rem; border-radius: 1rem; width: 90%; max-width: 400px; text-align: center; box-shadow: 0 15px 30px var(--shadow-md); }
.modal-icon { display: flex; justify-content: center; margin-bottom: 1rem; }
.modal-card h3 { font-size: 1.4rem; color: var(--text-main); margin-bottom: 0.5rem; font-weight: 800; }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .brand-panel { display: none; }
    .form-wrapper { max-width: 100%; padding: 1.5rem; }
    body { overflow-y: auto; }
}