/* ---------------------------------------------------------------------------
   Documentacion de Oktanet: indice y documentos largos (data sheet).

   Hereda la paleta de la portada para que un PDF impreso desde aqui se vea
   como la pagina. El bloque @media print es parte del entregable, no un
   adorno: el data sheet se distribuye en licitaciones como PDF.
   --------------------------------------------------------------------------- */

:root {
    --bg-main: #08131f;
    --bg-elevated: #0d1319;
    --bg-deep: #060f1b;
    --text-main: #c8d5ec;
    --text-muted: #a3b7d2;
    --line-soft: #15202b;
    --line-strong: #2a4159;
    --brand: #2b8fd4;
    --brand-strong: #99d1f9;
    --brand-soft: #041322;
    --highlight: #57c8ea;
    --radius-lg: 18px;
    --radius-md: 12px;
    --shadow-soft: 0 16px 34px rgba(0, 0, 0, 0.42);
    --doc-width: min(920px, calc(100% - 40px));
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Manrope", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--text-main);
    background: var(--bg-main);
    line-height: 1.55;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover,
a:focus-visible {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ----------------------------- Barra superior ----------------------------- */

.doc-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(180deg, #0f4d78 0%, #0b3a5c 100%);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.doc-header-inner {
    width: var(--doc-width);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
}

.doc-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.doc-brand img {
    width: 34px;
    height: 34px;
}

.doc-header nav {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.doc-header nav a {
    color: #dceaf7;
    font-size: 0.92rem;
    font-weight: 600;
}

.doc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    font-family: inherit;
}

.doc-btn:hover,
.doc-btn:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    text-decoration: none;
}

.doc-btn-solid {
    background: #fff;
    color: #0b4a78;
    border-color: #fff;
}

.doc-btn-solid:hover,
.doc-btn-solid:focus-visible {
    background: #e7f1fb;
}

/* `.doc-header nav a` pesa mas que `.doc-btn-solid`, asi que el enlace de
   descarga heredaba el azul palido de la navegacion sobre fondo blanco y
   quedaba casi ilegible. Se reponen los colores con la especificidad que hace
   falta, no subiendo la del resto. */
.doc-header nav a.doc-btn {
    color: #ffffff;
}

.doc-header nav a.doc-btn-solid {
    color: #0b4a78;
}

/* --------------------------------- Cuerpo --------------------------------- */

.doc-main {
    width: var(--doc-width);
    margin: 0 auto;
    padding: 40px 0 72px;
}

.doc-cover {
    padding: 34px 34px 30px;
    background: var(--bg-elevated);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.doc-eyebrow {
    margin: 0 0 10px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--highlight);
}

.doc-cover h1 {
    margin: 0 0 12px;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    line-height: 1.15;
}

.doc-lede {
    margin: 0 0 18px;
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 70ch;
}

.doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.doc-meta li {
    padding: 5px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: 0.84rem;
    color: var(--text-muted);
    background: #001326;
}

.doc-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
}

.doc-share-label {
    margin-right: 4px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.doc-share-link {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: #001326;
    color: var(--brand-strong);
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
}

.doc-share-link:hover,
.doc-share-link:focus-visible {
    background: var(--brand-soft);
    border-color: var(--brand);
    text-decoration: none;
}

.doc-share-link.is-done {
    background: var(--brand);
    border-color: var(--brand);
    color: #0d1319;
}

.doc-toc {
    margin: 26px 0 0;
    padding: 20px 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
}

.doc-toc h2 {
    margin: 0 0 12px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.doc-toc ol {
    margin: 0;
    /* 28px: con 20 el "1" de los números de dos cifras quedaba cortado. */
    padding-left: 28px;
    columns: 2;
    column-gap: 28px;
}

.doc-toc li {
    margin-bottom: 5px;
    break-inside: avoid;
}

.doc-section {
    margin-top: 30px;
    padding: 28px 30px;
    background: var(--bg-elevated);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
}

.doc-section h2 {
    margin: 0 0 14px;
    font-size: 1.5rem;
    line-height: 1.2;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--brand-soft);
}

.doc-section h3 {
    margin: 22px 0 8px;
    font-size: 1.1rem;
    color: var(--brand-strong);
}

.doc-section p {
    margin: 0 0 12px;
    color: var(--text-muted);
}

.doc-section ul,
.doc-section ol {
    margin: 0 0 12px;
    padding-left: 22px;
    color: var(--text-muted);
}

.doc-section li {
    margin-bottom: 6px;
}

.doc-section strong {
    color: var(--text-main);
}

.doc-table-wrap {
    overflow-x: auto;
    margin: 0 0 14px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
}

table.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

table.doc-table th,
table.doc-table td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line-soft);
}

