/* ==========================================================================
   Certificado público v2 — EDUTIC Webinar
   Paleta "institucional claro". Depende sólo de Space Grotesk.
   No requiere Bootstrap. Prefijo .cpub- para no chocar con certificado-publico.css
   ========================================================================== */

.cpub {
    --cpub-bg: #F4F7FA;
    --cpub-surface: #FFFFFF;
    --cpub-surface-alt: #EDF2F7;

    --cpub-ink: #16283C;
    --cpub-ink-2: #43566D;
    --cpub-muted: #55677A;

    --cpub-border: #DEE6EE;
    --cpub-border-strong: #C4D1DE;

    /* Verde = validez */
    --cpub-accent: #4C7A16;
    --cpub-accent-bright: #80B327;
    --cpub-accent-deep: #33540C;
    --cpub-accent-soft: #EDF4DE;
    --cpub-accent-line: #C9DFA3;

    /* Azul = verificación por terceros */
    --cpub-info: #22608F;
    --cpub-info-line: #C3DCF4;

    /* Chrome del portal */
    --cpub-header-bg: #0e1420;
    --cpub-footer-bg: #0a0f19;

    --cpub-radius: 14px;
    --cpub-shadow: 0 18px 44px rgba(22, 40, 60, 0.12);
    --cpub-maxw: 1180px;
    --cpub-font: 'Space Grotesk', 'Segoe UI', sans-serif;
    --cpub-mono: ui-monospace, Menlo, monospace;

    font-family: var(--cpub-font);
    background: var(--cpub-bg);
    color: var(--cpub-ink);
    min-height: 100%;
}

.cpub *,
.cpub *::before,
.cpub *::after { box-sizing: border-box; }

.cpub-shell {
    max-width: var(--cpub-maxw);
    margin: 0 auto;
    padding-left: 32px;
    padding-right: 32px;
}

/* ---------- Header ---------- */
.cpub-header { background: var(--cpub-header-bg); }

.cpub-header .cpub-shell {
    padding-top: 16px;
    padding-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.cpub-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    flex: none;
}

.cpub-logo-word {
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -0.02em;
    color: #FFFFFF;
    line-height: 1;
}

.cpub-logo-rule {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--cpub-accent-bright);
}

.cpub-logo-sub {
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1;
}

.cpub-nav {
    display: flex;
    gap: 24px;
    font-size: 14px;
    font-weight: 500;
}

.cpub-nav a {
    color: rgba(255, 255, 255, 0.62);
    text-decoration: none;
}

.cpub-nav a:hover { color: var(--cpub-accent-bright); }

.cpub-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

.cpub-access {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: var(--cpub-font);
    color: rgba(255, 255, 255, 0.62);
    font-size: 14px;
    font-weight: 600;
}

.cpub-access:hover { color: var(--cpub-accent-bright); }

.cpub-btn-pill {
    background: var(--cpub-accent-bright);
    color: var(--cpub-header-bg);
    font-weight: 700;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 999px;
    text-decoration: none;
}

.cpub-btn-pill:hover { background: #9ED14B; color: var(--cpub-header-bg); }

/* ---------- Hero ---------- */
.cpub-hero {
    background:
        radial-gradient(700px 380px at 80% -10%, rgba(45, 125, 210, 0.14), transparent 66%),
        linear-gradient(180deg, #FFFFFF 0%, var(--cpub-bg) 100%);
    border-bottom: 1px solid var(--cpub-border);
}

.cpub-hero .cpub-shell {
    padding-top: 52px;
    padding-bottom: 56px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 560px;
    gap: 44px;
    align-items: start;
}

.cpub-hero-copy { min-width: 0; }

.cpub-hero-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.cpub-hero-facts {
    margin-top: 36px;
}

.cpub-hero-facts .cpub-sub {
    margin-bottom: 18px;
}

.cpub-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--cpub-accent-soft);
    border: 1px solid var(--cpub-accent-line);
    color: var(--cpub-accent);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    padding: 7px 14px;
    border-radius: 999px;
}

.cpub-holder {
    margin: 20px 0 0;
    font-size: 52px;
    line-height: 1.04;
    letter-spacing: -0.03em;
    font-weight: 700;
}

.cpub-lede {
    margin: 16px 0 0;
    font-size: 19px;
    line-height: 1.5;
    color: var(--cpub-ink-2);
    max-width: 620px;
    text-wrap: pretty;
}

.cpub-lede strong {
    color: var(--cpub-ink);
    font-weight: 600;
}

.cpub-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 26px 0 0;
}

.cpub-chip {
    background: #9EB8A0;
    border: 1px solid #8AA98D;
    color: #16283C;
    font-size: 13.5px;
    font-weight: 600;
    padding: 9px 15px;
    border-radius: 999px;
}

/* Tarjeta con la imagen del certificado */
.cpub-doc-card {
    background: var(--cpub-surface);
    border: 1px solid var(--cpub-border);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--cpub-shadow);
}

.cpub-doc-card img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    background: #FFFFFF;
}

.cpub-doc-link {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    line-height: 0;
}

.cpub-doc-link:hover img {
    opacity: 0.96;
}

