/**
 * Portal público COPEC — landing de validación institucional (rojo / blanco / oscuro)
 */
:root {
    --copec-red: #D90416;
    --copec-red-dark: #B00312;
    --copec-wine: #78000A;
    --copec-red-light: #FF4D5A;
    --copec-ink: #101827;
    --copec-ink-soft: #4B5563;
    --portal-recuadro-fondo: #ffffff;
    --portal-recuadro-cabecera: var(--copec-red);
    --portal-recuadro-cabecera-texto: #ffffff;
    --copec-surface: #F4F6F8;
    --copec-white: #FFFFFF;
    --copec-border: #E7E9EE;
    --copec-border-soft: #DDE1E8;
    --header-h: 72px;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-panel: 0 24px 64px rgba(16, 24, 39, 0.12), 0 8px 24px rgba(16, 24, 39, 0.06);
    --shadow-header: 0 4px 20px rgba(16, 24, 39, 0.06);
    --ring-red: 0 0 0 3px rgba(217, 4, 22, 0.18);
    --cert-btn-start: #D90416;
    --cert-btn-mid: #C00314;
    --cert-btn-end: #B00312;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

html {
    scroll-behavior: smooth;
    height: 100%;
}

.portal-body {
    font-family: var(--font);
    color: var(--copec-ink);
    background: var(--copec-surface);
    padding-top: var(--header-h);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

/* Landing: sin franja blanca debajo — el hero ocupa el resto de la pantalla */
.portal-body.portal-body--fill {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background: #0a0a0f;
    overflow-x: hidden;
}

.portal-body.portal-body--fill .portal-hero--fill {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

.portal-body.portal-body--fill .portal-hero--fill > .portal-hero__container {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    padding-top: clamp(1.5rem, 4vw, 2.5rem);
    padding-bottom: clamp(1.25rem, 3vw, 2rem);
}

.portal-body.portal-body--fill .portal-hero--fill:has(.portal-hero__result-wrap.is-visible) > .portal-hero__container,
.portal-body.portal-body--fill .portal-hero--fill:has(.portal-result-card.has-result) > .portal-hero__container {
    justify-content: flex-start;
}

.portal-body.portal-body--fill .site-footer.portal-footer--on-hero {
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.55);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    margin-top: 0;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.portal-body.portal-body--fill .portal-footer--on-hero .portal-footer__brand,
.portal-body.portal-body--fill .portal-footer--on-hero .portal-footer__text {
    color: rgba(255, 255, 255, 0.9);
}

/* Extiende el gradiente del hero detrás del footer para que no se vea blanco */
.portal-body.portal-body--fill .portal-hero--fill .portal-hero__bg {
    bottom: auto;
    height: calc(100% + 8rem);
}

/* ——— Header blanco ——— */
.site-header.portal-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    min-height: var(--header-h);
    background: var(--copec-white);
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.site-header.portal-nav.portal-nav--scrolled {
    border-bottom-color: var(--copec-border);
    box-shadow: var(--shadow-header);
}

.portal-nav__container {
    min-height: var(--header-h);
    align-items: center;
    flex-wrap: nowrap;
}

@media (min-width: 992px) {
    .portal-nav__container {
        flex-wrap: wrap;
    }
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--copec-ink) !important;
    padding: 0;
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - 52px);
}

.portal-brand__mark {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(145deg, var(--copec-red) 0%, var(--copec-wine) 100%);
    color: var(--copec-white);
    font-weight: 800;
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(217, 4, 22, 0.35);
}

.portal-brand__logo {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: contain;
    background: var(--copec-white);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.portal-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.portal-brand__line1 {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
    color: var(--copec-ink);
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-brand__line2 {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--copec-ink-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-nav__toggler {
    border: 1px solid var(--copec-border);
    border-radius: var(--radius-md);
    padding: 0.35rem 0.55rem;
    flex-shrink: 0;
}

.portal-nav__toggler:focus {
    box-shadow: var(--ring-red);
}

.portal-nav__menu .nav-link {
    color: var(--copec-ink-soft) !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.45rem 1rem !important;
    border-radius: 999px;
    transition: color 0.2s, background 0.2s;
}

.portal-nav__menu .nav-link:hover,
.portal-nav__menu .nav-link:focus {
    color: var(--copec-ink) !important;
    background: rgba(217, 4, 22, 0.06);
}

.btn-portal-secondary {
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--copec-ink);
    background: var(--copec-white);
    border: 1px solid var(--copec-border);
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-portal-secondary:hover {
    color: var(--copec-ink);
    background: var(--copec-surface);
    border-color: var(--copec-border-soft);
    transform: translateY(-1px);
}

.btn-portal-primary {
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--copec-white) !important;
    background: linear-gradient(135deg, var(--copec-red) 0%, var(--copec-red-dark) 100%);
    border: none;
    border-radius: 999px;
    padding: 0.45rem 1.15rem;
    box-shadow: 0 4px 16px rgba(217, 4, 22, 0.3);
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-portal-primary:hover {
    background: linear-gradient(135deg, var(--copec-red-dark) 0%, var(--copec-wine) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(217, 4, 22, 0.38);
    color: var(--copec-white) !important;
}

.portal-nav__warn {
    color: #B45309;
}

@media (min-width: 992px) {
    .portal-nav__collapse {
        align-items: center;
    }

    .portal-nav__menu {
        gap: 0.15rem;
    }
}

/* ——— Hero ——— */
.hero-banner.portal-hero {
    position: relative;
    overflow: hidden;
    min-height: clamp(430px, 52vh, 500px);
    padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2.5rem, 5vw, 3.5rem);
    color: var(--copec-white);
}

.hero-banner.portal-hero.portal-hero--fill {
    min-height: calc(100vh - var(--header-h));
    min-height: calc(100dvh - var(--header-h));
    padding-bottom: 0;
}

.portal-hero__result-wrap {
    width: 100%;
    max-width: 720px;
    margin: 1.75rem auto 0;
    position: relative;
    z-index: 2;
}

@media (min-width: 992px) {
    .portal-hero__result-wrap.is-visible,
    .portal-hero__result-wrap:has(.portal-result-card.has-result) {
        width: calc(100vw - 4rem);
        max-width: calc(100vw - 4rem);
        margin-left: calc(50% - 50vw + 2rem);
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
        box-sizing: border-box;
    }
}

.portal-hero__result-wrap:not(.is-visible) .portal-result-card .cert-outcome[style*="display: none"],
.portal-hero__result-wrap:not(.is-visible) .portal-result-card .cert-outcome[style*="display:none"] {
    /* oculto hasta validar */
}

.portal-result-card {
    background: var(--copec-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-panel);
    padding: clamp(1rem, 3vw, 1.5rem);
    color: var(--copec-ink);
}

.portal-result-card:not(.has-result) {
    display: none;
}

.portal-result-card.has-result {
    display: block;
    animation: heroFade 0.45s ease both;
}

@media (min-width: 992px) {
    .portal-result-card.has-result {
        padding: 1.15rem 2rem 2rem;
    }
}

.portal-hero__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.portal-hero__gradient {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, #0a0a0f 0%, #1a0508 28%, var(--copec-wine) 58%, var(--copec-red) 100%);
}

.portal-hero__curve {
    position: absolute;
    border: 1px solid rgba(255, 77, 90, 0.22);
    border-radius: 50%;
    pointer-events: none;
}

.portal-hero__curve--1 {
    width: min(520px, 90vw);
    height: min(520px, 90vw);
    top: -35%;
    right: -12%;
    transform: rotate(-18deg);
}

.portal-hero__curve--2 {
    width: min(380px, 70vw);
    height: min(380px, 70vw);
    bottom: -25%;
    left: 5%;
    border-color: rgba(217, 4, 22, 0.18);
    transform: rotate(12deg);
}

.portal-hero__dots {
    position: absolute;
    top: 12%;
    right: 4%;
    width: 140px;
    height: 140px;
    background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1.5px, transparent 1.5px);
    background-size: 14px 14px;
    opacity: 0.7;
    mask-image: radial-gradient(circle at center, black 30%, transparent 75%);
}

.portal-hero__container {
    max-width: 1180px;
    z-index: 1;
}

@keyframes heroFade {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-animate {
    animation: heroFade 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-animate-delay {
    animation: heroFade 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(217, 4, 22, 0.45);
    border-radius: 999px;
    padding: 0.42rem 1rem;
    margin-bottom: 1rem;
}

.hero-badge i {
    color: var(--copec-red-light);
    font-size: 0.75rem;
}

.hero-title {
    font-size: clamp(2.15rem, 5.5vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.08;
    color: var(--copec-white);
}

.portal-hero__accent {
    background: linear-gradient(120deg, #FF6B76 0%, var(--copec-red-light) 45%, #FFB3B8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-lead {
    font-size: clamp(1rem, 2.2vw, 1.125rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
    max-width: 34rem;
}

.hero-lead strong {
    color: var(--copec-white);
    font-weight: 600;
}

.portal-hero__benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    max-width: 34rem;
}

.portal-hero__benefits li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
}

.portal-benefit__icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--copec-red);
    color: var(--copec-white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    box-shadow: 0 4px 12px rgba(217, 4, 22, 0.4);
}

/* ——— Formulario en hero (derecha) ——— */
.portal-hero__form-col {
    display: flex;
    align-items: center;
}

.portal-form-card--hero {
    width: 100%;
    background: var(--copec-white);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl);
    padding: clamp(1.25rem, 3vw, 1.65rem);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.35);
}

.portal-form-card--hero .portal-form-card__title {
    color: var(--copec-ink);
}

.portal-form-card--hero .portal-form-card__desc {
    color: var(--copec-ink-soft);
}

/* ——— Área pública y resultados ——— */
.portal-public-section {
    background: var(--copec-surface);
    padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2.5rem, 5vw, 3.5rem);
}

.portal-public-section__container {
    max-width: 1180px;
}

.portal-public-section__head {
    text-align: center;
    max-width: 40rem;
    margin: 0 auto clamp(1.75rem, 4vw, 2.5rem);
}

.portal-validation-panel {
    background: var(--copec-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-panel);
    border: 1px solid var(--copec-border);
    padding: clamp(1.5rem, 4vw, 2.75rem);
}

.portal-eyebrow {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--copec-red);
}

.portal-section__title {
    font-size: clamp(1.65rem, 3.5vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--copec-ink);
    line-height: 1.15;
}

.portal-title-accent {
    color: var(--copec-red);
}

.portal-section__lead {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--copec-ink-soft);
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

.portal-form-card {
    background: var(--copec-surface);
    border: 1px solid var(--copec-border);
    border-radius: var(--radius-lg);
    padding: clamp(1.25rem, 3vw, 1.75rem);
    box-shadow: 0 4px 20px rgba(16, 24, 39, 0.04);
}

.portal-form-card__title {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--copec-ink);
}

