/* Variables y configuración general */
:root {
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    color: #25354a;
    background: #f5f7fb;
    line-height: 1.5;
    font-size: 16px;
    --purple: #6030a8;
    --green: #258500;
    --teal: #00aab7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

a {
    color: #53308c;
}

button, input, select {
    font: inherit;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 0 28px;
}

/* Encabezado */
.topbar {
    background: #164c9c;
    padding: 9px 0;
}

    .topbar img {
        display: block;
    }

/* Cabecera principal */
.brandbar {
    position: relative;
    background: #007f9d url("../img/bg-certificados.webp") center 46% / cover no-repeat;
    color: #fff;
    overflow: hidden;
}

    .brandbar::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, #2c145d70, #00405738 65%, transparent);
        pointer-events: none;
    }

.brand {
    position: relative;
    display: flex;
    gap: 34px;
    align-items: center;
    min-height: 270px;
    padding-top: 38px;
    padding-bottom: 42px;
}

.brand-logo {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    padding: 18px;
    background: #ffffff14;
    border: 1px solid #ffffff45;
    border-radius: 26px 26px 26px 8px;
    box-shadow: 0 12px 32px #17346d26;
}

    .brand-logo img {
        display: block;
    }

.brand-copy {
    min-width: 0;
}

.brand-title {
    display: block;
    font-size: clamp(2.4rem, 5.2vw, 4.3rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.045em;
    text-shadow: 0 3px 12px #12365230;
}

.brand-subtitle {
    display: block;
    font-size: clamp(1.1rem, 2.4vw, 1.8rem);
    font-weight: 600;
    margin-top: 14px;
    line-height: 1.3;
}

.brand-tagline {
    display: block;
    margin-top: 16px;
    font-size: 1rem;
    letter-spacing: .025em;
    color: #fff;
}

/* Contenido principal */
main {
    min-height: 420px;
    padding-bottom: 44px !important;
}

.intro {
    padding: 28px 0 8px;
    max-width: 820px;
}

.eyebrow {
    color: var(--purple);
    font-size: .75rem;
    font-weight: 750;
    letter-spacing: .13em;
}

h1 {
    font-size: clamp(1.6rem, 3vw, 2rem);
    line-height: 1.2;
    margin: 10px 0;
    letter-spacing: -.025em;
}

h2 {
    font-size: 1.25rem;
    margin: 0 0 22px;
}

.intro > p:last-child {
    color: #526079;
}

/* Tarjetas y formularios */
.card {
    border: 1px solid #dfe5ef;
    border-radius: 24px;
    padding: 30px;
    margin: 18px 0;
    background: #fff;
    box-shadow: 0 8px 30px #344b7910;
}

    .card h2 {
        color: #342153;
    }

.fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px 24px;
}

.field {
    min-width: 0;
}

.field-mode {
    grid-column: 1 / -1;
    width: min(440px, 100%);
}

label {
    display: block;
    font-weight: 650;
    margin: 0 0 9px 16px;
    font-size: .95rem;
}

.input-shell {
    position: relative;
    border: 1px solid #d7e2e7;
    background: #fff;
    border-radius: 999px;
    transition: border-color .18s, box-shadow .18s;
}

    .input-shell::before {
        content: "";
        position: absolute;
        left: 53px;
        top: 17px;
        bottom: 17px;
        border-left: 1px solid #dce2ec;
        pointer-events: none;
    }

    .input-shell:focus-within {
        border-color: var(--purple);
        box-shadow: 0 0 0 4px #6030a81c;
    }