.cpub-inline-link {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--cpub-accent-line);
    text-underline-offset: 3px;
}

.cpub-inline-link:hover {
    color: var(--cpub-accent);
    text-decoration-color: var(--cpub-accent);
}

.cpub-btn-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid var(--cpub-border-strong);
    background: var(--cpub-surface);
    color: var(--cpub-accent);
    font-size: 14px;
    font-weight: 700;
    padding: 11px 0;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    font-family: var(--cpub-font);
}

.cpub-btn-outline:hover {
    border-color: var(--cpub-accent);
    background: var(--cpub-accent-soft);
    color: var(--cpub-accent-deep);
}

/* ---------- Cuerpo ---------- */
.cpub-main {
    max-width: var(--cpub-maxw);
    margin: 0 auto;
    padding: 46px 32px 60px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.cpub-topics-block {
    margin-top: 0;
    width: 100%;
}

.cpub-col { min-width: 0; }

.cpub-eyebrow {
    display: block;
    font-family: var(--cpub-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--cpub-accent);
    margin-bottom: 10px;
}

.cpub-h2 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.cpub-sub {
    margin: 0 0 22px;
    font-size: 15px;
    color: var(--cpub-muted);
}

.cpub-block { margin-top: 30px; }

/* Tabla de datos */
.cpub-table {
    background: var(--cpub-surface);
    border: 1px solid var(--cpub-border);
    border-radius: var(--cpub-radius);
    overflow: hidden;
}

.cpub-row {
    display: grid;
    grid-template-columns: 30% 70%;
    border-bottom: 1px solid var(--cpub-border);
}

.cpub-row:last-child { border-bottom: none; }

.cpub-row-label {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--cpub-ink);
    background: var(--cpub-surface-alt);
    padding: 16px 20px;
    border-right: 1px solid var(--cpub-border);
}

.cpub-row-value {
    font-size: 15.5px;
    font-weight: 500;
    color: var(--cpub-ink);
    padding: 16px 24px;
    text-wrap: pretty;
}

/* Temas — lista numerada (no pills) */
.cpub-topics {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--cpub-surface);
    border: 1px solid var(--cpub-border);
    border-radius: var(--cpub-radius);
    overflow: hidden;
}

.cpub-topic {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 0 16px;
    align-items: start;
    padding: 16px 20px;
    border-bottom: 1px solid var(--cpub-border);
    border-left: 3px solid var(--cpub-accent-bright);
}

.cpub-topic:last-child { border-bottom: none; }

.cpub-topic-n {
    font-family: var(--cpub-mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--cpub-accent);
    line-height: 1.45;
    padding-top: 1px;
}

.cpub-topic-t {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--cpub-ink);
    text-wrap: pretty;
}

.cpub-tag-empty {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    border: 1px dashed var(--cpub-border-strong);
    background: none;
    color: var(--cpub-muted);
    font-size: 14px;
    font-weight: 500;
    padding: 14px 18px;
    border-radius: var(--cpub-radius);
}

/* Cómo verificar — ancho completo */
.cpub-verify {
    background: var(--cpub-surface);
    border: 1px solid var(--cpub-info-line);
    border-top: 3px solid var(--cpub-info);
    border-radius: var(--cpub-radius);
    padding: 24px 26px;
    box-shadow: var(--cpub-shadow);
}

.cpub-verify h3 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    color: var(--cpub-info);
}

.cpub-verify > p {
    margin: 0 0 18px;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--cpub-ink-2);
}

.cpub-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.cpub-step {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.cpub-step-n {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--cpub-info);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cpub-step-t {
    font-size: 14.5px;
    font-weight: 600;
}

.cpub-step-d {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--cpub-ink-2);
    overflow-wrap: anywhere;
}

.cpub-step-d a {
    color: var(--cpub-info);
    font-weight: 600;
}

/* ---------- Aside ---------- */
.cpub-aside {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 380px;
    width: 100%;
}

.cpub-valid {
    background: var(--cpub-accent-soft);
    border: 1px solid var(--cpub-accent-line);
    border-radius: var(--cpub-radius);
    padding: 24px 24px 22px;
}

.cpub-valid-head {
    display: flex;
    align-items: center;
    gap: 11px;
}

.cpub-valid-mark {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: var(--cpub-accent);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cpub-valid-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--cpub-accent-deep);
}

.cpub-valid p {
    margin: 14px 0 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--cpub-ink-2);
}

.cpub-idblock { margin-top: 20px; }

.cpub-idlabel {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--cpub-muted);
}

.cpub-idrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.cpub-idrow code {
    flex: 1;
    min-width: 0;
    font-family: var(--cpub-mono);
    font-size: 12.5px;
    color: var(--cpub-ink);
    background: var(--cpub-surface);
    border: 1px solid var(--cpub-border);
    border-radius: 7px;
    padding: 10px 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cpub-icon-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--cpub-border-strong);
    border-radius: 7px;
    color: var(--cpub-ink-2);
    background: var(--cpub-surface);
    cursor: pointer;
}

.cpub-icon-btn:hover {
    border-color: var(--cpub-accent);
    color: var(--cpub-accent);
}