table.doc-table thead th {
    background: linear-gradient(180deg, #0c5a91 0%, #073f67 100%);
    color: #fff;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

table.doc-table tbody tr:nth-child(even) td {
    background: #041322;
}

table.doc-table td {
    color: var(--text-muted);
}

table.doc-table td strong {
    color: var(--text-main);
}

.doc-callout {
    margin: 0 0 14px;
    padding: 14px 18px;
    border-left: 4px solid var(--brand);
    background: #051321;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.doc-callout p:last-child {
    margin-bottom: 0;
}

.doc-steps {
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
    counter-reset: paso;
}

.doc-steps li {
    counter-increment: paso;
    position: relative;
    padding: 8px 0 8px 42px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--text-muted);
}

.doc-steps li:last-child {
    border-bottom: 0;
}

.doc-steps li::before {
    content: counter(paso);
    position: absolute;
    left: 0;
    top: 8px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-weight: 800;
    font-size: 0.85rem;
}

.doc-footer {
    margin-top: 34px;
    padding: 22px 30px;
    background: var(--bg-deep);
    color: #c8daee;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
}

.doc-footer h3 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 1.05rem;
}

.doc-footer a {
    color: #9fd0f2;
}

/* ------------------------- Indice de documentacion ------------------------ */

.doc-list {
    display: grid;
    gap: 16px;
    margin-top: 26px;
}

.doc-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    align-items: start;
    padding: 22px 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.doc-item-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 24px;
}

.doc-item h3 {
    margin: 0 0 6px;
    font-size: 1.15rem;
}

.doc-item p {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 0.96rem;
}

.doc-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.doc-item-actions a {
    padding: 8px 15px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    font-size: 0.9rem;
    font-weight: 700;
}

.doc-item-actions a:hover,
.doc-item-actions a:focus-visible {
    background: var(--brand-soft);
    text-decoration: none;
}

.doc-item-actions a.is-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #0d1319;
}

.doc-item-actions a.is-primary:hover,
.doc-item-actions a.is-primary:focus-visible {
    background: var(--brand-strong);
}

@media (max-width: 720px) {
    .doc-toc ol {
        columns: 1;
    }

    .doc-section {
        padding: 22px 18px;
    }

    .doc-cover {
        padding: 24px 20px;
    }

    .doc-item {
        grid-template-columns: 1fr;
    }
}

.doc-social {
    display: flex;
    gap: 10px;
    margin-bottom: 6px !important;
}

.doc-social a {
    font-weight: 700;
}

/* --------------------------------- Impresion ------------------------------ */

@media print {
    /* El sitio es oscuro; el papel no. Se restituye la paleta clara con la que
       se diseno el documento y todo lo que usa tokens la sigue. */
    :root {
        --bg-main: #ffffff;
        --bg-elevated: #ffffff;
        --bg-deep: #ffffff;
        --text-main: #132037;
        --text-muted: #4a5d7a;
        --line-soft: #d4deea;
        --line-strong: #a6bad5;
        --brand: #0c5a91;
        --brand-strong: #063e66;
        --brand-soft: #deecfb;
        --highlight: #167a9f;
        --shadow-soft: none;
    }

    .doc-footer {
        color: #132037;
    }

    /* Las pastillas de la portada llevan su color literal, no un token. */
    .doc-meta li {
        background: #f7fbff;
        border-color: #a6bad5;
        color: #4a5d7a;
    }

    @page {
        size: A4;
        margin: 16mm 14mm;
    }

    :root {
        --doc-width: 100%;
    }

    body {
        background: #fff;
        font-size: 10.5pt;
        line-height: 1.45;
    }

    .doc-header,
    .doc-toc-actions,
    .no-print {
        display: none !important;
    }

    .doc-main {
        width: 100%;
        padding: 0;
    }

    .doc-cover,
    .doc-section,
    .doc-toc,
    .doc-item {
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: #fff;
        padding: 0;
        margin-top: 0;
    }

    .doc-cover {
        padding-bottom: 10mm;
        border-bottom: 2px solid #0c5a91;
    }

    .doc-toc {
        margin-top: 8mm;
    }

    /* Chrome colapsa el multicolumna al paginar: en impresion se pide una
       reticula explicita para que el indice siga ocupando dos columnas. */
    .doc-toc ol {
        columns: auto;
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 12mm;
    }

    .doc-section {
        margin-top: 8mm;
        break-inside: auto;
    }

    .doc-section h2 {
        break-after: avoid;
        font-size: 14pt;
    }

    .doc-section h3 {
        break-after: avoid;
        font-size: 11.5pt;
    }

    table.doc-table {
        font-size: 9pt;
    }

    table.doc-table thead {
        display: table-header-group;
    }

    table.doc-table tr {
        break-inside: avoid;
    }

    /* El zebrado usa un color LITERAL, no un token, asi que la restitucion de
       la paleta clara de arriba no lo alcanzaba: en el PDF las filas pares
       salian con fondo casi negro mientras el texto ya venia en tinta oscura
       (--text-muted #4a5d7a). Oscuro sobre oscuro: ilegibles. Es la misma
       trampa que ya habia mordido a .doc-meta y .doc-callout, que se corrigen
       con literales unas lineas mas arriba. */
    table.doc-table tbody tr:nth-child(even) td {
        background: #f4f8fc;
    }

    .doc-table-wrap {
        overflow: visible;
        border: 1px solid #c9d8e7;
    }

    .doc-callout {
        break-inside: avoid;
        background: #f4f8fc;
    }

    .doc-footer {
        background: #fff;
        color: #132037;
        border-top: 2px solid #0c5a91;
        border-radius: 0;
        padding: 6mm 0 0;
        break-inside: avoid;
    }

    .doc-footer h3,
    .doc-footer a {
        color: #0c5a91;
    }
}

