@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ============================================================
   CAMPUS — Azul Nocturno
   Paleta: navy profundo + azul eléctrico + ámbar cálido
   Font:   Plus Jakarta Sans
   ============================================================ */

:root {
    /* Acento principal */
    --azul:          #3b82f6;
    --azul-claro:    #60a5fa;
    --azul-bright:   #5590f8;

    /* Ámbar como acento secundario (reemplaza naranja) */
    --naranja:       #f59e0b;
    --naranja-claro: #fbbf24;

    /* Texto — light sobre dark */
    --azul-oscuro:   #dceeff;   /* headings principales */
    --azul-profundo: #8ab0cc;   /* texto body */

    /* Superficies dark */
    --neutro:        #0c1826;   /* superficie sutil / fondos de inputs */
    --blanco:        #0b1a31;   /* cards, modales */

    /* Semánticos */
    --success:       #34d399;
    --error:         #f87171;
    --gray:          #4a6a8a;

    /* Sombras */
    --sombra:         0 4px 20px rgba(0,0,0,.4);
    --sombra-intensa: 0 10px 32px rgba(0,0,0,.55);

    /* Bordes */
    --border:        rgba(59,130,246,.14);
    --border-hover:  rgba(59,130,246,.28);

    --radio: 14px;
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow-x: hidden; }

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    background: #060d1a;
    background-image:
        radial-gradient(ellipse 1400px 900px at 80% 5%,  rgba(59,130,246,.07) 0%, transparent 60%),
        radial-gradient(ellipse 900px 700px  at 5%  85%, rgba(59,130,246,.05) 0%, transparent 55%);
    min-height: 100vh;
    color: var(--azul-profundo);
    line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 15px 20px 5px; min-height: calc(100vh - 10px); }

/* ── Card base ── */
.card {
    background: var(--blanco);
    border: 1px solid var(--border);
    border-radius: var(--radio);
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: var(--sombra);
    margin-bottom: 20px;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sombra-intensa);
    border-color: var(--border-hover);
}

/* ── Botones ── */
.btn {
    border: none; padding: 8px 16px; border-radius: 20px; font-weight: 700;
    cursor: pointer; transition: all 0.3s ease; display: inline-flex;
    align-items: center; gap: 6px; text-decoration: none; font-size: 13px;
    white-space: nowrap; font-family: inherit;
}
.btn:hover { transform: scale(1.05); }
.btn-primary  { background: linear-gradient(135deg, #3b7cf4, #2860c4); color: white;
                box-shadow: 0 4px 16px rgba(59,130,246,.3); }
.btn-secondary{ background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.28);
                color: var(--azul-claro); }
.btn-success  { background: linear-gradient(to right, #25D366, #128C7E); color: white; }
.btn-error    { background: rgba(248,113,113,.15); border: 1px solid rgba(248,113,113,.25);
                color: var(--error); }
.btn-small    { padding: 6px 12px; font-size: 11px; }

/* ── Header del dashboard ── */
.header-container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; }
.school-brand { display: flex; align-items: center; gap: 15px; flex: 1; min-width: 250px; }
.school-logo {
    width: 50px; height: 50px; object-fit: contain; border-radius: 12px;
    background: linear-gradient(135deg, rgba(59,130,246,.2), rgba(245,158,11,.14));
    padding: 6px; border: 1px solid rgba(59,130,246,.2);
}
.school-name { color: var(--azul-oscuro); font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.user-welcome { text-align: right; flex: 1; min-width: 180px; }
.user-welcome h2 { color: var(--azul-oscuro); margin-bottom: 5px; font-size: 16px; font-weight: 700; }
.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; background: rgba(52,211,153,.12);
    border: 1px solid rgba(52,211,153,.22); color: var(--success);
    border-radius: 20px; font-size: 10px; font-weight: 700;
    letter-spacing: .3px; margin-bottom: 8px;
}
.status-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--success); }

/* ── Dashboard layout ── */
.dashboard { max-height: calc(100vh - 30px); overflow-y: auto; margin-bottom: 5px; }
.back-btn { margin-bottom: 15px; }
.grid { display: grid; gap: 20px; margin-bottom: 30px; }
.grid-cursos  { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-modulos { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ── Tarjetas de curso ── */
.curso-card, .module-card {
    cursor: pointer;
    border: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; height: 100%; position: relative;
    transition: all .3s ease;
}
.curso-card:hover, .module-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 32px rgba(0,0,0,.5), 0 0 0 1px rgba(59,130,246,.15);
    transform: translateY(-2px);
}
.curso-notification-bell {
    position: absolute; top: 10px; right: 10px;
    background: var(--naranja); color: white;
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; box-shadow: 0 2px 10px rgba(245,158,11,.5);
    animation: bellRing 2s infinite; z-index: 10;
}
@keyframes bellRing {
    0%,100% { transform: rotate(0); }
    10%,30%  { transform: rotate(10deg); }
    20%,40%  { transform: rotate(-10deg); }
    50%      { transform: rotate(0); }
}
.curso-disponible-card {
    cursor: pointer;
    border: 1px solid rgba(52,211,153,.18);
    border-left: 1px solid rgba(52,211,153,.18);
    border-right: 1px solid rgba(52,211,153,.18);
    display: flex; flex-direction: column; height: 100%;
    transition: all .3s ease;
}
.curso-disponible-card:hover {
    border-color: rgba(52,211,153,.35);
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    transform: translateY(-2px);
}
.curso-imagen, .module-imagen {
    width: 100%; height: 160px;
    background: linear-gradient(135deg, #071a3a 0%, #0d2e6a 55%, #1040a0 100%);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 50px; overflow: hidden; position: relative;
    border-radius: 10px; margin-bottom: 15px;
}
.curso-imagen img, .module-imagen img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; border-radius: 10px;
}
.curso-card:hover .curso-imagen img,
.module-card:hover .module-imagen img,
.curso-disponible-card:hover .curso-imagen img { transform: scale(1.05); }

.curso-titulo, .module-titulo {
    font-size: 16px; font-weight: 700; color: var(--azul-oscuro);
    margin-bottom: 8px; text-align: center;
    border-bottom: 2px solid rgba(59,130,246,.25);
    padding-bottom: 8px; word-wrap: break-word;
}
.curso-disponible-titulo {
    font-size: 16px; font-weight: 700; color: var(--success);
    margin-bottom: 8px; text-align: center;
    border-bottom: 2px solid rgba(52,211,153,.25);
    padding-bottom: 8px; word-wrap: break-word;
}
.curso-content { padding: 0; flex: 1; display: flex; flex-direction: column; }
.curso-grupo { color: var(--gray); font-size: 13px; margin-bottom: 8px; text-align: center; font-weight: 500; }
.btn-acceder { width: 100%; margin-top: auto; }
.btn-inscribirme {
    width: 100%; margin-top: auto;
    background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.28);
    color: var(--success); border-radius: 20px;
}
.btn-inscribirme:hover { background: rgba(52,211,153,.22); }

/* ── Títulos de sección ── */
.section-title {
    color: var(--azul-oscuro); font-size: 22px; font-weight: 800;
    margin: 30px 0 6px 0; padding-bottom: 0;
    border-bottom: none;
    letter-spacing: -.4px;
    display: flex; align-items: center; gap: 14px;
}
.section-title::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, rgba(59,130,246,.4), transparent);
}
.section-subtitle {
    color: var(--gray); font-size: 13px; font-weight: 500;
    margin-bottom: 20px; text-align: center;
}