.portal-form-card__desc {
    font-size: 0.875rem;
    color: var(--copec-ink-soft);
    line-height: 1.55;
}

.portal-icon-accent {
    color: var(--copec-red);
}

.portal-link-fallback a {
    font-weight: 600;
    color: var(--copec-red);
    text-decoration: none;
    border-bottom: 1px solid rgba(217, 4, 22, 0.3);
    transition: color 0.15s, border-color 0.15s;
}

.portal-link-fallback a:hover {
    color: var(--copec-red-dark);
    border-bottom-color: var(--copec-red-dark);
}

.portal-validation-panel {
    display: none;
}

/* Recuadros por curso */
.portal-courses-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.portal-course-card {
    background: var(--copec-white);
    border: 1px solid var(--copec-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.35rem;
    box-shadow: 0 4px 18px rgba(16, 24, 39, 0.05);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.portal-course-card:hover {
    border-color: rgba(217, 4, 22, 0.2);
    box-shadow: 0 8px 24px rgba(16, 24, 39, 0.08);
}

.portal-course-card__header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--copec-border);
}

.portal-course-card__num {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--copec-red) 0%, var(--copec-red-dark) 100%);
    color: var(--copec-white);
    font-weight: 800;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(217, 4, 22, 0.28);
}

.portal-course-card__name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--copec-ink);
    line-height: 1.3;
}