/* ------------------------- Resumen ejecutivo (2 pags) ---------------------
   El resumen tiene que caber en dos hojas para cumplir lo que promete: un
   documento "de dos paginas" que sale en tres deja de serlo. Se aprieta solo
   la impresion de ESTE documento (`body.doc-compact`); en pantalla y en la
   ficha tecnica no cambia nada.
   -------------------------------------------------------------------------- */

@media print {
    body.doc-compact {
        font-size: 9.6pt;
        line-height: 1.38;
    }

    body.doc-compact .doc-cover {
        padding-bottom: 5mm;
    }

    body.doc-compact .doc-cover h1 {
        margin: 0 0 8px;
        font-size: 1.7rem;
    }

    body.doc-compact .doc-lede {
        margin: 0 0 10px;
        font-size: 0.95rem;
    }

    body.doc-compact .doc-section {
        margin-top: 5mm;
    }

    body.doc-compact .doc-section h2 {
        margin: 0 0 6px;
    }

    body.doc-compact .doc-section p {
        margin: 0 0 7px;
    }

    body.doc-compact table.doc-table {
        font-size: 8.2pt;
    }

    body.doc-compact table.doc-table th,
    body.doc-compact table.doc-table td {
        padding: 5px 8px;
    }

    body.doc-compact .doc-callout {
        padding: 8px 12px;
        margin-bottom: 8px;
    }

    body.doc-compact .doc-footer {
        padding-top: 4mm;
    }
}

/* ================================ Blog ====================================
   Los articulos reusan la maquinaria de la documentacion —portada, secciones,
   tablas, compartir y la hoja de impresion— para que cada uno se pueda mandar
   como PDF a un cliente sin trabajo extra. Lo unico propio es el indice y los
   pocos elementos que un articulo tiene y un documento no: fecha, tiempo de
   lectura, etiquetas y el cierre comercial.
   -------------------------------------------------------------------------- */

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.post-meta .post-tag {
    padding: 4px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--brand-strong);
    font-weight: 600;
    font-size: 0.8rem;
}

/* Frase suelta que sostiene el argumento del articulo. No es una cita de
   nadie, asi que no lleva comillas ni <blockquote>: es enfasis tipografico. */
.post-punch {
    margin: 22px 0;
    padding: 4px 0 4px 18px;
    border-left: 3px solid var(--brand);
    font-size: clamp(1.05rem, 2vw, 1.28rem);
    font-weight: 700;
    line-height: 1.4;
    color: var(--brand-strong);
}

/* El video va incrustado como caratula: no se carga nada de YouTube hasta
   que el lector pulsa. Mismo criterio que la portada del sitio. */
.post-video {
    margin: 26px 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-deep);
}

.post-video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-width: 100%;
}

.post-video-frame img,
.post-video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
}

.post-video-caption {
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* El cierre comercial va separado del cuerpo a proposito: el articulo tiene
   que servir aunque el lector nunca compre, y mezclarlo con el argumento
   tecnico le quita credibilidad a las dos partes. */
.post-cta {
    margin-top: 34px;
    padding: 24px 26px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--brand-soft);
}

