/* ==================================================
   VARIABLES GENERALES
================================================== */
:root {
    --azul:#2457d6;
    --celeste:#38bdf8;
    --morado:#7c3aed;
    --rosado:#ec4899;
    --naranjo:#f97316;
    --amarillo:#facc15;
    --verde:#22c55e;
    --oscuro:#172033;
    --texto:#273449;
    --suave:#f5f7ff;
    --blanco:#ffffff;
    --gris:#eef2f7;
    --sombra:0 18px 45px rgba(24,33,62,.13);
    --radio:26px;
}

/* ==================================================
   RESETEO Y BASE
================================================== */
* {
    box-sizing:border-box;
    margin:0;
    padding:0;
}
html {
    scroll-behavior:smooth;
}
body {
    font-family:'Nunito',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
    color:var(--texto);
    background:
        radial-gradient(circle at top left, rgba(56,189,248,.18), transparent 32%),
        radial-gradient(circle at top right, rgba(236,72,153,.12), transparent 28%),
        linear-gradient(180deg,#ffffff 0%,#f7f8ff 100%);
    min-height:100vh;
}
a {
    text-decoration:none;
    color:inherit;
}
ul {
    list-style:none;
}
main {
    min-height:70vh;
}

/* ==================================================
   HEADER Y NAVEGACIÓN
================================================== */
.header-principal {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 30px rgba(20, 31, 55, .08);
    background: repeating-linear-gradient(48deg, #6000a40f 0 5px, transparent 5px 10px);
    /* z-index: -1; */
}
.barra-superior {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 8px 7%;
    font-size: .86rem;
    color: #526070;
    background: linear-gradient(90deg, #ffcc00, #fac903, #ffffff);

    clip-path: polygon(
        0 0,
        100% 0,
        100% 88%,
        95% 100%,
        90% 88%,
        85% 100%,
        80% 88%,
        75% 100%,
        70% 88%,
        65% 100%,
        60% 88%,
        55% 100%,
        50% 88%,
        45% 100%,
        40% 88%,
        35% 100%,
        30% 88%,
        25% 100%,
        20% 88%,
        15% 100%,
        10% 88%,
        5% 100%,
        0 88%
    );
}
.navbar {
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:15px 7%;
    gap:20px;
}
.logo {
    display:flex;
    align-items:center;
    gap:12px;
    color:var(--oscuro);
}
.logo-icono {
    width:48px;
    height:48px;
    border-radius:16px;
    display:grid;
    place-items:center;
    color:white;
    font-weight:900;
    background:linear-gradient(135deg,var(--azul),var(--morado),var(--rosado));
    box-shadow:0 12px 25px rgba(124,58,237,.28);
}
.logo strong {
    display:block;
    font-size:1.25rem;
    line-height:1;
}
.logo small {
    color:#6b7280;
    font-weight:700;
}
.menu {
    display:flex;
    align-items:center;
    gap:10px;
    font-weight:800;
}
.menu a {
    padding:10px 14px;
    border-radius:999px;
    color:#344256;
}
.menu a:hover,.menu a.activo {
    background:#eef4ff;
    color:var(--azul);
}
.btn-menu {
    background:#edf2ff!important;
    color:var(--azul)!important;
}
.btn-menu.destacado {
    background:linear-gradient(135deg,var(--azul),var(--morado))!important;
    color:white!important;
    box-shadow:0 10px 25px rgba(36,87,214,.23);
}
.btn-menu.salir {
    background:#fff1f2!important;
    color:#e11d48!important;
}
.menu-toggle {
    display:none;
    border:0;
    background:var(--azul);
    color:#fff;
    border-radius:12px;
    padding:10px 14px;
    font-size:1.25rem;
    cursor:pointer;
}

/* ==================================================
   HERO PRINCIPAL
================================================== */
.hero {
    position:relative;
    overflow:hidden;
    padding:70px 7% 55px;
    display:grid;
    grid-template-columns:1.08fr .92fr;
    gap:38px;
    align-items:center;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff7ed;
    color: #c2410c;
    border: 2px dashed #fed7aa;
    border-radius: 999px;
    padding: 8px 15px;
    font-weight: 900;
    margin-bottom: 18px;
}
.hero h1 {
    font-size:clamp(2.2rem,5vw,4.8rem);
    line-height:.98;
    color:var(--oscuro);
    letter-spacing:-2px;
}
.hero h1 span {
    background:linear-gradient(135deg,var(--azul),var(--morado),var(--rosado));
    -webkit-background-clip:text;
    color:transparent;
}
.hero p {
    font-size:1.18rem;
    line-height:1.75;
    margin:22px 0;
    color:#ffffff;
    max-width:720px;
}
.hero-botones {
    display:flex;
    flex-wrap:wrap;
    gap:14px;
}
.btn {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    border:0;
    border-radius:999px;
    padding:14px 22px;
    font-weight:900;
    cursor:pointer;
    transition:.25s ease;
}
.btn-primario {
    background:linear-gradient(135deg,var(--azul),var(--morado));
    color:white;
    box-shadow:0 15px 35px rgba(36,87,214,.28);
}
.btn-secundario {
    background:white;
    color:var(--azul);
    border:1px solid #dbeafe;
}
.btn:hover {
    transform:translateY(-3px);
}

/* ==================================================
   PANEL DEL HERO
================================================== */
.panel-hero {
    position:relative;
    background:white;
    border-radius:36px;
    padding:24px;
    box-shadow:var(--sombra);
    border:1px solid #eef2ff;
}
.panel-cabecera {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:18px;
}
.puntitos span {
    display:inline-block;
    width:10px;
    height:10px;
    border-radius:999px;
    margin-left:5px;
}
.p1 {
    background:#ef4444;
}
.p2 {
    background:#f59e0b;
}
.p3 {
    background:#22c55e;
}
.panel-hero h3 {
    color:var(--oscuro);
    font-size:1.45rem;
}
.mini-grid {
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:14px;
}
.mini-card {
    border-radius:22px;
    border: 2px dashed #fcfcfc;
    padding:18px;
    min-height:120px;
    color:white;
    position:relative;
    overflow:hidden;
}
.mini-card strong {
    display:block;
    font-size:1.05rem;
    margin-bottom:8px;
}
.mini-card p {
    font-size:.92rem;
    opacity:.95;
    line-height:1.45;
}
.mini-card:nth-child(1) {
    background:linear-gradient(135deg,#2563eb,#38bdf8);
}
.mini-card:nth-child(2) {
    background:linear-gradient(135deg,#7c3aed,#ec4899);
}
.mini-card:nth-child(3) {
    background:linear-gradient(135deg,#f97316,#facc15);
}
.mini-card:nth-child(4) {
    background:linear-gradient(135deg,#16a34a,#22c55e);
}
.mini-card:after {
    content:'';
    position:absolute;
    width:90px;
    height:90px;
    border-radius:50%;
    background:rgba(255,255,255,.2);
    right:-24px;
    bottom:-24px;
}

/* ==================================================
   ESTADÍSTICAS
================================================== */
.estadisticas {
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:16px;
    padding:0 7% 60px;
}
.dato {
    background:white;
    border-radius:24px;
    padding:22px;
    text-align:center;
    box-shadow:0 12px 30px rgba(24,33,62,.08);
    border:1px solid #edf2ff;
}
.dato strong {
    display:block;
    font-size:2rem;
    color:var(--azul);
}
.dato span {
    font-weight:800;
    color:#64748b;
}

/* ==================================================
   SECCIONES GENERALES
================================================== */
.seccion {
    padding:65px 7%;
}
.titulo-seccion {
    text-align:center;
    max-width:820px;
    margin:0 auto 38px;
}
.titulo-seccion .etiqueta {
    color:var(--morado);
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.08em;
}
.titulo-seccion h2 {
    font-size:clamp(2rem,4vw,3.1rem);
    color:var(--oscuro);
    margin:8px 0;
}
.titulo-seccion p {
    line-height:1.75;
    color:#5b687a;
    font-size:1.08rem;
}

/* ==================================================
   VITRINA DE APLICACIONES
================================================== */
.apps-grid {
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:22px;
}
.app-card {
    background:white;
    border-radius:var(--radio);
    padding:23px;
    box-shadow:0 16px 42px rgba(24,33,62,.10);
    border:1px solid #edf2ff;
    display:flex;
    flex-direction:column;
    min-height:310px;
    position:relative;
    overflow:hidden;
    transition:.25s ease;
}
.app-card:hover {
    transform:translateY(-8px);
    box-shadow:0 20px 55px rgba(24,33,62,.16);
}
.app-icono {
    width:62px;
    height:62px;
    border-radius:20px;
    display:grid;
    place-items:center;
    color:white;
    font-size:1.9rem;
    margin-bottom:18px;
    box-shadow:0 12px 25px rgba(0,0,0,.14);
}
.app-card h3 {
    font-size:1.22rem;
    color:var(--oscuro);
    margin-bottom:10px;
}
.app-card p {
    line-height:1.6;
    color:#5d6b7d;
    flex:1;
}
.app-card .tag {
    display:inline-flex;
    align-self:flex-start;
    margin:15px 0;
    padding:6px 10px;
    border-radius:999px;
    background:#f1f5f9;
    color:#475569;
    font-size:.82rem;
    font-weight:900;
}
.app-card .abrir {
    margin-top:auto;
    font-weight:900;
    color:var(--azul);
}
.color-1 {
    background:linear-gradient(135deg,#2563eb,#38bdf8);
}
.color-2 {
    background:linear-gradient(135deg,#7c3aed,#ec4899);
}
.color-3 {
    background:linear-gradient(135deg,#f97316,#facc15);
}
.color-4 {
    background:linear-gradient(135deg,#16a34a,#22c55e);
}
.color-5 {
    background:linear-gradient(135deg,#0891b2,#06b6d4);
}
.color-6 {
    background:linear-gradient(135deg,#dc2626,#fb7185);
}
.color-7 {
    background:linear-gradient(135deg,#4f46e5,#a855f7);
}
.color-8 {
    background:linear-gradient(135deg,#0f766e,#14b8a6);
}

/* ==================================================
   RUTAS FORMATIVAS
================================================== */
.rutas {
    background:linear-gradient(180deg,#eef4ff,#ffffff);
}
.rutas-grid {
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:24px;
}
.ruta-card {
    background:white;
    padding:28px;
    border-radius:30px;
    box-shadow:var(--sombra);
    border:1px solid #eef2ff;
}
.ruta-card span {
    font-size:2.3rem;
}
.ruta-card h3 {
    margin:12px 0 10px;
    color:var(--oscuro);
}
.ruta-card p {
    line-height:1.7;
    color:#5b687a;
}

/* ==================================================
   LLAMADO A LA ACCIÓN
================================================== */
.cta {
    padding:70px 7%;
}
.cta-box {
    background:linear-gradient(135deg,#172033,#2457d6,#7c3aed);
    border-radius:36px;
    color:white;
    padding:45px;
    display:grid;
    grid-template-columns:1.2fr .8fr;
    gap:25px;
    align-items:center;
    box-shadow:0 25px 70px rgba(36,87,214,.30);
    position:relative;
    overflow:hidden;
}
.cta-box h2 {
    font-size:2.3rem;
    margin-bottom:12px;
}
.cta-box p {
    line-height:1.7;
    color:#e5edff;
}
.cta-box .btn {
    background:white;
    color:var(--azul);
}

/* ==================================================
   FORMULARIOS
================================================== */
.form-page {
    padding:70px 7%;
    display:grid;
    place-items:center;
}
.form-card {
    width:min(520px,100%);
    background:white;
    border-radius:32px;
    padding:34px;
    box-shadow:var(--sombra);
    border:1px solid #edf2ff;
}
.form-card h1 {
    color:var(--oscuro);
    margin-bottom:10px;
}
.form-card p {
    color:#64748b;
    margin-bottom:22px;
    line-height:1.6;
}
.campo {
    margin-bottom:16px;
}
.campo label {
    display:block;
    font-weight:900;
    margin-bottom:7px;
    color:#344256;
}
.campo input,.campo select,.campo textarea {
    width:100%;
    border:1px solid #dbe4f0;
    background:#f8fafc;
    border-radius:16px;
    padding:14px;
    font-family:inherit;
    font-size:1rem;
    outline:none;
}
.campo input:focus,.campo textarea:focus {
    border-color:var(--azul);
    box-shadow:0 0 0 4px rgba(36,87,214,.10);
}
.alerta {
    padding:13px 15px;
    border-radius:16px;
    margin-bottom:16px;
    font-weight:800;
}
.alerta.error {
    background:#fff1f2;
    color:#be123c;
}
.alerta.ok {
    background:#ecfdf5;
    color:#15803d;
}

/* ==================================================
   DASHBOARD
================================================== */
.dashboard {
    padding:60px 7%;
}
.dashboard-top {
    background:white;
    border-radius:32px;
    padding:30px;
    box-shadow:var(--sombra);
    display:flex;
    justify-content:space-between;
    gap:20px;
    align-items:center;
    margin-bottom:30px;
}
.dashboard-top h1 {
    color:var(--oscuro);
}

/* ==================================================
   PÁGINAS INTERNAS DE APLICACIONES
================================================== */
.pagina-app {
    padding:65px 7%;
}
.app-detalle {
    background:white;
    border-radius:34px;
    padding:38px;
    box-shadow:var(--sombra);
    border:1px solid #eef2ff;
    max-width:1000px;
    margin:0 auto;
}
.app-detalle h1 {
    font-size:2.4rem;
    color:var(--oscuro);
    margin-bottom:12px;
}
.app-detalle p {
    line-height:1.8;
    color:#5b687a;
    margin-bottom:18px;
}
.lista-check li {
    padding:10px 0;
    border-bottom:1px solid #eef2ff;
}
.lista-check li:before {
    content:'✓';
    color:#16a34a;
    font-weight:900;
    margin-right:8px;
}

/* ==================================================
   FOOTER
================================================== */
.footer-principal {
    background:#111827;
    color:#dbeafe;
    padding:50px 7% 20px;
}
.footer-grid {
    display:grid;
    grid-template-columns:1.2fr 1fr 1fr 1.1fr;
    gap:28px;
}
.footer-principal h3,.footer-principal h4 {
    color:white;
    margin-bottom:12px;
}
.footer-principal p,.footer-principal li {
    line-height:1.7;
    color:#cbd5e1;
}
.footer-principal a {
    color:#bfdbfe;
}
.footer-bottom {
    border-top:1px solid rgba(255,255,255,.12);
    margin-top:30px;
    padding-top:18px;
    display:flex;
    justify-content:space-between;
    gap:15px;
    color:#94a3b8;
    font-size:.92rem;
}

/* ==================================================
   ANIMACIONES
================================================== */
.fade-up {
    opacity:0;
    transform:translateY(32px);
    transition:opacity .75s ease,transform .75s ease;
}
.fade-up.visible {
    opacity:1;
    transform:translateY(0);
}

/* ==================================================
   RESPONSIVE
================================================== */
@media(max-width:1120px) {
    .apps-grid {
        grid-template-columns:repeat(3,1fr);
    }
    .hero {
        grid-template-columns:1fr;
    }
    .estadisticas {
        grid-template-columns:repeat(2,1fr);
    }
}
@media(max-width:820px) {
    .barra-superior {
        display:none;
    }
    .menu-toggle {
        display:block;
    }
    .menu {
        display:none;
        position:absolute;
        top:78px;
        left:7%;
        right:7%;
        background:white;
        border-radius:22px;
        box-shadow:var(--sombra);
        padding:14px;
        flex-direction:column;
        align-items:stretch;
    }
    .menu.abierto {
        display:flex;
    }
    .hero {
        padding-top:45px;
    }
    .apps-grid,.rutas-grid,.footer-grid,.cta-box {
        grid-template-columns:1fr;
    }
    .estadisticas {
        grid-template-columns:1fr;
    }
    .mini-grid {
        grid-template-columns:1fr;
    }
    .dashboard-top,.footer-bottom {
        flex-direction:column;
        align-items:flex-start;
    }
}
@media(max-width:560px) {
    .navbar {
        padding:13px 5%;
    }
    .hero,.seccion,.cta,.dashboard,.pagina-app,.form-page {
        padding-left:5%;
        padding-right:5%;
    }
    .form-card,.cta-box,.app-detalle {
        padding:25px;
    }
    .hero-botones {
        flex-direction:column;
    }
    .btn {
        width:100%;
    }
}







.hero2 {
    font-size: 1.18rem;
    line-height: 1.75;
    margin: 22px 0;
    color: #7d7575;
    max-width: 720px;
}

/* ==================================================
   CURSOS Y CAPÍTULOS
================================================== */
.curso-pagina,
.capitulo-pagina {
    max-width:1500px;
    margin:0 auto;
}
.curso-hero {
    background:linear-gradient(135deg,#ffffff 0%,#fff9eb 100%);
    border:1px solid #f4ead2;
    border-radius:34px;
    padding:34px;
    box-shadow:var(--sombra);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:28px;
    margin-bottom:34px;
}
.curso-hero h1,
.admin-curso-cabecera h2 {
    color:var(--oscuro);
    margin:7px 0 10px;
}
.curso-hero h1 { font-size:clamp(2rem,4vw,3.2rem); }
.curso-hero p,
.admin-curso-cabecera p {
    color:#64748b;
    line-height:1.7;
    max-width:850px;
}
.curso-kicker {
    display:inline-flex;
    color:#c2410c;
    background:#fff7ed;
    border:1px solid #fed7aa;
    border-radius:999px;
    padding:6px 11px;
    font-size:.8rem;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.06em;
}
.curso-acciones {
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    align-items:center;
}
.curso-seccion-cabecera,
.admin-curso-cabecera {
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:20px;
    margin-bottom:20px;
}
.curso-seccion-cabecera h2 { color:var(--oscuro); font-size:2rem; margin-top:5px; }
.curso-contador {
    background:#eef4ff;
    color:var(--azul);
    border-radius:999px;
    padding:8px 13px;
    font-weight:900;
    white-space:nowrap;
}
.capitulos-grid {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:22px;
    align-items:stretch;
}
.capitulo-card {
    min-width:0;
    height:100%;
    display:flex;
    flex-direction:column;
    background:#fff;
    border:1px solid #edf2ff;
    border-radius:26px;
    padding:22px;
    box-shadow:0 16px 42px rgba(24,33,62,.10);
    transition:.25s ease;
}
.capitulo-card:hover {
    transform:translateY(-6px);
    box-shadow:0 20px 55px rgba(24,33,62,.15);
}
.capitulo-card-top {
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:12px;
    margin-bottom:17px;
}
.capitulo-icono {
    width:56px;
    height:56px;
    flex:0 0 56px;
    border-radius:18px;
    display:grid;
    place-items:center;
    color:#fff;
    font-size:1.6rem;
    box-shadow:0 10px 22px rgba(0,0,0,.12);
}
.capitulo-icono.grande { width:72px; height:72px; flex-basis:72px; font-size:2rem; border-radius:22px; }
.capitulo-numero {
    color:#7c3aed;
    background:#f5f3ff;
    border-radius:999px;
    padding:6px 10px;
    font-size:.78rem;
    font-weight:900;
    white-space:nowrap;
}
.capitulo-card h3 {
    color:var(--oscuro);
    font-size:1.24rem;
    line-height:1.25;
    margin-bottom:10px;
}
.capitulo-card p {
    color:#64748b;
    line-height:1.65;
    margin-bottom:16px;
    flex:1;
}
.capitulo-tag {
    align-self:flex-start;
    display:inline-flex;
    background:#f1f5f9;
    color:#475569;
    border-radius:999px;
    padding:6px 10px;
    font-size:.8rem;
    font-weight:900;
    margin-bottom:16px;
}
.capitulo-boton {
    width:100%;
    margin-top:auto;
}
.curso-vacio {
    text-align:center;
    background:#fff;
    border:2px dashed #dbe4f0;
    border-radius:28px;
    padding:45px 28px;
}
.curso-vacio.compacto { padding:22px; }
.curso-vacio-icono { font-size:2.6rem; margin-bottom:10px; }
.curso-vacio h3,.curso-vacio h1 { color:var(--oscuro); margin-bottom:8px; }
.curso-vacio p { color:#64748b; margin-bottom:18px; }
.capitulo-detalle {
    max-width:1050px;
    margin:0 auto;
    background:#fff;
    border:1px solid #edf2ff;
    border-radius:34px;
    padding:38px;
    box-shadow:var(--sombra);
}
.capitulo-detalle-cabecera {
    display:flex;
    align-items:flex-start;
    gap:20px;
    padding-bottom:25px;
    border-bottom:1px solid #eef2f7;
}
.capitulo-detalle h1 {
    color:var(--oscuro);
    font-size:clamp(2rem,4vw,3rem);
    margin:8px 0;
}
.capitulo-bajada { color:#64748b; line-height:1.7; font-size:1.05rem; }
.capitulo-contenido {
    color:#344256;
    line-height:1.85;
    font-size:1.05rem;
    padding:30px 0;
    white-space:normal;
}
.capitulo-detalle-acciones {
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    border-top:1px solid #eef2f7;
    padding-top:24px;
}

/* Administración de cursos */
.admin-cursos-layout {
    display:grid;
    grid-template-columns:280px minmax(0,1fr);
    gap:26px;
    align-items:start;
}
.admin-cursos-sidebar,
.admin-curso-cabecera,
.admin-capitulos-lista {
    background:#fff;
    border:1px solid #edf2ff;
    border-radius:28px;
    box-shadow:0 14px 38px rgba(24,33,62,.08);
}
.admin-cursos-sidebar { padding:20px; position:sticky; top:120px; }
.admin-cursos-sidebar h2 { color:var(--oscuro); margin-bottom:14px; }
.admin-curso-lista { display:grid; gap:8px; }
.admin-curso-item {
    display:flex;
    gap:10px;
    align-items:center;
    padding:11px;
    border-radius:16px;
    border:1px solid transparent;
}
.admin-curso-item:hover,.admin-curso-item.activo { background:#f4f7ff; border-color:#dbeafe; color:var(--azul); }
.admin-curso-item span { font-size:1.35rem; }
.admin-curso-item strong,.admin-curso-item small { display:block; }
.admin-curso-item small { color:#94a3b8; margin-top:2px; }
.admin-nuevo-curso { margin-top:18px; border-top:1px solid #eef2f7; padding-top:16px; }
.admin-nuevo-curso summary { cursor:pointer; font-weight:900; color:var(--azul); }
.mini-form-admin { padding-top:16px; }
.admin-cursos-contenido { min-width:0; }
.admin-curso-cabecera { padding:24px; align-items:center; }
.admin-capitulo-form { width:100%; max-width:none; margin-bottom:26px; }
.admin-capitulo-form h2 { color:var(--oscuro); margin-bottom:6px; }
.admin-form-doble { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.admin-form-triple { display:grid; grid-template-columns:1fr 2fr 1fr; gap:14px; }
.admin-capitulos-lista { padding:24px; }
.admin-capitulos-lista > h2 { color:var(--oscuro); margin-bottom:16px; }
.admin-capitulo-item {
    display:flex;
    align-items:center;
    gap:16px;
    padding:17px 0;
    border-bottom:1px solid #eef2f7;
}
.admin-capitulo-item:last-child { border-bottom:0; }
.admin-capitulo-info { flex:1; min-width:0; }
.admin-capitulo-info p { color:#64748b; line-height:1.5; margin:6px 0; }
.admin-capitulo-info small { color:#94a3b8; }
.admin-capitulo-titulo { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.admin-capitulo-titulo strong { color:var(--oscuro); }
.estado-pill { padding:4px 8px; border-radius:999px; font-size:.72rem; font-weight:900; text-transform:uppercase; }
.estado-pill.visible { color:#15803d; background:#dcfce7; }
.estado-pill.oculto { color:#b45309; background:#fef3c7; }
.admin-capitulo-acciones { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.admin-capitulo-acciones .btn { padding:9px 13px; }

@media(max-width:1180px) {
    .capitulos-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:900px) {
    .capitulos-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .curso-hero,.curso-seccion-cabecera,.admin-curso-cabecera { align-items:flex-start; flex-direction:column; }
    .admin-cursos-layout { grid-template-columns:1fr; }
    .admin-cursos-sidebar { position:static; }
}
@media(max-width:620px) {
    .capitulos-grid { grid-template-columns:1fr; }
    .admin-form-doble,.admin-form-triple { grid-template-columns:1fr; gap:0; }
    .admin-capitulo-item { align-items:flex-start; flex-wrap:wrap; }
    .admin-capitulo-acciones { width:100%; justify-content:flex-start; }
    .capitulo-detalle-cabecera { flex-direction:column; }
}
.admin-ruta-curso {
    display:inline-block;
    margin-top:8px;
    padding:6px 10px;
    border-radius:10px;
    background:#f8fafc;
    color:#64748b;
    font-weight:800;
}

/* Ajustes administración multinivel: área > cursos > capítulos */
.admin-editar-curso { padding:0; overflow:hidden; }
.admin-editar-curso > summary { cursor:pointer; padding:22px 24px; font-weight:900; color:var(--oscuro); list-style-position:inside; }
.admin-editar-curso[open] > summary { border-bottom:1px solid #eef2f7; }
.admin-form-interno { padding:22px 24px 8px; }
.btn-peligro { background:#dc2626; color:#fff; border:1px solid #dc2626; }
.btn-peligro:hover { background:#b91c1c; border-color:#b91c1c; color:#fff; }
.zona-peligro { margin:18px 24px 24px; padding:16px; border:1px solid #fecaca; background:#fff7f7; border-radius:18px; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.zona-peligro strong { color:#991b1b; }
.zona-peligro p { color:#7f1d1d; margin-top:4px; font-size:.9rem; }
.admin-capitulo-acciones form { margin:0; }
.curso-card .capitulo-numero { color:#0369a1; background:#e0f2fe; }

@media(max-width:620px) {
    .zona-peligro { align-items:flex-start; flex-direction:column; }
}


/* Video dentro del desarrollo de cada capítulo */
.capitulo-video {
    position:relative;
    width:100%;
    max-width:100%;
    margin:34px 0 12px;
    padding:28px;
    background:linear-gradient(180deg,#ffffff 0%,#f6f9ff 100%);
    border:1px solid #dbe7ff;
    border-radius:30px;
    box-shadow:0 24px 60px rgba(36,87,214,.10), inset 0 1px 0 rgba(255,255,255,.85);
}
.capitulo-video-titulo {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:12px;
    color:var(--oscuro);
    margin-bottom:18px;
    text-align:center;
    font-size:1.1rem;
}
.capitulo-video-titulo span {
    width:42px;
    height:42px;
    display:grid;
    place-items:center;
    border-radius:50%;
    background:linear-gradient(135deg,var(--azul),var(--morado));
    color:#fff;
    font-size:.95rem;
    box-shadow:0 12px 24px rgba(36,87,214,.26);
}
.capitulo-video-responsive {
    position:relative;
    width:100%;
    max-width:100%;
    margin:0 auto;
    aspect-ratio:16 / 9;
    overflow:hidden;
    border-radius:24px;
    background:#0f172a;
    box-shadow:0 28px 60px rgba(15,23,42,.28);
    border:1px solid rgba(255,255,255,.08);
}
.capitulo-video-responsive iframe {
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    border:0;
}
.capitulo-video-enlace {
    margin:30px auto 8px;
    padding:20px 22px;
    width:min(100%, 920px);
    border-radius:22px;
    background:linear-gradient(180deg,#ffffff 0%,#f8faff 100%);
    border:1px solid #dbe7ff;
    color:#475569;
    text-align:center;
    box-shadow:0 18px 38px rgba(36,87,214,.08);
}
.capitulo-video-enlace a { color:var(--azul); font-weight:800; }
.campo-ayuda {
    display:block;
    margin-top:7px;
    color:#64748b;
    line-height:1.45;
}

@media(max-width:900px) {
    .capitulo-video {
        width:100%;
        max-width:100%;
        padding:20px;
        border-radius:24px;
    }
    .capitulo-video-titulo {
        font-size:1rem;
    }
    .capitulo-video-titulo span {
        width:38px;
        height:38px;
    }
    .capitulo-video-responsive {
        border-radius:18px;
    }
}

/* ==================================================
   EVALUACIÓN SECUENCIAL DE CAPÍTULOS
================================================== */
.evaluacion-capitulo {
    margin:34px 0 10px;
    padding:30px;
    border:1px solid #dbe7ff;
    border-radius:28px;
    background:linear-gradient(180deg,#ffffff 0%,#f8faff 100%);
    box-shadow:0 22px 50px rgba(36,87,214,.09);
}
.evaluacion-cabecera {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:22px;
    padding-bottom:22px;
    border-bottom:1px solid #e8eef8;
}
.evaluacion-cabecera h2 {
    margin:6px 0 7px;
    color:var(--oscuro);
    font-size:clamp(1.55rem,3vw,2rem);
}
.evaluacion-cabecera p {
    color:#64748b;
    line-height:1.6;
}
.evaluacion-icono {
    flex:0 0 auto;
    width:64px;
    height:64px;
    display:grid;
    place-items:center;
    border-radius:20px;
    background:linear-gradient(135deg,#eef4ff,#f5edff);
    font-size:2rem;
    box-shadow:inset 0 0 0 1px #dbe7ff;
}
.evaluacion-progreso {
    margin:24px 0 26px;
}
.evaluacion-progreso-texto {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:9px;
    color:#475569;
}
.evaluacion-progreso-texto strong { color:var(--oscuro); }
.evaluacion-barra {
    width:100%;
    height:10px;
    overflow:hidden;
    border-radius:999px;
    background:#e8eef8;
}
.evaluacion-barra span {
    display:block;
    height:100%;
    border-radius:inherit;
    background:linear-gradient(90deg,var(--azul),var(--morado));
    transition:width .3s ease;
}
.evaluacion-form h3 {
    color:var(--oscuro);
    font-size:1.22rem;
    line-height:1.55;
    margin-bottom:18px;
}
.evaluacion-opciones {
    display:grid;
    gap:12px;
}
.evaluacion-opcion {
    display:flex;
    align-items:center;
    gap:13px;
    width:100%;
    padding:15px 17px;
    border:1px solid #dfe7f2;
    border-radius:18px;
    background:#fff;
    cursor:pointer;
    transition:.2s ease;
    color:#344256;
    line-height:1.45;
}
.evaluacion-opcion:hover {
    border-color:#a8c0ff;
    transform:translateY(-1px);
    box-shadow:0 10px 25px rgba(36,87,214,.08);
}
.evaluacion-opcion:has(input:checked) {
    border-color:var(--azul);
    background:#f3f7ff;
    box-shadow:0 0 0 3px rgba(36,87,214,.08);
}
.evaluacion-opcion input {
    position:absolute;
    opacity:0;
    pointer-events:none;
}
.evaluacion-letra {
    flex:0 0 36px;
    width:36px;
    height:36px;
    display:grid;
    place-items:center;
    border-radius:12px;
    background:#eef3ff;
    color:var(--azul);
    font-weight:900;
}
.evaluacion-opcion:has(input:checked) .evaluacion-letra {
    background:linear-gradient(135deg,var(--azul),var(--morado));
    color:#fff;
}
.evaluacion-siguiente {
    margin-top:22px;
    min-width:220px;
}
.evaluacion-mensaje {
    margin:22px 0 0;
    padding:15px 18px;
    border-radius:16px;
    font-weight:800;
    line-height:1.5;
}
.evaluacion-mensaje.error {
    color:#991b1b;
    background:#fff1f2;
    border:1px solid #fecdd3;
}
.evaluacion-mensaje.exito {
    color:#166534;
    background:#f0fdf4;
    border:1px solid #bbf7d0;
}
.evaluacion-lograda {
    margin-top:24px;
    display:flex;
    align-items:center;
    gap:16px;
    padding:22px;
    border:1px solid #bbf7d0;
    border-radius:22px;
    background:linear-gradient(135deg,#f0fdf4,#ffffff);
}
.evaluacion-lograda-check {
    flex:0 0 54px;
    width:54px;
    height:54px;
    display:grid;
    place-items:center;
    border-radius:50%;
    background:#22c55e;
    color:#fff;
    font-size:1.7rem;
    font-weight:900;
    box-shadow:0 12px 28px rgba(34,197,94,.25);
}
.evaluacion-lograda strong {
    display:block;
    color:var(--oscuro);
    font-size:1.08rem;
}
.evaluacion-lograda span {
    display:inline-block;
    margin-top:3px;
    color:#15803d;
    font-weight:900;
}
.evaluacion-lograda p {
    margin-top:5px;
    color:#64748b;
}
.capitulo-logro {
    display:flex;
    align-items:center;
    gap:10px;
    margin:4px 0 16px;
    padding:11px 13px;
    border-radius:15px;
    background:#f0fdf4;
    border:1px solid #bbf7d0;
    color:#166534;
}
.capitulo-logro-icono {
    flex:0 0 30px;
    width:30px;
    height:30px;
    display:grid;
    place-items:center;
    border-radius:50%;
    background:#22c55e;
    color:#fff;
    font-weight:900;
}
.capitulo-logro strong,
.capitulo-logro small {
    display:block;
}
.capitulo-logro strong {
    color:#14532d;
    line-height:1.15;
}
.capitulo-logro small {
    margin-top:2px;
    color:#15803d;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.05em;
}

@media(max-width:700px) {
    .evaluacion-capitulo { padding:22px 18px; border-radius:22px; }
    .evaluacion-cabecera { align-items:flex-start; }
    .evaluacion-icono { width:52px; height:52px; border-radius:16px; font-size:1.6rem; }
    .evaluacion-opcion { align-items:flex-start; }
    .evaluacion-siguiente { width:100%; }
}

/* ==================================================
   TEXTO ENRIQUECIDO / HTML BÁSICO DE CURSOS Y CAPÍTULOS
================================================== */
.texto-html {
    line-height:1.75;
}
.texto-html p { margin:0 0 12px; }
.texto-html p:last-child { margin-bottom:0; }
.texto-html strong,
.texto-html b { font-weight:900; color:var(--oscuro); }
.texto-html em,
.texto-html i { font-style:italic; }
.texto-html u { text-underline-offset:3px; }
.texto-html h2,
.texto-html h3,
.texto-html h4 {
    color:var(--oscuro);
    line-height:1.25;
    margin:22px 0 10px;
}
.texto-html h2 { font-size:1.55rem; }
.texto-html h3 { font-size:1.3rem; }
.texto-html h4 { font-size:1.12rem; }
.texto-html ul,
.texto-html ol {
    margin:12px 0 16px 24px;
    padding-left:10px;
}
.texto-html ul { list-style:disc; }
.texto-html ol { list-style:decimal; }
.texto-html li { margin:5px 0; }
.texto-html blockquote {
    margin:18px 0;
    padding:14px 18px;
    border-left:4px solid var(--azul);
    background:#f8faff;
    border-radius:0 14px 14px 0;
}
.texto-html code {
    padding:2px 6px;
    border-radius:7px;
    background:#eef2ff;
    color:#4338ca;
    font-family:Consolas, Monaco, monospace;
}
.texto-html pre {
    margin:16px 0;
    padding:18px;
    overflow:auto;
    border-radius:16px;
    background:#111827;
    color:#f8fafc;
    font-family:Consolas, Monaco, monospace;
    line-height:1.55;
    white-space:pre-wrap;
}
.editor-codigo-html {
    min-height:360px;
    font-family:Consolas, Monaco, 'Courier New', monospace;
    line-height:1.55;
    tab-size:4;
}


/* Formato del HTML enriquecido de cursos y capítulos */
.texto-html,
.capitulo-contenido {
    overflow-wrap:anywhere;
}
.texto-html p,
.capitulo-contenido p {
    margin:0 0 1rem;
}
.texto-html h2, .texto-html h3, .texto-html h4,
.capitulo-contenido h2, .capitulo-contenido h3, .capitulo-contenido h4 {
    color:var(--oscuro);
    line-height:1.25;
    margin:1.6rem 0 .75rem;
}
.texto-html ul, .capitulo-contenido ul {
    list-style:disc;
    padding-left:1.6rem;
    margin:.65rem 0 1rem;
}
.texto-html ol, .capitulo-contenido ol {
    list-style:decimal;
    padding-left:1.8rem;
    margin:.65rem 0 1rem;
}
.texto-html li, .capitulo-contenido li {
    margin:.45rem 0;
    line-height:1.75;
}
.texto-html blockquote, .capitulo-contenido blockquote {
    margin:1rem 0;
    padding:14px 18px;
    border-left:4px solid var(--azul);
    background:#f8faff;
    border-radius:0 14px 14px 0;
}
.texto-html code, .capitulo-contenido code {
    font-family:Consolas, Monaco, 'Courier New', monospace;
    background:#eef2ff;
    padding:.15em .4em;
    border-radius:6px;
    font-size:.95em;
}
.texto-html pre, .capitulo-contenido pre {
    margin:1rem 0 1.35rem;
    padding:18px 20px;
    overflow:auto;
    background:#111827;
    color:#f8fafc;
    border-radius:16px;
    line-height:1.55;
    box-shadow:0 12px 30px rgba(15,23,42,.12);
}
.texto-html pre code, .capitulo-contenido pre code {
    background:transparent;
    color:inherit;
    padding:0;
    border-radius:0;
}
