/* ==========================================================================
   MPCH · Portal de Servicios Digitales | CSS v4.3 (Avisos translúcidos)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --azul: #143a61;
    --azul-oscuro: #0b2037;
    --azul-claro: #267ac0;
    --rojo: #c83b47;
    --amarillo: #e7bd68;
    --oro: #e7bd68;
    --blanco: #fff;
    --gris-claro: #f3f7fb;
    --gris: #e8edf4;
    --texto: #25394c;
    --verde: #16805b;
    --naranja: #bf772a;
    --radio: 18px;
    --sombra: 0 10px 35px rgba(14, 42, 71, .075);
    --sombra-hover: 0 22px 52px rgba(14, 42, 71, .16);
    --transicion: all .25s ease;
    --font-titulo: 'Outfit', system-ui, sans-serif;
    --font-cuerpo: 'DM Sans', system-ui, sans-serif;
    --header-h: 94px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body { margin: 0; background: var(--gris-claro); color: var(--texto); font: 400 16px/1.65 var(--font-cuerpo); overflow-x: hidden; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { font-family: var(--font-titulo); line-height: 1.18; }
a:focus-visible, button:focus-visible { outline: 3px solid #f1c76b; outline-offset: 4px; }
.skip-link { position: fixed; top: -80px; left: 12px; z-index: 99999; background: white; color: #09233d; padding: 12px 18px; border-radius: 9px; }
.skip-link:focus { top: 12px; }

/* ==========================================================================
   CABECERA (Header SÓLIDO)
   ========================================================================== */