.post-cta h2 {
    margin: 0 0 12px;
    font-size: 1.2rem;
}

.post-cta p {
    margin: 0 0 14px;
}

.post-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.post-cta-actions a {
    padding: 10px 18px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
}

.post-cta-actions a.is-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #f2f7ff;
}

/* ---------------------------- Indice del blog ----------------------------- */

.post-list {
    display: grid;
    gap: 18px;
    margin-top: 26px;
}

.post-card {
    display: block;
    padding: 24px 26px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    text-decoration: none;
    transition: border-color 180ms ease, transform 180ms ease;
}

.post-card:hover,
.post-card:focus-visible {
    border-color: var(--line-strong);
    transform: translateY(-2px);
    text-decoration: none;
}

.post-card h3 {
    margin: 10px 0 10px;
    font-size: 1.22rem;
    color: var(--text-main);
}

.post-card p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.post-card .post-meta {
    margin: 0;
}

@media print {
    /* Lo que existe solo para navegar no aporta nada en papel. */
    .post-video,
    .post-cta-actions {
        display: none !important;
    }

    .post-punch {
        color: #0c5a91;
    }

    .post-cta {
        background: #f4f8fc;
        break-inside: avoid;
    }
}

/* Botón de reproducción de los vídeos del blog. Se crea desde JavaScript,
   así que sin JavaScript queda la carátula y el artículo se lee igual. */
.post-video-frame {
    cursor: pointer;
}

.post-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 66px;
    height: 66px;
    padding: 0 0 0 4px;
    border: 1px solid rgba(153, 209, 249, 0.5);
    border-radius: 50%;
    background: rgba(8, 21, 33, 0.78);
    color: var(--brand-strong);
    font-size: 1.5rem;
    cursor: pointer;
    transition: background-color 180ms ease, transform 180ms ease;
}

.post-video-play:hover,
.post-video-play:focus-visible {
    background: rgba(12, 90, 145, 0.92);
    transform: translate(-50%, -50%) scale(1.06);
}

/* Icono al inicio de cada titulo de seccion de un articulo. Se dibuja con
   trazo y no relleno para que se lea igual sobre el fondo oscuro de la web y
   sobre el blanco del PDF, donde el color cambia a la tinta de marca. */
.doc-section h2 {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-section-icon {
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--highlight);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* La marca de Oktanet dentro del articulo, no solo en la barra superior. */
.post-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.post-brand img {
    width: 30px;
    height: 30px;
}

@media print {
    .post-section-icon {
        stroke: #0c5a91;
    }

    .post-brand {
        color: #4a5d7a;
    }
}

/* El icono en las tarjetas del indice: mismo juego que en las secciones, un
   poco mas chico porque acompana a un h3 y no a un h2. */
.post-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-card .post-section-icon {
    width: 22px;
    height: 22px;
}

/* ---- Examen interactivo (curso de preventa) --------------------------------
   Las preguntas viven en el HTML: el mismo marcado se imprime como examen en
   papel. En pantalla, la clave de respuestas (.print-only) no se ve; la
   respuesta de cada pregunta aparece sólo si el alumno la pide al calificar. */
.print-only {
    display: none;
}

.quiz-intro {
    color: var(--text-muted);
}

/* El número va dentro del enunciado: con el marcador de la lista quedaba a
   media altura, porque el enunciado flota para quedar dentro del recuadro. */
.quiz-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    counter-reset: quiz;
}

.quiz-q {
    margin: 0 0 14px;
    counter-increment: quiz;
}

.quiz-q legend::before {
    content: counter(quiz) ". ";
    color: var(--text-muted);
}

.quiz-q fieldset {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--line-soft);
    border-left: 3px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--bg-deep);
}

.quiz-q legend {
    float: left;
    width: 100%;
    margin: 0 0 8px;
    padding: 0;
    font-weight: 700;
    color: var(--text-main);
}

.quiz-multi {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-strong);
    vertical-align: middle;
}

.quiz-opt {
    clear: both;
    display: flex;
    gap: 8px;
    align-items: baseline;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
}

.quiz-opt:hover {
    background: rgba(87, 200, 234, 0.07);
}

.quiz-opt input {
    accent-color: var(--brand);
    flex: none;
    transform: translateY(2px);
}

.quiz-letter {
    flex: none;
    font-weight: 700;
    color: var(--text-muted);
}

.quiz-why {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(43, 143, 212, 0.1);
    color: var(--text-main);
}