.cpub-icon-btn.is-done {
    border-color: var(--cpub-accent);
    color: var(--cpub-accent);
}

/* Área privada: el único bloque oscuro del cuerpo */
.cpub-private {
    background: var(--cpub-header-bg);
    border-radius: var(--cpub-radius);
    padding: 24px;
    box-shadow: var(--cpub-shadow);
}

.cpub-private-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--cpub-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--cpub-accent-bright);
}

.cpub-private h3 {
    margin: 12px 0 8px;
    font-size: 16.5px;
    font-weight: 700;
    color: #FFFFFF;
}

.cpub-private p {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.72);
}

.cpub-private-actions {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
}

.cpub-private-actions > a {
    flex: 1 1 50%;
    min-width: 0;
    text-align: center;
    box-sizing: border-box;
}

.cpub-btn-accent {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cpub-accent-bright);
    color: var(--cpub-header-bg);
    font-size: 14.5px;
    font-weight: 700;
    padding: 12px 10px;
    border-radius: 8px;
    text-decoration: none;
}

.cpub-btn-accent:hover { background: #9ED14B; color: var(--cpub-header-bg); }

.cpub .cpub-private .cpub-btn-ghost,
.cpub-btn-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #FFFFFF;
    font-size: 14.5px;
    font-weight: 600;
    padding: 12px 10px;
    border-radius: 8px;
    text-decoration: none;
}

.cpub .cpub-private .cpub-btn-ghost:hover,
.cpub-btn-ghost:hover {
    border-color: #FFFFFF;
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}

.cpub .cpub-private .cpub-btn-ghost:visited,
.cpub-btn-ghost:visited {
    color: #FFFFFF;
}

.cpub-note {
    margin: 0;
    padding: 0 4px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--cpub-muted);
}

.cpub-note a {
    color: var(--cpub-accent);
    font-weight: 600;
}

/* ---------- Footer ---------- */
.cpub-footer {
    background: var(--cpub-footer-bg);
    border-top: 1px solid var(--cpub-border);
}

.cpub-footer .cpub-shell {
    padding-top: 36px;
    padding-bottom: 30px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 40px;
}

.cpub-footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.cpub-footer-brand p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.62);
    max-width: 460px;
}

.cpub-footer .cpub-logo-sub { color: rgba(255, 255, 255, 0.62); }

.cpub-social {
    display: flex;
    gap: 10px;
}

.cpub-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.62);
}

.cpub-social a:hover {
    border-color: var(--cpub-accent-bright);
    color: var(--cpub-accent-bright);
}

.cpub-footer-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.cpub-footer-meta-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.62);
}

.cpub-footer-meta span {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.62);
    line-height: 1.6;
}

.cpub-footer-meta a {
    font-size: 13.5px;
    color: var(--cpub-accent-bright);
    font-weight: 600;
    text-decoration: none;
}

/* ---------- Modal certificado a tamaño completo ---------- */
.cpub-zoom {
    position: fixed;
    inset: 0;
    background: rgba(6, 10, 17, 0.88);
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.cpub-zoom.is-open { display: flex; }

.cpub-zoom-inner {
    background: #FFFFFF;
    border-radius: 14px;
    padding: 20px;
    width: min(1020px, 100%);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cpub-zoom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cpub-zoom-bar strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--cpub-ink);
}

.cpub-zoom-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--cpub-border);
    background: none;
    color: var(--cpub-muted);
    cursor: pointer;
}

.cpub-zoom-close:hover {
    border-color: var(--cpub-ink);
    color: var(--cpub-ink);
}

.cpub-zoom-inner img {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 200px);
    object-fit: contain;
    border-radius: 8px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .cpub-hero .cpub-shell {
        grid-template-columns: minmax(0, 1fr);
    }
    .cpub-main { padding-bottom: 48px; }
    .cpub-doc-card,
    .cpub-hero-side { max-width: 560px; }
    .cpub-aside { max-width: 560px; }
}

@media (max-width: 820px) {
    .cpub-shell,
    .cpub-main { padding-left: 20px; padding-right: 20px; }
    .cpub-holder { font-size: 38px; }
    .cpub-lede { font-size: 17px; }
    .cpub-steps { grid-template-columns: minmax(0, 1fr); gap: 22px; }
    .cpub-nav { display: none; }
}

@media (max-width: 620px) {
    .cpub-row { grid-template-columns: minmax(0, 1fr); }
    .cpub-row-label {
        border-right: none;
        border-bottom: 1px solid var(--cpub-border);
        padding-bottom: 10px;
    }
    .cpub-holder { font-size: 32px; }
    .cpub-hero .cpub-shell { padding-top: 36px; padding-bottom: 40px; }
}

/* ---------- Impresión ---------- */
@media print {
    .cpub-header,
    .cpub-footer,
    .cpub-private,
    .cpub-btn-outline,
    .cpub-icon-btn { display: none !important; }

    .cpub,
    .cpub-hero { background: #FFFFFF !important; }

    .cpub-main { display: block; padding: 0; }
    .cpub-verify,
    .cpub-doc-card,
    .cpub-valid { box-shadow: none; }
}