/* ── Modal de preview de curso disponible ── */
.curso-preview-container {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.85); z-index: 10000;
    justify-content: center; align-items: center; padding: 20px;
}
.curso-preview-content {
    background: var(--blanco); border: 1px solid var(--border);
    border-radius: 16px; padding: 25px; width: 100%; max-width: 600px;
    max-height: 90vh; overflow-y: auto; position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,.6);
}
.preview-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.preview-title { color: var(--azul-oscuro); font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -.3px; }
.close-preview { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); font-size: 18px; cursor: pointer; color: var(--gray); padding: 6px 10px; border-radius: 8px; }
.close-preview:hover { color: var(--azul-oscuro); background: rgba(255,255,255,.1); }
.preview-image { width: 100%; height: 200px; object-fit: cover; border-radius: 10px; margin-bottom: 15px; }
.preview-description { color: var(--azul-profundo); line-height: 1.6; margin-bottom: 20px; }
.preview-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── Barras de progreso ── */
.progress-container { margin: 12px 0; padding: 8px; background: var(--neutro); border-radius: 8px; }
.progress-bar-container {
    background: rgba(255,255,255,.06); border-radius: 8px; height: 6px;
    overflow: hidden; margin-bottom: 4px; position: relative;
}
.progress-bar {
    background: linear-gradient(90deg, var(--azul), var(--azul-claro));
    height: 100%; transition: width 0.5s ease; border-radius: 8px;
    position: absolute; left: 0; top: 0;
    box-shadow: 0 0 8px rgba(59,130,246,.5);
}
.progress-text  { text-align: center; font-size: 11px; color: var(--gray); font-weight: 700; }
.progress-label { font-size: 11px; color: var(--gray); margin-bottom: 4px; text-align: center; font-weight: 600; }

/* ── Acordeón de lecciones ── */
.lesson-accordion {
    background: var(--blanco); border-radius: 12px; margin-bottom: 12px;
    overflow: hidden; box-shadow: var(--sombra); border: 1px solid var(--border);
}
.lesson-accordion.active {
    border-color: rgba(59,130,246,.28);
    box-shadow: 0 4px 20px rgba(59,130,246,.12);
}
.lesson-header {
    display: flex; align-items: flex-start; padding: 16px; cursor: pointer;
    background: var(--blanco); transition: background 0.3s ease; position: relative;
}
.lesson-header:hover { background: rgba(59,130,246,.05); }
.lesson-accordion.active .lesson-header { background: rgba(59,130,246,.07); }
.lesson-number-container { display: flex; align-items: flex-start; gap: 12px; margin-right: 12px; flex-shrink: 0; }
.lesson-number {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--azul); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
.lesson-accordion.completed .lesson-number { background: var(--success); }
.lesson-arrow {
    width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
    transition: transform 0.3s ease; color: var(--gray);
}
.lesson-accordion.active .lesson-arrow { transform: rotate(180deg); color: var(--azul); }

.lesson-thumbnail {
    width: 120px; height: 70px; border-radius: 8px; overflow: hidden;
    flex-shrink: 0; background: rgba(255,255,255,.06); display: flex;
    align-items: center; justify-content: center; position: relative;
    cursor: pointer; margin-right: 12px; border: 1px solid var(--border);
}
.lesson-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.lesson-thumbnail .play-icon {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    background: rgba(0,0,0,.75); border-radius: 50%; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center; color: white;
    font-size: 12px; opacity: 0; transition: opacity 0.3s;
}
.lesson-thumbnail:hover .play-icon { opacity: 1; }

.lesson-main-content { flex: 1; display: flex; flex-direction: column; align-items: center; }
.lesson-title { font-weight: 600; color: var(--azul-oscuro); font-size: 15px; text-align: center; margin-bottom: 8px; width: 100%; }
.lesson-accordion.completed .lesson-title { text-decoration: line-through; color: var(--gray); }
.lesson-description {
    color: var(--azul-profundo); font-size: 14px; line-height: 1.5;
    text-align: center; margin-bottom: 12px; width: 100%;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Calificaciones / estrellas ── */
.calificacion-container { display: flex; flex-direction: column; align-items: center; margin: 8px 0; width: 100%; }
.calificacion-estrellas { display: flex; gap: 4px; margin-bottom: 4px; }
.estrella { font-size: 18px; color: rgba(255,255,255,.15); transition: color 0.3s ease; }
.estrella.activa { color: var(--naranja); }
.calificacion-texto { font-size: 12px; font-weight: 600; color: var(--azul-oscuro); text-align: center; }
.calificacion-valor { color: var(--naranja); font-weight: 700; }
.certificado-estrellas { display: flex; gap: 4px; justify-content: center; }
.certificado-texto { font-size: 11px; font-weight: 600; color: var(--success); text-align: center; margin-top: 4px; }

/* ── Botones rápidos de lección ── */
.lesson-quick-actions { display: flex; gap: 6px; margin-top: 8px; justify-content: center; flex-wrap: wrap; }
.quick-action-btn {
    background: rgba(59,130,246,.14); color: var(--azul-claro);
    border: 1px solid rgba(59,130,246,.25); padding: 6px 10px;
    border-radius: 10px; font-size: 15px; cursor: pointer;
    transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 4px;
}
.quick-action-btn:hover { transform: scale(1.08); background: rgba(59,130,246,.24); border-color: rgba(59,130,246,.4); }
.quick-action-btn.certificado { background: rgba(52,211,153,.12); color: var(--success); border-color: rgba(52,211,153,.25); }
.quick-action-btn.certificado:hover { background: rgba(52,211,153,.22); }
.quick-action-btn.encuesta { background: rgba(245,158,11,.12); color: var(--naranja); border-color: rgba(245,158,11,.25); }
.quick-action-btn.encuesta:hover { background: rgba(245,158,11,.22); }
.quick-action-btn .btn-text { font-size: 12px; font-weight: 600; }

.vista-button-container { display: flex; justify-content: center; width: 100%; margin-top: 8px; }
.btn-vista {
    background: rgba(59,130,246,.14); color: var(--azul-claro);
    border: 1px solid rgba(59,130,246,.25); padding: 6px 14px;
    border-radius: 20px; font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all 0.3s ease; white-space: nowrap; font-family: inherit;
}
.btn-vista:hover { background: rgba(59,130,246,.24); transform: scale(1.05); }
.btn-vista.completed { background: rgba(52,211,153,.12); color: var(--success); border-color: rgba(52,211,153,.25); }

/* ── Contenido expandido de lección ── */
.lesson-content {
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: rgba(59,130,246,.04);
}
.lesson-accordion.active .lesson-content { max-height: 1000px; padding: 0 16px 16px; }
.reproductor-unico { margin-top: 24px; }
.reproductor-unico:empty { display: none; }
.reproductor-header { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 4px; }
.reproductor-numero {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
    background: rgba(245,158,11,.15); border: 1px solid rgba(245,158,11,.35);
    color: var(--naranja-claro); font-weight: 800; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
}
.reproductor-titulo { color: var(--azul-oscuro); font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.reproductor-descripcion { color: var(--azul-profundo); font-size: 13px; line-height: 1.5; }
.lesson-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-start; margin-top: 16px; }
.lesson-actions .btn { margin: 0; }

/* ── Video player ── */
.player-container {
    width: 100%; max-width: 800px;
    background: var(--blanco); border-radius: 15px; padding: 15px;
    box-shadow: 0 12px 40px rgba(0,0,0,.5); position: relative;
    margin: 12px 0; display: none;
    border: 1px solid var(--border);
}
.video-container {
    position: relative; width: 100%;
    background: #000; border-radius: 10px 10px 0 0;
    overflow: hidden; display: flex; justify-content: center; align-items: center;
    border: 1px solid rgba(59,130,246,.2);
}
.video-container div[id^="player-"] { width: 100% !important; aspect-ratio: 16/9; height: auto !important; max-height: 450px; }
.overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; cursor: pointer; }
.subtitulo-overlay {
    position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
    max-width: 85%; display: none; align-items: center; justify-content: center;
    background: rgba(0,0,0,.72); color: #fff; padding: 6px 16px;
    border-radius: 6px; font-size: 16px; line-height: 1.35; text-align: center;
    pointer-events: none; z-index: 15;
}
.video-controls button.active {
    background: var(--azul); color: #fff; border-color: var(--azul);
}
.corner-box {
    position: absolute; bottom: 10px; right: 10px; width: 100px; height: 40px;
    background: rgba(11,26,49,.92); border-radius: 8px;
    display: flex; justify-content: center; align-items: center;
    font-size: 24px; z-index: 20; pointer-events: none; color: var(--azul-claro);
    backdrop-filter: blur(8px); padding: 5px;
    border: 1px solid rgba(59,130,246,.25);
}
.corner-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.exit-fullscreen {
    position: absolute; top: 10px; right: 10px; width: 50px; height: 50px;
    background: var(--blanco); border-radius: 8px; display: none;
    justify-content: center; align-items: center; font-size: 20px; z-index: 30;
    cursor: pointer; color: var(--azul-claro); font-weight: bold;
    border: 1px solid var(--border);
}

