/* ================================================================
   MDVA — Portal Municipal | Diseño limpio estilo Gob.pe
   Colores dinámicos vía variables CSS inyectadas desde PHP
================================================================ */

:root {
  --c-primary:    #003876;
  --c-primary-d:  #002355;
  --c-red:        #c8102e;
  --c-red-d:      #9e0d25;
  --c-bg:         #f8fafc;
  --c-white:      #ffffff;
  --c-text:       #1e293b;
  --c-text-light: #64748b;
  --c-border:     #e2e8f0;
  --c-shadow-sm:  0 1px 4px rgba(0,0,0,.07);
  --c-shadow:     0 4px 16px rgba(0,0,0,.10);
  --c-shadow-lg:  0 8px 32px rgba(0,0,0,.14);
  --radius-sm:    4px;
  --radius:       8px;
  --radius-lg:    16px;
  --t:            .2s ease;
  --font:         -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',sans-serif;
  --container:    1200px;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{font-family:var(--font);color:var(--c-text);background:var(--c-bg);line-height:1.6;font-size:15px}
img{max-width:100%;display:block}
a{color:var(--c-primary);text-decoration:none;transition:color var(--t)}
a:hover{color:var(--c-red)}
ul,ol{list-style:none}
button{font-family:var(--font)}

/* ── Preloader ──────────────────────────────────────────────── */
#preloader{
  position:fixed;inset:0;background:#fff;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.5rem;
  z-index:9999;transition:opacity .45s ease, visibility .45s ease}
#preloader.oculto{opacity:0;visibility:hidden;pointer-events:none}
.pre-logo{width:80px;height:80px;object-fit:contain;animation:prePulse 1.4s ease-in-out infinite}
.pre-texto{font-size:.85rem;font-weight:600;color:var(--c-text-light);letter-spacing:.04em}
.pre-barra{width:180px;height:3px;background:var(--c-border);border-radius:2px;overflow:hidden}
.pre-progreso{height:100%;width:45%;background:var(--c-primary);border-radius:2px;
  animation:preSlide 1.2s ease-in-out infinite}
@keyframes prePulse{0%,100%{transform:scale(1)}50%{transform:scale(1.06)}}
@keyframes preSlide{0%{transform:translateX(-110%)}100%{transform:translateX(300%)}}