.quiz-q.is-correct fieldset {
    border-left-color: #34d399;
}

.quiz-q.is-wrong fieldset {
    border-left-color: #f87171;
}

.quiz-revealed .quiz-opt.is-answer {
    background: rgba(52, 211, 153, 0.12);
    box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.5);
}

.quiz-revealed .quiz-opt.is-chosen-wrong {
    background: rgba(248, 113, 113, 0.12);
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.5);
}

.quiz-graded .quiz-opt {
    cursor: default;
}

.quiz-bar {
    position: sticky;
    bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-soft);
}

.quiz-btn {
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--text-main);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.quiz-btn:hover,
.quiz-btn:focus-visible {
    border-color: var(--brand);
}

.quiz-btn-solid {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.quiz-btn-solid:disabled {
    opacity: 0.45;
    cursor: default;
}

.quiz-result {
    flex: 1 1 240px;
    margin: 0;
    font-weight: 700;
}

.quiz-result.is-pass {
    color: #34d399;
}

.quiz-result.is-fail {
    color: #f87171;
}

@media print {
    .print-only {
        display: block;
    }

    li.print-only {
        display: list-item;
    }

    .quiz-q {
        break-inside: avoid;
    }

    .quiz-q fieldset {
        padding: 6px 0;
        border: 0;
        background: none;
    }

    .quiz-opt {
        padding: 1px 0;
    }

    .quiz-opt input,
    .quiz-why,
    .quiz-multi {
        display: none;
    }
}

/* Bloques de código (curso de automatización): se ajustan al ancho. Una línea
   más ancha que la página hace que Chrome encoja todo el PDF. */
pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    padding: 12px 14px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    background: var(--bg-deep);
    font-size: 0.82rem;
}

@media print {
    pre {
        background: none;
        font-size: 8.5pt;
        break-inside: auto;
    }
}


/* Registro de un curso gratuito (Academia): sólo en pantalla. El contenido se
   imprime completo aunque no haya registro, para que el PDF salga entero. */
.course-gate .gate-form {
    display: grid;
    gap: 12px;
    max-width: 520px;
}

.course-gate label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.course-gate input[type="text"],
.course-gate input[type="email"],
.course-gate select {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: var(--bg-deep);
    color: var(--text-main);
    font: inherit;
}

.course-gate .gate-consent {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.course-gate .gate-error {
    color: #f87171;
    margin: 0;
}

@media print {
    [data-gated][hidden] {
        display: block !important;
    }
}

/* Un botón (display: inline-flex) le gana al atributo hidden: sin esto el
   PDF de un curso con registro se veía antes de registrarse. */
@media screen {
    [data-gated][hidden] {
        display: none !important;
    }
}

/* ---- Certificado de aprobación (cursos gratuitos) ---------------------------
   El bloque aparece bajo el examen sólo al aprobar; el certificado en sí es
   otra página (docs/certificado.html) pensada para salir en papel o PDF:
   hoja blanca también en pantalla, tamaño carta horizontal al imprimir. */
.quiz-cert {
    margin-top: 18px;
    padding: 18px 20px;
    border: 1px solid rgba(52, 211, 153, 0.45);
    border-left: 3px solid #34d399;
    border-radius: var(--radius-md);
    background: rgba(52, 211, 153, 0.07);
}

.quiz-cert h3 {
    margin: 0 0 6px;
    color: #34d399;
}

.quiz-cert p {
    margin: 0 0 12px;
    color: var(--text-muted);
}

.quiz-cert-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.quiz-cert-form label {
    display: grid;
    gap: 6px;
    flex: 1 1 260px;
    font-weight: 600;
    color: var(--text-main);
}

.quiz-cert-form input {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: var(--bg-deep);
    color: var(--text-main);
    font: inherit;
}

.quiz-cert-form input:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

.quiz-cert-note {
    margin: 12px 0 0 !important;
    font-size: 0.88rem;
}

/* La página del certificado es clara en pantalla: así lo que se ve es lo que
   sale en el PDF, y el logo de Oktavia va sobre blanco como en los impresos. */
.cert-page {
    --bg-main: #e9eef5;
    --bg-elevated: #ffffff;
    --bg-deep: #ffffff;
    --text-main: #132037;
    --text-muted: #4a5d7a;
    --line-soft: #d4deea;
    --line-strong: #a6bad5;
    --brand: #0c5a91;
    --brand-strong: #063e66;
    --brand-soft: #deecfb;
    --highlight: #167a9f;
    --shadow-soft: 0 18px 40px rgba(19, 32, 55, 0.18);
}

.cert-page .doc-main {
    width: min(1040px, calc(100% - 32px));
    padding: 28px 0 56px;
}

.cert-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 18px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.cert-actions p {
    margin: 0;
    flex: 1 1 320px;
}

.cert-actions .quiz-btn {
    color: var(--brand-strong);
}

.cert-actions .quiz-btn-solid {
    color: #fff;
}

.cert-sheet {
    position: relative;
    padding: clamp(22px, 5vw, 56px) clamp(18px, 6vw, 72px);
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    background: #fff;
    color: var(--text-main);
    box-shadow: var(--shadow-soft);
    text-align: center;
}

/* Doble marco: una línea gruesa azul y una fina adentro, como un diploma. */
.cert-sheet::before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 3px solid var(--brand);
    border-radius: 4px;
    pointer-events: none;
}