.portal-course-card__grid {
    margin-top: 0;
}

/* Vista móvil: tarjetas | Vista PC: layout imagen 2 (tablas + bloques) */
.portal-courses-mobile {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.portal-courses-desktop {
    display: none;
}

.portal-results-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
    color: #000;
}

.portal-results-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.portal-results-table-wrap + .portal-results-table-wrap {
    margin-top: -1px;
}

.portal-results-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #b8c0cc;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: #000;
    table-layout: fixed;
}

.portal-results-table--person {
    min-width: 0;
}

/* Cuadro compacto: Nombres / Apellidos / DNI */
.portal-results-table-wrap--person {
    width: 58%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(16, 185, 129, 0.22);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(16, 24, 39, 0.07);
    background: var(--portal-recuadro-fondo, #ffffff);
}

.portal-results-table-wrap--person + .portal-results-table-wrap {
    margin-top: 0;
}

.portal-results-table-wrap--person .portal-results-table {
    border: none;
    width: 100%;
}

.portal-results-table--person thead th.portal-recuadro {
    font-size: 14px;
    font-weight: 700;
    padding: 9px 0.65rem;
    width: 33.333%;
    letter-spacing: 0.04em;
}

.portal-results-table--person thead th.portal-recuadro:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.55);
}

.portal-results-table--person tbody td.portal-recuadro {
    font-size: 15px;
    font-weight: 600;
    padding: 11px 0.65rem;
    line-height: 1.3;
    word-break: break-word;
}