.controls-panel {
    background: var(--blanco); padding: 15px; border-radius: 0 0 10px 10px;
    margin-top: 0; transition: opacity 0.3s ease; opacity: 1; z-index: 20;
    border-top: 1px solid var(--border);
}
:-webkit-full-screen .controls-panel,
:-moz-full-screen .controls-panel,
:fullscreen .controls-panel {
    position: absolute !important; bottom: 0 !important; left: 0 !important; right: 0 !important;
    width: 100% !important; background: rgba(0,0,0,.88) !important; backdrop-filter: blur(8px);
    opacity: 0; visibility: hidden; transform: translateY(100%);
    transition: all 0.3s ease; z-index: 40; padding: 20px !important; border-radius: 0 !important;
}
:fullscreen .controls-panel.show-controls { opacity: 1 !important; visibility: visible !important; transform: translateY(0) !important; }
:fullscreen .video-container { border-radius: 0 !important; border: none !important; flex: 1 !important; }
:fullscreen .video-container div[id^="player-"] { max-height: 100% !important; }
:fullscreen .player-container { display: flex !important; flex-direction: column !important; height: 100% !important; max-width: 100% !important; padding: 0 !important; border-radius: 0 !important; border: none !important; }

.progress-row { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.progress-container-player {
    flex: 1; height: 20px; background: rgba(255,255,255,.06);
    border-radius: 10px; position: relative; cursor: pointer; z-index: 15;
}
.progress-player {
    height: 100%; background: var(--azul); border-radius: 10px;
    width: 0%; position: absolute; left: 0; top: 0;
    box-shadow: 0 0 8px rgba(59,130,246,.5);
}
.thumb {
    position: absolute; top: 50%; transform: translate(-50%,-50%);
    width: 20px; height: 20px; background: var(--azul-oscuro);
    border-radius: 50%; cursor: pointer; z-index: 25;
    box-shadow: 0 2px 6px rgba(0,0,0,.5); left: 0;
    border: 2px solid var(--azul);
}
.time-display { color: var(--azul-claro); font-size: 14px; font-weight: 700; min-width: 100px; text-align: center; font-family: monospace; }
:fullscreen .time-display { color: white; }
.video-controls { display: flex; justify-content: center; gap: 15px; z-index: 30; position: relative; }
.video-controls button {
    background: rgba(59,130,246,.12); color: var(--azul-claro);
    border: 1px solid rgba(59,130,246,.28); padding: 10px 20px;
    border-radius: 10px; font-size: 14px; font-weight: 700;
    cursor: pointer; transition: all 0.3s; flex: 1; max-width: 200px; font-family: inherit;
}
.video-controls button:hover { background: rgba(59,130,246,.22); color: var(--azul-oscuro); }

/* ── Botones de cabecera de curso ── */
.course-buttons, .module-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 15px; }
.course-buttons .btn, .module-buttons .btn { margin: 0; }
.course-header-buttons { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; }
.course-header-btn {
    display: flex; align-items: center; gap: 8px; padding: 8px 16px;
    background: rgba(59,130,246,.1); color: var(--azul-claro);
    border: 1px solid rgba(59,130,246,.28); border-radius: 20px;
    font-weight: 600; cursor: pointer; transition: all 0.3s ease;
    text-decoration: none; font-size: 13px; font-family: inherit;
}
.course-header-btn:hover {
    background: rgba(59,130,246,.22); color: var(--azul-oscuro);
    transform: scale(1.03); border-color: rgba(59,130,246,.45);
}
.course-header-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* ── Info de curso ── */
.course-info-text {
    margin-top: 15px; padding: 14px; background: var(--neutro);
    border-radius: 10px; border-left: 3px solid var(--azul);
}
.course-info-item { margin-bottom: 10px; display: flex; align-items: flex-start; gap: 10px; }
.course-info-item:last-child { margin-bottom: 0; }
.course-info-icon { font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.course-info-content { flex: 1; }
.course-info-label { font-weight: 700; color: var(--azul-oscuro); font-size: 13px; margin-bottom: 4px; }
.course-info-value { color: var(--azul-profundo); font-size: 14px; line-height: 1.4; }
.course-info-value a { color: var(--azul-claro); text-decoration: none; }
.course-info-value a:hover { text-decoration: underline; }

/* ── Cabecera expandida de módulo (dentro del acordeón) ── */
.module-header-expanded { display: none; }
.module-title-section { text-align: center; margin-bottom: 15px; }
.module-title-section h2  { color: var(--azul-oscuro); font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.module-content { display: flex; gap: 20px; align-items: flex-start; }
.module-image-container { flex: 0 0 150px; }
.module-header-image { width: 100%; max-height: 120px; object-fit: cover; border-radius: 12px; }
.module-info { flex: 1; }
.module-description { color: var(--azul-profundo); line-height: 1.5; margin-bottom: 12px; font-size: 14px; }

/* ============================================================
   HERO CINEMATOGRÁFICO DEL CURSO (estilo Disney+)
   ============================================================ */
.course-hero {
    border-radius: var(--radio); overflow: hidden; margin-bottom: 24px;
    box-shadow: var(--sombra-intensa); border: 1px solid var(--border);
    background: var(--blanco);
}
.course-hero-banner {
    position: relative; width: 100%; height: 280px;
    background: linear-gradient(135deg, #071a3a 0%, #0d2e6a 55%, #1040a0 100%);
}
.course-hero-banner-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.course-hero-gradient {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(6,13,26,0) 0%, rgba(6,13,26,.55) 55%, #060d1a 100%);
}
.course-hero-back {
    position: absolute; top: 16px; left: 16px; z-index: 2;
    background: rgba(6,13,26,.6); backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,.15);
}
.course-hero-content { padding: 0 28px 26px; margin-top: -64px; position: relative; z-index: 1; }
.course-hero-title {
    color: var(--azul-oscuro); font-size: 30px; font-weight: 800;
    letter-spacing: -.6px; margin-bottom: 10px;
    text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
.course-hero-description {
    color: var(--azul-profundo); font-size: 14px; line-height: 1.6;
    max-width: 720px; margin-bottom: 4px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.course-hero-description.expanded { -webkit-line-clamp: unset; overflow: visible; }
.course-hero-desc-toggle {
    background: none; border: none; color: var(--azul-claro); font-family: inherit;
    font-size: 12px; font-weight: 700; cursor: pointer; padding: 0 0 16px; display: block;
}
.course-hero-desc-toggle:hover { text-decoration: underline; }
.course-hero-continue { max-width: 420px; margin-bottom: 18px; }
.course-hero-continue-text { color: var(--azul-oscuro); font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.course-hero-progress { height: 6px; }
.course-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.course-hero-btn-play {
    font-size: 15px; font-weight: 800; padding: 12px 26px;
    border-radius: 24px; letter-spacing: .2px;
}

/* ── Barra de pestañas ── */
.course-tabs {
    display: flex; gap: 6px; margin-bottom: 20px; overflow-x: auto;
    border-bottom: 1px solid var(--border); padding-bottom: 0;
}
.course-tab {
    background: transparent; border: none; color: var(--gray);
    font-family: inherit; font-size: 14px; font-weight: 700;
    padding: 10px 16px; cursor: pointer; white-space: nowrap;
    border-bottom: 2px solid transparent; transition: all .2s ease;
}
.course-tab:hover { color: var(--azul-oscuro); }
.course-tab.active { color: var(--azul-claro); border-bottom-color: var(--azul); }
.course-tab-panel { min-height: 60px; }

/* ── Selector de módulo ── */
.module-selector-row { margin-bottom: 18px; }
.module-selector-row .select-input,
#moduloSelector {
    width: 100%; max-width: 360px; padding: 11px 14px;
    border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.05);
    color: var(--azul-oscuro); border-radius: 12px; font-size: 14px;
    font-weight: 600; font-family: inherit; cursor: pointer; outline: none;
}
#moduloSelector:focus { border-color: rgba(59,130,246,.5); }

/* ── Grilla de módulos (tarjeta con foto + % completado, cuando el curso tiene más de uno) ── */
.grid-modulos {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px; margin-bottom: 20px;
}
.modulo-card {
    background: var(--blanco); border: 1px solid var(--border); border-radius: 12px;
    overflow: hidden; cursor: pointer; transition: all .25s ease;
}
.modulo-card:hover {
    border-color: var(--border-hover); transform: translateY(-3px);
    box-shadow: var(--sombra-intensa);
}
.modulo-card.seleccionado {
    border-color: var(--naranja); box-shadow: 0 0 0 2px rgba(245,158,11,.35), var(--sombra-intensa);
}
.modulo-card.seleccionado .modulo-card-titulo { color: var(--naranja-claro); }
.modulo-poster {
    position: relative; width: 100%; aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #071a3a 0%, #0d2e6a 55%, #1040a0 100%);
    overflow: hidden;
}
.modulo-poster img { width: 100%; height: 100%; object-fit: cover; }
.modulo-poster-fallback {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 30px; color: white;
}
.modulo-poster-badge {
    position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.6); color: white;
    font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 12px;
}
.modulo-poster-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.5); }
.modulo-poster-fill { height: 100%; background: var(--azul); }
.modulo-card-info { padding: 12px 14px 14px; }
.modulo-card-titulo { color: var(--azul-oscuro); font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.modulo-card-progreso { color: var(--gray); font-size: 12px; }

/* ── Grilla de episodios ── */
.grid-episodios {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px; margin-bottom: 20px;
}
.episodio-card {
    background: var(--blanco); border: 1px solid var(--border); border-radius: 12px;
    overflow: hidden; cursor: pointer; transition: all .25s ease; display: flex; flex-direction: column;
}
.episodio-card:hover {
    border-color: var(--border-hover); transform: translateY(-3px);
    box-shadow: var(--sombra-intensa);
}
.episodio-card.seleccionado {
    border-color: var(--naranja); box-shadow: 0 0 0 2px rgba(245,158,11,.35), var(--sombra-intensa);
}
.episodio-card.seleccionado .episodio-titulo { color: var(--naranja-claro); }
.episodio-poster {
    position: relative; width: 100%; aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #071a3a 0%, #0d2e6a 55%, #1040a0 100%);
    overflow: hidden;
}
.episodio-poster img { width: 100%; height: 100%; object-fit: cover; }
.episodio-poster-fallback {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 34px; color: white;
}
.episodio-progress-bar {
    position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
    background: rgba(0,0,0,.5);
}
.episodio-progress-fill { height: 100%; background: var(--azul); }
.episodio-info { padding: 12px 14px 14px; flex: 1; display: flex; flex-direction: column; }
.episodio-titulo { color: var(--azul-oscuro); font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.episodio-sinopsis {
    color: var(--azul-profundo); font-size: 12px; line-height: 1.5; margin-bottom: 12px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    flex: 1;
}
.episodio-footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.episodio-play {
    background: rgba(59,130,246,.16); color: var(--azul-claro); border: 1px solid rgba(59,130,246,.28);
    padding: 6px 12px; border-radius: 16px; font-size: 12px; font-weight: 700;
    cursor: pointer; font-family: inherit;
}
.episodio-play:hover { background: rgba(59,130,246,.28); }
.episodio-badge {
    font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 12px;
}
.episodio-badge.ok  { background: rgba(52,211,153,.14); color: var(--success); }
.episodio-badge.pend { background: rgba(245,158,11,.14); color: var(--naranja); }
.episodio-foro-btn {
    margin-left: auto; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
    color: var(--azul-profundo); width: 30px; height: 30px; border-radius: 50%;
    cursor: pointer; font-size: 13px;
}
.episodio-foro-btn:hover { background: rgba(59,130,246,.18); color: var(--azul-claro); }

/* ── Listas agregadas (Foro / Material / Evaluaciones) ── */
.foro-lista-clases, .material-lista, .evaluaciones-lista { display: flex; flex-direction: column; gap: 10px; }
.foro-lista-item, .material-item, .evaluacion-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--blanco); border: 1px solid var(--border); border-radius: 10px;
    padding: 12px 16px; flex-wrap: wrap;
}
.foro-lista-modulo, .material-modulo, .evaluacion-modulo { color: var(--gray); font-size: 12px; margin-top: 2px; }
.material-links { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.material-links a { color: var(--azul-claro); text-decoration: none; }
.material-links a:hover { text-decoration: underline; }
.material-sin { color: var(--gray); font-size: 12px; }

/* ── Drawer de foro ── */
.foro-drawer { position: fixed; inset: 0; z-index: 10001; display: none; }
.foro-drawer.open { display: block; }
.foro-drawer-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.foro-drawer-panel {
    position: absolute; top: 0; right: 0; height: 100%; width: 100%; max-width: 440px;
    background: var(--blanco); border-left: 1px solid var(--border);
    box-shadow: -12px 0 40px rgba(0,0,0,.5);
    display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform .25s ease;
}
.foro-drawer.open .foro-drawer-panel { transform: translateX(0); }
.foro-drawer-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.foro-drawer-header h3 { color: var(--azul-oscuro); font-size: 17px; font-weight: 800; }
.foro-drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1; }

