/* ==========================================================================
   COMPONENTES DE INTERFAZ CENTRALIZADOS (css/componentes.css)
   ========================================================================== */

html {
    scroll-behavior: smooth;
}

/* --- BARRA DE NAVEGACIÓN (Navbar) --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--color-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.navbar-brand {
    font-family: var(--font-titles);
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.navbar-brand span {
    color: var(--color-accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-link-item {
    font-family: var(--font-body);
    text-decoration: none;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    transition: var(--transition-smooth);
}

.nav-link-item:hover {
    color: var(--color-accent);
}

.nav-link {
    font-family: var(--font-body);
    text-decoration: none;
    font-size: 0.95rem;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: var(--color-accent);
    font-weight: 600;
}

.nav-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 5px;
}

/* --- BANNER PRINCIPAL (Hero Section) --- */
.hero-section {
    position: relative;
    height: 75vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(17, 27, 36, 0.92), rgba(26, 42, 58, 0.85));
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 900px;
    padding: 0 20px;
}

.hero-title {
    font-family: var(--font-titles);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: #ffffff;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
    margin-bottom: 35px;
}

.auth-buttons-container {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* --- BOTONES CORPORATIVOS --- */
.btn-gold {
    font-family: var(--font-body);
    font-weight: 600;
    background-color: var(--color-accent);
    color: var(--color-primary);
    padding: 12px 28px;
    border-radius: var(--border-radius);
    text-decoration: none;
    border: none;
    cursor: pointer;
    display: inline-block;
    transition: var(--transition-smooth);
}

.btn-gold:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(197, 160, 89, 0.3);
}

.btn-outline-white {
    font-family: var(--font-body);
    font-weight: 500;
    background-color: transparent;
    color: #ffffff;
    padding: 12px 28px;
    border-radius: var(--border-radius);
    text-decoration: none;
    border: 2px solid #ffffff;
    cursor: pointer;
    display: inline-block;
    transition: var(--transition-smooth);
}

.btn-outline-white:hover {
    background-color: #ffffff;
    color: var(--color-primary);
    transform: translateY(-2px);
}

.card-btn {
    font-size: 9pt;
    padding: 10px 20px;
    text-decoration: none;
    display: inline-block;
    margin-top: auto;
    text-align: center;
}

