/* Base, tipografía y contenedor */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    color: #303030;
    background: #ffffff;
    line-height: 1.6;
}

.contenedor {
    width: 90%;
    max-width: 1300px;
    margin: auto;
}

/* Barra superior institucional */

.barra-superior {
    background: #126b45;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.barra-contenido {
    width: 100%;
    padding: 10px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    line-height: 1;
}

.barra-contenido a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.barra-contenido strong {
    margin: 0 8px;
}

/* Encabezado y menú de navegación */

.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,.10);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-contenido {
    width: 100%;
    padding: 0 5px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-area img {
    width: 65px;
}

.logo-area h2 {
    color: #126b45;
    font-size: 20px;
}

.logo-area p {
    font-size: 13px;
    color: #777;
}

.menu {
    display: flex;
    list-style: none;
    gap: 25px;
}

.menu a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    transition: .3s;
}

.menu a:hover {
    color: #126b45;
}

/* Portada, textos y botones */

.hero {
    min-height: 620px;
    background:
    linear-gradient(rgba(18, 107, 69, 0.68), rgba(18, 107, 69, 0.68)),
    url("../img/gra.jpeg") center / cover no-repeat;
    display: flex;
    align-items: center;
    position: relative;
    color: white;
   
}

.hero-contenido {
    max-width: 850px;
}

.etiqueta {
    display: inline-block;
    background: #126b45;
    padding: 7px 15px;
    border-radius: 20px;
    font-size: 14px;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 52px;
    line-height: 1.1;
    margin-bottom: 10px;
}

.hero h2 {
    font-size: 32px;
    color: #e3b341;
    margin-bottom: 20px;
}

.hero p {
    max-width: 700px;
    font-size: 19px;
    margin-bottom: 30px;
}

.botones {
    display: flex;
    gap: 15px;
}

.btn {
    display: inline-block;
    padding: 13px 25px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
}

.btn-principal {
    background: #126b45;
    color: white;
}

.btn-secundario {
    border: 2px solid white;
    color: white;
}

.btn:hover {
    opacity: .85;
}

/* Espaciado y títulos de sección */

.seccion {
    padding: 90px 0;
}

.fondo-gris {
    background: #f5f6f6;
}

.titulo-seccion {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 50px;
}

.titulo-seccion span {
    color: #126b45;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1px;
}

.titulo-seccion h2 {
    font-size: 38px;
    margin: 8px 0 10px;
    color: #252525;
}

/* Estilos compartidos de tarjetas */

.carrera {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,.08);
    transition: transform .3s, box-shadow .3s;
}

.carrera:hover {
    transform: translateY(-7px);
    box-shadow: 0 12px 30px rgba(0,0,0,.14);
}

.icono,
.carrera-icono {
    font-size: 38px;
    margin-bottom: 15px;
}

.carrera h3 {
    color: #126b45;
    margin-bottom: 12px;
}

/* Identidad institucional: misión y visión */

.identidad-institucional {
    width: 100%;
    max-width: 1050px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr .95fr;
    gap: 20px;
    align-items: stretch;
}

.identidad-tarjetas {
    display: grid;
    grid-template-rows: repeat(2, minmax(300px, 1fr));
    gap: 30px;
}

.tarjeta-identidad {
    position: relative;
    overflow: hidden;
    min-height: 210px;
    padding: 25px;
    color: white;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.tarjeta-identidad::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(18, 107, 69, .68);
    z-index: 1;
    transition: background .3s ease;
}

.tarjeta-identidad .icono,
.tarjeta-identidad h3,
.tarjeta-identidad p {
    position: relative;
    z-index: 2;
    color: white;
}

.tarjeta-identidad .icono {
    width: 56px;
    height: 56px;
    background: #126b45;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: 0 3px 6px rgba(0,0,0,.15);
    position: relative;
    z-index: 2;
}