/* ── Notificaciones toast ── */
.notification {
    position: fixed; top: 15px; right: 15px; padding: 12px 18px;
    border-radius: 10px; background: rgba(52,211,153,.15);
    border: 1px solid rgba(52,211,153,.3); color: var(--success);
    font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.3);
    opacity: 0; transform: translateX(320px);
    transition: all 0.3s ease; z-index: 1000; font-size: 13px;
}
.notification.show { opacity: 1; transform: translateX(0); }
.notification.error {
    background: rgba(248,113,113,.15);
    border-color: rgba(248,113,113,.3); color: var(--error);
}

/* ── Modal de manual/PDF ── */
#universalManualModal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.88); z-index: 10000; display: none;
    justify-content: center; align-items: center;
}
#universalManualModal .modal-content {
    position: relative; width: 90%; height: 90%;
    max-width: 900px; background: var(--blanco);
    border-radius: 12px; overflow: hidden;
    border: 1px solid var(--border);
}
#universalManualModal .modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; background: #0d1f38; color: white;
}
#universalManualModal .modal-header h3 { margin: 0; font-size: 15px; font-weight: 700; }
#universalManualModal .close-modal { background: none; border: none; color: rgba(255,255,255,.7); font-size: 20px; cursor: pointer; }
#universalManualModal .close-modal:hover { color: white; }
#universalManualModal iframe { width: 100%; height: calc(100% - 50px); border: none; }