.btn-dark-border {
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-dark-border:hover {
    background-color: var(--color-primary);
    color: #ffffff;
}

/* --- SECCIÓN 1: SOBRE LA PLATAFORMA --- */
.info-general-container {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.section-header-block {
    margin-bottom: 40px;
}

.section-header-block h2 {
    font-family: var(--font-titles);
    font-size: 2.5rem;
    color: var(--color-primary);
}

.section-subtitle {
    font-family: var(--font-body);
    color: var(--color-text-muted);
    max-width: 800px;
    margin: 15px auto 0;
    font-size: 1.05rem;
}

.info-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.info-card-item {
    background: var(--color-card-bg);
    padding: 35px 30px;
    border-radius: var(--border-radius);
    border-top: 4px solid var(--color-accent);
    box-shadow: var(--shadow-subtle);
    transition: var(--transition-smooth);
}

.info-card-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.info-card-item h4 {
    font-family: var(--font-titles);
    font-size: 1.35rem;
    margin-bottom: 12px;
    color: var(--color-primary);
}

.info-card-item p {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.section-divider {
    border: 0;
    height: 1px;
    background: #e2e8f0;
    max-width: 1100px;
    margin: 0 auto;
}

/* --- SECCIÓN 2: MARCO PROCESAL --- */
.marco-procesal-container {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.marco-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 50px;
    align-items: center;
}

.marco-text h2 {
    font-family: var(--font-titles);
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--color-primary);
}

.marco-description {
    font-family: var(--font-body);
    line-height: 1.7;
    color: var(--color-text-main);
    margin-bottom: 25px;
    font-size: 1.05rem;
}

.marco-bullet {
    background: #ffffff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: var(--shadow-subtle);
}

.marco-bullet h4 {
    font-family: var(--font-titles);
    font-size: 1.2rem;
    color: var(--color-accent);
    margin-bottom: 8px;
}

.marco-bullet p {
    font-family: var(--font-body);
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* --- TABLA CORPORATIVA (Dark Theme para Contraste) --- */
.tabla-contenedor-dark {
    background: var(--color-primary);
    color: #ffffff;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
}

.tabla-contenedor-dark h3 {
    font-family: var(--font-titles);
    font-size: 1.6rem;
    color: var(--color-accent);
    margin-bottom: 25px;
    text-align: center;
    letter-spacing: 0.5px;
}

.tabla-procesal {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.tabla-procesal th {
    padding: 12px;
    border-bottom: 2px solid var(--color-accent);
    color: var(--color-accent);
    text-align: left;
    font-weight: 600;
}

.tabla-procesal td {
    padding: 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    color: rgba(255, 255, 255, 0.9);
}

.tabla-procesal tr:last-child td {
    border-bottom: none;
}

.td-bold {
    font-weight: 600;
    color: #ffffff !important;
}

.tabla-footer-text {
    margin-top: 30px;
    text-align: center;
}

.tabla-footer-text p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* --- SECCIÓN 3: ROLES DE USUARIO --- */
.features-container {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-family: var(--font-titles);
    font-size: 2.5rem;
    color: var(--color-primary);
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.role-card {
    background: var(--color-card-bg);
    padding: 40px 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: var(--transition-smooth);
    border: 1px solid #e2e8f0;
}

.role-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
    border-color: rgba(197, 160, 89, 0.3);
}

.role-icon {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.role-card h3 {
    font-family: var(--font-titles);
    font-size: 1.5rem;
    color: var(--color-primary);
}

.role-card p {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 15px;
}

/* ==========================================================================
   ESTILOS COMPARTIDOS PARA CAPAS DE AUTENTICACIÓN (LOGIN / REGISTRO)
   ========================================================================== */

body.auth-body {
    background: linear-gradient(135deg, var(--color-primary), #1a2a3a);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.auth-box {
    background: #ffffff;
    color: var(--color-text-main);
    max-width: 500px; /* Ajustado a 500px para el formulario de registro */
    width: 100%;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    border: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.auth-box h2 {
    font-family: var(--font-titles);
    color: var(--color-primary);
    font-size: 1.9rem;
    margin-bottom: 8px;
    text-align: center;
}

.auth-box .subtitle {
    font-family: var(--font-body);
    color: var(--color-text-muted);
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.5;
    margin-bottom: 25px;
}

.auth-box .role-badge {
    display: block;
    text-align: center;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-accent);
    margin-bottom: 20px;
}

/* Alertas de Validación */
.alert-box {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    font-size: 0.88rem;
    margin-bottom: 18px;
    display: none;
    text-align: center;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-primary);
    display: block;
    margin-bottom: 6px;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-field {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    background-color: #f8fafc;
    color: var(--color-text-main);
    transition: var(--transition-smooth);
    box-sizing: border-box;
}

.password-wrapper .input-field {
    padding-right: 45px;
}

.input-field:focus {
    outline: none;
    border-color: var(--color-accent);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.15);
}

/* Bordes de validación dinámicos */
.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.input-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: var(--transition-smooth);
    user-select: none;
}

.toggle-password:hover {
    color: var(--color-primary);
    transform: scale(1.1);
}

/* Medidor de Fuerza de Contraseña */
.strength-bar-container {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    border-radius: 3px;
    width: 0%;
    transition: all 0.4s ease;
}

.strength-text {
    font-size: 0.75rem;
    margin-top: 4px;
    font-family: var(--font-body);
}

/* --- Lista de Requisitos Interactivos (Registro) --- */
.requirements-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
    font-family: var(--font-body);
    font-size: 0.8rem;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    transition: var(--transition-smooth);
}

.invalid {
    color: #ef4444;
}

.valid {
    color: #10b981;
    font-weight: 500;
}

.btn-auth-submit {
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
    margin-top: 10px;
}

.btn-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.auth-footer {
    margin-top: 20px;
    text-align: center;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.auth-footer a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.auth-footer a:hover {
    color: var(--color-accent-hover);
}

/* --- PIE DE PÁGINA (Footer general) --- */
footer {
    background-color: var(--color-primary);
    color: rgba(255, 255, 255, 0.7);
    padding: 30px 20px;
    text-align: center;
    font-family: var(--font-body);
    font-size: 0.85rem;
    border-top: 3px solid var(--color-accent);
}

footer p {
    margin-bottom: 6px;
}

/* ==========================================================================
   INTERFAZ DEL DASHBOARD (PANEL DE CONTROL CENTRALIZADO)
   ========================================================================== */

.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background-color: #f1f5f9; /* Fondo gris sutil para resaltar tarjetas */
}

/* --- BARRA LATERAL (Sidebar Fixed) --- */
.sidebar {
    width: 260px;
    background-color: var(--color-primary);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 25px 20px;
    position: fixed;
    height: 100vh;
    box-sizing: border-box;
    border-right: 2px solid rgba(197, 160, 89, 0.2);
}

.sidebar-brand {
    font-family: var(--font-titles);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 35px;
    letter-spacing: 0.5px;
}

.sidebar-brand span {
    color: var(--color-accent);
}

.sidebar-user-info {
    background: rgba(255, 255, 255, 0.04);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 25px;
    border-left: 3px solid var(--color-accent);
}

.sidebar-user-info h4 {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
}

.sidebar-user-info span {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    display: block;
    margin-top: 2px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.sidebar-menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: var(--transition-smooth);
}

.sidebar-menu-item a:hover,
.sidebar-menu-item.active a {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-menu-item.active a {
    border-right: 3px solid var(--color-accent);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #ef4444; /* Rojo de salida */
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

/* --- ÁREA DE CONTENIDO PRINCIPAL --- */
.dashboard-main {
    flex: 1;
    margin-left: 260px; /* Evita que el sidebar tape el contenido */
    padding: 40px;
    box-sizing: border-box;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 20px;
}

.dashboard-header h1 {
    font-family: var(--font-titles);
    font-size: 2.2rem;
    color: var(--color-primary);
}

.dashboard-header p {
    font-family: var(--font-body);
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* --- BLOQUES DINÁMICOS POR ROL --- */
.role-section-panel {
    display: none; /* Controlado dinámicamente mediante JavaScript */
}

.role-section-panel.active-view {
    display: block;
}

/* --- CUADRÍCULA DE TARJETAS INFORMATIVAS (KPIs) --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.kpi-card {
    background: #ffffff;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-subtle);
    border: 1px solid #e2e8f0;
}

.kpi-card .kpi-title {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-card .kpi-value {
    font-family: var(--font-titles);
    font-size: 2rem;
    color: var(--color-primary);
    margin: 10px 0 5px 0;
    font-weight: 700;
}

.kpi-card .kpi-desc {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: #10b981; /* Verde positivo por defecto */
}

/* --- TABLAS Y ACCIONES DEL PANEL --- */
.panel-card-container {
    background: #ffffff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-subtle);
    border: 1px solid #e2e8f0;
    padding: 30px;
    margin-bottom: 30px;
}

.panel-card-container h3 {
    font-family: var(--font-titles);
    color: var(--color-primary);
    font-size: 1.4rem;
    margin-bottom: 20px;
}

/* Reutilización y ajuste de tabla para fondo claro */
.tabla-panel-light {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
    font-size: 0.9rem;
}

.tabla-panel-light th {
    padding: 12px;
    background-color: #f8fafc;
    border-bottom: 2px solid var(--color-accent);
    color: var(--color-primary);
    text-align: left;
    font-weight: 600;
}

.tabla-panel-light td {
    padding: 14px 12px;
    border-bottom: 1px solid #e2e8f0;
    color: var(--color-text-main);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active { 
    background-color: #d1fae5; 
    color: #065f46; 
}

.status-badge.pending { 
    background-color: #fef3c7; 
    color: #92400e; 
}

/* Contenedor principal de la sección */
.contenedor-procedimientos {
    text-align: center;
    padding: 40px 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Grid para organizar las tarjetas de forma responsive */
.grid-tarjetas {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin-top: 30px;
}

/* Contenedor de la tarjeta individual (establece la perspectiva 3D) */
.flip-card {
    background-color: transparent;
    width: 300px;
    height: 350px;
    perspective: 1000px; /* Crea el espacio 3D */
}

/* El contenedor interior que girará */
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: left;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 10px;
}

/* Activación del giro con el efecto Hover pedido en la rúbrica */
.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

/* Estilos compartidos para la parte frontal y trasera */
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    border-radius: 10px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Diseño de la cara frontal */
.flip-card-front {
    background-color: #1e3a8a; /* Azul institucional, acorde a Derecho */
    color: white;
    text-align: center;
    align-items: center;
}

.flip-card-front h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* Diseño de la cara trasera */
.flip-card-back {
    background-color: #f8fafc;
    color: #333;
    transform: rotateY(180deg);
    border: 2px solid #1e3a8a;
}

.flip-card-back h4 {
    color: #1e3a8a;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

.flip-card-back p, .flip-card-back ul {
    font-size: 0.9rem;
    line-height: 1.5;
}

.flip-card-back ul {
    padding-left: 20px;
    margin-top: 10px;
}

/* ==========================================================================
   INTERFAZ DEL TEST Y EVALUACIONES (test.html)
   ========================================================================== */

.test-layout {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 20px;
}

.test-header {
    background: var(--color-primary);
    color: #fff;
    padding: 30px 35px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.test-header h1 {
    font-family: var(--font-titles);
    font-size: 1.6rem;
    color: var(--color-accent);
}

.test-header p {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    margin-top: 4px;
}

.progress-info { text-align: right; }

.progress-info span {
    font-family: var(--font-titles);
    font-size: 2rem;
    color: var(--color-accent);
}

.progress-bar-wrap {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    height: 8px;
    margin-top: 8px;
    width: 200px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    background: var(--color-accent);
    transition: width 0.5s ease;
}

.selector-container {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 35px;
    box-shadow: var(--shadow-subtle);
    border: 1px solid #e2e8f0;
    text-align: center;
}

.selector-container h2 {
    font-family: var(--font-titles);
    font-size: 1.8rem;
    color: var(--color-primary);
    margin-bottom: 10px;
}

.selector-container p {
    font-family: var(--font-body);
    color: var(--color-text-muted);
    margin-bottom: 30px;
}

.procedimientos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.proc-btn {
    padding: 20px 15px;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    background: #f8fafc;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
    transition: var(--transition-smooth);
    text-align: center;
}

.proc-btn:hover, .proc-btn.selected {
    border-color: var(--color-accent);
    background: #fffbf0;
    color: var(--color-accent);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(197,160,89,0.2);
}

.proc-btn .proc-icon { font-size: 1.8rem; display: block; margin-bottom: 8px; }

.question-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 35px;
    box-shadow: var(--shadow-subtle);
    border: 1px solid #e2e8f0;
    display: none;
}

.question-card.active { display: block; }

.question-number {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.question-text {
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--color-text-main);
    line-height: 1.7;
    margin-bottom: 25px;
    font-weight: 500;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    background: #f8fafc;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text-main);
    text-align: left;
    transition: var(--transition-smooth);
    line-height: 1.5;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--color-accent);
    background: #fffbf0;
}

.option-btn .opt-letter {
    font-weight: 700;
    color: var(--color-accent);
    min-width: 22px;
    font-size: 1rem;
}

.option-btn.correct { border-color: #10b981; background: #f0fdf4; color: #065f46; }
.option-btn.correct .opt-letter { color: #10b981; }
.option-btn.wrong { border-color: #ef4444; background: #fef2f2; color: #b91c1c; }
.option-btn.wrong .opt-letter { color: #ef4444; }
.option-btn:disabled { cursor: default; }

.feedback-box {
    margin-top: 20px;
    padding: 18px 20px;
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.6;
    display: none;
}

.feedback-box.show { display: block; }
.feedback-correct { background: #f0fdf4; border-left: 4px solid #10b981; color: #065f46; }
.feedback-wrong { background: #fef2f2; border-left: 4px solid #ef4444; color: #7f1d1d; }
.feedback-box strong { display: block; margin-bottom: 6px; font-size: 1rem; }

.next-btn-wrap { margin-top: 25px; text-align: right; }

.results-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 50px 40px;
    box-shadow: var(--shadow-subtle);
    border: 1px solid #e2e8f0;
    text-align: center;
    display: none;
}

.results-card.show { display: block; }

.results-score {
    font-family: var(--font-titles);
    font-size: 4rem;
    color: var(--color-primary);
    margin: 20px 0 5px;
}

.results-score span { color: var(--color-accent); }

.results-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.badge-excelente { background: #d1fae5; color: #065f46; }
.badge-bueno { background: #dbeafe; color: #1e40af; }
.badge-regular { background: #fef3c7; color: #92400e; }
.badge-insuficiente { background: #fef2f2; color: #b91c1c; }

.results-detail {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 25px 0 35px;
    flex-wrap: wrap;
}

.result-item { text-align: center; }

.result-item .ri-val {
    font-family: var(--font-titles);
    font-size: 1.8rem;
    font-weight: 700;
}

.result-item .ri-label {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.loading-box {
    text-align: center;
    padding: 60px;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-subtle);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin { to { transform: rotate(360deg); } }
/* ==========================================================================
   INTERFAZ DE RECUPERACIÓN DE CONTRASEÑA
   ========================================================================== */
.recovery-result-box {
    margin-top: 25px;
    padding: 20px;
    background: #f0fdf4;
    border: 2px dashed #10b981;
    border-radius: var(--border-radius);
    text-align: center;
}

.recovery-success-text {
    color: #065f46;
    font-family: var(--font-body);
    font-size: 1rem;
}

.recovery-temp-password {
    font-family: monospace;
    font-size: 1.8rem;
    letter-spacing: 2px;
    color: #1e3a8a;
    font-weight: bold;
    margin: 15px 0;
}

.recovery-hint {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.recovery-login-btn {
    display: inline-block;
    margin-top: 15px;
    text-decoration: none;
}
/* =========================================
   ALERTAS PARA RECUPERACIÓN DE CONTRASEÑA
   ========================================= */
.alert-box { 
    padding: 12px; 
    border-radius: var(--border-radius, 8px); 
    margin-bottom: 15px; 
    display: none; 
    text-align: center; 
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.9rem;
}
.alert-error { 
    background: #fef2f2; 
    color: #b91c1c; 
    border: 1px solid #fecaca; 
}
.alert-success { 
    background: #f0fdf4; 
    color: #166534; 
    border: 1px solid #bbf7d0; 
}
.btn-loading { 
    opacity: 0.7; 
    cursor: not-allowed; 
}
/* ==========================================
   ESTILOS PARA CELULARES (Pantallas de 768px o menos)
   ========================================== */
@media (max-width: 768px) {
    
    /* Tu barra de navegación: en vez de estar de lado, que los enlaces se pongan abajo */
    .navbar {
        flex-direction: column;
        text-align: center;
        padding: 15px;
        gap: 10px;
    }
    
    .nav-links {
        justify-content: center;
    }

    /* Tu contenedor principal: dale un poco más de espacio a los lados en el celular */
    .auth-container {
        padding: 10px;
    }

    .auth-box {
        padding: 20px; /* Menos espacio interno para que quepa más texto */
        border-radius: 8px; /* Bordes un poco más sutiles en pantallas chicas */
    }

    /* Si tienes textos muy grandes (títulos), bájales un poco el tamaño en celulares */
    h2 {
        font-size: 1.8rem;
    }
    
    /* Tablas del Administrador: para que no se corten en el celular */
    table {
        display: block;
        overflow-x: auto; /* Crea una barra de desplazamiento interna SOLO para la tabla si no cabe */
        white-space: nowrap;
    }
}

/* ==========================================
   ESTILOS PARA TABLETS (Pantallas entre 769px y 1024px)
   ========================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .auth-box {
        max-width: 80%; /* Que ocupe un poco más de espacio balanceado en tablets */
    }
}
/* ==========================================
   TARJETA MÓDULO INFORMATIVO (DASHBOARD)
   ========================================== */
.card-informativa {
    border-left: 4px solid var(--color-accent);
    background-color: #1e293b; /* Usa el fondo oscuro de tus tarjetas */
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.card-titulo {
    color: white;
    margin-top: 0;
    margin-bottom: 10px;
}

.card-texto {
    color: #94a3b8; /* Color de texto secundario/mutado */
    margin-bottom: 15px;
}

.btn-modulo {
    display: inline-block;
    text-decoration: none;
    margin-top: 10px;
}

/* ==========================================
   AJUSTES RESPONSIVOS GENERALES (CELULARES)
   ========================================== */
@media (max-width: 768px) {

    
    /* 1. Evitar el scroll horizontal (la franja blanca a la derecha) */
    html, body {
        overflow-x: hidden;
        width: 100%;
    }

    /* 2. Arreglar la barra de navegación para que no se desborde */
    .navbar {
        flex-direction: column; /* Pone el logo arriba y los links abajo */
        padding: 15px 10px;
        height: auto;
        text-align: center;
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap; /* Si los botones no caben, bajan a otra línea automáticamente */
        justify-content: center;
        gap: 10px;
        margin-top: 15px;
        width: 100%;
    }

    /* Achicamos un poco los botones del menú para que quepan mejor */
    .nav-link-item, .nav-links a {
        font-size: 0.85rem;
        padding: 5px 10px;
    }

    /* 3. Achicar los textos gigantes (como el de "Entorno Digital...") */
    h1 {
        font-size: 2.2rem !important; 
        line-height: 1.2;
        word-wrap: break-word; 
    }
    
    p {
        font-size: 0.95rem;
        padding: 0 10px; /* Le da un poco de respiro a los textos a los lados */
    }
    
    /* 4. Ajustar los contenedores para que no queden pegados a los bordes */
    .features-container, .hero-container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    /* ==========================================
       AJUSTES PARA EL DASHBOARD EN CELULAR
       ========================================== */
    .dashboard-layout {
        display: flex;
        flex-direction: column !important; /* Apila el menú arriba y el contenido abajo */
    }

    .sidebar {
        width: 100% !important; /* El menú toma todo el ancho de la pantalla */
        min-height: auto !important; /* Deja de forzar la altura completa */
        position: relative !important; /* Evita que se quede fijo sobreponiéndose a otras cosas */
    }

    .dashboard-main {
        width: 100% !important;
        margin-left: 0 !important; /* Elimina cualquier margen izquierdo que dejaba espacio para el menú */
        padding: 15px !important; /* Un poco de respiro a los lados */
        box-sizing: border-box;
    }
}
/* ==========================================================================
   UTILIDADES GENERALES DEL PANEL ADMIN
   ========================================================================== */

.hidden {
    display: none !important;
}

.mb-15 {
    margin-bottom: 15px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Encabezado de sección con título + buscador/acción a la derecha */
.header-acciones {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.header-acciones h2 {
    font-family: var(--font-titles);
    font-size: 1.5rem;
    color: var(--color-accent);
    letter-spacing: 0.5px;
}

/* --- CAMPO DE BÚSQUEDA (sobre fondo oscuro tabla-contenedor-dark) --- */
.input-buscador {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--border-radius);
    padding: 10px 16px;
    min-width: 240px;
    outline: none;
    transition: var(--transition-smooth);
}

.input-buscador::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-buscador:focus {
    border-color: var(--color-accent);
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.15);
}

/* Tabla a ancho completo dentro del contenedor dark */
.tabla-full {
    width: 100%;
}

/* Badge numérico de solicitudes pendientes, sobre botón outline */
#btn-abrir-solicitudes {
    position: relative;
}

.badge-contador {
    background-color: #f97316;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 7px;
    margin-left: 8px;
    display: none;
}

/* ==========================================================================
   MODAL DE GESTIÓN DE USUARIO (CRUD Admin)
   ========================================================================== */

.modal-overlay-cogep {
    display: none; /* Controlado por JS: flex al abrir */
    position: fixed;
    inset: 0;
    background-color: rgba(17, 27, 36, 0.65);
    backdrop-filter: blur(2px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-box-cogep {
    background-color: var(--color-card-bg);
    width: 100%;
    max-width: 460px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    animation: modalAparece 0.25s ease;
}

@keyframes modalAparece {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header-cogep {
    background-color: var(--color-primary);
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--color-accent);
}

.modal-header-cogep h3 {
    font-family: var(--font-titles);
    color: var(--color-accent);
    font-size: 1.2rem;
    letter-spacing: 0.3px;
}

.btn-cerrar-modal-cogep {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
    transition: var(--transition-smooth);
}

.btn-cerrar-modal-cogep:hover {
    opacity: 1;
    color: var(--color-accent);
}

.modal-body-cogep {
    padding: 25px;
    max-height: 70vh;
    overflow-y: auto;
}

.campo-form-cogep {
    margin-bottom: 18px;
}

.campo-form-cogep label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}

.campo-form-cogep input,
.campo-form-cogep select {
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text-main);
    background-color: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    padding: 11px 14px;
    outline: none;
    transition: var(--transition-smooth);
}

.campo-form-cogep input:focus,
.campo-form-cogep select:focus {
    border-color: var(--color-accent);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.15);
}

.campo-form-cogep small {
    display: block;
    margin-top: 5px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.modal-footer-cogep {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 25px;
    border-top: 1px solid #e2e8f0;
}

.modal-footer-cogep .btn-gold,
.modal-footer-cogep .btn-dark-border {
    padding: 11px 24px;
    font-size: 0.9rem;
}

/* ==========================================================================
   PANEL ESTUDIANTE: SIMULADOR DE PLAZOS Y CALIFICACIONES
   ========================================================================== */

.kpi-desc-text {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 8px;
    line-height: 1.5;
}

.simulador-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    align-items: start;
}

.resultado-simulador-box {
    margin-top: 22px;
    background-color: #fffbf0;
    border-left: 4px solid var(--color-accent);
    border-radius: var(--border-radius);
    padding: 16px 20px;
}

.resultado-simulador-box p {
    font-family: var(--font-body);
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Ocultar elementos móviles en computadora */
.btn-menu-movil, .overlay-movil {
    display: none;
}
/* ==========================================================================
   MOSAICO DE HERRAMIENTAS - PANEL ESTUDIANTE (dashboard)
   ========================================================================== */

.herramientas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.herramienta-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    border-radius: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    font-family: var(--font-body);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: none;
    width: 100%;
    box-sizing: border-box;
}

.herramienta-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

/* Módulo Informativo — dorado/destacado */
.herramienta-primary {
    background: linear-gradient(135deg, #1e293b 0%, #263044 100%);
    border-color: var(--color-accent);
    grid-column: span 2;
}

/* Test / Evaluación */
.herramienta-secondary {
    background-color: #1e293b;
    border-color: #334155;
}

.herramienta-secondary:hover {
    border-color: #10b981;
}

/* Sala Virtual — rojo vivo */
.herramienta-live {
    background-color: #1e293b;
    border-color: #ef4444;
}

.herramienta-live:hover {
    border-color: #ef4444;
    box-shadow: 0 8px 24px rgba(239,68,68,0.2);
}

/* Simulador */
.herramienta-tool {
    background-color: #1e293b;
    border-color: #334155;
}

.herramienta-tool:hover {
    border-color: var(--color-accent);
}

.herramienta-icono-wrap {
    font-size: 2rem;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255,255,255,0.05);
    border-radius: 12px;
}

.herramienta-primary .herramienta-icono-wrap {
    background-color: rgba(197,160,89,0.15);
}

.herramienta-info {
    flex: 1;
}

.herramienta-info h3 {
    font-family: var(--font-titles);
    color: #f8fafc;
    font-size: 1rem;
    margin-bottom: 4px;
}

.herramienta-primary .herramienta-info h3 {
    color: var(--color-accent);
}

.herramienta-info p {
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.4;
    margin: 0;
}

.herramienta-flecha {
    color: #64748b;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: color 0.2s, transform 0.2s;
}

.herramienta-card:hover .herramienta-flecha {
    color: var(--color-accent);
    transform: translateX(3px);
}

.herramienta-badge-live {
    flex-shrink: 0;
    background-color: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 999px;
    animation: pulseLive 2s infinite;
}

@keyframes pulseLive {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Panel colapsable del simulador */
.simulador-panel-colapsable {
    background-color: #1e293b;
    border: 1px solid var(--color-accent);
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 20px;
}

.simulador-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.simulador-panel-header h3 {
    font-family: var(--font-titles);
    color: var(--color-accent);
    font-size: 1.2rem;
}

.btn-cerrar-simulador {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.btn-cerrar-simulador:hover {
    color: #ef4444;
    background-color: rgba(239,68,68,0.1);
}

@media (max-width: 600px) {
    .herramientas-grid {
        grid-template-columns: 1fr;
    }
    .herramienta-primary {
        grid-column: span 1;
    }
}