.tarjeta-identidad .icono svg {
    width: 25px;
    height: 25px;
    stroke: white;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tarjeta-identidad h3 {
    font-size: 22px;
    margin-bottom: 9px;
}

.tarjeta-identidad p {
    font-size: 13.5px;
    line-height: 1.55;
    text-align: justify;
}

.tarjeta-mision {
    background-image: url("../img/mision2.png");
}

.tarjeta-vision {
    background-image: url("../img/vision2.png");
}

.tarjeta-identidad:hover::before {
    background: rgba(0, 170, 85, .93);
}

/* Carrusel de valores: tarjeta, imágenes, flechas e indicadores */

.valores-carrusel {
    position: relative;
    min-height: 436px;
    padding: 20px 23px 48px;
    border-radius: 12px;
    background: white;
    color: #303030;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 5px 20px rgba(0,0,0,.08);
}

.titulo-valores {
    color: #303030;
    font-size: 21px;
    margin-bottom: 10px;
}

.valor-ilustracion {
    width: 150px;
    height: 185px;
    flex: 0 0 auto;
    margin: 30px auto 14px;
    border: 6px solid #174785;
    border-radius: 8px;
    background: linear-gradient( 145deg, #edf5ff, #e7f5ed 55%, #fff2e8 );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 0 5px rgba(23,71,133,.08);
}

.valor-info {
    width: 100%;
    max-width: 270px;
}

.valor-info h3 {
    color: #303030;
    font-size: 19px;
    margin: 0 0 5px;
}

.valor-frase {
    color: #126b45;
    font-size: 13px;
    font-style: italic;
    font-weight: bold;
    margin-bottom: 10px;
}

.valor-control {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #13b981;
    color: white;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background .2s ease, transform .2s ease;
}

.valor-control:hover {
    background: #0d9668;
    transform: translateY(-50%) scale(1.08);
}

.valor-anterior {
    left: -15px;
}

.valor-siguiente {
    right: -15px;
}

.valores-indicadores {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 17px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.valor-punto {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #c7c7c7;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.valor-punto.activo {
    background: #126b45;
    transform: scale(1.2);
}

@media (prefers-reduced-motion: reduce) {
    .tarjeta-identidad::before,
    .valor-control,
    .valor-punto {
        transition: none;
    }
}

#nosotros .titulo-valores {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#nosotros .valores-icono-titulo {
    display: block;
    object-fit: contain;
}

#nosotros .valor-ilustracion {
    width: min(220px, 65%);
    height: auto;
    aspect-ratio: 4 / 5;
    border: 0;
    background: transparent;
    box-shadow: none;
}

#nosotros .valor-ilustracion img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Estilos base de las tarjetas de carreras */

.grid-carreras {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 25px;
}

.carrera a {
    display: inline-block;
    margin-top: 20px;
    color: #126b45;
    text-decoration: none;
    font-weight: bold;
}

.grid-carreras .carrera:not(.carrera-oferta) {
    background: white;
    color: #303030;
}

.grid-carreras .carrera:not(.carrera-oferta)::before {
    display: none;
}

.grid-carreras .carrera:not(.carrera-oferta) .carrera-icono,
.grid-carreras .carrera:not(.carrera-oferta) h3,
.grid-carreras .carrera:not(.carrera-oferta) p {
    position: static;
    color: inherit;
}

.grid-carreras .carrera:not(.carrera-oferta) h3 {
    color: #126b45;
}

/* Identidad gráfica: colores, descargas y visor PDF */

.identidad-grafica {
    background: #f7f8f8;
    padding: 85px 0;
}

.identidad-grafica .titulo-seccion p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.identidad-grafica-grid {
    width: 100%;
    max-width: 1100px;
    margin: auto;
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 25px;
    align-items: stretch;
}

.identidad-card {
    background: white;
    padding: 28px;
    border-radius: 13px;
    border: 1px solid #e9eceb;
    box-shadow: 0 3px 12px rgba(0,0,0,.07);
    min-width: 0;
}

.identidad-card-titulo {
    border-bottom: 1px solid #dfe4e2;
    padding-bottom: 12px;
    margin-bottom: 22px;
}

.identidad-card-titulo h3 {
    font-size: 19px;
    color: #222;
}

.color-principal {
    display: flex;
    align-items: center;
    gap: 17px;
    padding-bottom: 22px;
}

.muestra-principal {
    width: 65px;
    height: 65px;
    flex-shrink: 0;
    background: #007E67;
    border-radius: 10px;
}

.color-datos {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.color-datos strong {
    font-size: 15px;
    color: #222;
}

.color-datos span {
    color: #777;
    font-size: 12px;
}

.color-datos code {
    color: #007E67;
    font-size: 12px;
    font-weight: bold;
}

.color-datos small {
    color: #888;
    font-size: 11px;
}

.paleta-encabezado {
    border-top: 1px solid #e7e7e7;
    padding-top: 17px;
    margin-bottom: 15px;
}

.paleta-encabezado h4 {
    font-size: 15px;
    color: #292929;
}

.paleta-encabezado p {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
}

.paleta-colores {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 12px;
}

.color-muestra {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.color-muestra > span {
    width: 39px;
    height: 39px;
    flex-shrink: 0;
    border-radius: 7px;
    border: 1px solid rgba(0,0,0,.06);
}

.color-muestra div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.color-muestra strong {
    color: #333;
    font-size: 11px;
}

.color-muestra code {
    font-size: 11px;
    color: #777;
}

.identidad-recursos {
    display: flex;
    flex-direction: column;
}

.logo-identidad {
    text-align: center;
    background: #f8faf9;
    border-radius: 10px;
    padding: 20px;
}

.logo-identidad img {
    width: 100%;
    max-width: 190px;
    height: 125px;
    object-fit: contain;
}

.logo-identidad h4 {
    color: #222;
    font-size: 16px;
    margin-top: 10px;
}

.logo-identidad p {
    font-size: 12px;
    color: #777;
}

.recursos-descarga {
    margin-top: 25px;
}

.recursos-descarga h4 {
    color: #222;
    font-size: 15px;
    margin-bottom: 14px;
}

.btn-recurso {
    width: 100%;
    min-height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 15px;
    margin-bottom: 12px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    transition: .3s ease;
}

.btn-recurso svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-recurso-principal {
    background: #007E67;
    color: white;
    border: 1px solid #007E67;
}

.btn-recurso-principal:hover {
    background: #005F4D;
    transform: translateY(-2px);
}

.btn-recurso-secundario {
    background: white;
    color: #007E67;
    border: 1px solid #007E67;
}

.btn-recurso-secundario:hover {
    background: #edf6f3;
    transform: translateY(-2px);
}

.enlace-guia-oficial {
    display: block;
    text-align: center;
    color: #007E67;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
    margin-top: 15px;
}

.enlace-guia-oficial:hover {
    text-decoration: underline;
}

.identidad-vista-previa {
    width: 100%;
    max-width: 1100px;
    margin: 30px auto 0;
    padding: 28px;
    background: white;
    border: 1px solid #e9eceb;
    border-radius: 13px;
    box-shadow: 0 3px 12px rgba(0,0,0,.07);
}

.vista-previa-encabezado {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.vista-previa-encabezado span {
    color: #007E67;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
}

.vista-previa-encabezado h3 {
    color: #222;
    font-size: 21px;
    margin: 5px 0;
}

.vista-previa-encabezado p {
    color: #777;
    font-size: 13px;
}

.btn-abrir-pdf {
    flex-shrink: 0;
    background: #007E67;
    color: white;
    padding: 11px 20px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
    transition: .3s;
}

.btn-abrir-pdf:hover {
    background: #005F4D;
}

.visor-pdf {
    width: 100%;
    height: 650px;
    overflow: hidden;
    background: #f1f3f2;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.visor-pdf iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
}

.nota-pdf {
    color: #888;
    font-size: 12px;
    text-align: center;
    margin-top: 13px;
}

@media (max-width: 900px) {
    .identidad-grafica-grid {
        grid-template-columns: 1fr;
        max-width: 650px;
    }

    .identidad-vista-previa {
        max-width: 650px;
    }
}

@media (max-width: 600px) {
    .identidad-grafica {
        padding: 55px 0;
    }

    .identidad-card {
        padding: 20px;
    }

    .identidad-vista-previa {
        padding: 17px;
    }

    .paleta-colores {
        grid-template-columns: 1fr 1fr;
        gap: 15px 8px;
    }

    .color-muestra > span {
        width: 32px;
        height: 32px;
    }

    .color-muestra strong {
        font-size: 10px;
    }

    .color-muestra code {
        font-size: 10px;
    }

    .vista-previa-encabezado {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-abrir-pdf {
        width: 100%;
        text-align: center;
    }

    .visor-pdf {
        height: 480px;
    }
}

/* Galería de imágenes */

.galeria {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 18px;
}

.galeria img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    transition: .3s;
}

.galeria img:hover {
    transform: scale(1.02);
}

/* Estilos base de contacto */

.contacto {
    background: #f6f7f7;
}

.contacto-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.dato {
    margin: 25px 0;
}

.formulario {
    background: white;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,.08);
}

.formulario label {
    display: block;
    margin-bottom: 7px;
    font-weight: bold;
}

.formulario input,
.formulario textarea {
    width: 100%;
    padding: 13px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 15px;
}

.formulario textarea {
    min-height: 130px;
    resize: vertical;
}

.formulario button {
    width: 100%;
    border: 0;
    padding: 14px;
    background: #126b45;
    color: white;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.formulario button:hover {
    background: #0c5235;
}

/* Pie de página */

footer {
    background: #202825;
    color: #ddd;
    padding-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 50px;
    padding-bottom: 50px;
}

.logo-footer {
    width: 100px;
    margin-bottom: 15px;
}

footer h3,
footer h4 {
    color: white;
    margin-bottom: 15px;
}

footer a {
    display: block;
    color: #ddd;
    text-decoration: none;
    margin: 7px 0;
}

footer a:hover {
    color: white;
}

.copyright {
    border-top: 1px solid rgba(255,255,255,.15);
    text-align: center;
    padding: 20px;
    font-size: 13px;
}

/* Adaptación general y de la identidad a pantallas pequeñas */

@media(max-width:900px) {
    .menu {
        display: none;
    }

    .hero h1 {
        font-size: 39px;
    }

    .grid-carreras {
        grid-template-columns: 1fr 1fr;
    }

    .contacto-grid {
        grid-template-columns: 1fr;
    }
}

@media(max-width:600px) {
    .hero {
        min-height: 550px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero h2 {
        font-size: 25px;
    }

    .botones {
        flex-direction: column;
    }

    .grid-carreras,
    .galeria,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .titulo-seccion h2 {
        font-size: 30px;
    }
}

@media (max-width: 760px) {
    .identidad-institucional {
        grid-template-columns: 1fr;
    }

    .identidad-tarjetas {
        grid-template-rows: auto auto;
    }

    .tarjeta-identidad {
        min-height: 220px;
    }

    .valores-carrusel {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
    }
}

/* Oferta educativa: tarjetas, iconos y distribución adaptable */

.grid-carreras {
    width: 100%;
    max-width: 1120px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 35px;
    align-items: stretch;
}

.grid-carreras .carrera-oferta {
    position: relative;
    overflow: hidden;
    height: 335px;
    min-height: 335px;
    padding: 25px 17px;
    border-radius: 38px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    color: white;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-shadow: 0 8px 22px rgba(0,0,0,.20);
    transition: transform .3s ease, box-shadow .3s ease;
}

.grid-carreras .carrera-oferta::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    transition: background .3s ease;
}

.tarjeta-informatica::before {
    background: rgba(18, 107, 69, .75);
}

.tarjeta-motores::before {
    background: rgba(18, 107, 69, .75);
}

.tarjeta-administracion::before {
    background: rgba(18, 107, 69, .75);
}

.tarjeta-enfermeria::before {
    background: rgba(18, 107, 69, .75);
}

.grid-carreras .carrera-oferta > * {
    position: relative;
    z-index: 2;
}

.grid-carreras .carrera-oferta .carrera-icono {
    width: 75px;
    height: 75px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
}

.grid-carreras .carrera-oferta .carrera-icono svg {
    width: 70px;
    height: 70px;
    stroke: white;
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.grid-carreras .carrera-oferta h3 {
    color: white;
    font-size: 17px;
    font-weight: bold;
    text-transform: uppercase;
    line-height: 1.2;
    margin-bottom: 15px;
}

.grid-carreras .carrera-oferta p {
    color: white;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.grid-carreras .carrera-oferta a {
    color: white;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    border-bottom: 1px solid white;
    margin-top: 15px;
    display: inline-block;
}

.grid-carreras .carrera-oferta:hover {
    transform: translateY(-8px);
    box-shadow: 0 14px 30px rgba(0,0,0,.28);
}

.tarjeta-informatica:hover::before,
.tarjeta-administracion:hover::before {
    background: rgba(0, 145, 75, .93);
}

.tarjeta-motores:hover::before,
.tarjeta-enfermeria:hover::before {
    background: rgba(0, 145, 75, .93);
}

@media (max-width: 1000px) {
    .grid-carreras {
        grid-template-columns: repeat(2, 1fr);
        max-width: 650px;
        gap: 30px;
    }
}

@media (max-width: 600px) {
    .grid-carreras {
        grid-template-columns: 1fr;
        max-width: 300px;
        gap: 25px;
    }

    .grid-carreras .carrera-oferta {
        height: 335px;
        min-height: 335px;
    }
}

.tarjeta-informatica {
    background-image: url("../img/informatica.jpg");
}

.tarjeta-motores {
    background-image: url("../img/motores.jpg");
}

.tarjeta-administracion {
    background-image: url("../img/administracion.jpg");
}

.tarjeta-enfermeria {
    background-image: url("../img/enfermeria.jpg");
}

.grid-carreras .carrera-oferta:hover::before {
    background: rgba(0, 170, 85, .93);
}

@media (max-width: 600px) {
    .grid-carreras {
        grid-template-columns: 1fr;
    }

    .grid-carreras .carrera-oferta {
        min-height: 280px;
    }
}

/* Ventana de carreras y acciones de los documentos PDF */

.grid-carreras .carrera-oferta .btn-conocer-carrera {
    position: relative;
    z-index: 2;
    margin-top: 18px;
    padding: 0;
    width: fit-content;
    border: none;
    border-bottom: 1px solid white;
    background: transparent;
    color: white;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}

.modal-carrera {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    padding: 20px;
    background: rgba(0, 0, 0, .65);
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.modal-carrera.activa {
    display: flex;
}

.modal-carrera-contenido {
    position: relative;
    width: 100%;
    max-width: 950px;
    min-height: 500px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    box-shadow: 0 15px 50px rgba(0,0,0,.25);
}

.modal-carrera-imagen {
    position: relative;
    min-height: 500px;
    background-color: #126b45;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-carrera-imagen::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(18, 107, 69, .30);
}

.modal-carrera-icono {
    position: relative;
    z-index: 2;
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-carrera-icono svg {
    width: 110px;
    height: 110px;
    stroke: white;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.modal-carrera-detalle {
    padding: 45px 40px;
}

.modal-etiqueta {
    color: #126b45;
    font-weight: bold;
    font-size: 12px;
    letter-spacing: 1px;
}

.modal-carrera-detalle h2 {
    margin: 5px 0 15px;
    font-size: 32px;
    color: #222;
}

.modal-clave {
    display: inline-block;
    background: #e7f5ed;
    color: #126b45;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 20px;
}

.modal-descripcion {
    margin-top: 17px;
}

.modal-descripcion h3,
.modal-documento h3 {
    font-size: 15px;
    color: #333;
    margin-bottom: 7px;
}

.modal-descripcion p {
    color: #777;
    font-size: 14px;
    line-height: 1.6;
}

.modal-documentos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 25px;
}

.modal-documento {
    min-width: 0;
}

.modal-pdf-acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modal-pdf-acciones a {
    display: inline-block;
    padding: 8px 11px;
    border-radius: 7px;
    background: #e7f5ed;
    color: #126b45;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
    transition: .3s;
}

.modal-pdf-acciones a:hover {
    background: #126b45;
    color: white;
}

.modal-cerrar {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 5;
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    background: #f1f1f1;
    color: #333;
    font-size: 24px;
    cursor: pointer;
}

.modal-cerrar:hover {
    background: #dddddd;
}

@media (max-width: 700px) {
    .modal-carrera-contenido {
        grid-template-columns: 1fr;
        max-width: 480px;
    }

    .modal-carrera-imagen {
        min-height: 190px;
    }

    .modal-carrera-icono {
        width: 80px;
        height: 80px;
    }

    .modal-carrera-icono svg {
        width: 65px;
        height: 65px;
    }

    .modal-carrera-detalle {
        padding: 30px 22px;
    }

    .modal-carrera-detalle h2 {
        font-size: 26px;
    }
}

@media (max-width: 400px) {
    .modal-documentos {
        grid-template-columns: 1fr;
    }
}

/* Antecedentes históricos y tablas */

.antecedentes-historicos {
    width: 100%;
    padding: 60px 7%;
    background: #ffffff;
    color: #333;
}

.antecedentes-header {
    text-align: center;
    margin-bottom: 35px;
}

.antecedentes-header h2 {
    color: #006b3f;
    font-size: 32px;
    font-weight: 700;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.antecedentes-header h2::after {
    content: "";
    position: absolute;
    width: 75px;
    height: 4px;
    background: #83bd00;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 5px;
}

.antecedentes-contenido {
    max-width: 1100px;
    margin: auto;
}

.antecedentes-contenido h3 {
    color: #006b3f;
    font-size: 23px;
    margin-top: 35px;
    margin-bottom: 15px;
    padding-left: 12px;
    border-left: 5px solid #83bd00;
}

.antecedentes-contenido h4 {
    color: #006b3f;
    font-size: 19px;
    margin-top: 25px;
    margin-bottom: 15px;
}

.antecedentes-contenido p {
    font-size: 16px;
    line-height: 1.8;
    text-align: justify;
    color: #444;
    margin-bottom: 20px;
}

.dato-interes {
    background: #edf6f0;
    border-left: 5px solid #006b3f;
    padding: 18px 22px;
    margin: 25px 0;
    border-radius: 5px;
    line-height: 1.7;
    color: #333;
}

.dato-interes strong {
    color: #006b3f;
}

.tabla-historica {
    width: 100%;
    overflow-x: auto;
    margin: 20px 0 30px;
}

.tabla-historica table {
    width: 100%;
    border-collapse: collapse;
    min-width: 450px;
    background: white;
}

.tabla-historica th {
    background: #006b3f;
    color: white;
    padding: 14px;
    text-align: left;
    font-size: 15px;
}

.tabla-historica td {
    padding: 13px 15px;
    border: 1px solid #ddd;
    font-size: 15px;
}

.tabla-historica tbody tr:nth-child(even) {
    background: #edf6f0;
}

.tabla-historica tbody tr:hover {
    background: #dcefe3;
    transition: 0.3s;
}

@media (max-width: 768px) {
    .antecedentes-historicos {
        padding: 45px 5%;
    }

    .antecedentes-header h2 {
        font-size: 26px;
    }

    .antecedentes-contenido h3 {
        font-size: 20px;
    }

    .antecedentes-contenido p {
        font-size: 14px;
    }

    .tabla-historica th,
    .tabla-historica td {
        padding: 10px;
        font-size: 13px;
    }
}

/* Carrusel de Facebook: publicaciones, controles y botón de acceso */

.noticias-facebook {
    background: #fafafa;
    padding: 75px 20px;
    overflow: hidden;
}

.noticias-facebook .titulo-seccion {
    text-align: center;
    margin-bottom: 40px;
}

.noticias-facebook .titulo-seccion span {
    color: #126b45;
    font-size: 12px;
    letter-spacing: 1px;
    font-weight: bold;
}

.noticias-facebook .titulo-seccion h2 {
    color: #202020;
    font-size: 36px;
    margin: 5px 0 12px;
}

.noticias-facebook .titulo-seccion p {
    color: #777;
    font-size: 14px;
}

.carrusel-noticias {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    overflow: hidden;
}

.noticias-track {
    display: flex;
    width: 100%;
    transition: transform 0.5s ease;
    will-change: transform;
}

.noticias-track .publicacion-facebook {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
    min-width: 0;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.publicacion-facebook .fb-post {
    width: 100%;
    max-width: 100%;
}

.publicacion-facebook .fb-post span {
    max-width: 100%;
}

.publicacion-facebook iframe {
    max-width: 100% !important;
}

.controles-noticias {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 25px;
}

.flecha-noticias {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: #126b45;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: .3s ease;
}

.flecha-noticias:hover {
    background: #0c5235;
    transform: scale(1.08);
}

.flecha-noticias:disabled {
    opacity: .35;
    cursor: not-allowed;
    transform: none;
}

.indicadores-noticias {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    margin-top: 20px;
}

.indicador-noticia {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: .3s ease;
}

.indicador-noticia.activo {
    background: #126b45;
    transform: scale(1.3);
}

.facebook-cargando,
.facebook-error {
    width: 100%;
    text-align: center;
    padding: 40px 15px;
    color: #126b45;
    font-weight: bold;
}

.contenedor-cta-noticias {
    text-align: center;
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid #ddd;
}

.btn-facebook {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #1877F2;
    color: white;
    padding: 13px 25px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    transition: .3s ease;
}

.btn-facebook:hover {
    background: #0866FF;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(24,119,242,.25);
}

@media (max-width: 900px) {
    .noticias-track .publicacion-facebook {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 600px) {
    .noticias-facebook {
        padding: 50px 12px;
    }

    .noticias-facebook .titulo-seccion h2 {
        font-size: 29px;
    }

    .noticias-track .publicacion-facebook {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 5px;
    }

    .controles-noticias {
        gap: 12px;
    }

    .flecha-noticias {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .btn-facebook {
        padding: 11px 20px;
        font-size: 13px;
    }
}

.marco-carrusel-noticias {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.carrusel-noticias {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
}

.noticias-track .publicacion-facebook {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
    min-width: 0;
    padding: 8px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.controles-noticias {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 0;
    pointer-events: none;
    z-index: 10;
}

.flecha-noticias {
    pointer-events: auto;
    width: 38px;
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    border-radius: 50%;
    background: #126b45;
    color: white;
    font-size: 17px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.flecha-noticias:hover {
    background: #0c5235;
    transform: scale(1.10);
}

.flecha-noticias:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 900px) {
    .noticias-track .publicacion-facebook {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 600px) {
    .marco-carrusel-noticias {
        max-width: 100%;
    }

    .noticias-track .publicacion-facebook {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 5px;
    }

    .flecha-noticias {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
}

/* Ajustes de tamaño y centrado del carrusel de Facebook */

.btn-facebook .icono-facebook {
    width: 13px;
    height: 18px;
    display: inline-block;
}

.marco-carrusel-noticias {
    position: relative;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}

.carrusel-noticias {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    overflow: hidden;
}

.noticias-track {
    display: flex;
    width: 100%;
    transition: transform 0.5s ease;
}

.noticias-track .publicacion-facebook {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
    min-width: 0;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

@media (max-width: 1100px) {
    .noticias-track .publicacion-facebook {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 600px) {
    .noticias-track .publicacion-facebook {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 5px;
    }
}

#ultimas-noticias .contenedor-cta-noticias {
    display: grid !important;
    grid-template-columns: 1fr;
    justify-items: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 35px auto 0 !important;
    padding: 25px 0 0 !important;
    text-align: center !important;
    box-sizing: border-box;
}

#ultimas-noticias .contenedor-cta-noticias .btn-facebook {
    display: inline-flex !important;
    justify-self: center !important;
    margin: 0 auto !important;
    position: static !important;
    float: none !important;
}

/* Contacto: información, formulario y estados de envío */

.contacto {
    padding: 90px 20px;
    background: linear-gradient( 135deg, #f1f8f4 0%, #f8fbf9 50%, #edf6f0 100% );
}

.contacto .titulo-seccion {
    text-align: center;
    margin-bottom: 55px;
}

.contacto .titulo-seccion span {
    color: #16834f;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.contacto .titulo-seccion h2 {
    color: #183c2b;
    font-size: 38px;
    font-weight: 800;
    margin: 12px 0;
}

.contacto .titulo-seccion p {
    color: #64746a;
    font-size: 15px;
    max-width: 600px;
    margin: auto;
    line-height: 1.7;
}

.contacto-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 30px;
    max-width: 1100px;
    margin: auto;
    align-items: stretch;
}

.info-contacto {
    background: linear-gradient( 145deg, #176b43, #104c32 );
    color: white;
    padding: 38px 32px;
    border-radius: 18px;
    box-shadow: 0 12px 35px rgba(20, 85, 51, 0.15);
    position: relative;
    overflow: hidden;
}

.info-contacto::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    border: 35px solid rgba(255,255,255,0.05);
    border-radius: 50%;
    right: -100px;
    bottom: -100px;
    pointer-events: none;
}

.contacto-encabezado {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 42px;
}

.icono-contacto {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.15);
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
}

.contacto-encabezado h3 {
    font-size: 21px;
    margin-bottom: 5px;
}

.contacto-encabezado p {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
}

.dato {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 30px;
}

.dato-icono {
    min-width: 43px;
    height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.13);
    border-radius: 11px;
    font-size: 18px;
}

.dato strong {
    display: block;
    font-size: 15px;
    margin-bottom: 7px;
    color: white;
}

.dato p {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255,255,255,0.78);
    overflow-wrap: anywhere;
}

.contacto-mensaje {
    border-top: 1px solid rgba(255,255,255,0.2);
    margin-top: 38px;
    padding-top: 25px;
}

.contacto-mensaje h4 {
    font-size: 16px;
    margin-bottom: 9px;
}

.contacto-mensaje p {
    font-size: 13px;
    line-height: 1.7;
    color: rgba(255,255,255,0.75);
}

.formulario {
    background: #ffffff;
    padding: 40px;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(24, 60, 43, 0.08);
    border: 1px solid #e7eee9;
}

.formulario-encabezado {
    margin-bottom: 30px;
}

.formulario-encabezado h3 {
    color: #183c2b;
    font-size: 23px;
    margin-bottom: 9px;
}

.formulario-encabezado p {
    color: #78867d;
    font-size: 13px;
    line-height: 1.6;
}

.campo-formulario {
    margin-bottom: 22px;
}

.campo-formulario label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #344c3d;
    margin-bottom: 9px;
}

.campo-formulario input,
.campo-formulario textarea {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid #dce6df;
    border-radius: 10px;
    background: #f9fbf9;
    color: #263b2e;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: all 0.25s ease;
}

.campo-formulario input {
    height: 51px;
}

.campo-formulario textarea {
    min-height: 145px;
    resize: vertical;
}

.campo-formulario input::placeholder,
.campo-formulario textarea::placeholder {
    color: #a1ada5;
}

.campo-formulario input:focus,
.campo-formulario textarea:focus {
    background: #ffffff;
    border-color: #16834f;
    box-shadow: 0 0 0 4px rgba(22,131,79,0.10);
}

.formulario button {
    width: 100%;
    height: 53px;
    border: none;
    border-radius: 10px;
    background: linear-gradient( 135deg, #16834f, #105c38 );
    color: white;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.formulario button:hover {
    background: linear-gradient( 135deg, #105c38, #0b472b );
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(22,131,79,0.22);
}

.formulario button:active {
    transform: translateY(0);
}

.flecha-boton {
    font-size: 19px;
    transition: transform 0.3s ease;
}

.formulario button:hover .flecha-boton {
    transform: translateX(5px);
}

#respuesta-formulario {
    margin-top: 15px;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

.formulario-seguridad {
    margin-top: 22px;
    padding-top: 17px;
    border-top: 1px solid #edf1ed;
    text-align: center;
    font-size: 11px;
    line-height: 1.6;
    color: #89968d;
}

@media (max-width: 850px) {
    .contacto-grid {
        grid-template-columns: 1fr;
        max-width: 650px;
    }

    .info-contacto {
        padding: 32px;
    }

    .formulario {
        padding: 32px;
    }
}

@media (max-width: 480px) {
    .contacto {
        padding: 65px 15px;
    }

    .contacto .titulo-seccion h2 {
        font-size: 30px;
    }

    .contacto .titulo-seccion p {
        font-size: 14px;
    }

    .info-contacto,
    .formulario {
        padding: 25px 20px;
        border-radius: 14px;
    }

    .contacto-encabezado h3 {
        font-size: 18px;
    }

    .formulario-encabezado h3 {
        font-size: 20px;
    }
}

/* Servicios CONALEP: tarjetas y adaptación a pantallas pequeñas */

.servicios-conalep {
    background: #ffffff;
    padding: 75px 0 85px;
}

.servicios-conalep .titulo-seccion {
    margin-bottom: 35px;
}

.servicios-conalep .titulo-seccion h2 {
    color: #333333;
    font-size: 32px;
    font-weight: 700;
}

.servicios-conalep .titulo-seccion span {
    color: #007E67;
}

.servicios-grid {
    width: 100%;
    max-width: 1000px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    align-items: stretch;
}

.servicio-card {
    min-width: 0;
    min-height: 162px;
    padding: 15px 12px;
    background: #ffffff;
    border: 1px solid #d8d8d8;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    text-decoration: none;
    color: #333333;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.servicio-icono {
    height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 5px;
}

.servicio-card h3 {
    color: #222222;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 5px;
}

.servicio-card p {
    color: #777777;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

.servicio-card:hover {
    transform: translateY(-5px);
    border-color: #007E67;
    box-shadow: 0 7px 18px rgba(0, 126, 103, .12);
}

.servicio-card:hover h3 {
    color: #007E67;
}

.servicio-card:focus-visible {
    outline: 3px solid #007E67;
    outline-offset: 3px;
}

@media (max-width: 900px) {
    .servicios-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 600px;
    }
}

@media (max-width: 600px) {
    .servicios-conalep {
        padding: 55px 0;
    }

    .servicios-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .servicio-card {
        min-height: 170px;
        padding: 14px 9px;
    }

    .servicio-card h3 {
        font-size: 12px;
    }

    .servicio-card p {
        font-size: 10px;
    }

    .servicio-icono {
        font-size: 29px;
    }
}

@media (max-width: 360px) {
    .servicios-grid {
        grid-template-columns: 1fr;
        max-width: 260px;
    }
}

/* Paleta común, lectura y ritmo de las secciones */
:root {
    --verde: #00745e;
    --verde-hover: #005e4c;
    --verde-activo: #004638;
    --tinta: #19352f;
    --superficie: #f5f4f0;
    --borde: #d6e4dd;
    --radio: 18px;
    --sombra: 0 8px 28px rgb(20 56 44 / 8%);
}

body {
    font-family: "Segoe UI", system-ui, sans-serif;
    color: var(--tinta);
}

.seccion, #ultimas-noticias {
    padding-block: clamp(3.25rem, 7vw, 6rem);
}

.fondo-gris, #ultimas-noticias, #identidad {
    background: var(--superficie);
}

main section .titulo-seccion h2 {
    font-size: clamp(1.85rem, 3.6vw, 2.8rem);
    line-height: 1.12;
    letter-spacing: -.035em;
    color: var(--tinta);
    text-wrap: balance;
}

main section .titulo-seccion p {
    max-width: 60ch;
    margin-inline: auto;
    color: #4b6059;
    line-height: 1.65;
}

/* Portada: conserva la fotografía que actualiza el script */
.hero-contenido {
    position: relative;
    z-index: 1;
    padding-block: 3.5rem;
}

.hero h1 {
    font-size: clamp(2.25rem, 5vw, 4.15rem);
    letter-spacing: -.045em;
    text-wrap: balance;
}

.hero h2 { color: #ffd676; }
.hero p { max-width: 57ch; }
.etiqueta { background: #135943; }


/* Superficies y separación de las tarjetas */
.grid-carreras { gap: clamp(1rem, 2vw, 1.75rem); }

.grid-carreras .carrera-oferta {
    height: auto;
    padding: 1.75rem 1.2rem;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
}

.grid-carreras .carrera-oferta .btn-conocer-carrera {
    margin-top: auto;
    padding: .55rem 1rem;
    border: 1px solid rgb(255 255 255 / 55%);
    border-radius: .65rem;
}

.valores-carrusel, .servicio-card, .formulario, .modal-carrera-contenido {
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
}

.tarjeta-identidad, .info-contacto, .galeria img {
    border-radius: var(--radio);
}

.valor-anterior { left: .5rem; }
.valor-siguiente { right: .5rem; }

/* La separación se aplica dentro de cada publicación para respetar
   los anchos que usa el carrusel al calcular sus desplazamientos. */
.noticias-track .publicacion-facebook {
    padding: clamp(6px, 1vw, 12px);
}

.publicacion-facebook .fb-post {
    max-width: 100%;
    background: white;
    border-radius: 14px;
    box-shadow: 0 0 0 1px var(--borde), var(--sombra);
}

/* Acciones primarias: un verde común en reposo, al apuntar y al pulsar. */
:is(.btn-principal, .btn-recurso-principal, .btn-abrir-pdf, .valor-control, .flecha-noticias,
    .formulario button, .valor-punto.activo, .indicador-noticia.activo) {
    background: var(--verde);
    color: white;
}
:is(.btn-principal, .btn-recurso-principal, .btn-abrir-pdf, .valor-control, .flecha-noticias,
    .formulario button):hover:not(:disabled) {
    background: var(--verde-hover);
    opacity: 1;
}
:is(.btn-principal, .btn-recurso-principal, .btn-abrir-pdf, .valor-control, .flecha-noticias,
    .formulario button):active:not(:disabled) { background: var(--verde-activo); }

.btn-recurso-secundario {
    color: var(--verde);
    border-color: var(--verde);
    background: white;
}
.btn-recurso-secundario:hover { background: #f3f8f6; }
.btn-secundario:hover { background: rgb(255 255 255 / 12%); opacity: 1; }

/* Cabecera: franja institucional compacta y navegación en blanco. */
header .barra-superior { background: #126b45; font-size: .75rem; letter-spacing: .05em; }
header .barra-contenido, header .nav-contenido {
    width: min(92%, 1260px);
    padding-inline: 0;
}
header .navbar { border-bottom: 1px solid #d6e4dd; box-shadow: 0 3px 14px #14382c10; }
.nav-contenido { gap: 1.5rem; }
.logo-area h2 { color: #126b45; line-height: 1.2; letter-spacing: -.035em; }
.logo-area p { color: #57645c; }
.menu { gap: clamp(.5rem, 1.3vw, 1.4rem); }
.menu a { display: block; padding-block: .7rem; white-space: nowrap; }
.menu a:hover, .menu a:focus-visible { text-decoration: underline; text-underline-offset: .45em; }

@media (max-width: 1100px) {
    header .nav-contenido { flex-wrap: wrap; gap: 0; padding-block: .65rem .15rem; }
    header .menu {
        display: flex;
        width: 100%;
        gap: 1.25rem;
        overflow-x: auto;
        padding: .15rem .2rem;
    }
}

/* Cierre de página: columnas de información sobre verde oscuro. */
footer {
    background: #103f34;
    color: #dce9e1;
    border-top: 4px solid #d6af62;
    padding-top: clamp(2.5rem, 5vw, 4.5rem);
}
.footer-grid {
    grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
    gap: clamp(1.5rem, 5vw, 5rem);
    padding-bottom: 2.75rem;
}
.logo-footer { width: 76px; height: 76px; object-fit: contain; }
footer h3 { font-size: 1.4rem; letter-spacing: -.025em; margin-bottom: .45rem; }
footer h4 { color: #f2ce87; font-size: 1rem; }
footer p { max-width: 34ch; line-height: 1.7; }
footer a { width: fit-content; color: #eef5f0; }
footer a:hover { text-decoration: underline; text-underline-offset: .25em; }
.copyright { background: #0c3027; color: #ceded4; padding: 1rem 5%; }
:where(header, main, footer) :is(button, a):focus-visible {
    outline: 3px solid #b07817;
    outline-offset: 3px;
}
@media (max-width: 650px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
    .footer-grid > :first-child { grid-column: 1 / -1; }
}


/* Información estatal dentro del pie de página */
footer .footer-estatal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
    gap: 2rem;
    padding-block: 2.5rem;
    border-top: 1px solid rgb(255 255 255 / 25%);
}

.footer-estatal address {
    font-style: normal;
    line-height: 1.65;
}

.footer-estatal address + p {
    margin-top: 0.8rem;
}


/* Redes sociales del footer: íconos blancos con borde circular */
footer .footer-redes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

footer .footer-redes a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    border: 1px solid rgb(255 255 255 / 65%);
    border-radius: 50%;
    background: transparent;
    color: #fff;
    text-decoration: none;
    transition: background-color .2s, border-color .2s;
}

footer .footer-redes svg {
    display: block;
    width: 18px;
    height: 18px;
}

footer .footer-redes a:hover,
footer .footer-redes a:focus-visible {
    background-color: rgb(255 255 255 / 14%);
    border-color: #fff;
}

footer .footer-redes a:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}


/* Botón flotante para volver al inicio */
#btn-volver-arriba {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 50;

    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;

    border: 2px solid white;
    border-radius: 50%;
    background: var(--verde, #00745e);
    color: white;
    box-shadow: 0 4px 14px rgb(0 0 0 / 20%);
    cursor: pointer;
}

#btn-volver-arriba[hidden] {
    display: none;
}

#btn-volver-arriba:hover {
    background: var(--verde-hover, #005e4c);
}

#btn-volver-arriba:active {
    background: var(--verde-activo, #004638);
}

#btn-volver-arriba:focus-visible {
    outline: 3px solid var(--verde, #00745e);
    outline-offset: 3px;
}




/* Menú principal de CONALEP */
.menu-boton,
header .menu[hidden] {
    display: none;
}

/* Encabezado de celulares y tabletas */
@media (max-width: 1100px) {
    header .nav-contenido {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        min-height: 66px;
        padding-block: 8px;
        gap: 0 12px;
    }

    header .logo-area {
        flex: 1;
        min-width: 0;
        gap: 9px;
    }

    header .logo-area img {
        width: 46px;
        height: 46px;
        object-fit: contain;
    }

    header .logo-area h2 {
        font-size: clamp(1rem, 3.7vw, 1.2rem);
        line-height: 1.2;
    }

    header .logo-area p {
        font-size: 0.75rem;
    }

    /* Botón de tres líneas */
    .menu-boton:not([hidden]) {
        display: grid;
        align-content: center;
        justify-items: center;
        gap: 5px;
        width: 46px;
        height: 46px;
        padding: 0;
        border: 0;
        border-radius: 8px;
        background: white;
        color: #005e4c;
        cursor: pointer;
    }

    .menu-boton span {
        width: 24px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
    }

    /* Las tres líneas forman una X cuando se abre el menú */
    .menu-boton[aria-expanded="true"] {
        background: #edf5f0;
    }

    .menu-boton[aria-expanded="true"] span:first-child {
        transform: translateY(7px) rotate(45deg);
    }

    .menu-boton[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .menu-boton[aria-expanded="true"] span:last-child {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Los enlaces se despliegan debajo del logo */
    header .menu {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin: 6px 0 0;
        padding: 0;
        overflow-x: visible;
        list-style: none;
        border-top: 1px solid #d6e4dd;
    }

    header .menu a {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 8px 12px;
        white-space: normal;
    }

    header .menu a:hover,
    header .menu a:focus-visible {
        background: #edf5f0;
        color: #005e4c;
    }
}

/* Portada y secciones en celular */
@media (max-width: 600px) {
    header .barra-superior {
        font-size: 0.65rem;
        letter-spacing: 0.02em;
    }

    header .barra-contenido {
        padding-block: 8px;
        gap: 8px;
        line-height: 1.3;
    }

    .barra-contenido strong {
        margin-inline: 4px;
    }

    .hero {
        min-height: auto;
    }

    .hero-contenido {
        padding-block: clamp(2.5rem, 11vw, 4rem);
    }

    .hero h1 {
        font-size: clamp(2rem, 8.6vw, 2.75rem);
        line-height: 1.08;
    }

    .hero h2 {
        font-size: clamp(1.3rem, 5.5vw, 1.7rem);
        margin-bottom: 14px;
    }

    .hero p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 24px;
    }

    .botones {
        flex-direction: column;
        gap: 10px;
    }

    .botones .btn {
        min-height: 46px;
        text-align: center;
    }

    .titulo-seccion {
        margin-bottom: 28px;
    }

    .grid-carreras {
        max-width: 100%;
        gap: 16px;
    }

    .tarjeta-identidad p {
        text-align: start;
        font-size: 0.95rem;
    }

    .servicio-card h3 {
        font-size: 0.95rem;
    }

    .servicio-card p {
        font-size: 0.8rem;
    }

    .contacto {
        padding-inline: 0;
    }

    .campo-formulario input,
    .campo-formulario textarea {
        font-size: 1rem;
    }
}



/* ENCABEZADO: logo y nombre a la izquierda, botón a la derecha */
@media (max-width: 1100px) {
    header .nav-contenido {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    header .logo-area {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
    }

    header .logo-area img {
        flex-shrink: 0;
    }

    header .menu-boton {
        justify-self: end;
    }

    header .menu {
        grid-column: 1 / -1;
    }

    header .menu a {
        justify-content: center;
    }
}

/* DISTRIBUCIÓN DE LAS SECCIONES EN CELULAR */
@media (max-width: 700px) {
    .hero-contenido,
    .tarjeta-identidad,
    .tarjeta-identidad p,
    .antecedentes-historicos,
    .antecedentes-contenido p,
    .identidad-card,
    .vista-previa-encabezado,
    .info-contacto,
    .formulario-encabezado,
    footer {
        text-align: center;
    }

    .hero p,
    .tarjeta-identidad .icono,
    footer p,
    footer a,
    .logo-footer {
        margin-inline: auto;
    }

    .hero .botones {
        display: grid;
        gap: 10px;
        max-width: 26rem;
        margin-inline: auto;
    }

    .grid-carreras,
    .galeria,
    .footer-grid,
    footer .footer-estatal {
        grid-template-columns: minmax(0, 1fr);
    }

    .grid-carreras {
        max-width: 30rem;
    }

    .grid-carreras .btn-conocer-carrera {
        min-height: 44px;
    }

    .galeria img {
        display: block;
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .tabla-historica th,
    .tabla-historica td {
        text-align: center;
    }

    .vista-previa-encabezado,
    .contacto-encabezado,
    .info-contacto .dato {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .color-principal,
    .color-muestra {
        flex-direction: column;
        align-items: center;
    }

    .color-datos {
        align-items: center;
    }

    .logo-footer {
        display: block;
    }

    footer .footer-redes {
        justify-content: center;
    }
}

/* VENTANA "CONOCER CARRERA": celular vertical y horizontal */
@media (max-width: 700px),
       (max-height: 500px) and (max-width: 1000px) {

    .modal-carrera {
        padding: 12px;
    }

    .modal-carrera-contenido {
        width: min(100%, 32rem);
        min-height: 0;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        border-radius: 20px;
    }

    /* La fotografía ocupa una franja superior */
    .modal-carrera-imagen {
        min-height: 0;
        height: clamp(64px, 17vh, 144px);
    }

    .modal-carrera-icono,
    .modal-carrera-icono svg {
        width: 54px;
        height: 54px;
    }

    /* Botón de cierre siempre visible */
    .modal-cerrar {
        top: 8px;
        right: 8px;
        width: 44px;
        height: 44px;
        background: white;
        color: #005e4c;
    }

    /* La información se puede deslizar dentro de la ficha */
    .modal-carrera-detalle {
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 20px clamp(14px, 4vw, 24px);
        text-align: center;
    }

    .modal-carrera-detalle h2 {
        color: #103f34;
        font-size: clamp(1.45rem, 6vw, 2rem);
        line-height: 1.15;
    }

    .modal-clave {
        margin-bottom: 0;
    }

    .modal-descripcion p {
        color: #40534b;
        font-size: 1rem;
    }

    /* Una tarjeta para el mapa curricular y otra para el perfil */
    .modal-documentos {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .modal-documento {
        padding: 14px;
        border: 1px solid #d6e4dd;
        border-radius: 12px;
        background: #f5f8f6;
    }

    .modal-pdf-acciones {
        display: grid;
        grid-template-columns:
            repeat(auto-fit, minmax(min(100%, 7rem), 1fr));
    }

    .modal-pdf-acciones a {
        display: grid;
        place-items: center;
        min-height: 44px;
        border: 1px solid #126b45;
        background: white;
        font-size: 0.875rem;
    }

    .modal-pdf-acciones a:first-child {
        background: #126b45;
        color: white;
    }
}