.portal-header { 
    position: relative; 
    top: 0; left: 0; right: 0; 
    z-index: 80; 
    color: white; 
    background: linear-gradient(110deg, #06192c 0%, #10314f 100%); 
    border-bottom: 3px solid var(--oro); 
}
.portal-header-inner { width: 100%; margin: auto; min-height: var(--header-h); padding: 12px clamp(16px, 3.4vw, 72px); display: flex; align-items: center; gap: clamp(16px, 2vw, 36px); }
.portal-brand { display: flex; align-items: center; gap: 13px; min-width: 0; text-decoration: none; flex-shrink: 0; }
.portal-brand-logo { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .3)); }
.portal-brand-text { display: flex; flex-direction: column; max-width: 360px; line-height: 1.22; }
.portal-brand-text strong { font: 700 clamp(13px, 1.08vw, 17px)/1.22 var(--font-titulo); letter-spacing: .01em; }
.portal-brand-text small { color: #f1d18c; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin-top: 5px; }
.portal-nav { display: flex; gap: clamp(12px, 1.4vw, 27px); align-items: center; justify-content: center; margin-left: auto; }
.portal-nav a { text-decoration: none; font-size: 13px; font-weight: 700; color: #f1f5fa; white-space: nowrap; transition: color .2s; }
.portal-nav a:hover { color: #f4ce83; }
.portal-header-cta { white-space: nowrap; text-decoration: none; border: 1px solid rgba(243, 205, 132, .65); color: #0b2037; background: #e8c47c; border-radius: 11px; padding: 11px 16px; font-size: 13px; font-weight: 800; transition: var(--transicion); }
.portal-header-cta:hover { background: #fff; transform: translateY(-2px); }

/* ==========================================================================
   HERO Y SLIDER
   ========================================================================== */
.portal-hero { 
    position: relative; 
    width: 100%; 
    height: calc(100vh - var(--header-h)); 
    min-height: 550px; 
    isolation: isolate; 
    background: #0b2037; 
    overflow: hidden; 
}

.slider-wrap { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; }

.slide { 
    position: absolute; inset: 0; 
    display: flex; align-items: flex-end; justify-content: flex-start; 
    opacity: 0; visibility: hidden; pointer-events: none; 
    transition: opacity .8s ease, visibility .8s ease; 
    padding-bottom: 12vh; 
}
.slide.activo { opacity: 1; visibility: visible; pointer-events: auto; z-index: 1; }

.slide > picture { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: hidden; }

.slide img, .slide > picture > img { 
    position: absolute; inset: 0; 
    width: 100%; height: 100%; 
    object-fit: cover; 
    object-position: center center; 
}

/* DEGRADADO SUTIL PARA EL TEXTO */
.slide-overlay { 
    position: absolute; 
    inset: 0; 
    background: linear-gradient(90deg, rgba(5, 20, 37, 0.85) 0%, rgba(5, 20, 37, 0.45) 45%, transparent 70%); 
    z-index: 1;
    pointer-events: none;
}

/* TEXTO Y BOTÓN */
.slide-content { 
    position: relative; 
    z-index: 2; 
    width: min(800px, 90vw); 
    margin-left: clamp(25px, 8vw, 150px); 
    padding: 20px; 
    color: white; 
    text-align: left; 
}

.slide-content h2 { 
    font-size: clamp(32px, 4vw, 70px); 
    font-weight: 800; 
    line-height: 1.05; 
    letter-spacing: -.03em; 
    margin: 0 0 20px; 
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); 
}
.slide-content p { 
    font-size: clamp(15px, 1.3vw, 22px); 
    color: #e6eff7; 
    max-width: 600px; 
    margin: 0 0 25px; 
    line-height: 1.5;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.slide-btn { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    min-height: 48px; 
    background: var(--oro); 
    color: #0b2037; 
    text-decoration: none; 
    font-size: 15px; 
    font-weight: 800; 
    border-radius: 12px; 
    padding: 14px 30px; 
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3); 
    transition: var(--transicion); 
}
.slide-btn:hover { 
    background: white; 
    transform: translateY(-3px); 
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

/* Controles del Slider */
.slide-dots { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 12; display: flex; gap: 8px; align-items: center; }
.slide-dot { width: 10px; height: 10px; border: 0; border-radius: 99px; padding: 0; background: rgba(255, 255, 255, .6); transition: var(--transicion); }
.slide-dot.activo { width: 28px; background: var(--oro); }
.slide-arrow { position: absolute; top: 50%; z-index: 12; transform: translateY(-50%); width: 48px; height: 48px; border: 1px solid rgba(255, 255, 255, .4); border-radius: 50%; display: grid; place-items: center; color: white; background: rgba(0, 0, 0, .4); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font-size: 28px; line-height: 1; transition: var(--transicion); }
.slide-arrow:hover { background: rgba(0, 0, 0, .7); transform: translateY(-50%) scale(1.05); }
.slide-prev { left: 20px; }
.slide-next { right: 20px; }

/* ==========================================================================
   AVISOS (Banner flotante TRANSLÚCIDO - UX Mejorado)
   ========================================================================== */
.portal-hero-notices { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); z-index: 50; width: min(680px, calc(100% - 36px)); pointer-events: none; }
.notice-banner { 
    pointer-events: auto; 
    position: relative; 
    display: flex; 
    align-items: center; 
    gap: 13px; 
    padding: 14px 18px; 
    /* Borde sutil y translúcido */
    border: 1px solid rgba(255, 255, 255, 0.4); 
    border-left: 4px solid #e3b764; 
    border-radius: 14px; 
    /* Fondo mucho más transparente (65% de opacidad) */
    background: rgba(255, 255, 255, 0.65); 
    color: #17334f; 
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15); 
    /* Desenfoque más intenso para que se lea bien a pesar de la transparencia */
    backdrop-filter: blur(25px); 
    -webkit-backdrop-filter: blur(25px); 
    max-height: min(180px, 28svh); 
    overflow: hidden; 
}
.notice-banner .aviso-icono { flex: 0 0 auto; display: grid; place-items: center; width: 37px; height: 37px; border-radius: 10px; background: rgba(238, 244, 250, 0.8); font-size: 21px; }
.aviso-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.aviso-eyebrow { font-size: 9px; letter-spacing: .13em; color: #a57731; font-weight: 800; }
.aviso-titulo { font-size: 14px; line-height: 1.3; color: #163552; font-weight: 800; }
.notice-banner #avisoContenido { font-size: 12px; line-height: 1.45; color: #3a4d61; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.aviso-contador { flex-shrink: 0; font-size: 10px; color: #64748b; white-space: nowrap; }
.aviso-controls { display: flex; gap: 4px; flex-shrink: 0; }
.aviso-control { border: 1px solid rgba(215, 224, 232, 0.8); background: rgba(255, 255, 255, 0.7); color: #193c5b; width: 28px; height: 30px; border-radius: 8px; font-size: 19px; line-height: 1; transition: var(--transicion); }
.aviso-control:hover { background: white; }

/* ==========================================================================
   CONTENIDO PRINCIPAL Y TARJETAS
   ========================================================================== */
main { width: 100%; max-width: 1920px; margin: 0 auto; padding: clamp(45px, 5vw, 85px) clamp(16px, 3vw, 72px) 30px; }
.portal-main-heading { text-align: center; margin: 0 auto clamp(45px, 5vw, 75px); max-width: 850px; }
.portal-kicker, .section-kicker { font-size: 11px; font-weight: 800; letter-spacing: .2em; color: #ad7b30; }
.portal-main-heading h1 { font-size: clamp(30px, 3.4vw, 58px); letter-spacing: -.035em; color: #0c2946; margin: 12px 0; }
.portal-main-heading p { font-size: clamp(15px, 1.2vw, 18px); color: #65788a; margin: 0; }
.section { margin-bottom: clamp(48px, 5vw, 85px); scroll-margin-top: 30px; }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 25px; padding-bottom: 16px; border-bottom: 1px solid #dce5ee; position: relative; }
.section-header:after { content: ''; position: absolute; bottom: -1px; left: 0; width: 80px; height: 3px; background: var(--oro); border-radius: 5px; }
.section-header h2, .section>h2 { font-size: clamp(23px, 2vw, 34px); font-weight: 800; letter-spacing: -.025em; color: #0c2946; margin: 7px 0 0; }
.section>h2 { margin-bottom: 24px; }
.cards { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: clamp(14px, 1.5vw, 25px); }
.card { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(22px, 2vw, 34px) clamp(15px, 1.6vw, 25px); border-radius: 19px; border: 1px solid #e1eaf2; border-top: 3px solid #1d527e; background: linear-gradient(150deg, #fff, #f9fbfd); box-shadow: var(--sombra); transition: box-shadow .25s ease, border-color .25s ease, transform .25s ease; overflow: hidden; }
.card:before { content: ''; position: absolute; inset: 0 0 auto; height: 80px; background: linear-gradient(180deg, rgba(40, 112, 169, .045), transparent); pointer-events: none; }
.card:hover { transform: translateY(-6px) !important; box-shadow: var(--sombra-hover); border-color: #b9d4e7; }
.card-icon { position: relative; display: grid; place-items: center; width: 74px; height: 74px; border-radius: 20px; background: linear-gradient(140deg, #e8f2fb, #f4f9fc); border: 1px solid #deebf5; font-size: 38px; margin: 4px 0 18px; }
.card h3 { font-size: clamp(16px, 1.15vw, 20px); font-weight: 800; color: #102e4a; margin: 0 0 12px; line-height: 1.3; overflow-wrap: anywhere; }
.card p { font-size: 13px; color: #607487; line-height: 1.6; margin: 0 0 23px; flex: 1; overflow-wrap: anywhere; }
.card a { display: inline-flex; justify-content: center; align-items: center; text-decoration: none; min-height: 42px; padding: 10px 20px; border-radius: 10px; background: #154a77; color: white; font-size: 13px; font-weight: 800; transition: var(--transicion); }
.card a:hover { background: #0b2b49; transform: translateY(-2px); }
.card a.disabled { background: #dce3ea; color: #617181; pointer-events: none; cursor: not-allowed; }
.card a.mantenimiento { background: #f8e6d5; color: #99581e; }
.badge { position: absolute; top: 13px; right: 12px; z-index: 2; border-radius: 99px; padding: 4px 9px; font-size: 10px; font-weight: 800; background: #edf2f6; color: #34495d; }
.badge.disponible { background: #e1f4eb; color: #167b56; }
.badge.proximamente { background: #fff2d4; color: #94620b; }
.badge.mantenimiento { background: #fff0df; color: #a85c1a; }
.badge.interno { background: #e9e8f7; color: #61528c; }
.badge.nuevo { background: #fce7ec; color: #b32c4d; }

/* Obras */
.obras-filtros { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 24px; }
.obra-filtro-btn { border: 1px solid #d8e4ed; background: white; color: #3b5269; border-radius: 99px; padding: 9px 15px; font-size: 12px; font-weight: 800; transition: var(--transicion); }
.obra-filtro-btn:hover, .obra-filtro-btn.activo { background: #153e65; color: white; border-color: #153e65; }
.obras-grid { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 22px; }
.obra-card { min-width: 0; background: white; border: 1px solid #e1eaf2; border-radius: 18px; padding: 22px; box-shadow: var(--sombra); transition: var(--transicion); overflow: hidden; }
.obra-card:hover { transform: translateY(-5px); box-shadow: var(--sombra-hover); }
.obra-card img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; margin-bottom: 15px; }
.obra-estado { display: inline-block; padding: 5px 12px; border-radius: 99px; font-size: 11px; font-weight: 800; margin-bottom: 12px; background: #edf2f6; }
.obra-estado.en_ejecucion { background: #e4f0fc; color: #1765a0; }
.obra-estado.terminada { background: #e0f3e9; color: #14734e; }
.obra-estado.paralizada { background: #fff0e0; color: #a95c1b; }
.obra-estado.por_iniciar { background: #eee9fa; color: #6650a5; }
.obra-estado.licitacion { background: #e0f5f2; color: #087a71; }
.obra-nombre { font-size: 18px; font-weight: 800; color: #102e4a; margin-bottom: 12px; overflow-wrap: anywhere; }
.obra-info { font-size: 13px; color: #607487; margin-bottom: 15px; }
.obra-progreso-label { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 800; color: #486078; margin-bottom: 8px; }
.obra-progreso-bar { height: 9px; border-radius: 99px; background: #e6edf4; overflow: hidden; }
.obra-progreso-fill { height: 100%; background: linear-gradient(90deg, #1b6aa2, #2e9fba); border-radius: inherit; transition: width 1s ease; }

/* Contacto, FAQ y mapa */
.contact-grid { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 20px; }
.contact-card { min-width: 0; background: white; border: 1px solid #e0e9f1; border-radius: 17px; padding: clamp(20px, 2vw, 30px); box-shadow: var(--sombra); overflow-wrap: anywhere; }
.contact-card h3 { font-size: 18px; color: #123657; margin: 0 0 17px; }
.contact-card ul { list-style: none; padding: 0; margin: 0; }
.contact-card li { padding: 10px 0; border-bottom: 1px solid #edf1f5; font-size: 13px; }
.contact-card li:last-child { border-bottom: 0; }
.contact-card a { color: #17659a; text-decoration: none; overflow-wrap: anywhere; }
.contact-card a:hover { text-decoration: underline; }
.contact-card p { font-size: 14px; color: #596d7e; margin: 0; }
.map-container { background: white; border: 1px solid #e0e9f1; border-radius: 20px; padding: clamp(12px, 2vw, 24px); box-shadow: var(--sombra); }
.map-container h3 { font-size: clamp(15px, 1.3vw, 20px); color: #183a58; margin: 0 0 15px; }
.map-container iframe { display: block; width: 100%; height: clamp(280px, 42vw, 500px); border: 0; border-radius: 13px; }

/* ==========================================================================
   FOOTER PROFESIONAL
   ========================================================================== */
.portal-footer { background: linear-gradient(130deg, #081d33, #153e63); border-top: 4px solid #d8b26d; width: 100%; padding: 16px 0; color: #fff; font-family: var(--font-cuerpo); }
.footer-container { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 1920px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 60px); }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-logo { width: 45px; height: 45px; object-fit: contain; }
.footer-info { display: flex; flex-direction: column; line-height: 1.3; }
.footer-info strong { font-size: 14px; color: #fff; font-weight: 700; }
.footer-info span { font-size: 12px; color: #a0b2c6; }
.footer-copy { font-size: 12px; color: #a0b2c6; text-align: right; }

/* Botones Flotantes */
.whatsapp-float { position: fixed; bottom: 28px; right: 24px; z-index: 1000; width: 56px; height: 56px; display: grid; place-items: center; background: #1ac568; color: white; border-radius: 50%; box-shadow: 0 9px 28px rgba(0, 0, 0, .22); transition: var(--transicion); text-decoration: none; }
.whatsapp-float:hover { transform: translateY(-4px) scale(1.04); background: #12a95a; }
.whatsapp-float svg { width: 31px; height: 31px; }
.whatsapp-tooltip { position: absolute; right: 65px; top: 50%; transform: translateY(-50%); background: white; color: #24394e; padding: 9px 12px; border-radius: 9px; font-size: 12px; white-space: nowrap; box-shadow: var(--sombra); opacity: 0; pointer-events: none; transition: opacity .2s; }
.whatsapp-float:hover .whatsapp-tooltip { opacity: 1; }

/* ==========================================================================
   RESPONSIVE (Escalado de columnas)
   ========================================================================== */
@media (min-width: 600px) { .cards, .obras-grid, .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .cards, .obras-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .cards, .contact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1600px) { .cards { grid-template-columns: repeat(5, minmax(0, 1fr)); } .obras-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1920px) { .cards { grid-template-columns: repeat(6, minmax(0, 1fr)); } .obras-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

@media (max-width: 1199px) { .portal-nav { display: none; } .portal-header-cta { margin-left: auto; } }

/* ==========================================================================
   AJUSTES ESPECÍFICOS PARA MÓVILES
   ========================================================================== */
@media (max-width: 767px) {
    :root { --header-h: 76px; }
    .portal-header-inner { min-height: 76px; padding: 8px 16px; }
    .portal-brand-logo { width: 49px; height: 49px; }
    .portal-brand-text { max-width: 225px; }
    .portal-brand-text strong { font-size: 12px; }
    .portal-brand-text small { font-size: 9px; letter-spacing: .06em; }
    .portal-header-cta { display: none; }

    .portal-hero {
        height: calc(100vh - var(--header-h));
        min-height: 500px;
    }

    .slide { padding-bottom: 10vh !important; align-items: flex-end !important; }
    .slide-content { width: 100%; margin-left: 0 !important; padding: 20px 24px; text-align: center; align-self: center; }
    .slide-content h2 { font-size: clamp(28px, 8vw, 42px) !important; margin-bottom: 10px !important; }
    .slide-content p { font-size: 14px !important; margin-bottom: 15px !important; }
    .slide-overlay { background: linear-gradient(0deg, rgba(5, 20, 37, .9), rgba(5, 20, 37, .3) 70%), linear-gradient(90deg, rgba(5, 20, 37, .4), transparent); }
    
    .slide img, .slide > picture > img { object-position: center center; }

    .slide-arrow { width: 36px; height: 36px; font-size: 22px; }
    .slide-prev { left: 10px; }
    .slide-next { right: 10px; }
    
    .portal-hero-notices { top: 15px; width: calc(100% - 24px); }
    .notice-banner { padding: 10px 11px; gap: 8px; }
    .aviso-icono { width: 30px !important; height: 30px !important; font-size: 17px !important; }
    .aviso-contador { display: none !important; }
    .aviso-titulo { font-size: 12px; }
    .notice-banner #avisoContenido { font-size: 11px; -webkit-line-clamp: 2; }
    .aviso-eyebrow { font-size: 8px; }
    .aviso-controls { display: none; }

    .slide-dots { bottom: 15px; }
    main { padding: 42px 16px 15px; }
    
    .portal-footer { padding: 20px 0; }
    .footer-container { flex-direction: column; text-align: center; gap: 15px; }
    .footer-brand { flex-direction: column; gap: 8px; }
    .footer-info span { display: none; }
    .footer-copy { text-align: center; }
    
    .whatsapp-float { width: 52px; height: 52px; right: 15px; bottom: 20px; }
}

@media (max-width: 420px) {
    .portal-brand-text { max-width: 190px; }
    .portal-brand-text strong { font-size: 11px; }
    .slide-content h2 { font-size: clamp(26px, 7vw, 34px) !important; }
    .slide-content p { font-size: 13px !important; }
    .slide-arrow { display: none; }
    .notice-banner .aviso-control { width: 24px; height: 27px; }
    .notice-banner #avisoContenido { -webkit-line-clamp: 1; }
    .portal-hero { min-height: 450px; }
    .portal-hero-notices { top: 10px !important; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    #sliderPortal .slide, #sliderPortal .slide.activo { transition: none; }
}