:root {
    --azul: #0a39e4;
    --azul-osc: #0827a6;
    --verde: #198754;
    --verde-osc: #157347;
    --rojo: #dc3545;
    --ambar: #664d03;
    --gris: #6c757d;
    --gris-claro: #eef1f5;
    --borde: #e2e6ea;
    --fondo: #f4f6fb;
    --radio: 12px;
    --sombra: 0 1px 3px rgba(0, 0, 0, .06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--fondo);
    color: #212529;
    line-height: 1.5;
}

.contenedor {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ---------- Encabezado (franja azul · SENATI) ---------- */
.encabezado {
    position: relative;
    overflow: hidden;
    background: linear-gradient(110deg, #081530 0%, #0e2f8f 55%, #0a39e4 100%);
    color: #fff;
    padding: .95rem 0 1.15rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 18px rgba(4, 12, 24, .22);
}
.encabezado::after {
    content: "";
    position: absolute;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    right: -120px;
    bottom: -180px;
    background: radial-gradient(circle, rgba(255, 213, 74, .18), transparent 70%);
    pointer-events: none;
}

.encabezado-fijo {
    position: sticky;
    top: 0;
    z-index: 50;
}

.encabezado .contenedor { max-width: none; }

.encabezado-inner {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
}

.marca {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    background: transparent;
    flex: 0 0 auto;
    line-height: 0;
    transition: opacity .15s ease, transform .15s ease;
}
.marca:hover { opacity: .92; }

.marca img {
    display: block;
    height: 46px;
    width: auto;
}

.encabezado-identidad {
    position: relative;
    z-index: 1;
    text-align: right;
    margin-left: auto;
}
.encabezado-eyebrow {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #ffd54a;
    margin-bottom: .12rem;
}
.encabezado-evento {
    display: block;
    font-size: clamp(1.2rem, 3.2vw, 1.65rem);
    font-weight: 800;
    letter-spacing: .05em;
    line-height: 1.12;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}

@media (max-width: 520px) {
    .encabezado { padding: .8rem 0 1rem; }
    .encabezado-inner { justify-content: center; }
    .encabezado-identidad { text-align: center; margin-left: 0; }
    .marca img { height: 40px; }
}

/* ---------- Pasos ---------- */
.pasos {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    counter-reset: paso;
}

.pasos li {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    color: var(--gris);
    font-weight: 500;
    padding: .5rem .6rem;
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
}

.pasos li span {
    flex: 0 0 auto;
    width: 1.6rem;
    height: 1.6rem;
    display: grid;
    place-items: center;
    background: var(--gris-claro);
    border-radius: 50%;
    font-weight: 700;
    font-size: .85rem;
}

.pasos li.activo {
    border-color: var(--azul);
    color: var(--azul-osc);
}

.pasos li.activo span { background: var(--azul); color: #fff; }

/* ---------- Tarjetas ---------- */
.tarjeta {
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--sombra);
}

.tarjeta h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
.tarjeta h3 { margin: 0 0 .5rem; font-size: 1.05rem; }

.tarjeta-titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .6rem 1rem;
    margin-bottom: .5rem;
}

.tarjeta-titulo h2 { margin: 0; }

.exportar {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.formulario-en-linea { display: inline-block; }

.desplegable {
    margin-top: .75rem;
    border-top: 1px solid var(--borde);
    padding-top: .75rem;
}
.desplegable summary {
    cursor: pointer;
    color: var(--azul);
    font-weight: 600;
    font-size: .9rem;
}

.tarjeta-exito { text-align: center; }

.exito-icono {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto .75rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #d1e7dd;
    color: var(--verde-osc);
    font-size: 1.8rem;
    font-weight: 800;
}

/* ---------- Campos y botones ---------- */
.campo { display: block; margin-bottom: 1rem; }

.campo span {
    display: block;
    font-weight: 600;
    margin-bottom: .35rem;
    font-size: .9rem;
}

.campo input[type="text"],
.campo input[type="file"],
.campo input[type="email"],
.campo input[type="tel"] {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
}

.campo select,
.campo textarea {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    font-family: inherit;
}

.campo textarea { resize: vertical; min-height: 5.5rem; }

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
    outline: 3px solid rgba(13, 110, 253, .15);
    border-color: var(--azul);
}

.subtitulo {
    margin: 1.25rem 0 .75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--borde);
    font-size: 1rem;
}

.opcional { color: var(--gris); font-weight: 400; }

.btn {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    padding: .6rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    line-height: 1.2;
}

.btn-primario { background: var(--azul); }
.btn-primario:hover { background: var(--azul-osc); }

.btn-secundario {
    background: #fff;
    color: var(--azul-osc);
    border: 1px solid var(--azul);
}