@media (max-width: 991.98px) {
    .portal-results-table-wrap--person {
        width: 95%;
        max-width: none;
    }

    .portal-results-table--person thead th.portal-recuadro {
        font-size: 12px;
        padding: 8px 0.4rem;
    }

    .portal-results-table--person tbody td.portal-recuadro {
        font-size: 13px;
        padding: 10px 0.4rem;
    }
}

.portal-results-table--summary {
    min-width: 0;
}

.portal-recuadro {
    background: var(--portal-recuadro-fondo, #ffffff);
    border: 1px solid #b8c0cc;
    color: #000;
    vertical-align: middle;
    text-align: center;
    padding: 0.55rem 0.5rem;
}

.portal-recuadro.portal-recuadro--head,
.portal-results-table thead th.portal-recuadro {
    background: var(--portal-recuadro-cabecera, var(--copec-red));
    color: var(--portal-recuadro-cabecera-texto, #ffffff);
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.portal-results-table tbody .portal-recuadro {
    font-weight: 600;
    font-size: 0.78rem;
}

.portal-recuadro--curso {
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-weight: 700;
}

.portal-recuadro--reg {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.72rem;
    white-space: nowrap;
}

.portal-results-section-title {
    margin: 1.25rem 0 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    color: #000;
    letter-spacing: -0.01em;
}

.portal-course-blocks {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.portal-course-block {
    border: 1px solid var(--copec-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--portal-recuadro-fondo, #ffffff);
}

.portal-course-block__head {
    text-align: left;
    padding: 0.65rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.portal-course-block__rows {
    display: flex;
    flex-direction: column;
}

.portal-course-block__row {
    display: flex;
    align-items: stretch;
    border-top: 1px solid var(--copec-border);
}

.portal-course-block__row:first-child {
    border-top: none;
}

.portal-course-block__label,
.portal-course-block__value {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #000;
    border: none;
    border-radius: 0;
    text-align: center;
}

.portal-course-block__row--nota .portal-recuadro--nota {
    background: var(--portal-recuadro-cabecera, var(--copec-red));
    color: var(--portal-recuadro-cabecera-texto, #ffffff);
    border-color: var(--portal-recuadro-cabecera, var(--copec-red));
    font-weight: 700;
}

.portal-course-block__label {
    border-right: 1px solid var(--copec-border);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
}

.portal-course-block__row--nota .portal-course-block__label {
    border-right-color: rgba(255, 255, 255, 0.35);
}

.portal-course-block__row--nota .portal-course-block__value {
    font-size: 1rem;
}

.portal-results-table__row:hover .portal-recuadro {
    filter: brightness(0.98);
}

.cert-portal-inline-root--results .portal-course-card,
.cert-portal-inline-root--results .cert-tile {
    background: var(--portal-recuadro-fondo, #ffffff);
    color: #000;
}

.cert-portal-inline-root--results .cert-tile__k {
    color: #374151;
}

.cert-portal-inline-root--results .cert-tile__v {
    color: #000;
}

@media (min-width: 992px) {
    .portal-courses-mobile {
        display: none;
    }

    .portal-courses-desktop {
        display: block;
    }

    .cert-portal-inline-root--results .portal-courses-list {
        margin-top: 0.5rem;
    }

    .cert-portal-inline-root--results .cert-name,
    .cert-portal-inline-root--results .cert-docline {
        display: none;
    }

    .cert-portal-inline-root--results .portal-results-layout,
    .cert-portal-inline-root--results .portal-results-layout .portal-recuadro,
    .cert-portal-inline-root--results .portal-course-block__label,
    .cert-portal-inline-root--results .portal-course-block__value,
    .cert-portal-inline-root--results .portal-results-section-title {
        color: #000;
    }
}

/* ——— Formulario embebido: hero ——— */
.cert-portal-inline-root--hero .cert-premium.cert-embed {
    font-family: var(--font);
    color: var(--copec-ink);
    min-height: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.cert-portal-inline-root--hero .cert-glass {
    padding: 0;
}

.cert-portal-inline-root--hero .cert-outcome {
    margin-top: 1rem;
}

.cert-portal-inline-root--hero .cert-success {
    margin-top: 0;
}

.cert-portal-inline-root--results .cert-premium.cert-embed,
.cert-portal-inline-root--results .cert-shell {
    min-height: 0;
    background: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

.cert-portal-inline-root--results .cert-success {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.cert-portal-inline-root--results .cert-success::before {
    display: none;
}

.cert-portal-inline-root--results .cert-success__head {
    text-align: center;
    margin-bottom: 0.65rem;
    padding: 0.45rem 0.25rem 0;
    gap: 0;
}

@media (min-width: 992px) {
    .cert-portal-inline-root--results .cert-success__head {
        padding-top: 0.55rem;
        margin-bottom: 0.75rem;
    }
}

.cert-portal-inline-root--results .cert-avatar {
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 0.35rem;
}

.cert-portal-inline-root--results .cert-badge-ok {
    margin-bottom: 0;
    padding: 0.3rem 0.75rem;
    font-size: 0.68rem;
}

.cert-portal-inline-root--results .cert-name {
    font-size: clamp(1.1rem, 4.5vw, 1.45rem);
    word-break: break-word;
    line-height: 1.25;
    padding: 0 0.5rem;
}

.cert-portal-inline-root--results .cert-docline {
    font-size: 0.88rem;
}

.cert-portal-inline-root--results .portal-course-card {
    padding: 1rem 1.05rem;
}

.cert-portal-inline-root--results .portal-course-card__name {
    font-size: clamp(0.9rem, 3.8vw, 1.05rem);
    word-break: break-word;
}

.cert-portal-inline-root--results .portal-course-card__header {
    align-items: flex-start;
}

.cert-portal-inline-root--results .cert-spec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

@media (max-width: 575.98px) {
    .cert-portal-inline-root--results .cert-spec-grid {
        grid-template-columns: 1fr;
    }

    .cert-portal-inline-root--results .cert-success {
        border-radius: var(--radius-lg);
        padding: 1rem 0.75rem;
    }

    .cert-portal-inline-root--results .cert-tile {
        padding: 0.65rem 0.75rem;
    }
}

.cert-portal-inline-root--results .cert-error {
    margin-top: 0;
}

.cert-portal-inline-root .cert-premium.cert-embed a,
.cert-portal-inline-root--hero .cert-premium.cert-embed a,
.cert-portal-inline-root--results .cert-premium.cert-embed a {
    color: var(--copec-red);
}

.cert-portal-inline-root .cert-premium.cert-embed a:hover {
    color: var(--copec-red-dark);
}

.cert-portal-inline-root .cert-shell {
    max-width: none;
    margin: 0;
    padding: 0;
}

.cert-portal-inline-root .cert-intro .cert-kicker,
.cert-portal-inline-root .cert-intro .cert-title,
.cert-portal-inline-root .cert-intro .cert-sub {
    display: none;
}

.cert-portal-inline-root .cert-glass {
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    padding: 0;
    animation: none;
}

.cert-portal-inline-root .cert-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.cert-portal-inline-root .cert-hint {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--copec-ink-soft);
}

@media (min-width: 768px) {
    .cert-portal-inline-root #cert-form {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .cert-portal-inline-root .cert-row2 {
        display: grid;
        grid-template-columns: 1fr 1.2fr;
        gap: 0.85rem;
    }

    .cert-portal-inline-root .cert-field {
        margin-bottom: 0;
    }

    .cert-portal-inline-root .cert-submit {
        margin-top: 0.25rem;
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .cert-portal-inline-root .cert-row2 {
        grid-template-columns: 1fr;
    }
}

.cert-portal-inline-root .cert-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--copec-ink-soft);
    margin-bottom: 0.35rem;
}

.cert-portal-inline-root .cert-input,
.cert-portal-inline-root .cert-select {
    min-height: 48px;
    border-radius: var(--radius-md);
    border: 1px solid var(--copec-border);
    background: var(--copec-white);
    color: var(--copec-ink);
    font-size: 0.95rem;
    padding: 0.65rem 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cert-portal-inline-root .cert-input::placeholder {
    color: #9CA3AF;
}

.cert-portal-inline-root .cert-input-wrap {
    position: relative;
}

.cert-portal-inline-root .cert-input-wrap__icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}

.cert-portal-inline-root .cert-input.cert-input--with-icon {
    padding-left: 2.55rem;
}

.cert-portal-inline-root .cert-input:focus,
.cert-portal-inline-root .cert-select:focus {
    border-color: var(--copec-red);
    box-shadow: var(--ring-red);
    outline: none;
    background: var(--copec-white);
}

.cert-portal-inline-root .cert-submit {
    font-family: var(--font);
    width: 100%;
    min-height: 48px;
    margin-top: 1rem;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--copec-red) 0%, var(--copec-red-dark) 100%);
    color: var(--copec-white);
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 6px 20px rgba(217, 4, 22, 0.28);
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.cert-portal-inline-root .cert-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--copec-red-dark) 0%, var(--copec-wine) 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(217, 4, 22, 0.35);
    color: var(--copec-white);
}

.cert-portal-inline-root .cert-submit:disabled {
    opacity: 0.65;
}

.cert-portal-inline-root .cert-loader {
    border: 1px solid var(--copec-border);
    border-radius: var(--radius-md);
    background: var(--copec-white);
    margin-top: 1rem;
}

.cert-portal-inline-root .cert-loader__text {
    color: var(--copec-ink-soft);
}

.cert-portal-inline-root .cert-loader__ring {
    border-color: var(--copec-red) transparent transparent transparent;
}

.cert-portal-inline-root .cert-skel {
    background: linear-gradient(90deg, rgba(16, 24, 39, 0.05) 25%, rgba(16, 24, 39, 0.1) 50%, rgba(16, 24, 39, 0.05) 75%);
}

.cert-portal-inline-root .cert-tenant {
    display: none !important;
}

.cert-portal-inline-root .cert-tenant--legacy-hidden {
    display: none !important;
}

.cert-portal-inline-root .cert-tenant p {
    color: var(--copec-ink-soft);
}

.cert-portal-inline-root .cert-tenant h2 {
    color: var(--copec-ink);
}

.cert-portal-inline-root .cert-success {
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-lg);
    background: linear-gradient(160deg, #ECFDF5 0%, var(--copec-white) 60%);
    box-shadow: 0 4px 20px rgba(16, 24, 39, 0.06);
    margin-top: 1rem;
}

.cert-portal-inline-root .cert-success::before {
    opacity: 0.2;
}

.cert-portal-inline-root .cert-name {
    color: var(--copec-ink);
}

.cert-portal-inline-root .cert-docline {
    color: var(--copec-ink-soft);
}

.cert-portal-inline-root .cert-badge-ok {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #047857;
}

.cert-portal-inline-root .cert-avatar {
    background: linear-gradient(135deg, var(--copec-red), var(--copec-wine));
}

.cert-portal-inline-root .cert-tile {
    border-color: var(--copec-border);
    background: var(--copec-white);
    border-radius: var(--radius-md);
}

.cert-portal-inline-root .cert-tile:hover {
    border-color: rgba(217, 4, 22, 0.35);
}

.cert-portal-inline-root .cert-tile__k {
    color: var(--copec-ink-soft);
}

.cert-portal-inline-root .cert-tile__v {
    color: var(--copec-ink);
}

.cert-portal-inline-root .cert-btn-reset {
    border: 1px solid var(--copec-border);
    color: var(--copec-ink-soft);
    border-radius: var(--radius-md);
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.cert-portal-inline-root .cert-btn-reset:hover {
    color: var(--copec-red);
    border-color: rgba(217, 4, 22, 0.35);
    background: rgba(217, 4, 22, 0.04);
}

.cert-portal-inline-root .cert-error {
    border: 1px solid rgba(217, 4, 22, 0.25);
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, #FEF2F2, var(--copec-white));
    margin-top: 1rem;
}

.cert-portal-inline-root .cert-error h3 {
    color: var(--copec-red-dark);
}

.cert-portal-inline-root .cert-error p {
    color: var(--copec-ink-soft);
}

.cert-portal-inline-root .cert-others__title {
    color: var(--copec-ink-soft);
    font-size: 0.85rem;
}

.cert-portal-inline-root .cert-extra-block {
    border-top-color: var(--copec-border);
}

/* ——— Footer ——— */
.site-footer.portal-footer {
    background: linear-gradient(180deg, #0f1419 0%, #080b10 100%);
    color: rgba(255, 255, 255, 0.72);
    border-top: 3px solid var(--copec-red);
}

.portal-footer__inner {
    max-width: 40rem;
}

.portal-footer__brand {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.02em;
    color: var(--copec-white);
}

.portal-footer__text {
    font-size: 0.9rem;
    line-height: 1.65;
}

/* ——— Responsive móvil ——— */
@media (max-width: 991.98px) {
    .portal-hero__benefits {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .portal-hero__benefits li {
        font-size: 0.7rem;
        align-items: center;
        text-align: center;
    }

    .portal-hero__benefits li span:last-child {
        max-width: 5.5rem;
    }

    .portal-validation-panel__info {
        text-align: center;
    }
}

@media (max-width: 767.98px) {
    :root {
        --header-h: 64px;
    }

    .portal-brand {
        max-width: calc(100% - 48px);
    }

    .portal-brand__mark {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        flex-shrink: 0;
    }

    .portal-brand__line1 {
        font-size: clamp(0.72rem, 3.4vw, 0.85rem);
        line-height: 1.25;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        white-space: normal;
    }

    .portal-brand__line2 {
        font-size: 0.62rem;
        -webkit-line-clamp: 1;
    }

    .portal-nav__toggler {
        margin-left: auto !important;
    }

    .portal-nav__collapse {
        flex-basis: 100%;
        width: 100%;
    }

    .hero-banner.portal-hero {
        min-height: auto;
        padding-bottom: clamp(2rem, 8vw, 3rem);
    }

    .hero-title {
        font-size: clamp(2rem, 9vw, 2.75rem);
    }

    .portal-hero__form-col {
        margin-top: 0.5rem;
    }

    .portal-form-card--hero {
        border-radius: 20px;
    }

    .portal-public-section {
        padding-left: 18px;
        padding-right: 18px;
    }

    .portal-public-section__head {
        text-align: center;
    }

    .cert-portal-inline-root #cert-form {
        display: block;
    }

    .cert-portal-inline-root .cert-submit {
        width: 100%;
    }

    .portal-nav__actions .btn-portal-secondary {
        display: none;
    }

    .portal-nav__actions .btn-portal-primary {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 400px) {
    .portal-hero__benefits {
        gap: 0.35rem;
    }

    .portal-benefit__icon {
        width: 30px;
        height: 30px;
        font-size: 0.72rem;
    }
}

/* Portal por instituto: colores de marca inyectados vía :root (--cert-*, --portal-*) */
.portal-body--institute .portal-hero__gradient {
    background: var(--portal-hero-grad, linear-gradient(115deg, #0a0a0f 0%, #1a0508 28%, var(--copec-wine) 58%, var(--copec-red) 100%));
}

.portal-body--institute .portal-hero__curve--1 {
    border-color: var(--portal-hero-curve, rgba(255, 77, 90, 0.22));
}

.portal-body--institute .portal-hero__curve--2 {
    border-color: var(--portal-hero-curve-2, rgba(217, 4, 22, 0.18));
}

.portal-body--institute .hero-badge i {
    color: var(--cert-accent2, var(--copec-red-light));
}

.portal-body--institute .portal-benefit__icon {
    background: color-mix(in srgb, var(--cert-accent, var(--copec-red)) 18%, transparent);
    color: var(--cert-accent, var(--copec-red-light));
}

.portal-body--institute .portal-icon-accent {
    color: var(--cert-accent, var(--copec-red));
}

.portal-body--institute .portal-title-accent,
.portal-body--institute .portal-eyebrow {
    color: var(--cert-accent, var(--copec-red));
}

.portal-body--institute .btn-portal-primary {
    background: linear-gradient(135deg, var(--cert-btn-start, var(--copec-red)) 0%, var(--cert-btn-end, var(--copec-wine)) 100%);
    box-shadow: 0 4px 14px var(--portal-primary-shadow, rgba(217, 4, 22, 0.32));
}

.portal-body--institute .btn-portal-primary:hover {
    background: linear-gradient(135deg, var(--portal-primary-dark, var(--copec-red-dark)) 0%, var(--cert-btn-end, var(--copec-wine)) 100%);
    box-shadow: 0 6px 20px var(--portal-primary-shadow, rgba(217, 4, 22, 0.38));
}

.portal-body--institute .portal-hero__accent {
    background: linear-gradient(120deg, var(--cert-accent2, #FF6B76) 0%, var(--cert-accent, var(--copec-red-light)) 55%, color-mix(in srgb, var(--cert-accent, #FFB3B8) 40%, white) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.portal-body--institute .portal-brand__mark {
    background: linear-gradient(145deg, var(--cert-btn-start, var(--copec-red)) 0%, var(--cert-btn-end, var(--copec-wine)) 100%);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--cert-accent, var(--copec-red)) 35%, transparent);
}

.portal-body--institute .portal-link-fallback a {
    color: var(--cert-accent, var(--copec-red));
}

.portal-body--institute .cert-portal-inline-root .cert-submit {
    background: linear-gradient(135deg, var(--cert-btn-start, var(--copec-red)) 0%, var(--cert-btn-end, var(--copec-wine)) 100%);
    box-shadow: 0 4px 14px var(--portal-primary-shadow, rgba(217, 4, 22, 0.28));
}

.portal-body--institute .cert-portal-inline-root .cert-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--portal-primary-dark, var(--copec-red-dark)) 0%, var(--cert-btn-end, var(--copec-wine)) 100%);
}