.input-icon {
    position: absolute;
    width: 22px;
    height: 22px;
    left: 18px;
    top: 19px;
    color: var(--green);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

input, select {
    width: 100%;
    min-width: 0;
    min-height: 60px;
    padding: 14px 22px 14px 70px;
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: #29394b;
}

    input::placeholder {
        color: #637584;
        opacity: 1;
    }

select {
    appearance: none;
    padding-right: 48px;
    cursor: pointer;
}

    select option {
        color: #25354a;
        background: #fff;
    }

.input-shell-select::after {
    content: "";
    position: absolute;
    right: 24px;
    top: 24px;
    width: 7px;
    height: 7px;
    border: solid var(--green);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    pointer-events: none;
}

.input-shell input:focus-visible, .input-shell select:focus-visible {
    outline: 2px solid var(--purple);
    outline-offset: 2px;
}

.input-shell:has(.input-validation-error) {
    border-color: #a01c24;
}

/* Validación y CAPTCHA */
.verification {
    margin: 28px 0;
    padding-top: 24px;
    border-top: 1px solid #dce5eb;
}

    .verification > label {
        margin-left: 0;
    }

.captcha-input {
    width: min(290px, 100%);
}

    .captcha-input input {
        letter-spacing: .13em;
    }

.captcha-row {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
    margin: 12px 0;
}

    .captcha-row > img {
        border: 1px solid #d7e2e7;
        border-radius: 12px;
        max-width: 100%;
        height: auto;
    }

small {
    display: block;
    color: #59687a;
    margin-top: 9px;
    font-size: .8rem;
}

/* Botones y acciones */
.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    min-height: 46px;
    padding: 11px 25px;
    border-radius: 999px;
    border: 1px solid var(--purple);
    text-decoration: none;
    cursor: pointer;
    font-weight: 650;
    white-space: nowrap;
    transition: background-color .18s, box-shadow .18s;
}

    .button svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
    }

/* El color de respaldo evita pasar por transparente al alternar el degradado. */

.primary {
    background: #49228c linear-gradient(135deg, #8346c5, #49228c);
    color: #fff;
    box-shadow: 0 5px 14px #6030a826;
    min-width: 150px;
}

    .primary:where(:hover:not(:disabled), :focus-visible) {
        background: #49228c;
        box-shadow: 0 7px 18px #6030a83b;
    }

.secondary {
    background: #fff;
    color: var(--purple);
}

    .secondary:hover {
        background: #f0eaf9;
    }

.button:disabled {
    opacity: .65;
    cursor: wait;
}

.primary:disabled {
    opacity: 1;
    box-shadow: none;
}

:focus-visible {
    outline: 3px solid #164c9c;
    outline-offset: 4px;
}

.validation {
    color: #a01c24;
}

.validation-summary-valid {
    display: none;
}

/* Resultados y tablas */
.card.results {
    background: #fff;
    scroll-margin-top: 24px;
}

.results tbody tr:hover, .results tbody tr:focus-within {
    background: var(--results-row-hover, #f0ebf8);
}

.results .column-firma {
    min-width: 115px;
    white-space: nowrap;
}

.results .button-download {
    min-width: 0;
    min-height: 32px;
    padding: 6px 12px;
    font-size: .8rem;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 14px 12px;
    border-bottom: 1px solid #e5e4ed;
    vertical-align: top;
}

th {
    background: #f2eff8;
    font-size: .9rem;
    color: #432866;
}

td {
    overflow-wrap: anywhere;
    min-width: 105px;
}

.notice {
    border-left: 4px solid var(--teal);
    border-radius: 0 14px 14px 0;
    padding: 18px 22px;
    margin-top: 24px;
    background: #e7f3f4;
    color: #315b64;
}

/* Nomenclatura y tarjetas informativas */
.nomenclature {
    margin-top: 34px;
    padding-top: 28px;
    border-top: 1px solid #dfe5ef;
}

    .nomenclature > h2 {
        text-align: center;
        font-size: 1.6rem;
        font-weight: 800;
        margin-bottom: 24px;
    }

.nomenclature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 12px;
}

    .nomenclature-cards.is-interactive {
        display: flex;
    }