/* ── Login ── */
.login-container {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; padding: 20px; position: relative; overflow: hidden;
}
.login-container::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 800px 600px at 30% 55%, rgba(59,130,246,.13) 0%, transparent 65%),
        radial-gradient(ellipse 500px 400px at 75% 30%, rgba(245,158,11,.08) 0%, transparent 55%);
}
.login-container::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(circle, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 32px 32px;
}

.form-container {
    width: 340px; padding: 36px 32px; text-align: center;
    position: relative; z-index: 1;
    background: rgba(10,20,40,.85);
    border: 1px solid rgba(59,130,246,.22);
    border-radius: 22px;
    backdrop-filter: blur(24px);
    box-shadow: 0 28px 70px rgba(0,0,0,.55), 0 0 0 1px rgba(59,130,246,.08),
                inset 0 1px 0 rgba(255,255,255,.06);
}
.school-header { text-align: center; margin-bottom: 24px; }
.login-school-logo {
    max-width: 72px; max-height: 56px; object-fit: contain;
    margin: 0 auto 14px; display: block; border-radius: 14px;
    background: linear-gradient(135deg, rgba(59,130,246,.25), rgba(245,158,11,.18));
    padding: 10px; border: 1px solid rgba(59,130,246,.2);
}
.login-title {
    text-align: center; color: var(--azul-oscuro);
    margin-bottom: 6px; font-weight: 800; font-size: 21px; letter-spacing: -.4px;
}