/* ── Utilidades ─────────────────────────────────────────────── */
.container{max-width:var(--container);margin:0 auto;padding:0 1.25rem}
.seccion{padding:4rem 0}
.seccion-alt{background:var(--c-bg)}
.seccion-white{background:var(--c-white)}
.text-center{text-align:center}
.hidden{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.tag{display:inline-block;padding:.2rem .65rem;border-radius:20px;font-size:.72rem;font-weight:700;letter-spacing:.03em}

/* ════════════════════════════════════════════════════════════
   GOVBAR — franja gob.pe superior
════════════════════════════════════════════════════════════ */
.govbar{background:#c8102e;color:#fff;font-size:.7rem;padding:.28rem 0;line-height:1}
.govbar-inner{display:flex;align-items:center;justify-content:space-between;gap:1rem}
.govbar-left{display:flex;align-items:center;gap:.4rem}
.govbar-left strong{font-size:.78rem;font-weight:800;letter-spacing:.02em}
.govbar-sep{opacity:.5;margin:0 .1rem}
.govbar-right a{color:rgba(255,255,255,.85);font-size:.68rem;text-decoration:underline}
.govbar-right a:hover{color:#fff}

/* ════════════════════════════════════════════════════════════
   HEADER PRINCIPAL — blanco, estilo SERPAR
   [ LOGO ]   [ ——— BUSCAR ——— ]   [ INST | PTE | LIBRO ]
════════════════════════════════════════════════════════════ */
.site-header{
  background:#fff;
  border-bottom:1px solid #e5e7eb;
  padding:.9rem 0}

.header-inner{
  display:flex;
  align-items:center;
  gap:1.75rem}

/* ── Logo ───────────────────────────────────────────────── */
.header-marca{
  display:flex;align-items:center;gap:.75rem;
  text-decoration:none;flex-shrink:0;
  color:var(--c-text)}
.header-marca:hover{color:var(--c-text)}

/* Logo subido: horizontal, sin restricción de ancho fija */
.header-logo-img{
  max-height:62px;
  max-width:260px;
  width:auto;
  height:auto;
  object-fit:contain;
  object-position:left center;
  display:block}

/* Texto de fallback (sin logo) */
.header-nombre-bloque{display:flex;flex-direction:column;justify-content:center}
.hn-nombre{
  font-size:1rem;
  font-weight:800;
  color:var(--c-primary);
  text-transform:uppercase;
  letter-spacing:.02em;
  line-height:1.2;
  max-width:280px}

/* ── Buscador AJAX ──────────────────────────────────────── */
.header-search{
  flex:1;max-width:480px;
  position:relative;
  display:flex;align-items:center;gap:.4rem;
  background:#fff;
  border:1.5px solid #d1d5db;
  border-radius:50px;
  padding:0 .65rem 0 1rem;
  transition:border-color .18s,box-shadow .18s;
  z-index:400;
  box-shadow:0 1px 3px rgba(0,0,0,.06)}
.header-search.hs-focused{
  border-color:var(--c-primary);
  box-shadow:0 0 0 3px rgba(0,56,118,.14),0 1px 3px rgba(0,0,0,.06);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--c-primary) 18%,transparent),0 1px 3px rgba(0,0,0,.06)}
.hs-ico{
  color:#9ca3af;flex-shrink:0;
  transition:color .18s;pointer-events:none}
.header-search.hs-focused .hs-ico{color:var(--c-primary)}
.hs-input{
  flex:1;min-width:0;
  border:none;outline:none;
  -webkit-appearance:none;appearance:none;
  font-family:var(--font);font-size:.875rem;color:var(--c-text);
  padding:.65rem 0;background:transparent;
  caret-color:var(--c-primary)}
.hs-input:focus,.hs-input:focus-visible{
  outline:none;outline:0;border:none;box-shadow:none}
.hs-input::placeholder{color:#b0b8c8}
/* Ocultar controles nativos del browser en input[type=search] */
.hs-input::-webkit-search-cancel-button,
.hs-input::-webkit-search-decoration,
.hs-input::-webkit-search-results-button,
.hs-input::-webkit-search-results-decoration{-webkit-appearance:none;display:none}
/* botón limpiar */
.hs-clear{
  background:none;border:none;cursor:pointer;
  width:24px;height:24px;border-radius:50%;
  display:none;align-items:center;justify-content:center;
  color:#9ca3af;flex-shrink:0;
  transition:background .15s,color .15s}
.hs-clear:hover{background:#f1f5f9;color:var(--c-text)}
.hs-clear.visible{display:flex}
/* ── Dropdown de resultados ── */
.hs-drop{
  position:absolute;top:calc(100% + 10px);left:0;right:0;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:16px;
  box-shadow:0 8px 24px rgba(0,0,0,.10),0 2px 8px rgba(0,0,0,.06);
  z-index:500;overflow:hidden;display:none;
  min-width:340px}
.hs-drop.open{
  display:block;
  animation:hsDrop .16s cubic-bezier(.2,.9,.4,1)}
@keyframes hsDrop{
  from{opacity:0;transform:translateY(-8px) scale(.98)}
  to{opacity:1;transform:translateY(0) scale(1)}}

/* ── Cabecera de grupo ── */
.hs-grp-title{
  display:flex;align-items:center;gap:.45rem;
  padding:.65rem 1rem .3rem;
  font-size:.62rem;font-weight:800;color:#94a3b8;
  text-transform:uppercase;letter-spacing:.1em;
  border-top:1px solid #f1f5f9}
.hs-grp-title:first-child{border-top:none}
.hs-grp-title svg{flex-shrink:0;opacity:.7}

/* ── Ítem de resultado ── */
.hs-item{
  display:flex;align-items:center;gap:.8rem;
  padding:.6rem 1rem;cursor:pointer;
  text-decoration:none;color:var(--c-text);
  background:transparent;border:none;width:100%;text-align:left;
  border-left:3px solid transparent;
  transition:background .12s,border-color .12s}
.hs-item:hover,.hs-item.hs-kb{
  background:#f8fafc;
  border-left-color:var(--c-primary)}
.hs-item:last-of-type{margin-bottom:.3rem}

/* ── Icono cuadrado ── */
.hs-item-ico{
  width:36px;height:36px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;transition:transform .12s}
.hs-item:hover .hs-item-ico{transform:scale(1.07)}
.hs-item-ico svg{width:16px;height:16px}

/* ── Texto ── */
.hs-item-body{flex:1;min-width:0}
.hs-item-name{
  font-size:.83rem;font-weight:600;color:#111827;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  display:flex;align-items:center;gap:.4rem}
.hs-item-name mark{
  background:#fef9c3;color:inherit;
  border-radius:3px;padding:0 2px;font-style:normal}
.hs-item-meta{
  font-size:.71rem;color:#94a3b8;
  margin-top:.15rem;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ── Flecha ── */
.hs-item-arr{
  color:#d1d5db;font-size:1rem;flex-shrink:0;
  line-height:1;transition:color .12s,transform .12s}
.hs-item:hover .hs-item-arr,.hs-item.hs-kb .hs-item-arr{
  color:var(--c-primary);transform:translateX(3px)}

/* ── Estados vacío / cargando / error ── */
.hs-loading,.hs-empty,.hs-error{
  text-align:center;padding:1.5rem 1rem 1.25rem;
  font-size:.83rem;color:#94a3b8;line-height:1.7}
.hs-empty strong{color:#374151}
.hs-error{color:#dc2626}
.hs-spinner{
  width:22px;height:22px;
  border:2.5px solid #e5e7eb;
  border-top-color:var(--c-primary);
  border-radius:50%;
  animation:spin .65s linear infinite;
  margin:0 auto .6rem}
@keyframes spin{to{transform:rotate(360deg)}}

/* ════════════════════════════════════════════════════════════
   MODAL DETALLE DE EXPEDIENTE (desde buscador del header)
════════════════════════════════════════════════════════════ */
.exp-modal-ov{
  position:fixed;inset:0;
  background:rgba(0,0,0,.55);
  display:flex;align-items:center;justify-content:center;
  z-index:9000;
  padding:1rem;
  opacity:0;transition:opacity .2s ease}
.exp-modal-ov.open{opacity:1}
.exp-modal-ov[hidden]{display:none}
.exp-modal-box{
  background:#fff;
  border-radius:16px;
  box-shadow:0 20px 60px rgba(0,0,0,.22);
  width:100%;max-width:440px;
  position:relative;
  transform:translateY(12px);
  transition:transform .22s ease;
  overflow:hidden}
.exp-modal-ov.open .exp-modal-box{transform:translateY(0)}
.exp-modal-cls{
  position:absolute;top:.75rem;right:.75rem;
  background:#f3f4f6;border:none;cursor:pointer;
  width:32px;height:32px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  color:#6b7280;transition:background .15s,color .15s;
  z-index:1}
.exp-modal-cls:hover{background:#e5e7eb;color:#111827}
.exp-modal-body{padding:1.75rem 1.5rem 1.5rem}
.exp-modal-spin{
  display:flex;flex-direction:column;align-items:center;
  gap:.5rem;padding:2rem 0;
  font-size:.85rem;color:#9ca3af}
.exp-modal-err{
  display:flex;flex-direction:column;align-items:center;
  gap:.6rem;padding:2rem 0;text-align:center;color:#6b7280}
.exp-modal-err p{font-size:.88rem}

/* ── Cabecera del detalle ── */
.emr-head{
  display:flex;align-items:flex-start;gap:.9rem;
  margin-bottom:1.1rem;padding-bottom:1rem;
  border-bottom:1px solid #f3f4f6}
.emr-ico{
  width:48px;height:48px;border-radius:12px;
  background:linear-gradient(135deg,var(--c-primary),var(--c-primary-dark,#002a5c));
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;color:#fff}
.emr-ico svg{width:24px;height:24px}
.emr-codigo{
  font-size:1.15rem;font-weight:800;
  color:#111827;letter-spacing:.02em;line-height:1.2;
  margin-bottom:.35rem}
.emr-badge{
  display:inline-block;
  font-size:.68rem;font-weight:700;
  padding:.2rem .6rem;border-radius:20px;
  letter-spacing:.04em}

/* ── Filas de info ── */
.emr-rows{display:flex;flex-direction:column;gap:.55rem;margin-bottom:1rem}
.emr-row{
  display:flex;align-items:baseline;justify-content:space-between;
  gap:.5rem;font-size:.83rem}
.emr-lbl{color:#9ca3af;flex-shrink:0;min-width:120px}
.emr-row strong{color:#111827;text-align:right}

/* ── Bloque observación ── */
.emr-obs{
  background:#fffbeb;border:1px solid #fde68a;
  border-radius:8px;padding:.7rem .9rem;
  margin-bottom:.9rem;font-size:.82rem}
.emr-obs .emr-lbl{
  display:block;margin-bottom:.25rem;
  color:#92400e;font-weight:600}
.emr-obs p{color:#78350f;margin:0}

/* ── Enlace "Ver seguimiento completo" ── */
.emr-link{
  display:flex;align-items:center;justify-content:center;gap:.4rem;
  margin-top:.9rem;
  padding:.65rem 1rem;border-radius:8px;
  background:var(--c-primary);color:#fff;
  font-size:.82rem;font-weight:600;text-decoration:none;
  transition:opacity .15s}
.emr-link:hover{opacity:.88}

/* ── Vínculos institucionales ───────────────────────────── */
.header-inst{
  display:flex;align-items:center;gap:1rem;flex-shrink:0}

.inst-sep{
  width:1px;height:36px;background:#e5e7eb;flex-shrink:0}

.inst-item{
  display:flex;align-items:center;gap:.55rem;
  text-decoration:none;color:var(--c-text);
  transition:opacity var(--t)}
.inst-item:hover{opacity:.72;color:var(--c-text)}

.inst-logo-img{height:40px;width:auto;object-fit:contain}
.inst-escudo-ph{flex-shrink:0}

.inst-texto{
  display:flex;flex-direction:column;line-height:1.2}
.inst-texto span{font-size:.69rem;color:var(--c-text-light)}
.inst-texto strong{font-size:.75rem;font-weight:800;color:var(--c-primary)}
.inst-texto small{font-size:.63rem;color:var(--c-text-light)}

/* PTE — círculo rojo */
.pte-badge{
  width:44px;height:44px;border-radius:50%;
  background:var(--c-red);color:#fff;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
  box-shadow:0 0 0 2.5px var(--c-red),0 0 0 4px rgba(200,16,46,.18)}
.pte-badge span{
  font-size:.7rem;font-weight:900;letter-spacing:.04em}

/* Libro de Reclamaciones Digital */
.libro-badge{flex-shrink:0}
.digital-tag{
  display:inline-block;background:#1d4ed8;color:#fff;
  font-size:.56rem;font-weight:800;letter-spacing:.06em;
  padding:.1rem .35rem;border-radius:2px;margin-top:.15rem}

/* ════════════════════════════════════════════════════════════
   SITE-NAV — barra azul de navegación (sticky)
════════════════════════════════════════════════════════════ */
.site-nav{
  background:var(--c-primary);
  position:sticky;top:0;z-index:200;
  box-shadow:0 2px 8px rgba(0,0,0,.18)}
.site-nav .container{padding-top:0;padding-bottom:0}
.site-nav ul{
  display:flex;align-items:center;gap:0;list-style:none}
.site-nav a{
  display:block;padding:.82rem 1.1rem;
  color:rgba(255,255,255,.85);
  font-size:.84rem;font-weight:500;
  text-decoration:none;white-space:nowrap;
  transition:background var(--t),color var(--t)}
.site-nav a:hover,.site-nav a.activo{
  background:rgba(255,255,255,.13);color:#fff}
.nav-mdp{
  margin-left:auto;
  background:var(--c-red)!important;color:#fff!important;
  padding:.82rem 1.3rem!important}
.nav-mdp:hover{background:var(--c-red-d)!important}

/* Hamburger (mobile — controla el site-nav en móvil) */
.nav-toggle{
  display:none;flex-direction:column;gap:5px;
  background:none;border:none;cursor:pointer;
  padding:.45rem;flex-shrink:0}
.nav-toggle span{
  display:block;width:22px;height:2px;
  background:var(--c-text-light);border-radius:2px;transition:var(--t)}

/* ── Hero ───────────────────────────────────────────────────── */
.hero{background:linear-gradient(135deg,var(--c-primary) 55%,#0050a0 100%);
  color:#fff;padding:4rem 0 5rem;overflow:hidden;position:relative}
.hero::after{content:'';position:absolute;right:-60px;bottom:-60px;
  width:400px;height:400px;border-radius:50%;
  background:rgba(255,255,255,.04);pointer-events:none}
.hero-grid{display:grid;grid-template-columns:1fr 420px;gap:3rem;align-items:center}
.hero-badge{display:inline-flex;align-items:center;gap:.4rem;background:rgba(255,255,255,.15);
  color:rgba(255,255,255,.9);font-size:.75rem;font-weight:600;
  padding:.3rem .85rem;border-radius:20px;letter-spacing:.04em;margin-bottom:1rem}
.hero h1{font-size:clamp(1.7rem,4vw,2.6rem);font-weight:800;line-height:1.15;
  margin-bottom:.85rem;letter-spacing:-.02em}
.hero-desc{font-size:1rem;opacity:.88;line-height:1.65;margin-bottom:2rem;max-width:480px}
.hero-btns{display:flex;gap:.75rem;flex-wrap:wrap}
.btn-hero-primary{display:inline-flex;align-items:center;gap:.5rem;
  background:#fff;color:var(--c-primary);padding:.75rem 1.5rem;border-radius:30px;
  font-weight:700;font-size:.9rem;transition:transform var(--t),box-shadow var(--t)}
.btn-hero-primary:hover{transform:translateY(-2px);box-shadow:0 6px 20px rgba(0,0,0,.2);color:var(--c-primary)}
.btn-hero-secondary{display:inline-flex;align-items:center;gap:.5rem;
  background:rgba(255,255,255,.15);border:1.5px solid rgba(255,255,255,.4);
  color:#fff;padding:.75rem 1.5rem;border-radius:30px;font-weight:600;font-size:.9rem;
  transition:background var(--t)}
.btn-hero-secondary:hover{background:rgba(255,255,255,.25);color:#fff}

/* Tarjeta de búsqueda en hero */
.hero-search-card{background:rgba(255,255,255,.12);backdrop-filter:blur(8px);
  border:1px solid rgba(255,255,255,.2);border-radius:var(--radius-lg);padding:1.75rem;color:#fff}
.hero-search-card h3{font-size:1rem;font-weight:700;margin-bottom:.35rem}
.hero-search-card p{font-size:.82rem;opacity:.8;margin-bottom:1.1rem}
.buscar-row{display:flex;gap:.5rem}
.buscar-row input{flex:1;padding:.65rem .9rem;border:none;border-radius:var(--radius-sm);
  font-size:.9rem;font-family:var(--font);text-transform:uppercase;background:rgba(255,255,255,.95)}
.buscar-row input:focus{outline:2px solid #fff}
.btn-buscar-exp{background:var(--c-red);color:#fff;border:none;padding:.65rem 1.15rem;
  border-radius:var(--radius-sm);font-weight:700;cursor:pointer;white-space:nowrap;
  font-size:.85rem;transition:background var(--t)}
.btn-buscar-exp:hover{background:var(--c-red-d)}
#resultado-hero{margin-top:.85rem;font-size:.85rem}

/* Tarjeta resultado expediente */
.exp-card{background:rgba(255,255,255,.15);border:1px solid rgba(255,255,255,.25);
  border-radius:var(--radius);padding:1rem}
.exp-card .exp-codigo{font-size:1.05rem;font-weight:800;margin-bottom:.6rem}
.exp-card .exp-fila{display:flex;justify-content:space-between;align-items:center;
  font-size:.8rem;margin-bottom:.3rem;opacity:.9}
.exp-card .exp-fila strong{color:#fff}

/* ── Alertas banner ─────────────────────────────────────────── */
.alertas-zona{padding:.75rem 0}
.banner-alerta{display:flex;align-items:flex-start;gap:.75rem;padding:.85rem 1.1rem;
  border-radius:var(--radius);margin-bottom:.5rem;font-size:.88rem;font-weight:500;
  border-left:4px solid}
.banner-alerta.info       {background:#dbeafe;color:#1e40af;border-color:#3b82f6}
.banner-alerta.advertencia{background:#fef9c3;color:#854d0e;border-color:#f59e0b}
.banner-alerta.peligro    {background:#fee2e2;color:#991b1b;border-color:#ef4444}
.banner-alerta.exito      {background:#dcfce7;color:#166534;border-color:#22c55e}

/* ── Carrusel de servicios digitales ────────────────────────── */
.srv-crl-section{padding-top:1.5rem;padding-bottom:2rem;overflow:hidden;position:relative;z-index:10}
.srv-crl-outer{
  position:relative;
  overflow:hidden;
  /* fade edges */
  -webkit-mask:linear-gradient(to right,transparent 0,#000 6%,#000 94%,transparent 100%);
  mask:linear-gradient(to right,transparent 0,#000 6%,#000 94%,transparent 100%);
}
.srv-crl-track{
  display:flex;
  gap:1rem;
  width:max-content;
  padding:.6rem 1rem 1.2rem;
  animation:srvScroll linear infinite;
}
.srv-crl-track:hover{animation-play-state:paused}
@keyframes srvScroll{
  from{transform:translateX(0)}
  to  {transform:translateX(-50%)}
}
/* card base */
.acceso-card{
  background:var(--c-white);
  border-radius:var(--radius);
  box-shadow:var(--c-shadow);
  padding:1.4rem 1.1rem;
  text-align:center;
  border-bottom:3px solid transparent;
  transition:transform var(--t),border-color var(--t),box-shadow var(--t);
  color:var(--c-text);
  display:flex;flex-direction:column;align-items:center;gap:.5rem;
  text-decoration:none;
}
.acceso-card:hover{
  transform:translateY(-4px);
  border-color:var(--c-primary);
  box-shadow:var(--c-shadow-lg);
  color:var(--c-text);
}
/* carrusel item tamaño fijo */
.srv-crl-item{
  flex:0 0 210px;
  min-height:90px;
  cursor:pointer;
}
.acceso-icon{font-size:2rem;line-height:1}
.acceso-card strong{font-size:.88rem;color:var(--c-primary);font-weight:700;line-height:1.3}
.acceso-card span{font-size:.75rem;color:var(--c-text-light);line-height:1.35}
/* legado: grid estático si se usa en otro sitio */
.acceso-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:1rem;
  margin-top:-2.5rem;position:relative;z-index:10}

/* ── Encabezados de sección ─────────────────────────────────── */
.sec-header{margin-bottom:2.5rem}
.sec-header.center{text-align:center}
.sec-eyebrow{font-size:.72rem;font-weight:700;text-transform:uppercase;
  letter-spacing:.08em;color:var(--c-red);margin-bottom:.4rem}
.sec-header h2{font-size:clamp(1.5rem,3vw,2.1rem);font-weight:800;
  color:var(--c-primary);letter-spacing:-.02em;line-height:1.2}
.sec-header p{color:var(--c-text-light);font-size:.95rem;margin-top:.4rem;max-width:600px}
.sec-header.center p{margin-left:auto;margin-right:auto}

/* ── TUPA ───────────────────────────────────────────────────── */
.tupa-filtros{display:flex;gap:.75rem;margin-bottom:2rem;flex-wrap:wrap}
.tupa-filtros input,.tupa-filtros select{
  padding:.65rem .95rem;border:1.5px solid var(--c-border);border-radius:var(--radius-sm);
  font-family:var(--font);font-size:.88rem;background:#fff;color:var(--c-text);
  transition:border-color var(--t)}
.tupa-filtros input{flex:1;min-width:220px}
.tupa-filtros input:focus,.tupa-filtros select:focus{
  outline:none;border-color:var(--c-primary);box-shadow:0 0 0 3px rgba(0,56,118,.1)}

.tramites-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(310px,1fr));gap:1.1rem}
.tramite-card{background:var(--c-white);border-radius:var(--radius);
  border:1px solid var(--c-border);padding:1.25rem;
  transition:transform var(--t),box-shadow var(--t),border-color var(--t)}
.tramite-card:hover{transform:translateY(-3px);box-shadow:var(--c-shadow);
  border-color:var(--c-primary)}
/* tarjeta como enlace */
a.tramite-card-link{display:flex;flex-direction:column;text-decoration:none;color:inherit;cursor:pointer}
a.tramite-card-link:hover{border-color:var(--c-primary);box-shadow:0 6px 20px rgba(0,56,118,.12)}
a.tramite-card-link:hover .tramite-ver-mas{opacity:1;transform:translateX(3px)}
/* campos de la tarjeta */
.tramite-codigo{font-size:.7rem;font-weight:700;text-transform:uppercase;
  letter-spacing:.06em;color:var(--c-red);margin-bottom:.35rem}
.tramite-nombre{font-size:.95rem;font-weight:700;color:var(--c-primary);
  margin-bottom:.45rem;line-height:1.35}
.tramite-desc{font-size:.82rem;color:var(--c-text-light);margin-bottom:.85rem;flex:1;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.tramite-meta{display:flex;gap:.45rem;flex-wrap:wrap;align-items:center;font-size:.78rem;margin-bottom:.75rem}
.tramite-area{background:#eef2ff;color:var(--c-primary);padding:.2rem .55rem;
  border-radius:20px;font-weight:600}
.tramite-costo{color:var(--c-red);font-weight:700}
.tramite-plazo{color:var(--c-text-light)}
.tramite-requisitos{margin-top:.7rem;padding-top:.7rem;border-top:1px solid var(--c-border);font-size:.8rem}
.tramite-requisitos summary{font-weight:600;color:var(--c-primary);cursor:pointer;user-select:none;list-style:none}
.tramite-requisitos summary::-webkit-details-marker{display:none}
.tramite-requisitos ul{margin:.5rem 0 0 .9rem;color:var(--c-text-light);line-height:1.55}
.tramite-ver-mas{margin-top:.85rem;font-size:.78rem;font-weight:700;color:var(--c-primary);
  opacity:0;transition:opacity .2s,transform .2s;letter-spacing:.01em}
.tc-codigo{font-size:.7rem;font-weight:700;text-transform:uppercase;
  letter-spacing:.05em;color:var(--c-red);margin-bottom:.35rem}
.tc-nombre{font-size:.95rem;font-weight:700;color:var(--c-primary);
  margin-bottom:.45rem;line-height:1.3}
.tc-desc{font-size:.82rem;color:var(--c-text-light);margin-bottom:.85rem;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.tc-meta{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center;font-size:.78rem}
.tc-area{background:#eef2ff;color:var(--c-primary);padding:.2rem .55rem;
  border-radius:20px;font-weight:600}
.tc-costo{color:var(--c-red);font-weight:700}
.tc-plazo{color:var(--c-text-light)}
.tc-reqs{margin-top:.85rem;padding-top:.75rem;border-top:1px solid var(--c-border)}
.tc-reqs summary{font-size:.8rem;font-weight:600;color:var(--c-primary);
  cursor:pointer;user-select:none}
.tc-reqs ul{margin-top:.5rem;padding-left:.9rem;font-size:.79rem;color:var(--c-text-light)}
.tc-reqs li{list-style:disc;margin-bottom:.25rem}
.tupa-vacio{grid-column:1/-1;text-align:center;padding:3rem;color:var(--c-text-light)}
#tupa-loader{text-align:center;padding:2rem;display:none;color:var(--c-text-light);font-size:.9rem}

/* ── Noticias ───────────────────────────────────────────────── */
.noticias-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:1.25rem}
.noticia-card{background:var(--c-white);border-radius:var(--radius);
  border:1px solid var(--c-border);overflow:hidden;
  transition:transform var(--t),box-shadow var(--t)}
.noticia-card:hover{transform:translateY(-4px);box-shadow:0 8px 28px rgba(0,0,0,.12)}
/* Card clicable (etiqueta <a>) */
.noticia-card.nc-link{cursor:pointer}
.noticia-card.nc-link:hover .nc-titulo{color:var(--c-primary)}
.noticia-card.nc-link:hover .nc-imagen img{transform:scale(1.04)}
.nc-imagen img{transition:transform .35s ease}
.nc-imagen{height:155px;background:linear-gradient(135deg,var(--c-primary),#0050a0);
  display:flex;align-items:center;justify-content:center;font-size:2.2rem;overflow:hidden}
.nc-imagen img{width:100%;height:100%;object-fit:cover}
.nc-body{padding:1.1rem}
.nc-cat{display:inline-block;padding:.2rem .6rem;border-radius:20px;font-size:.7rem;
  font-weight:700;letter-spacing:.03em;margin-bottom:.5rem;text-transform:uppercase}
.nc-cat.noticia      {background:#dbeafe;color:#1e40af}
.nc-cat.alerta       {background:#fef9c3;color:#854d0e}
.nc-cat.agenda       {background:#dcfce7;color:#166534}
.nc-cat.comunicado   {background:#f3e8ff;color:#6b21a8}
.nc-cat.convocatoria {background:#ffedd5;color:#9a3412}
.nc-titulo{font-size:.92rem;font-weight:700;color:var(--c-text);
  line-height:1.35;margin-bottom:.45rem}
.nc-resumen{font-size:.8rem;color:var(--c-text-light);
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.nc-fecha{font-size:.74rem;color:var(--c-text-light);margin-top:.75rem;
  display:flex;align-items:center;gap:.3rem}

/* ── Agenda ─────────────────────────────────────────────────── */
.agenda-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:1rem}
.agenda-card{background:var(--c-white);border-radius:var(--radius);
  border:1px solid var(--c-border);padding:1.1rem;
  border-left:4px solid var(--c-red)}
.agenda-fecha{font-size:.75rem;font-weight:700;color:var(--c-red);margin-bottom:.4rem}
.agenda-titulo{font-size:.9rem;font-weight:700;color:var(--c-primary)}
.agenda-lugar{font-size:.8rem;color:var(--c-text-light);margin-top:.3rem}

/* ── Empresas Aliadas — Carrusel ────────────────────────────── */
.aliados-carrusel{
  position:relative;overflow:hidden;
  margin-top:2rem;user-select:none;
}
.aliados-track{
  display:flex;
  transition:transform .55s cubic-bezier(.4,0,.2,1);
  will-change:transform;
}
.aliado-item{
  flex-shrink:0;
  box-sizing:border-box;
  padding:.75rem;
  display:flex;
  text-decoration:none;color:inherit;
}
.aliado-card-inner{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:.75rem;width:100%;
  background:#fff;border-radius:16px;
  padding:1.75rem 1rem 1.25rem;
  border:1.5px solid #e5e7eb;
  transition:box-shadow .25s,transform .25s,border-color .25s;
  box-shadow:0 2px 8px rgba(0,0,0,.04);
}
.aliado-item:hover .aliado-card-inner{
  box-shadow:0 10px 32px rgba(0,0,0,.10);
  transform:translateY(-4px);
  border-color:var(--c-primary);
}
.aliado-logo{width:110px;height:68px;object-fit:contain}
.aliado-logo-ph{
  width:80px;height:60px;background:#f1f5f9;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
}
.aliado-nombre{
  font-size:.82rem;font-weight:700;
  text-align:center;color:#374151;line-height:1.3;
}
.aliados-dots{
  display:flex;justify-content:center;
  gap:.5rem;margin-top:1.5rem;min-height:16px;
}
.a-dot{
  width:8px;height:8px;border-radius:4px;
  background:#d1d5db;border:none;cursor:pointer;
  padding:0;transition:all .32s cubic-bezier(.4,0,.2,1);flex-shrink:0;
}
.a-dot.a-dot-on{background:var(--c-primary);width:24px}

/* ── Página Muni (pública) ──────────────────────────────────── */
.muni-hero{
  background:linear-gradient(135deg,var(--c-primary) 0%,#001a42 100%);
  color:#fff;padding:3.5rem 0 2.5rem;text-align:center
}
.muni-hero h1{font-size:clamp(1.8rem,4vw,2.6rem);font-weight:800;letter-spacing:-.02em;margin-bottom:.5rem}
.muni-hero p{font-size:1rem;opacity:.82;max-width:540px;margin:0 auto}
.muni-tabs-bar{display:flex;gap:0;justify-content:center;flex-wrap:wrap;
  background:#fff;border-bottom:2px solid var(--c-border);position:sticky;top:0;z-index:100;
  box-shadow:0 2px 8px rgba(0,0,0,.05)}
.muni-tab{padding:.75rem 1.75rem;font-size:.88rem;font-weight:600;color:#6b7280;
  border-bottom:3px solid transparent;margin-bottom:-2px;
  text-decoration:none;transition:color .15s,border-color .15s;white-space:nowrap;cursor:pointer;
  background:none;border-top:none;border-left:none;border-right:none}
.muni-tab:hover{color:var(--c-primary)}
.muni-tab.activo{color:var(--c-primary);border-bottom-color:var(--c-primary)}
.muni-panel{display:block;padding:2.5rem 0}
.muni-panel.activo{display:block}
.muni-vm-grid{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;margin-top:1.5rem}
@media(max-width:640px){.muni-vm-grid{grid-template-columns:1fr}}
.muni-vm-card{background:var(--c-white);border-radius:14px;
  border:1.5px solid var(--c-border);padding:1.75rem;border-top:4px solid var(--c-primary)}
.muni-vm-card.mision{border-top-color:var(--c-red)}
.muni-vm-card h3{font-size:1.05rem;font-weight:800;color:var(--c-primary);margin-bottom:.75rem}
.muni-vm-card.mision h3{color:var(--c-red)}
.muni-historia-box{background:var(--c-white);border-radius:14px;border:1.5px solid var(--c-border);
  padding:2rem;line-height:1.85;color:var(--c-text);font-size:.95rem;white-space:pre-line}
.muni-agenda-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:1rem;margin-top:1.5rem}
.muni-agenda-card{background:var(--c-white);border-radius:12px;
  border:1.5px solid var(--c-border);padding:1.25rem;border-left:4px solid var(--c-red)}
.muni-agenda-card .ma-fecha{font-size:.78rem;font-weight:700;color:var(--c-red);margin-bottom:.3rem}
.muni-agenda-card .ma-titulo{font-size:.92rem;font-weight:700;color:var(--c-text);margin-bottom:.3rem}
.muni-agenda-card .ma-lugar{font-size:.78rem;color:#6b7280}

/* ── CTA Mesa de Partes ─────────────────────────────────────── */
.cta-mdp{background:var(--c-primary);color:#fff;padding:4.5rem 0;text-align:center;position:relative;overflow:hidden}
.cta-mdp h2{font-size:clamp(1.5rem,3vw,2.1rem);font-weight:800;margin-bottom:.65rem;
  letter-spacing:-.02em}
.cta-mdp p{font-size:1rem;opacity:.88;max-width:540px;margin:.5rem auto 2rem}
.btn-cta{display:inline-flex;align-items:center;gap:.5rem;
  background:var(--c-red);color:#fff;padding:.9rem 2.25rem;border-radius:30px;
  font-weight:700;font-size:.95rem;transition:background var(--t),transform var(--t)}
.btn-cta:hover{background:var(--c-red-d);transform:scale(1.03);color:#fff}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer{
  background:linear-gradient(175deg,#002060 0%,#00153d 100%);
  color:rgba(255,255,255,.78);position:relative;margin-top:0;
}
.site-footer::before{
  content:'';position:absolute;inset:0;pointer-events:none;
  background-image:radial-gradient(rgba(255,255,255,.04) 1px,transparent 1px);
  background-size:22px 22px;
}
.footer-grid{
  display:grid;grid-template-columns:1.55fr 1fr 1fr 1.1fr;
  gap:2.5rem;padding:3.5rem 0 2.5rem;position:relative;z-index:1;
}
.footer-col h4{
  color:#fff;font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.09em;
  margin-bottom:1rem;padding-bottom:.5rem;
  border-bottom:2px solid var(--c-red);
}
.footer-col ul{list-style:none;padding:0;margin:0}
.footer-col ul li{margin-bottom:.55rem}
.footer-col ul li a{
  color:rgba(255,255,255,.62);font-size:.82rem;
  display:inline-flex;align-items:center;gap:.4rem;
  transition:color var(--t),padding-left var(--t);
}
.footer-col ul li a::before{
  content:'›';font-size:1.1rem;line-height:1;color:var(--c-red);flex-shrink:0;
}
.footer-col ul li a:hover{color:#fff;padding-left:.3rem}
.footer-col address{font-style:normal}
/* Logo marca */
.footer-logo{display:flex;align-items:center;gap:.85rem;margin-bottom:.75rem}
.footer-logo img{
  width:58px;height:58px;border-radius:50%;background:#fff;padding:5px;flex-shrink:0;
  box-shadow:0 4px 18px rgba(0,0,0,.28),0 0 0 3px rgba(255,255,255,.2);
}
.footer-logo span{font-size:.92rem;font-weight:700;color:#fff;line-height:1.3}
.footer-slogan{font-size:.8rem;opacity:.6;line-height:1.65;margin-bottom:1.2rem}
/* Redes sociales */
.footer-social{display:flex;gap:.55rem;margin-top:.25rem}
.footer-social a{
  display:flex;align-items:center;justify-content:center;
  width:40px;height:40px;
  background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.14);
  border-radius:50%;transition:all var(--t);
}
.footer-social a svg{width:18px;height:18px;fill:#fff;stroke:none;display:block}
.footer-social a.ig-link svg{fill:none;stroke:#fff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.footer-social a:hover{background:var(--c-red);border-color:var(--c-red);transform:translateY(-3px)}
/* Ítems de contacto con icono */
.footer-contact-item{
  display:flex;align-items:flex-start;gap:.6rem;
  margin-bottom:.75rem;font-size:.81rem;color:rgba(255,255,255,.7);line-height:1.55;
}
.footer-contact-item svg{
  width:15px;height:15px;flex-shrink:0;margin-top:2px;
  fill:none;stroke:var(--c-red);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;
}
/* Links dentro de items de contacto */
.footer-contact-link{
  color:rgba(255,255,255,.7);text-decoration:none;
  transition:color var(--t);border-bottom:1px dotted rgba(255,255,255,.25);
}
.footer-contact-link:hover{color:#fff;border-bottom-color:rgba(255,255,255,.6)}
/* Divisor decorativo */
.footer-divider{
  height:1px;position:relative;z-index:1;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.14) 25%,rgba(255,255,255,.14) 75%,transparent);
}
/* Barra inferior */
.footer-bottom{padding:1.2rem 0;background:rgba(0,0,0,.22);position:relative;z-index:1}
.footer-bottom-inner{
  display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:.5rem;
  font-size:.73rem;color:rgba(255,255,255,.4);
}
.footer-bottom-inner p{margin:0}
@media(max-width:900px){
  .footer-grid{grid-template-columns:1fr 1fr;gap:2rem}
}
@media(max-width:600px){
  .footer-grid{grid-template-columns:1fr;gap:1.75rem;padding:2.5rem 0 2rem}
  .footer-bottom-inner{flex-direction:column;text-align:center;gap:.3rem}
}

/* ════════════════════════════════════════════════════════════════
   MESA DE PARTES VIRTUAL — Diseño premium
════════════════════════════════════════════════════════════════ */

/* ── Hero ── */
.mesa-hero{
  background:linear-gradient(135deg, var(--c-primary) 0%, color-mix(in srgb,var(--c-primary) 75%,#001d40) 100%);
  color:#fff;position:relative;overflow:hidden;
}
.mesa-hero-inner{
  padding:3rem 0 4.5rem;position:relative;z-index:1;
}
/* Patrón punteado decorativo */
.mesa-hero::before{
  content:'';position:absolute;inset:0;
  background-image:radial-gradient(circle,rgba(255,255,255,.06) 1px,transparent 1px);
  background-size:28px 28px;pointer-events:none;
}
/* Círculo decorativo derecho */
.mesa-hero::after{
  content:'';position:absolute;right:-80px;top:-80px;
  width:320px;height:320px;border-radius:50%;
  background:rgba(255,255,255,.04);pointer-events:none;
}
.mesa-hero-badge{
  display:inline-flex;align-items:center;gap:.45rem;
  background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.18);
  border-radius:30px;padding:.3rem .85rem;font-size:.75rem;font-weight:600;
  margin-bottom:1rem;letter-spacing:.03em;backdrop-filter:blur(4px);
}
.mesa-hero h1{
  font-size:clamp(1.65rem,3.5vw,2.3rem);font-weight:800;
  margin-bottom:.55rem;letter-spacing:-.025em;line-height:1.15;
}
.mesa-hero p{opacity:.78;font-size:.92rem;max-width:580px}
/* Ola inferior del hero */
.mesa-hero-wave{
  position:absolute;bottom:-1px;left:0;right:0;height:54px;
  background:var(--c-bg);
  clip-path:ellipse(55% 100% at 50% 100%);
}

/* ── Layout principal ── */
.mesa-layout{display:grid;grid-template-columns:330px 1fr;gap:2rem;padding:2rem 0 3rem}

/* ── Panel informativo ── */
.info-panel{position:sticky;top:88px;align-self:start;display:flex;flex-direction:column;gap:1rem}

.info-card{
  background:#fff;border-radius:14px;overflow:hidden;
  box-shadow:0 2px 16px rgba(0,0,0,.07);
}
.info-card-header{
  background:linear-gradient(135deg,var(--c-primary),color-mix(in srgb,var(--c-primary) 80%,#001));
  padding:.85rem 1.1rem;display:flex;align-items:center;gap:.6rem;
}
.info-card-header svg{color:rgba(255,255,255,.85);flex-shrink:0}
.info-card-header span{color:#fff;font-weight:700;font-size:.88rem}
.info-card-body{padding:1.1rem}

.info-card-body>p{font-size:.83rem;color:#6b7280;margin-bottom:.9rem;line-height:1.55}

.info-lista{list-style:none;display:flex;flex-direction:column;gap:.5rem}
.info-lista li{
  display:flex;align-items:flex-start;gap:.65rem;
  font-size:.82rem;color:#374151;
  padding:.6rem .75rem;border-radius:8px;
  background:#f8fafc;border:1px solid #e2e8f0;line-height:1.4;
}
.info-lista li svg{flex-shrink:0;color:var(--c-primary);margin-top:.05rem}
.info-lista li strong{color:var(--c-primary)}

/* Panel consulta de expediente */
.consulta-panel{
  background:#fff;border-radius:14px;overflow:hidden;
  box-shadow:0 2px 16px rgba(0,0,0,.07);
}
.consulta-panel-head{
  background:linear-gradient(135deg,#1e3a5f,var(--c-primary));
  padding:.85rem 1.1rem;display:flex;align-items:center;gap:.6rem;
}
.consulta-panel-head svg{color:rgba(255,255,255,.8)}
.consulta-panel-head h3{color:#fff;font-size:.88rem;font-weight:700;margin:0}
.consulta-panel-body{padding:1rem 1.1rem}
.consulta-row{display:flex;gap:.5rem;margin-bottom:.5rem}
.consulta-row input{
  flex:1;padding:.6rem .85rem;
  border:1.5px solid #e2e8f0;border-radius:8px;
  font-family:var(--font);font-size:.85rem;text-transform:uppercase;
  transition:border-color .15s;
}
.consulta-row input:focus{outline:none;border-color:var(--c-primary);box-shadow:0 0 0 3px rgba(0,56,118,.1)}
.btn-consultar{
  background:var(--c-primary);color:#fff;border:none;
  padding:.6rem 1rem;border-radius:8px;
  font-weight:700;cursor:pointer;font-size:.82rem;
  transition:background .15s,transform .12s;white-space:nowrap;
}
.btn-consultar:hover{background:var(--c-primary-d);transform:translateY(-1px)}
#resultado-consulta{font-size:.82rem}

/* Resultado exp en panel lateral */
.exp-card-lateral{background:#eff6ff;border:1px solid #bfdbfe;border-radius:10px;padding:.9rem}
.exp-card-lateral .ec-codigo{font-size:.95rem;font-weight:800;color:var(--c-primary);margin-bottom:.5rem}
.exp-card-lateral .ec-fila{display:flex;justify-content:space-between;
  font-size:.79rem;color:#6b7280;margin-bottom:.25rem}
.exp-card-lateral .ec-fila strong{color:#1e293b}

/* ── Formulario principal ── */
.form-panel{
  background:#fff;border-radius:16px;
  box-shadow:0 4px 24px rgba(0,0,0,.08);
  overflow:hidden;
}

/* Pasos indicadores */
.form-steps{
  display:flex;padding:1.25rem 1.75rem;gap:0;
  border-bottom:1px solid #f1f5f9;background:#fafbfc;
}
.form-step{
  display:flex;align-items:center;gap:.55rem;flex:1;position:relative;
}
.form-step:not(:last-child)::after{
  content:'';position:absolute;right:0;top:50%;
  width:calc(100% - 38px);height:1px;
  background:#e2e8f0;transform:translateY(-50%);left:38px;z-index:0;
}
.step-num{
  width:32px;height:32px;border-radius:50%;
  background:#f1f5f9;color:#94a3b8;
  font-weight:800;font-size:.78rem;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;border:2px solid #e2e8f0;z-index:1;
  transition:background .2s,color .2s,border-color .2s;
}
.step-num.active{background:var(--c-primary);color:#fff;border-color:var(--c-primary)}
.step-num.done{background:#22c55e;color:#fff;border-color:#22c55e}
.step-lbl{font-size:.73rem;font-weight:600;color:#94a3b8;white-space:nowrap}
.step-lbl.active{color:var(--c-primary)}

/* Cuerpo del formulario */
.form-body{padding:1.75rem}

/* Sección del formulario */
.form-section{margin-bottom:1.5rem}
.form-section-title{
  display:flex;align-items:center;gap:.6rem;
  font-size:.88rem;font-weight:800;color:var(--c-primary);
  margin-bottom:1.1rem;padding-bottom:.6rem;
  border-bottom:2px solid #f1f5f9;
}
.form-section-title svg{
  background:color-mix(in srgb,var(--c-primary) 12%,transparent);
  padding:5px;border-radius:8px;width:30px;height:30px;
  color:var(--c-primary);
}

.form-row{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
.form-group{display:flex;flex-direction:column;gap:.28rem;margin-bottom:.85rem}
.form-group label{font-size:.8rem;font-weight:700;color:#374151}
.req{color:var(--c-red)}

/* Inputs modernos */
.form-control{
  padding:.7rem 1rem;
  border:1.5px solid #e2e8f0;border-radius:10px;
  font-family:var(--font);font-size:.88rem;
  transition:border-color .15s,box-shadow .15s;
  background:#fff;width:100%;color:#1e293b;
}
.form-control:focus{
  outline:none;border-color:var(--c-primary);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--c-primary) 15%,transparent);
}
.form-control.is-error{border-color:#ef4444;box-shadow:0 0 0 3px rgba(239,68,68,.1)}
.form-group select.form-control{cursor:pointer}
.form-group textarea.form-control{resize:vertical;min-height:90px;line-height:1.55}
.error-msg{color:#ef4444;font-size:.74rem;font-weight:600;min-height:.85rem}

/* Zona de carga PDF */
.file-drop{
  border:2px dashed #cbd5e1;border-radius:14px;
  padding:2rem 1.5rem;text-align:center;cursor:pointer;
  transition:border-color .2s,background .2s,transform .15s;
  background:#fafbfc;position:relative;
}
.file-drop:hover,.file-drop.drag-over{
  border-color:var(--c-primary);background:#eff6ff;
  transform:translateY(-2px);
}
.file-drop.has-file{
  border-color:#22c55e;background:#f0fdf4;
}
.file-drop input[type=file]{display:none}
.file-drop-icon{
  width:56px;height:56px;margin:0 auto .75rem;
  background:color-mix(in srgb,var(--c-primary) 10%,transparent);
  border-radius:14px;display:flex;align-items:center;justify-content:center;
  transition:background .2s;
}
.file-drop:hover .file-drop-icon,.file-drop.drag-over .file-drop-icon{
  background:color-mix(in srgb,var(--c-primary) 18%,transparent);
}
.file-drop.has-file .file-drop-icon{background:#dcfce7}
.file-drop-icon svg{color:var(--c-primary)}
.file-drop.has-file .file-drop-icon svg{color:#16a34a}
.file-hint{font-size:.84rem;color:#6b7280;margin-bottom:.25rem}
.file-hint strong{color:var(--c-primary)}
.file-name{
  display:none;font-size:.84rem;font-weight:700;
  color:#16a34a;margin-top:.35rem;
}
.file-drop.has-file .file-name{display:block}
.file-drop small{font-size:.74rem;color:#94a3b8}

/* Declaración jurada */
.declaracion{
  display:flex;align-items:flex-start;gap:.75rem;
  background:#fafbfc;border:1px solid #e2e8f0;
  border-radius:10px;padding:.9rem 1rem;margin-bottom:1.25rem;
}
.declaracion input[type=checkbox]{
  width:18px;height:18px;margin-top:.15rem;flex-shrink:0;
  accent-color:var(--c-primary);cursor:pointer;
}
.declaracion span{font-size:.82rem;color:#4b5563;line-height:1.5}

/* Botón enviar */
.btn-enviar{
  width:100%;
  background:linear-gradient(135deg,var(--c-primary),color-mix(in srgb,var(--c-primary) 70%,#001d40));
  color:#fff;border:none;
  padding:1rem;border-radius:12px;
  font-size:.95rem;font-weight:800;
  cursor:pointer;
  transition:transform .15s,box-shadow .15s,opacity .15s;
  display:flex;align-items:center;justify-content:center;gap:.7rem;
  box-shadow:0 4px 18px color-mix(in srgb,var(--c-primary) 40%,transparent);
  letter-spacing:.01em;
}
.btn-enviar:hover{transform:translateY(-2px);box-shadow:0 8px 24px color-mix(in srgb,var(--c-primary) 50%,transparent)}
.btn-enviar:active{transform:translateY(0);box-shadow:none}
.btn-enviar:disabled{opacity:.6;cursor:not-allowed;transform:none;box-shadow:none}
.spinner{
  width:18px;height:18px;
  border:2px solid rgba(255,255,255,.35);
  border-top-color:#fff;border-radius:50%;
  animation:spin .7s linear infinite;display:none;flex-shrink:0;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ── Modal éxito ── */
.modal-overlay{
  position:fixed;inset:0;
  background:rgba(0,0,0,.6);backdrop-filter:blur(4px);
  z-index:500;display:none;align-items:center;justify-content:center;padding:1rem;
}
.modal-overlay.open{display:flex}
.modal-box{
  background:#fff;border-radius:20px;
  padding:2.5rem 2rem 2rem;
  max-width:480px;width:100%;text-align:center;
  animation:modalIn .35s cubic-bezier(.34,1.56,.64,1);
  position:relative;overflow:hidden;
}
.modal-box::before{
  content:'';position:absolute;top:0;left:0;right:0;height:5px;
  background:linear-gradient(90deg,var(--c-primary),#22c55e);
}
@keyframes modalIn{from{transform:scale(.88) translateY(20px);opacity:0}to{transform:scale(1) translateY(0);opacity:1}}
.modal-icon{
  width:72px;height:72px;border-radius:50%;
  background:linear-gradient(135deg,#22c55e,#16a34a);
  display:flex;align-items:center;justify-content:center;
  margin:0 auto 1.1rem;
  box-shadow:0 8px 24px rgba(34,197,94,.3);
  animation:popIn .4s .2s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes popIn{from{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}
.modal-icon svg{width:36px;height:36px;color:#fff}
.modal-box h3{font-size:1.35rem;color:#1e293b;font-weight:800;margin-bottom:.4rem}
.modal-box>p{color:#6b7280;font-size:.87rem;line-height:1.55}
.codigo-box{
  background:linear-gradient(135deg,#eff6ff,#f0fdf4);
  border:1.5px solid #bfdbfe;border-radius:14px;
  padding:1.2rem;margin:1.2rem 0;
}
.codigo-box small{font-size:.72rem;color:#6b7280;display:block;margin-bottom:.3rem;text-transform:uppercase;letter-spacing:.06em;font-weight:600}
.codigo-box strong{font-size:1.6rem;color:var(--c-primary);font-weight:900;letter-spacing:.06em}
.modal-meta{font-size:.82rem;color:#6b7280;margin-bottom:.5rem}
.modal-meta strong{color:#374151}
.modal-hint{font-size:.8rem;color:#9ca3af;margin-bottom:1.25rem;line-height:1.5}
.btn-modal-ok{
  background:linear-gradient(135deg,var(--c-primary),color-mix(in srgb,var(--c-primary) 70%,#001));
  color:#fff;border:none;
  padding:.85rem 2.5rem;border-radius:30px;
  font-weight:800;cursor:pointer;font-size:.9rem;
  transition:transform .15s,box-shadow .15s;
  box-shadow:0 4px 14px color-mix(in srgb,var(--c-primary) 35%,transparent);
}
.btn-modal-ok:hover{transform:translateY(-2px);box-shadow:0 8px 20px color-mix(in srgb,var(--c-primary) 45%,transparent)}

/* Badges */
.badge{display:inline-block;padding:.2rem .65rem;border-radius:20px;font-size:.72rem;font-weight:700}
.badge-info   {background:#dbeafe;color:#1e40af}
.badge-warning{background:#fef9c3;color:#854d0e}
.badge-danger {background:#fee2e2;color:#991b1b}
.badge-success{background:#dcfce7;color:#166534}
.badge-gray   {background:#f3f4f6;color:#4b5563}

/* ── Admin login ─────────────────────────────────────────────── */
.admin-login{min-height:100vh;display:flex;align-items:center;
  justify-content:center;background:var(--c-bg)}
.login-card{background:#fff;border-radius:var(--radius-lg);
  box-shadow:0 4px 32px rgba(0,0,0,.1);padding:2.5rem;width:100%;max-width:400px}
.login-card h2{text-align:center;color:var(--c-primary);font-size:1.2rem;margin-bottom:1.5rem}
.btn-login{width:100%;background:var(--c-primary);color:#fff;border:none;
  padding:.88rem;border-radius:10px;font-size:.95rem;font-weight:700;
  cursor:pointer;transition:background .18s,box-shadow .18s,transform .12s;
  box-shadow:0 2px 8px rgba(0,56,118,.25)}
.btn-login:hover{background:var(--c-primary-d);transform:translateY(-1px);
  box-shadow:0 5px 16px rgba(0,56,118,.35)}
.btn-login:active{transform:translateY(0);box-shadow:none}

/* ── Responsive ─────────────────────────────────────────────── */
@media(max-width:1200px){
  .header-inst{gap:.65rem}
  .inst-sep{display:none}
}
@media(max-width:1024px){
  /* Hero: apilar y centrar contenido */
  .hero-grid{grid-template-columns:1fr}
  .hero-content{text-align:center}
  .hero-badge{margin-left:auto;margin-right:auto}
  .hero-desc{margin-left:auto;margin-right:auto;max-width:540px}
  .hero-btns{justify-content:center;flex-wrap:wrap}
  /* Tarjeta de búsqueda centrada */
  .hero-search-card{max-width:500px;width:100%;margin:2rem auto 0}
  .footer-grid{grid-template-columns:1fr 1fr}
  .header-inst{display:none}
}
@media(max-width:768px){
  /* Header: logo centrado, sin buscador, sin nav (usa barra inferior) */
  .header-inst{display:none}
  .header-search{display:none}
  .nav-toggle{display:none}
  .header-inner{justify-content:center}
  .header-marca{margin:0 auto}
  .site-nav{display:none}

  /* Secciones: reducir padding vertical */
  .seccion{padding:2.25rem 0}
  .sec-header{margin-bottom:1.5rem}

  /* Páginas internas */
  .mesa-layout{grid-template-columns:1fr}
  .info-panel{position:static}
  .form-row{grid-template-columns:1fr}
  .form-steps{padding:.9rem 1rem;gap:.25rem}
  .step-lbl{display:none}
  .form-body{padding:1.25rem}

  /* TUPA: columna, inputs full-width */
  .tupa-filtros{flex-direction:column}
  .tupa-filtros input,.tupa-filtros select{width:100%;min-width:0}

  /* Noticias: 2 columnas en tablet-mobile */
  .noticias-grid{grid-template-columns:repeat(2,1fr)}

  /* Hero: buttons apilados y centrados */
  .hero-btns{flex-direction:column;align-items:stretch;gap:.65rem}
  .btn-hero-primary,.btn-hero-secondary{
    justify-content:center;width:100%;max-width:340px;
    margin-left:auto;margin-right:auto}
  .buscar-row{flex-direction:column}
  .hero-search-card{display:none}

  /* Footer */
  .footer-grid{grid-template-columns:1fr 1fr}

  /* Logo */
  .header-logo-img{max-height:50px;max-width:200px}
  .hn-nombre{font-size:.88rem;max-width:220px;text-align:center}
}
@media(max-width:480px){
  /* Govbar: ocultar link en pantallas pequeñas */
  .govbar-right{display:none}

  /* Header */
  .header-logo-img{max-height:44px;max-width:165px}
  .hn-nombre{font-size:.8rem;max-width:175px}

  /* Secciones: padding mínimo */
  .seccion{padding:1.75rem 0}
  .sec-header{margin-bottom:1.1rem}
  .container{padding-inline:1rem}

  /* Hero */
  .hero{padding:1.75rem 0 2rem}
  .hero-badge{font-size:.7rem;padding:.25rem .7rem}

  /* Grids a 1 columna */
  .acceso-grid{grid-template-columns:1fr 1fr}
  .tramites-grid{grid-template-columns:1fr}
  .noticias-grid{grid-template-columns:1fr}
  .footer-grid{grid-template-columns:1fr;gap:1.75rem;padding:2rem 0 1.75rem}
  .footer-bottom-inner{flex-direction:column;text-align:center;gap:.3rem}

  /* Servicio carousel: tarjetas más compactas */
  .srv-crl-item{flex:0 0 175px;min-height:78px}
  .acceso-card strong{font-size:.82rem}
  .acceso-card span{font-size:.72rem}

  /* Noticias: imagen más compacta en mobile pequeño */
  .nc-imagen{height:130px}
}

/* ══════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION BAR
══════════════════════════════════════════════════════════════ */
.mobile-btmnav{display:none}
.hero-quick-strip{display:none}

@media(max-width:768px){
  /* Espacio para que el footer no quede detrás de la barra */
  body{padding-bottom:calc(64px + env(safe-area-inset-bottom,0px))}

  /* ── Barra inferior ── */
  .mobile-btmnav{
    display:flex;
    position:fixed;bottom:0;left:0;right:0;
    background:#fff;
    border-top:1px solid #e5e7eb;
    box-shadow:0 -4px 24px rgba(0,0,0,.10);
    z-index:600;
    height:62px;
    padding-bottom:env(safe-area-inset-bottom,0px);
    padding:0 .25rem;
    align-items:stretch
  }

  .mbn-item{
    flex:1;display:flex;flex-direction:column;
    align-items:center;justify-content:center;
    gap:3px;text-decoration:none;
    color:#9ca3af;font-size:.58rem;font-weight:700;
    letter-spacing:.01em;padding:.3rem .15rem;
    transition:color .18s,transform .15s;
    position:relative;border-radius:12px;
    -webkit-tap-highlight-color:transparent
  }
  .mbn-item:active{transform:scale(.93)}
  .mbn-item svg{width:22px;height:22px;transition:transform .2s}
  .mbn-item.mbn-activo{color:var(--c-primary)}
  .mbn-item.mbn-activo svg{transform:scale(1.12)}
  .mbn-item.mbn-activo::after{
    content:'';position:absolute;bottom:2px;left:50%;
    transform:translateX(-50%);
    width:20px;height:3px;border-radius:2px;
    background:var(--c-primary)
  }

  /* ── Botón central FAB (Mesa de Partes) ── */
  .mbn-center{flex:1.1;position:relative;color:var(--c-primary);font-weight:800}
  .mbn-fab{
    width:50px;height:50px;
    background:linear-gradient(135deg,var(--c-primary),color-mix(in srgb,var(--c-primary) 80%,#000));
    border-radius:50%;
    display:flex;align-items:center;justify-content:center;
    position:absolute;top:-20px;left:50%;transform:translateX(-50%);
    box-shadow:0 6px 20px color-mix(in srgb,var(--c-primary) 45%,transparent),
               0 2px 8px rgba(0,0,0,.18);
    border:3px solid #fff;
    transition:transform .18s,box-shadow .18s
  }
  .mbn-center:active .mbn-fab{transform:translateX(-50%) scale(.92)}
  .mbn-fab svg{color:#fff;width:22px;height:22px}
  .mbn-center span{margin-top:18px;font-size:.58rem}

  /* ── Quick-access strips en el hero (mobile only) ── */
  .hero-quick-strip{
    display:flex;gap:.5rem;flex-wrap:wrap;
    margin-top:1.25rem;justify-content:center
  }
  .hqs-chip{
    display:flex;align-items:center;gap:.4rem;
    background:rgba(255,255,255,.15);
    border:1.5px solid rgba(255,255,255,.25);
    color:#fff;border-radius:30px;
    padding:.42rem .9rem;font-size:.72rem;font-weight:700;
    text-decoration:none;backdrop-filter:blur(4px);
    transition:background .18s;white-space:nowrap;
    -webkit-tap-highlight-color:transparent
  }
  .hqs-chip:active{background:rgba(255,255,255,.28)}
  .hqs-chip svg{width:14px;height:14px;flex-shrink:0}

  /* ── Hero mobile mejorado ── */
  .hero{padding:2rem 0 2.5rem}
  .hero h1{font-size:clamp(1.55rem,8vw,2rem);text-align:center}
  .hero-desc{text-align:center;font-size:.92rem}
  .hero-badge{margin:0 auto .75rem}
  .btn-hero-primary{
    background:#fff;color:var(--c-primary);
    font-weight:800;border-radius:30px;
    padding:.85rem 1.5rem;font-size:.92rem;
    box-shadow:0 4px 16px rgba(0,0,0,.15);
    text-align:center;justify-content:center
  }
  .btn-hero-secondary{
    background:rgba(255,255,255,.18);color:#fff;
    border-radius:30px;padding:.75rem 1.5rem;
    font-size:.88rem;font-weight:700;
    border:1.5px solid rgba(255,255,255,.35);
    text-align:center;justify-content:center
  }
}

/* ── Carrusel / Slider Principal ────────────────────────────── */
.carrusel-seccion {
  padding: 0;
  background: #000;
  line-height: 0;
}
.carrusel-contenedor {
  position: relative;
  width: 100%;
  /* Escala proporcional (ratio 3:1): ~400px en 1200px, ~256px en 768px, mín 200px en móvil */
  height: clamp(200px, 33.33vw, 500px);
  overflow: hidden;
  background: #000;
}
.carrusel-slides {
  position: relative;
  width: 100%;
  height: 100%;
}
.carrusel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
  z-index: 1;
}
.carrusel-slide.activo {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}
.carrusel-slide picture {
  display: block;
  width: 100%;
  height: 100%;
}
.carrusel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.carrusel-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, rgba(0, 0, 0, 0) 100%);
  padding: 3rem 2rem 1.8rem;
  color: #fff;
  z-index: 3;
  pointer-events: none;
}
.carrusel-overlay h3 {
  font-size: clamp(1.1rem, 2.5vw, 1.8rem);
  font-weight: 800;
  margin: 0;
  line-height: 1.25;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  max-width: 80%;
  letter-spacing: -0.01em;
}
.carrusel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.carrusel-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-50%) scale(1.06);
}
.carrusel-btn.prev {
  left: 1.25rem;
}
.carrusel-btn.next {
  right: 1.25rem;
}
.carrusel-indicadores {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.carrusel-indicador {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 0;
  transition: background 0.25s, width 0.25s, border-radius 0.25s;
}
.carrusel-indicador:hover {
  background: rgba(255, 255, 255, 0.7);
}
.carrusel-indicador.activo {
  background: #fff;
  width: 22px;
  border-radius: 4px;
}

@media (max-width: 768px) {
  .carrusel-overlay {
    padding: 2rem 1rem 1rem;
  }
  .carrusel-overlay h3 {
    max-width: 95%;
  }
  .carrusel-btn {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
  .carrusel-btn.prev { left: 0.6rem; }
  .carrusel-btn.next { right: 0.6rem; }
  .carrusel-indicadores {
    bottom: 0.6rem;
    padding: 4px 8px;
  }
  .carrusel-indicador { width: 6px; height: 6px; }
  .carrusel-indicador.activo { width: 16px; }
}
@media (max-width: 480px) {
  .carrusel-overlay {
    padding: 1.25rem 0.75rem 0.75rem;
  }
  .carrusel-btn {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }
  .carrusel-btn.prev { left: 0.4rem; }
  .carrusel-btn.next { right: 0.4rem; }
}

/* Foco accesible */
:focus-visible{outline:3px solid var(--c-red);outline-offset:2px;border-radius:2px}