.nomenclature-card {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-width: 0;
    min-height: 340px;
    padding: 0;
    border: 1px solid #ffffff40;
    border-radius: 20px;
    background: var(--nomenclature-art-bg, linear-gradient(135deg, #13b7b0, #2cab55));
    color: #fff;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 5px 16px #34215312;
    transition: flex-grow .4s cubic-bezier(.2,.65,.3,1), box-shadow .25s;
}

.is-interactive .nomenclature-card[aria-expanded="true"] {
    flex-grow: 2.8;
    box-shadow: 0 10px 24px #34215329;
}

.nomenclature-art {
    position: relative;
    display: grid;
    place-items: center;
    flex: 1 0 145px;
    padding: 24px 12px;
    isolation: isolate;
}

    .nomenclature-art::before {
        content: "";
        position: absolute;
        z-index: -1;
        width: 160px;
        height: 160px;
        border: 24px solid #ffffff12;
        border-radius: 38% 62% 55% 45%;
        transform: rotate(-20deg);
    }

    .nomenclature-art svg {
        width: 96px;
        max-width: 100%;
        height: 96px;
        overflow: visible;
        fill: none;
        stroke: #38235c;
        stroke-width: 3;
        stroke-linecap: round;
        stroke-linejoin: round;
        filter: drop-shadow(0 8px 5px #15374430);
        transition: transform .4s;
    }

.nomenclature-paper {
    fill: #f8f4ff;
}

.nomenclature-accent {
    fill: #cfb0ff;
}

.nomenclature-card[aria-expanded="true"] .nomenclature-art svg {
    transform: scale(1.12) rotate(-3deg);
}

.nomenclature-copy {
    display: block;
    position: relative;
    padding: 30px 14px 24px;
    width: 100%;
    border-radius: 50% 50% 0 0 / 30px 30px 0 0;
    background: var(--nomenclature-copy-bg, linear-gradient(160deg, #8840ce, #542498));
    color: var(--nomenclature-ink, #fff);
}

.nomenclature-label {
    display: block;
    font-size: 1rem;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.nomenclature-description {
    display: block;
    font-size: .85rem;
    font-weight: 400;
    line-height: 1.55;
    margin-top: 12px;
    overflow-wrap: anywhere;
}

.is-interactive .nomenclature-description:not([hidden]) {
    animation: nomenclature-reveal .3s ease both;
}

@keyframes nomenclature-reveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.nomenclature-card:focus-visible {
    outline-offset: 4px;
}

/* Responsive de nomenclatura */
@media (max-width: 900px) {
    .nomenclature-cards.is-interactive {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .nomenclature-card {
        min-height: 260px;
    }
}

@media (max-width: 600px) {
    .nomenclature-cards.is-interactive {
        grid-template-columns: minmax(0, 1fr);
    }

    .nomenclature-card {
        min-height: 210px;
    }

    .nomenclature-art {
        flex-basis: 120px;
        padding: 16px;
    }

        .nomenclature-art svg {
            width: 80px;
            height: 80px;
        }
}

/* Preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    .nomenclature-card, .nomenclature-art svg {
        transition: none;
    }

    .is-interactive .nomenclature-description:not([hidden]) {
        animation: none;
    }
}

/* Ajustes de impresión */
@media print {
    .nomenclature-cards.is-interactive {
        display: block;
    }

    .nomenclature-card {
        min-height: 0;
        margin-bottom: 12px;
        break-inside: avoid;
    }

    .nomenclature-art {
        display: none;
    }

    .nomenclature-copy {
        background: #fff;
        color: #000;
        padding: 12px;
        border: 1px solid #777;
        border-radius: 0;
    }

    .nomenclature-description[hidden] {
        display: block !important;
    }
}

/* Pie de página */
.footer-sena {
    position: relative;
    background: linear-gradient(120deg, #29204f, #362261 65%, #253e65);
    color: #fff;
    padding: 16px 0 20px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 16px;
}

.footer-container {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    padding: 0 13px;
}

.footer-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 24px;
    padding: 0 10px;
}

.footer-sena .footer-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    margin: 0;
    letter-spacing: .1px;
}

.footer-sena h3 {
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    margin: 24px 0 16px;
}

.footer-sena p {
    margin: 6px 0 0;
}

.footer-sena .footer-address {
    margin-top: 0;
    font-weight: 600;
}

.footer-sena a {
    color: #78bfff;
    text-decoration: none;
    text-underline-offset: 2px;
}

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

    .footer-sena a:focus-visible {
        outline-color: #9ce6e1;
    }

.footer-certifications {
    align-self: start;
    margin-top: -4px;
}

.iso-card {
    background: #fff;
    border-radius: 18px;
    padding: 2px;
}

    .iso-card img {
        display: block;
        width: 100%;
        height: auto;
    }

.footer-social {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 18px;
    margin: 20px 0 0;
}

    .footer-social a {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        color: #fff;
        font-size: 12px;
        line-height: 18px;
        white-space: nowrap;
        transition: transform .25s ease;
    }

        .footer-social a:hover, .footer-social a:focus-visible {
            color: #fff;
            transform: translateY(-4px) scale(1.05);
        }

    .footer-social img {
        display: block;
        flex: 0 0 auto;
        width: 27px;
        height: 27px;
    }

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 12px;
}

    .footer-links a {
        font-size: 12px;
        font-weight: 500;
        line-height: 18px;
    }

.topbar-bottom .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.topbar-bottom span {
    color: #fff;
    font-size: .8rem;
}

.body-step.will-reveal, .footer-step.will-reveal {
    opacity: 0;
    transform: translateY(-22px);
    transition: opacity .6s ease, transform .7s cubic-bezier(.2,.65,.3,1);
    transition-delay: var(--reveal-delay, 0ms);
}

    .body-step.will-reveal.is-visible, .footer-step.will-reveal.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

[hidden] {
    display: none !important;
}

.sr-only, .skip-link:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link:focus {
    display: block;
    padding: 12px;
    background: white;
}

/* Responsive general */
@media (max-width: 760px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .brand {
        gap: 20px;
        min-height: 230px;
        padding-top: 32px;
        padding-bottom: 32px;
    }

    .brand-logo {
        padding: 12px;
        border-radius: 18px 18px 18px 6px;
    }

        .brand-logo img {
            width: 68px;
            height: 68px;
        }

    .brand-title {
        font-size: clamp(2rem, 6.5vw, 3rem);
    }

    .brand-subtitle {
        font-size: 1.12rem;
    }

    .brand-tagline {
        font-size: .85rem;
    }

    .fields {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .field-mode {
        width: 100%;
    }

    .card {
        padding: 22px;
        border-radius: 20px;
    }

    .footer-main {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .footer-certifications {
        max-width: 350px;
        width: 100%;
        margin-top: 0;
    }

    .footer-social {
        gap: 12px 18px;
    }
}

@media (max-width: 420px) {
    .brand {
        gap: 14px;
    }

    .brand-logo {
        padding: 9px;
    }

        .brand-logo img {
            width: 48px;
            height: 48px;
        }

    .brand-title {
        font-size: 2rem;
    }

    .brand-subtitle {
        font-size: 1rem;
    }

    .brand-tagline {
        font-size: .78rem;
    }

    .card {
        padding: 18px;
    }

    input, select {
        font-size: .9rem;
        padding-left: 60px;
    }

    .input-shell::before {
        left: 47px;
    }

    .input-icon {
        left: 15px;
        width: 20px;
    }

    .topbar-bottom span {
        font-size: .7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
    }

    .body-step.will-reveal, .footer-step.will-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .button, .input-shell, .footer-social a {
        transition: none;
    }

        .footer-social a:hover, .footer-social a:focus-visible {
            transform: none;
        }
}

@media print {
    .body-step.will-reveal, .footer-step.will-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