.cert-sheet::after {
    content: "";
    position: absolute;
    inset: 17px;
    border: 1px solid var(--line-strong);
    border-radius: 2px;
    pointer-events: none;
}

.cert-logo {
    width: clamp(72px, 12vw, 110px);
    margin: 0 auto 10px;
}

.cert-academy {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brand);
}

.cert-title {
    margin: 10px 0 4px;
    font-size: clamp(1.6rem, 4.2vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--brand-strong);
}

.cert-lead {
    margin: 0;
    color: var(--text-muted);
}

.cert-name {
    margin: 18px auto 4px;
    max-width: 80%;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--brand);
    font-size: clamp(1.5rem, 4.5vw, 2.4rem);
    font-weight: 800;
    color: var(--text-main);
    overflow-wrap: anywhere;
}

.cert-course-label {
    margin: 14px 0 2px;
    color: var(--text-muted);
}

.cert-course {
    margin: 0;
    font-size: clamp(1.15rem, 3vw, 1.6rem);
    font-weight: 700;
    color: var(--brand-strong);
}

.cert-level {
    margin: 2px 0 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cert-validation {
    margin: 16px auto 0;
    max-width: 640px;
    color: var(--text-main);
}

.cert-facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 28px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.cert-facts li {
    display: grid;
    gap: 2px;
    min-width: 120px;
}

.cert-facts .cert-fact-label {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.cert-facts .cert-fact-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cert-signature {
    margin: 26px auto 0;
    max-width: 300px;
    padding-top: 8px;
    border-top: 1px solid var(--text-main);
}

.cert-signature p {
    margin: 0;
}

.cert-signature .cert-signer {
    font-weight: 700;
}

.cert-signature .cert-signer-role {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.cert-fine {
    margin: 22px auto 0;
    max-width: 720px;
    font-size: 0.76rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.cert-fine a {
    color: var(--brand);
}

.cert-invalid {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px;
    border: 1px solid var(--line-soft);
    border-left: 3px solid #f87171;
    border-radius: var(--radius-md);
    background: #fff;
}

.cert-invalid h2 {
    margin-top: 0;
}

@media (max-width: 640px) {
    .cert-sheet::before {
        inset: 6px;
        border-width: 2px;
    }

    .cert-sheet::after {
        inset: 11px;
    }

    .cert-name {
        max-width: 100%;
    }

    .cert-facts {
        gap: 10px 18px;
    }
}

/* Impresión del certificado: carta horizontal, sin navegación ni controles.
   El marco se dibuja con bordes, no con fondos, para que salga aunque el
   navegador no imprima fondos. */
@media print {
    .cert-page {
        --bg-main: #ffffff;
    }

    .cert-page .doc-main {
        width: 100%;
        padding: 0;
    }

    .cert-actions,
    .cert-page .doc-header {
        display: none !important;
    }

    .cert-sheet {
        box-shadow: none;
        border-radius: 0;
        border-color: #fff;
        padding: 14mm 18mm;
        break-inside: avoid;
        min-height: 186mm;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .cert-sheet::before {
        inset: 4mm;
        border-radius: 0;
    }

    .cert-sheet::after {
        inset: 6mm;
        border-radius: 0;
    }

    .cert-logo {
        width: 26mm;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .cert-title {
        font-size: 24pt;
    }

    .cert-name {
        font-size: 24pt;
    }

    .cert-course {
        font-size: 15pt;
    }

    .cert-fine {
        font-size: 7.5pt;
    }
}

@page cert {
    size: letter landscape;
    margin: 10mm;
}

.cert-page {
    page: cert;
}
