/* portal.css — maquetación exclusiva del portal público (componentes comunes en base.css) */

/* Barra fija de emergencia */
.crisis-bar { position: sticky; top: 0; z-index: var(--z-bar); background: var(--red-primary); color: #fff; border-bottom: 1px solid rgba(255, 255, 255, 0.15); }
.crisis-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 0; font-size: 0.85rem; }
.status-live { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.dot-live { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #fde047; animation: pulso 2s ease-out infinite; }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(253, 224, 71, 0.6); } 70%, 100% { box-shadow: 0 0 0 0.5rem rgba(253, 224, 71, 0); } }
.sm-only { display: none; }
.crisis-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.crisis-btns .btn { padding: 0.45rem 0.9rem; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn-911 { font-weight: 800; }
.btn-gps .icon { color: #fde047; }

/* Navegación (Consolidada + Desplegables Minimalistas Estándar GovTech) */
.nav { display: flex; align-items: center; gap: 1.75rem; font-size: 0.875rem; font-weight: 600; color: var(--text-secondary); }
.nav-item { position: relative; display: inline-flex; align-items: center; }

.nav a,
.nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav a:hover:not(.active),
.nav-item:hover > .nav-trigger:not(.active) {
  color: var(--red-primary);
  border-bottom-color: rgba(185, 28, 28, 0.35);
}

.nav a.active,
.nav-trigger.active {
  color: var(--red-primary);
  border-bottom-color: var(--red-primary);
}

.nav-live::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--st-ok);
  flex-shrink: 0;
}

.nav-chevron {
  width: 0.85rem;
  height: 0.85rem;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}
.nav-item:hover .nav-chevron,
.nav-item:focus-within .nav-chevron {
  transform: rotate(180deg);
  color: var(--red-primary);
}
/* Panel desplegable de un solo nivel (Cero ruido visual) */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: -0.75rem;
  min-width: 15.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.45rem;
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-dropdown::before {
  content: "";
  position: absolute;
  top: -0.5rem;
  left: 0;
  right: 0;
  height: 0.5rem;
}

.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown a {
  display: block;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  border-bottom: none;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-dropdown a:hover {
  background: var(--bg-page);
  color: var(--red-primary);
  font-weight: 600;
}

/* Menú Móvil con soporte de sub-enlaces y punto vivo */
.menu-toggle { display: none; padding: 0.4rem; color: var(--text-primary); }
.nav-mobile { background: var(--bg-surface); border-top: 1px solid var(--border-subtle); padding: 1rem 1.5rem; display: flex; flex-direction: column; gap: 0.65rem; font-size: 0.9rem; font-weight: 600; }
.nav-mobile a { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.25rem 0; }
.nav-mobile-sub { display: flex; flex-direction: column; gap: 0.4rem; padding-left: 0.9rem; margin-top: -0.25rem; border-left: 2px solid var(--border-subtle); font-size: 0.84rem; font-weight: 500; color: var(--text-secondary); }

/* Boletín y hero */
.bulletin { --bn-bg: var(--amber-soft); --bn-line: var(--amber-line); --bn-text: var(--amber-text); --bn-tag: #d97706; background: var(--bn-bg); border-bottom: 1px solid var(--bn-line); padding: 0.65rem 0; font-size: 0.85rem; color: var(--bn-text); }
.bulletin[data-nivel="precaucion"] { --bn-bg: #fff7ed; --bn-line: #fdba74; --bn-text: #7c2d12; --bn-tag: #ea580c; }
.bulletin[data-nivel="alerta"] { --bn-bg: var(--red-soft); --bn-line: var(--red-line); --bn-text: #7f1d1d; --bn-tag: var(--red-primary); }
.bulletin-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; }
.bulletin .tag { margin-right: 0.5rem; background: var(--bn-tag); display: inline-flex; align-items: center; gap: 0.3rem; }
.bulletin .tag .icon { width: 0.8rem; height: 0.8rem; }
.bulletin-link { font-weight: 700; text-decoration: underline; }
.hero { background: var(--bg-surface); padding: 4rem 0 3.5rem; border-bottom: 1px solid var(--border-subtle); }
.eyebrow { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--red-primary); margin-bottom: 0.65rem; }
h1 { font-size: clamp(2rem, 4vw, 2.85rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; max-width: 44rem; }
.hero-sub { font-size: 1.05rem; color: var(--text-secondary); max-width: 40rem; margin-top: 1rem; }
.hero .search { margin-top: 2rem; max-width: 34rem; }
.hero .search .input { background: var(--bg-page); }
.hero .search .input:focus { background: var(--bg-surface); }

/* Tarjetas, secciones y triaje */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.25rem; margin-top: 2.5rem; }
.card-link { display: block; padding: 1.5rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); transition: border-color 0.2s, transform 0.2s; }
.card-link:hover { border-color: var(--text-primary); transform: translateY(-2px); }
.card-link h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.4rem; }
.card-link p { font-size: 0.875rem; color: var(--text-secondary); }
.card-arrow { display: inline-block; margin-top: 1rem; font-size: 0.825rem; font-weight: 700; color: var(--red-primary); }

.section { padding: 4rem 0; border-bottom: 1px solid var(--border-subtle); }
.section-alt { background: var(--bg-surface); }
.section-head { margin-bottom: 2rem; }
.section-title { font-size: 1.65rem; font-weight: 800; letter-spacing: -0.02em; }
.section-desc { color: var(--text-secondary); font-size: 0.95rem; margin-top: 0.35rem; max-width: 38rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; align-items: start; }

.tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.step { padding: 1.25rem; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--bg-page); font-size: 0.9rem; }
.step.critical { background: var(--red-soft); border-color: var(--red-line); }
.step strong { display: block; margin-bottom: 0.3rem; font-size: 0.95rem; }

/* Chequeo, tarjeta de diagnóstico, KPI */
.check-row { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.9rem 1rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); margin-bottom: 0.65rem; cursor: pointer; background: var(--bg-surface); font-size: 0.9rem; }
.check-row:hover { border-color: var(--border-strong); }
.check-row input { width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; accent-color: var(--red-primary); }
.score-card { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: 2rem; }
.score-card h3 { font-size: 1.4rem; font-weight: 800; margin-top: 0.5rem; }
.score-card p { color: #cbd5e1; font-size: 0.9rem; margin-top: 0.75rem; }
.score-row { display: flex; align-items: center; gap: 1rem; margin-top: 1.25rem; }
.score-icon { width: 3.5rem; height: 3.5rem; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: #f87171; }
#resultadoHogar[data-nivel="medio"] .score-icon { color: #fcd34d; }
#resultadoHogar[data-nivel="alto"] .score-icon { color: #34d399; }
.score-card .score-sub { margin: 0; color: #94a3b8; }
.score-card .score-num { margin: 0; color: #fff; font-size: 2.6rem; font-weight: 800; line-height: 1.1; }
.score-num small { font-size: 1.1rem; color: #94a3b8; font-weight: 600; }
.meter { height: 0.5rem; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.1); overflow: hidden; margin-top: 1.25rem; }
.meter span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #ef4444, #fbbf24, #34d399); transition: width 0.5s ease; }
.check-row.checked { border-color: #34d399; background: var(--ok-bg); }
.facts { margin-top: 1.5rem; display: grid; gap: 1rem; }
.fact { display: flex; gap: 0.75rem; align-items: center; }
.fact-ico { width: 2.5rem; height: 2.5rem; border-radius: var(--radius-sm); background: var(--red-soft); color: var(--red-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fact dt { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.fact dd { font-weight: 600; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.kpi { position: relative; overflow: hidden; padding: 1.5rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-page); }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--red-primary); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.kpi-top .icon { color: var(--red-primary); }
.kpi-val.is-ok { color: var(--ok-text); }
.kpi-val.is-warn { color: #b45309; }
.kpi-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.kpi-val { font-size: 2rem; font-weight: 800; margin: 0.25rem 0; }
.kpi-sub { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

/* Pie institucional (Consolidado 3 columnas + Estándar GovTech) */
.footer { background: var(--ink); color: #94a3b8; padding: 3.5rem 0 2rem; font-size: 0.875rem; }
.footer strong { color: #fff; }
.footer-title { font-size: 1.05rem; }

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 2.5rem;
  align-items: start;
}

.footer-tel {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-tel:hover {
  color: #fca5a5;
}

.footer-links { list-style: none; margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.45rem; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #cbd5e1;
  transition: color 0.2s ease, transform 0.2s ease;
}
.footer-links a::after {
  content: "→";
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.footer-links a:hover {
  color: #fff;
  transform: translateX(4px);
}
.footer-links a:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.footer-staff {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #cbd5e1;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.footer-staff:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.footer-base { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #1e293b; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; font-size: 0.8rem; }

@media (max-width: 768px) {
  .nav { display: none; }
  .menu-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}
/* Cabeceras con acción, chips y notas */
.section-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.chip { padding: 0.5rem 0.85rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--bg-page); font-size: 0.85rem; }
.chip span { color: var(--text-muted); }
.fine-print { margin-top: 1.25rem; }

/* Disponibilidad de la flota */
.fleet-card { margin-top: 1.25rem; padding: 1.25rem 1.5rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-page); display: grid; gap: 0.9rem; }
.fleet-main { display: flex; align-items: center; gap: 0.9rem; }
.fleet-main > .icon { width: 2rem; height: 2rem; color: var(--red-primary); }
.fleet-total { font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.fleet-total small { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.fleet-bar { display: flex; height: 0.6rem; border-radius: var(--radius-pill); overflow: hidden; background: var(--border-subtle); }
.fleet-bar span { display: block; height: 100%; width: 0; background: var(--st); transition: width 0.6s ease; }
.fleet-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 0.85rem; color: var(--text-secondary); }
.fleet-legend li { display: flex; align-items: center; gap: 0.4rem; }
.fleet-legend b { color: var(--text-primary); }

/* Pasos del permiso (secuencia real) */
.permit { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: 2rem; }
.permit h3 { font-size: 1.4rem; font-weight: 800; margin-top: 0.5rem; }
.permit > p { color: #94a3b8; font-size: 0.9rem; margin-top: 0.35rem; }
.permit-steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.permit-steps li { display: flex; gap: 0.75rem; }
.permit-steps strong { display: block; }
.permit-steps p { font-size: 0.85rem; color: #94a3b8; }
.permit-ico { position: relative; width: 2.5rem; height: 2.5rem; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.1); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fca5a5; }
.permit-ico b { position: absolute; top: -0.4rem; right: -0.4rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--red-primary); color: #fff; font-size: 0.65rem; display: flex; align-items: center; justify-content: center; }

/* Modal: confirmación de solicitud */
.mb-md { margin-bottom: 1.1rem; }
.ok-pane { text-align: center; display: grid; gap: 0.75rem; justify-items: center; }
.ok-pane h3 { font-size: 1.3rem; font-weight: 800; }
.ok-icon { width: 3.5rem; height: 3.5rem; color: var(--st-ok); }
.ok-code-wrap { display: grid; gap: 0.6rem; justify-items: center; width: 100%; }
.ok-code { width: 100%; padding: 0.9rem; border: 2px dashed var(--red-primary); border-radius: var(--radius-md); background: var(--red-soft); color: var(--red-hover); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.5rem; font-weight: 800; letter-spacing: 0.05em; }
.ok-actions { justify-content: center; flex-wrap: wrap; }

@media (max-width: 520px) {
  .lg-only { display: none; }
  .sm-only { display: inline; }
}

/* Hero: texto + estado del servicio en vivo */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 3rem; align-items: center; }
.hero-status { background: var(--bg-page); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.5rem; }
.hero-status-title { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.hero-status .dot-live { background: var(--st-ok); animation-name: pulso-ok; }
@keyframes pulso-ok { 0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.5); } 70%, 100% { box-shadow: 0 0 0 0.5rem rgba(5, 150, 105, 0); } }
.hero-status ul { list-style: none; display: grid; gap: 1rem; margin-top: 1.1rem; }
.hero-status li { display: flex; align-items: center; gap: 0.85rem; }
.hero-status li > .icon { width: 2.5rem; height: 2.5rem; padding: 0.6rem; border-radius: var(--radius-sm); background: var(--red-soft); color: var(--red-primary); }
.hero-status b { display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.hero-status li span { font-size: 0.8rem; color: var(--text-muted); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 2rem; } }