.btn-secundario:hover { background: #eaf2ff; }

/* ---------- Datos ---------- */
.datos {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: .35rem .75rem;
    margin: .5rem 0 0;
}

.datos dt {
    font-weight: 600;
    color: var(--gris);
    font-size: .9rem;
}

.datos dd { margin: 0; }

.separador {
    border-top: 1px solid var(--borde);
    margin: 1.25rem 0;
}

#buscar { scroll-margin-top: 1rem; }

/* ---------- Avisos / flash ---------- */
.aviso {
    border-radius: 8px;
    padding: .75rem 2.5rem .75rem 1rem;
    margin-bottom: 1.25rem;
    font-weight: 500;
    position: relative;
}

.aviso-ok   { background: #d1e7dd; color: #0f5132; border: 1px solid #badbcc; }
.aviso-error{ background: #f8d7da; color: #842029; border: 1px solid #f5c2c7; }
.aviso-advertencia { background: #fff3cd; color: #664d03; border: 1px solid #ffecb5; }

.aviso-cerrar {
    position: absolute;
    top: 50%;
    right: .5rem;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: .6;
}

.aviso-cerrar:hover { opacity: 1; }

/* ---------- Estado ---------- */
.estado {
    display: inline-block;
    padding: .3rem .9rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: .9rem;
    margin: .5rem 0 1rem;
}

.estado-pendiente { background: #fff3cd; color: var(--ambar); }
.estado-en_revision { background: #cfe2ff; color: #084298; }
.estado-aprobado  { background: #d1e7dd; color: #0f5132; }
.estado-rechazado { background: #f8d7da; color: #842029; }
.estado-nuevo { background: #e6dcf8; color: #5b2ba0; }
.estado-pagado { background: #d1e7dd; color: #0f5132; }

/* ---------- Utilidades ---------- */
.nota { color: var(--gris); font-size: .9rem; }

/* Barra de navegación entre sistemas en las páginas públicas */
.sistemas-mini {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}

/* Portal de acceso a los sistemas */
.portal-sistemas {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-bottom: 1rem;
}
.portal-item {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 1.2rem;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease, transform .15s ease;
}
.portal-item:hover { border-color: var(--azul); transform: translateY(-2px); }
.portal-item strong { font-size: 1.05rem; color: var(--azul-osc); }
.portal-item span { color: var(--gris); font-size: .9rem; }
.portal-item em { font-style: normal; color: var(--azul); font-weight: 600; font-size: .9rem; margin-top: .3rem; }

code {
    background: var(--gris-claro);
    padding: .1rem .35rem;
    border-radius: 4px;
    font-size: .85em;
}

/* ---------- Portal (inicio) ---------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 2.2rem 0 1.8rem;
    margin-bottom: 1rem;
}
.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.hero::before { width: 300px; height: 300px; top: -170px; right: -120px; background: radial-gradient(circle, rgba(10, 57, 228, .07), transparent 70%); }
.hero::after  { width: 220px; height: 220px; bottom: -150px; left: -100px;  background: radial-gradient(circle, rgba(255, 179, 0, .08), transparent 70%); }

.hero-presenta {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(1rem, 2vw, 2rem);
    width: 100%;
}
.hero-texto {
    min-width: 0;
    padding-right: 0;
}

.hero-burbuja-btn {
    position: static;
    justify-self: end;
    align-self: center;
    background: none;
    border: none;
    padding: 0;
    line-height: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: transform .18s ease;
    margin-left: 0;
}
.hero-burbuja-btn:hover { transform: scale(1.06); }
.hero-burbuja-btn:focus-visible { outline: 3px solid #ffd54a; outline-offset: 4px; border-radius: 50%; }

.hero-burbuja {
    width: clamp(130px, 11vw, 175px);
    height: clamp(130px, 11vw, 175px);
    object-fit: cover;
    object-position: center top;
    border-radius: 50%;
    border: 4px solid #ffd54a;
    box-shadow: 0 0 0 7px rgba(10, 57, 228, .12), 0 14px 34px rgba(10, 57, 228, .22);
    animation: burbuja-flotar 5s ease-in-out infinite;
}
@keyframes burbuja-flotar {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

/* ---------- Modal de imagen ---------- */
.modal-imagen {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(6, 12, 34, .88);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    animation: modal-imagen-in .16s ease;
}
.modal-imagen[hidden] { display: none; }
@keyframes modal-imagen-in {
    from { opacity: 0; transform: scale(.96); }
    to   { opacity: 1; transform: scale(1); }
}
.modal-imagen-foto {
    max-width: min(92vw, 880px);
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.modal-imagen-cerrar {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .28);
    color: #fff;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .15s ease, transform .1s ease;
}
.modal-imagen-cerrar:hover { background: rgba(255, 255, 255, .3); }
.modal-imagen-cerrar:active { transform: scale(.94); }
.modal-imagen-cerrar:focus-visible { outline: 3px solid #ffd54a; outline-offset: 3px; }

.hero .contenedor { position: relative; z-index: 1; }

.hero-etiqueta {
    display: inline-block;
    padding: .3rem .75rem;
    border: 1px solid #dbe6ff;
    background: #eef3ff;
    color: var(--azul);
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hero h2 {
    margin: 1rem 0 .5rem;
    font-size: clamp(1.5rem, 4.2vw, 2.2rem);
    line-height: 1.15;
    color: #0f172a;
    overflow-wrap: break-word;
}
.hero-evento {
    color: var(--azul);
    white-space: normal;
    overflow-wrap: break-word;
    box-shadow: inset 0 -.35em 0 rgba(255, 213, 74, .5);
}
.hero-intro { margin: 0 0 1.75rem; max-width: 62ch; color: var(--gris); font-size: 1rem; }

@media (max-width: 860px) {
    .hero-presenta {
        display: block;
    }

    .hero-burbuja-btn {
        position: static;
        display: block;
        margin: 1.25rem 0 0 auto;
    }
}

@media (max-width: 620px) {
    .hero-burbuja { width: clamp(100px, 26vw, 140px); height: clamp(100px, 26vw, 140px); }
}

.hero-pasos {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.hero-paso {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    padding: .35rem 0;
}
.hero-num {
    flex: 0 0 auto;
    width: 2.85rem;
    height: 2.85rem;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    box-shadow: 0 5px 12px rgba(15, 23, 42, .18);
}
.hero-num svg { display: block; }
.hero-paso:nth-child(1) .hero-num { background: linear-gradient(135deg, #0a39e4, #4d7cff); }
.hero-paso:nth-child(2) .hero-num { background: linear-gradient(135deg, #157347, #3fb873); }
.hero-paso:nth-child(3) .hero-num { background: linear-gradient(135deg, #334155, #64748b); }

.hero-paso-n {
    display: block;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: .1rem;
}
.hero-paso:nth-child(1) .hero-paso-n { color: var(--azul); }
.hero-paso:nth-child(2) .hero-paso-n { color: var(--verde-osc); }
.hero-paso:nth-child(3) .hero-paso-n { color: #475569; }

.hero-paso strong { display: block; font-size: 1rem; color: #0f172a; }
.hero-paso small { display: block; color: var(--gris); font-size: .85rem; margin-top: .15rem; }

.accesos {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-bottom: 1.25rem;
}
.acceso {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: 1.4rem;
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(8, 39, 166, .06);
    text-decoration: none;
    color: inherit;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.acceso:hover {
    transform: translateY(-3px);
    border-color: var(--azul);
    box-shadow: 0 8px 22px rgba(10, 57, 228, .14);
}
.acceso-icono {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 12px;
}
.acceso:nth-child(1) .acceso-icono { background: #e7edff; color: var(--azul); }
.acceso:nth-child(2) .acceso-icono { background: #e2f4ea; color: var(--verde-osc); }
.acceso-etiqueta {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.acceso:nth-child(1) .acceso-etiqueta { color: var(--azul); }
.acceso:nth-child(2) .acceso-etiqueta { color: var(--verde-osc); }
.acceso strong { font-size: 1.1rem; color: var(--azul-osc); }
.acceso-desc { font-size: .9rem; color: var(--gris); }
.acceso-link { margin-top: auto; padding-top: .4rem; font-weight: 700; font-size: .92rem; }
.acceso:nth-child(1) .acceso-link { color: var(--azul); }
.acceso:nth-child(2) .acceso-link { color: var(--verde-osc); }

.estado-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.1rem 1.3rem;
    margin-bottom: 1rem;
    background: linear-gradient(120deg, #eef1f9, #fbfcfe);
    border: 1px solid var(--borde);
    border-radius: 16px;
}
.estado-box-info { display: flex; align-items: center; gap: .8rem; }
.estado-box .acceso-icono {
    width: 42px;
    height: 42px;
    background: #fff;
    color: var(--gris);
    box-shadow: var(--sombra);
}
.estado-box strong { display: block; }

.lista { margin: .5rem 0 0; padding-left: 1.2rem; }
.lista li { margin-bottom: .4rem; }

.mv {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

abbr { text-decoration: none; }

/* ---------- Pie ---------- */
.pie {
    margin-top: 2rem;
    padding: 1rem 0 1.5rem;
    border-top: 1px solid var(--borde);
    color: var(--gris);
    font-size: .85rem;
    text-align: center;
}

.pie p { margin: .15rem 0; }
.pie-secundario a {
    color: #adb5bd;
    text-decoration: none;
}
.pie-secundario a:hover { color: var(--gris); text-decoration: underline; }
.pie-separador { color: #495057; margin: 0 .4rem; }

@media (max-width: 420px) {
    .encabezado-inner { flex-wrap: wrap; gap: .5rem; }
    .marca img { height: 40px; }
    .pasos li { font-size: .75rem; }
    .pasos li span { width: 1.4rem; height: 1.4rem; }
    .datos { grid-template-columns: 1fr; gap: .2rem; }
    .datos dt { margin-top: .5rem; }
}