/* ── Inputs ── */
input[type=text], input[type=password], input[type=email], input[type=tel] {
    width: 100%; padding: 12px 14px; margin: 6px 0;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.05);
    outline: none; text-align: center; font-size: 14px; font-weight: 600;
    color: var(--azul-oscuro); border-radius: 12px;
    transition: all 0.3s; font-family: inherit;
}
input[type=text]:focus, input[type=password]:focus,
input[type=email]:focus, input[type=tel]:focus {
    border-color: rgba(59,130,246,.5);
    background: rgba(59,130,246,.07);
    box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
input[type=text]::placeholder, input[type=password]::placeholder,
input[type=email]::placeholder, input[type=tel]::placeholder { color: var(--gray); }
input[type=submit], input[type=button] { width: 100%; margin: 5px 0; }

.error-message { color: var(--error); font-size: 11px; text-align: center; margin: 8px 0; min-height: 18px; }
.google-divider {
    display: flex; align-items: center; gap: 10px;
    margin: 14px 0 12px; color: var(--gray); font-size: 12px;
}
.google-divider::before, .google-divider::after {
    content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.08);
}
.login-links { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.login-link {
    background: transparent; border: none; color: var(--azul-claro);
    text-decoration: none; font-size: 12px; cursor: pointer;
    padding: 5px; font-weight: 600; font-family: inherit; opacity: .85;
}
.login-link:hover { color: var(--azul-oscuro); opacity: 1; }

/* ── Modales genéricos ── */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.8); z-index: 10000; display: none;
    justify-content: center; align-items: center; padding: 20px;
}
.modal-content {
    background: var(--blanco); border-radius: 18px; padding: 26px;
    width: 100%; max-width: 420px;
    border: 1px solid rgba(59,130,246,.2);
    box-shadow: 0 28px 64px rgba(0,0,0,.6);
    position: relative;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px;
    padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,.07);
}
.modal-title { color: var(--azul-oscuro); font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.close-modal {
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
    font-size: 15px; cursor: pointer; color: var(--gray);
    width: 28px; height: 28px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.close-modal:hover { color: var(--azul-oscuro); background: rgba(255,255,255,.1); }
.form-group { margin-bottom: 14px; text-align: left; }
.form-label { display: block; margin-bottom: 5px; font-weight: 700; color: var(--azul-claro); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }

/* ── Modal de encuesta ── */
.survey-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.92); z-index: 10000; display: none;
    justify-content: center; align-items: center; padding: 20px;
}
.survey-modal-content {
    background: var(--blanco); border-radius: 16px; width: 100%; max-width: 900px;
    max-height: 90vh; border: 1px solid var(--border);
    box-shadow: 0 24px 60px rgba(0,0,0,.6); position: relative;
    overflow: hidden; display: flex; flex-direction: column;
}
.survey-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 22px; background: #0d1f38; color: white; flex-shrink: 0;
    border-bottom: 1px solid rgba(59,130,246,.2);
}
.survey-modal-title { font-size: 17px; font-weight: 700; margin: 0; }
.close-survey-modal {
    background: none; border: none; color: rgba(255,255,255,.6); font-size: 22px;
    cursor: pointer; width: 38px; height: 38px; display: flex;
    align-items: center; justify-content: center; border-radius: 50%; transition: all 0.2s;
}
.close-survey-modal:hover { background: rgba(255,255,255,.1); color: white; }
.survey-body { padding: 25px; overflow-y: auto; flex: 1; }
.survey-info {
    background: rgba(59,130,246,.08); padding: 14px; border-radius: 10px;
    margin-bottom: 20px; border-left: 3px solid var(--azul);
    color: var(--azul-profundo);
}
.survey-question {
    background: var(--neutro); padding: 20px; border-radius: 12px;
    margin-bottom: 20px; border-left: 3px solid var(--azul);
}
.question-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.question-number {
    background: var(--azul); color: white; width: 32px; height: 32px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; flex-shrink: 0;
}
.question-type-badge {
    background: rgba(245,158,11,.15); color: var(--naranja);
    border: 1px solid rgba(245,158,11,.28);
    padding: 4px 12px; border-radius: 12px; font-size: 11px; font-weight: 700;
}
.question-text { color: var(--azul-oscuro); font-size: 16px; font-weight: 700; margin: 10px 0 15px 0; line-height: 1.5; }
.question-options { display: flex; flex-direction: column; gap: 10px; }
.option-label {
    display: flex; align-items: center; padding: 12px 16px;
    background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px; cursor: pointer; transition: all 0.2s ease;
}
.option-label:hover { border-color: var(--azul); background: rgba(59,130,246,.07); }
.option-label input[type="radio"] { margin-right: 12px; cursor: pointer; width: 18px; height: 18px; accent-color: var(--azul); }
.option-text { flex: 1; color: var(--azul-profundo); font-size: 14px; }
.question-textarea {
    width: 100%; min-height: 120px; padding: 12px;
    border: 1px solid rgba(255,255,255,.1); border-radius: 10px;
    font-family: inherit; font-size: 14px; resize: vertical;
    background: rgba(255,255,255,.05); color: var(--azul-oscuro);
    transition: border-color 0.3s;
}
.question-textarea:focus { outline: none; border-color: rgba(59,130,246,.4); background: rgba(59,130,246,.05); }
.question-file-input { display: none; }
.file-upload-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px;
    background: rgba(59,130,246,.14); color: var(--azul-claro);
    border: 1px solid rgba(59,130,246,.28); border-radius: 10px;
    cursor: pointer; font-weight: 700; transition: all 0.3s; font-family: inherit;
}
.file-upload-btn:hover { background: rgba(59,130,246,.24); }
.file-info {
    margin-top: 10px; padding: 10px; background: rgba(52,211,153,.1);
    border-radius: 8px; color: var(--success); font-size: 14px; display: none;
    border: 1px solid rgba(52,211,153,.2);
}
.survey-actions {
    padding: 14px 24px; border-top: 1px solid rgba(255,255,255,.06);
    display: flex; justify-content: space-between; gap: 10px; flex-shrink: 0;
}
.survey-resultado { padding: 25px; text-align: center; }
.resultado-header {
    background: linear-gradient(135deg, #0d2e6a, #1a4a9c);
    border: 1px solid rgba(59,130,246,.25);
    color: white; padding: 30px; border-radius: 15px; margin-bottom: 25px;
}
.resultado-score { font-size: 48px; font-weight: 800; margin: 15px 0; color: var(--naranja-claro); }
.resultado-mensaje { font-size: 18px; margin: 10px 0; }

/* ── Revisión de encuesta ── */
.revision-question {
    background: var(--neutro); padding: 20px; margin: 15px 0;
    border-radius: 12px; border: 1px solid rgba(255,255,255,.06);
}
.revision-question.correcta  { border-left: 4px solid var(--success); background: rgba(52,211,153,.07); }
.revision-question.incorrecta{ border-left: 4px solid var(--error);   background: rgba(248,113,113,.07); }
.revision-question.pendiente { border-left: 4px solid var(--naranja); background: rgba(245,158,11,.07); }
.revision-status { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.revision-status.correcta  { background: rgba(52,211,153,.15);  color: var(--success); border: 1px solid rgba(52,211,153,.3); }
.revision-status.incorrecta{ background: rgba(248,113,113,.15); color: var(--error);   border: 1px solid rgba(248,113,113,.3); }
.revision-status.pendiente { background: rgba(245,158,11,.15);  color: var(--naranja); border: 1px solid rgba(245,158,11,.3); }
.respuesta-alumno   { background: rgba(255,255,255,.04); padding: 12px; border-radius: 8px; margin: 10px 0; color: var(--azul-profundo); }
.respuesta-correcta { background: rgba(52,211,153,.08); padding: 12px; border-radius: 8px; margin: 10px 0; border: 1px solid rgba(52,211,153,.2); color: var(--azul-profundo); }
.puntaje-badge {
    display: inline-block; padding: 4px 12px;
    background: rgba(59,130,246,.15); border: 1px solid rgba(59,130,246,.28);
    color: var(--azul-claro); border-radius: 12px; font-size: 13px; font-weight: 700; margin-left: 10px;
}

/* ── Notas y manual ── */
.notes-area { display: none; margin-top: 8px; }
.notes-textarea {
    width: 100%; height: 100px; padding: 10px;
    border: 1px solid rgba(255,255,255,.1); border-radius: 8px; resize: vertical;
    font-family: inherit; background: rgba(255,255,255,.04); color: var(--azul-oscuro);
}
.notes-textarea:focus { outline: none; border-color: rgba(59,130,246,.35); }
.save-notes-btn { margin-top: 8px; }
.manual-container { display: none; margin-top: 8px; }

/* ── Búsqueda por subtítulo (buscar palabra → saltar en el video) ── */
.subtitulo-search { margin-top: 8px; }
.subtitulo-input {
    width: 100%; padding: 10px 14px;
    border: 1px solid rgba(255,255,255,.1); border-radius: 8px;
    font-family: inherit; font-size: 14px;
    background: rgba(255,255,255,.04); color: var(--azul-oscuro);
}
.subtitulo-input:focus { outline: none; border-color: rgba(59,130,246,.35); }
.subtitulo-resultados { margin-top: 8px; max-height: 220px; overflow-y: auto; }
.subtitulo-resultado {
    display: flex; align-items: baseline; gap: 10px;
    padding: 8px 10px; border-radius: 8px; cursor: pointer;
    border: 1px solid transparent;
}
.subtitulo-resultado:hover { background: rgba(59,130,246,.1); border-color: var(--border-hover); }
.subtitulo-tiempo { flex-shrink: 0; font-weight: 700; color: var(--azul-claro); font-size: 13px; }
.subtitulo-texto { color: var(--azul-profundo); font-size: 13px; line-height: 1.4; }
.subtitulo-vacio { padding: 8px 10px; color: var(--gray); font-size: 13px; }

/* ── Rosco / Pasapalabra ── */
#roscoModal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.88); z-index: 10000; display: none;
    justify-content: center; align-items: center; padding: 16px;
}
#roscoModal .modal-content {
    position: relative; width: 100%; max-width: 1000px; max-height: 92vh;
    background: var(--blanco); border-radius: 18px; overflow-y: auto;
    border: 1px solid var(--border); padding: 0;
}
#roscoModal .modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px; background: #0d1f38; color: white;
    position: sticky; top: 0; z-index: 2; margin: 0; border: none;
}
#roscoModal .modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; color: white; }
#roscoModal .close-modal { background: none; border: none; color: rgba(255,255,255,.7); font-size: 20px; cursor: pointer; }
#roscoModal .close-modal:hover { color: white; }
#roscoModalBody { padding: 20px; }

.rosco-game-area { display: flex; flex-direction: column; gap: 20px; }
.rosco-canvas-wrapper { max-width: 260px; margin: 0 auto; }
#roscoCanvas { background: var(--neutro); border-radius: 50%; width: 100%; aspect-ratio: 1/1; box-shadow: inset 0 0 0 2px var(--border-hover); }
.rosco-play-panel { background: rgba(255,255,255,.03); border-radius: 18px; padding: 20px; border: 1px solid var(--border); margin-top: 16px; }
.rosco-current-letter { font-size: 4.5rem; font-weight: 800; text-align: center; color: var(--naranja-claro); }
.rosco-definition-box { background: var(--neutro); border-radius: 14px; padding: 18px; margin: 12px 0; border-left: 6px solid var(--azul); font-size: 1.15rem; color: var(--azul-oscuro); }
.rosco-timer-bar { height: 10px; background: rgba(255,255,255,.08); border-radius: 20px; margin: 10px 0; overflow: hidden; }
.rosco-timer-fill { height: 100%; width: 100%; background: var(--success); border-radius: 20px; transition: width .1s; }
.rosco-timer-text { font-size: 1.2rem; font-weight: 700; color: var(--naranja-claro); text-align: center; }
.rosco-control-row { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.rosco-control-row button, .rosco-answer-section button {
    background: rgba(59,130,246,.12); color: var(--azul-claro); border: 1px solid rgba(59,130,246,.28);
    padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.rosco-control-row button:hover, .rosco-answer-section button:hover { background: rgba(59,130,246,.22); }
.rosco-answer-section { display: flex; gap: 10px; margin: 14px 0; }
.rosco-answer-section input {
    flex: 1; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--neutro); color: var(--azul-oscuro); font-family: inherit;
}
.rosco-feedback { min-height: 24px; text-align: center; font-weight: 600; color: var(--azul-oscuro); }
.rosco-score { text-align: center; font-size: 1.1rem; font-weight: 700; color: var(--azul-oscuro); margin-top: 8px; }
.rosco-history-panel { background: rgba(255,255,255,.03); border-radius: 18px; padding: 18px; border: 1px solid var(--border); max-height: 320px; overflow-y: auto; }
.rosco-history-title { color: var(--azul-oscuro); font-size: 1.05rem; margin-bottom: 12px; text-align: center; font-weight: 700; }
.rosco-history-list { display: flex; flex-direction: column; gap: 10px; }
.rosco-history-item { padding: 10px 14px; border-radius: 12px; background: var(--neutro); border-left: 5px solid; }
.rosco-history-correct { border-left-color: var(--success); }
.rosco-history-incorrect { border-left-color: var(--error); }
.rosco-history-pass { border-left-color: var(--naranja); opacity: .85; }
.rosco-history-pending { border-left-color: var(--azul-claro); }
.rosco-history-question { font-weight: 500; color: var(--azul-profundo); margin-bottom: 4px; font-size: 13px; }
.rosco-history-answer { font-size: 13px; }
.rosco-history-user { color: var(--naranja-claro); }
.rosco-history-correct-ans { color: var(--azul-claro); margin-left: 6px; }
.rosco-history-empty { color: var(--gray); text-align: center; font-size: 13px; }

@media (min-width: 700px) {
    .rosco-game-area { flex-direction: row; align-items: flex-start; }
    .rosco-area { flex: 1.2; }
    .rosco-history-panel { flex: 1; }
}

.rosco-practica-btn { display: inline-flex; margin-top: 10px; }

/* ── Cartel de instalación PWA ── */
.pwa-install-banner {
    position: fixed; left: 12px; right: 12px; bottom: -140px;
    z-index: 9000; display: flex; align-items: center; gap: 12px;
    background: var(--blanco); border: 1px solid var(--border-hover);
    border-radius: 16px; padding: 14px 14px 14px 16px;
    box-shadow: var(--sombra-intensa);
    transition: bottom .35s ease;
}
/* En mobile el navegador puede tapar el borde inferior con su propia barra
   (URL bar colapsable, gestos de Android) — sumamos el safe-area para que
   el cartel quede siempre arriba de esa zona, no a medio tapar. */
.pwa-install-banner.visible { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.pwa-install-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.pwa-install-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pwa-install-text strong { color: var(--azul-oscuro); font-size: 14px; }
.pwa-install-text span { color: var(--azul-profundo); font-size: 12px; }
.pwa-install-btn {
    flex-shrink: 0; background: var(--azul); color: #fff; border: none;
    padding: 9px 16px; border-radius: 10px; font-weight: 700; font-size: 13px;
    cursor: pointer; font-family: inherit;
}
.pwa-install-close {
    flex-shrink: 0; background: none; border: none; color: var(--gray);
    font-size: 16px; cursor: pointer; padding: 4px;
}
@media (min-width: 700px) { .pwa-install-banner { left: auto; right: 20px; width: 360px; } }

/* ── Utilidades ── */
.image-fallback { font-size: 50px; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.loading    { text-align: center; padding: 20px; color: var(--gray); font-weight: 500; }
.no-content { text-align: center; padding: 20px; color: var(--gray); font-weight: 500; }

/* ── Portada promo ── */
.portada-promo-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.92); z-index: 10000; display: none;
    justify-content: center; align-items: center; padding: 20px; overflow-y: auto;
}
.portada-promo-content {
    background: var(--blanco); border-radius: 16px; width: 100%;
    max-width: 900px; max-height: 90vh; overflow-y: auto; position: relative;
    border: 1px solid var(--border); box-shadow: 0 28px 60px rgba(0,0,0,.6);
}
.portada-header {
    position: sticky; top: 0;
    background: linear-gradient(135deg, #0d2e6a, #1a4a9c);
    color: white; padding: 20px 25px; border-radius: 16px 16px 0 0;
    z-index: 100; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(59,130,246,.25);
}
.portada-title { font-size: 22px; font-weight: 800; margin: 0; flex: 1; letter-spacing: -.3px; }
.close-portada {
    background: rgba(255,255,255,.12); border: none; color: white;
    font-size: 26px; cursor: pointer; width: 38px; height: 38px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
}
.close-portada:hover { background: rgba(255,255,255,.22); transform: rotate(90deg); }
.portada-body { padding: 28px; }
.portada-section { margin-bottom: 28px; }
.portada-section-title {
    color: var(--azul-oscuro); font-size: 19px; font-weight: 800;
    margin-bottom: 15px; padding-bottom: 8px;
    border-bottom: 2px solid rgba(59,130,246,.25);
    display: flex; align-items: center; gap: 10px; letter-spacing: -.2px;
}
.portada-description {
    color: var(--azul-profundo); font-size: 15px; line-height: 1.8;
    margin-bottom: 20px; padding: 18px 20px;
    background: var(--neutro); border-radius: 12px;
    border-left: 3px solid var(--azul);
}
.portada-video-container {
    position: relative; width: 100%; background: #000;
    border-radius: 12px; overflow: hidden; margin-bottom: 20px;
    border: 1px solid rgba(59,130,246,.2);
}
.portada-video-container iframe { width: 100%; height: auto; aspect-ratio: 16/9; border: none; }
.portada-temario-card {
    background: var(--neutro); padding: 18px; border-radius: 12px;
    border-left: 3px solid var(--naranja); cursor: pointer;
    transition: all 0.3s; display: flex; align-items: center; gap: 15px;
}
.portada-temario-card:hover {
    background: rgba(59,130,246,.07); transform: translateX(4px);
    box-shadow: var(--sombra); border-color: var(--azul);
}
.portada-temario-icon { font-size: 38px; flex-shrink: 0; }
.portada-temario-info { flex: 1; }
.portada-temario-title { font-weight: 700; color: var(--azul-oscuro); font-size: 15px; margin-bottom: 5px; }
.portada-temario-subtitle { color: var(--gray); font-size: 13px; }
.portada-solicitud-section {
    background: linear-gradient(135deg, rgba(59,130,246,.08), rgba(245,158,11,.06));
    padding: 24px; border-radius: 16px; text-align: center;
    border: 1px solid rgba(59,130,246,.2);
}
.portada-solicitud-title { color: var(--azul-oscuro); font-size: 20px; font-weight: 800; margin-bottom: 10px; letter-spacing: -.3px; }
.portada-solicitud-text { color: var(--gray); font-size: 14px; margin-bottom: 20px; line-height: 1.6; }
.portada-btn-solicitud {
    background: linear-gradient(135deg, #3b7cf4, #2860c4); color: white;
    border: none; padding: 14px 40px; border-radius: 25px;
    font-size: 17px; font-weight: 700; cursor: pointer; transition: all 0.3s;
    display: inline-flex; align-items: center; gap: 10px;
    box-shadow: 0 6px 20px rgba(59,130,246,.35); font-family: inherit;
}
.portada-btn-solicitud:hover { transform: scale(1.04); box-shadow: 0 8px 28px rgba(59,130,246,.5); }
.portada-btn-solicitud:disabled { background: var(--gray); cursor: not-allowed; opacity: 0.5; }
.solicitud-pendiente-card {
    background: linear-gradient(135deg, rgba(52,211,153,.15), rgba(16,185,129,.1));
    border: 1px solid rgba(52,211,153,.25); color: var(--success);
    padding: 28px; border-radius: 16px; text-align: center;
}
.solicitud-pendiente-icon { font-size: 56px; margin-bottom: 15px; }
.solicitud-pendiente-title { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.solicitud-pendiente-text { font-size: 15px; line-height: 1.6; opacity: .9; }
.portada-whatsapp-btn {
    background: linear-gradient(to right, #25D366, #128C7E); color: white;
    border: none; padding: 12px 28px; border-radius: 25px;
    font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.3s;
    display: inline-flex; align-items: center; gap: 10px;
    margin-top: 15px; text-decoration: none; font-family: inherit;
}
.portada-whatsapp-btn:hover { transform: scale(1.04); box-shadow: 0 4px 16px rgba(37,211,102,.35); }

/* ── Módulo expandido ── */
.expanded-module { width: 100%; padding: 0; margin-bottom: 5px; }
.module-header { display: flex; align-items: center; margin-bottom: 15px; padding-bottom: 12px; }
.module-progress-expanded { margin: 15px 0; padding: 12px; text-align: center; }
.content-list-expanded { margin-top: 15px; margin-bottom: 5px; }

/* ── SVG icons ── */
.icon        { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.icon-play, .icon-pause, .icon-book, .icon-phone,
.icon-target, .icon-trophy, .icon-notes,
.icon-calendar, .icon-manual { width: 18px; height: 18px; }

/* ── Animaciones ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.modal-content > div[id^="forgotPasswordStep"] { animation: fadeIn 0.25s ease; }

#resetCode {
    font-family: 'Courier New', monospace; background: var(--neutro);
    border: 1px solid rgba(59,130,246,.3); letter-spacing: 6px;
    font-size: 24px; font-weight: 700; color: var(--azul-oscuro); text-align: center;
}
#resetCode:focus {
    border-color: rgba(59,130,246,.55); background: rgba(59,130,246,.07);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* ════════════════════════════════
   MEDIA QUERIES
   ════════════════════════════════ */

@media (max-width: 926px) and (orientation: landscape) {
    :fullscreen .controls-panel { min-height: 80px !important; max-height: 80px !important; padding: 10px 15px !important; display: flex !important; align-items: center !important; justify-content: space-around !important; }
    :fullscreen .progress-row  { flex: 1; margin-right: 15px; }
    :fullscreen .video-controls { display: flex !important; gap: 10px !important; }
    :fullscreen .video-controls button { padding: 8px 12px !important; font-size: 12px !important; }

    .controls-panel { position: fixed !important; bottom: 0 !important; left: 0 !important; right: 0 !important; width: 100% !important; background: rgba(0,0,0,.88) !important; backdrop-filter: blur(10px); opacity: 0; visibility: hidden; transform: translateY(100%); transition: all 0.3s ease; z-index: 50; padding: 10px 15px !important; border-radius: 0 !important; }
    .controls-panel.show-controls-mobile { opacity: 1 !important; visibility: visible !important; transform: translateY(0) !important; }
    .player-container { position: relative; }
    .video-container { width: 100% !important; height: 100vh !important; }
    .progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
    .video-controls { display: flex !important; gap: 8px !important; }
    .video-controls button { padding: 6px 10px !important; font-size: 11px !important; }
    .time-display { font-size: 12px !important; min-width: 80px !important; color: white !important; }
    .subtitulo-overlay { font-size: 13px !important; bottom: 8px !important; padding: 4px 10px !important; }
}

@media (max-width: 768px) {
    .container { padding: 10px 10px 5px; }
    .header-container { flex-direction: column; text-align: center; padding: 12px 15px; }
    .school-brand, .user-welcome { justify-content: center; text-align: center; min-width: auto; }
    .user-welcome { display: flex; flex-direction: column; align-items: center; }
    .course-content, .module-content { flex-direction: column; gap: 15px; }
    .course-image-container, .module-image-container { flex: 0 0 auto; width: 100%; max-width: 200px; margin: 0 auto; }
    .grid-cursos, .grid-modulos { grid-template-columns: 1fr; gap: 15px; }
    .player-container { padding: 10px; margin: 10px 0; }
    .modal-content, .survey-modal-content { padding: 18px; }
    .survey-body { padding: 15px; }
    .portada-promo-content { max-width: 100%; max-height: 100vh; border-radius: 0; }
    .portada-header { border-radius: 0; }
    .portada-title { font-size: 17px; }
    .portada-body { padding: 18px; }
    .portada-btn-solicitud { width: 100%; padding: 12px 20px; font-size: 15px; }
    .course-header-buttons { flex-direction: column; gap: 8px; }
    .course-header-btn { width: 100%; justify-content: center; }
    .lesson-quick-actions { display: flex; }
    .lesson-quick-actions .btn-text { display: none; }
    .lesson-accordion.active .lesson-quick-actions { display: none; }
    .lesson-accordion.active .lesson-actions { display: flex; }
    .section-title { font-size: 19px; }

    .course-hero-banner { height: 180px; }
    .course-hero-content { padding: 0 16px 20px; margin-top: -48px; }
    .course-hero-title { font-size: 22px; }
    .course-tabs { gap: 2px; }
    .course-tab { padding: 9px 10px; font-size: 12px; }
    .grid-episodios { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .foro-drawer-panel { max-width: 100%; }
    .foro-lista-item, .material-item, .evaluacion-item { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 769px) {
    .lesson-quick-actions { display: flex; }
    .lesson-quick-actions .btn-text { display: inline; }
    .lesson-accordion.active .lesson-actions { display: none; }
}

@media (max-width: 480px) {
    .form-container { width: 100%; max-width: 320px; padding: 24px 20px; }
    .btn { width: 100%; margin-right: 0; justify-content: center; }
    .modal-content { padding: 16px; }
    .lesson-actions { flex-direction: column; }
    .lesson-actions .btn { width: 100%; }
}

/* ── FORO ── */
.foro-panel { margin-top: 16px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; }
.foro-container { display: flex; flex-direction: column; gap: 12px; }
.foro-titulo { font-size: 14px; font-weight: 600; color: var(--primary); margin: 0 0 8px; }
.foro-mensajes { display: flex; flex-direction: column; gap: 10px; }
.foro-vacio { color: var(--gray); font-size: 13px; }
.foro-mensaje { background: rgba(255,255,255,.04); border-radius: 8px; padding: 10px 12px; }
.foro-autor { font-size: 12px; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.foro-fecha { font-weight: 400; color: var(--gray); margin-left: 8px; }
.foro-texto { font-size: 13px; color: var(--text); line-height: 1.5; }
.foro-respuesta { margin-left: 20px; border-left: 2px solid var(--primary); padding-left: 10px; }
.foro-btn-responder { background: none; border: none; color: var(--primary); font-size: 12px; cursor: pointer; padding: 4px 0; opacity: .8; }
.foro-btn-responder:hover { opacity: 1; }
.foro-form { display: flex; flex-direction: column; gap: 8px; }
.foro-textarea { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: 8px; color: var(--text); padding: 10px 12px; font-size: 13px; resize: vertical; font-family: inherit; }
.foro-textarea:focus { outline: none; border-color: var(--primary); }
.foro-submit { align-self: flex-end; }
.foro-loading, .foro-error { color: var(--gray); font-size: 13px; padding: 8px 0; }
