/* =========================================================
   FEDE-MUNICIPIOS — Hoja de estilos principal
   Paleta: blanco + azul oscuro (educativo, sobrio, legal)
   ========================================================= */

:root {
  --primary: #0a2540;        /* azul oscuro profundo */
  --primary-700: #103256;
  --primary-500: #1e4d8c;    /* azul medio */
  --accent: #2563eb;         /* azul brillante (acentos/CTAs) */
  --accent-hover: #1d4ed8;
  --whatsapp: #25D366;
  --whatsapp-hover: #1ebe5d;
  --bg: #ffffff;
  --bg-soft: #f6f9fc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-soft: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #ea580c;
  --shadow-sm: 0 1px 2px rgba(10, 37, 64, 0.06);
  --shadow-md: 0 6px 18px rgba(10, 37, 64, 0.08);
  --shadow-lg: 0 14px 40px rgba(10, 37, 64, 0.14);
  --radius: 10px;
  --radius-lg: 16px;
  --max-w: 1200px;
}

/* ---------- Reset y base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary); }

h1, h2, h3, h4 { color: var(--primary); line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: .8rem; }
h3 { font-size: 1.3rem; margin-bottom: .6rem; }
p { margin-bottom: 1rem; color: var(--text-soft); }

ul, ol { margin: 0 0 1rem 1.2rem; color: var(--text-soft); }
li { margin-bottom: .35rem; }

/* ---------- Layout ---------- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; }
.section-tight { padding: 2.5rem 0; }
.section-soft { background: var(--bg-soft); }

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; gap: 1.5rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .75rem; color: #fff; }
.brand:hover { color: #fff; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 1.2rem;
}
.brand-text { line-height: 1.1; }
.brand-text strong { display: block; font-size: 1.05rem; letter-spacing: .3px; }
.brand-text small { color: #cbd5e1; font-size: .78rem; }

.nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.nav a {
  color: #e2e8f0;
  padding: .55rem .9rem;
  border-radius: 8px;
  font-size: .94rem;
  font-weight: 500;
  transition: background .2s, color .2s;
}
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav a.active { background: var(--accent); color: #fff; }

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  padding: .5rem .8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
}

/* ---------- Hero / Carrusel ---------- */
.hero {
  position: relative;
  min-height: 540px;
  color: #fff;
  overflow: hidden;
}
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  background-size: cover;
  background-position: center;
}
.hero-slide.active { opacity: 1; }
.hero-slide::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(10,37,64,.85), rgba(10,37,64,.55));
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 5rem 0;
  max-width: 800px;
}
.hero-content .pill {
  display: inline-block;
  background: rgba(37, 99, 235, .25);
  border: 1px solid rgba(96,165,250,.4);
  color: #bfdbfe;
  padding: .35rem .8rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .5px;
  margin-bottom: 1rem;
}
.hero-content h1 { color: #fff; margin-bottom: 1rem; }
.hero-content p { color: #dbeafe; font-size: 1.1rem; max-width: 720px; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }

.hero-dots {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 3;
}
.hero-dots .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,.4);
  cursor: pointer; border: 0;
}
.hero-dots .dot.active { background: #fff; width: 28px; border-radius: 999px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: .98rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  justify-content: center;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-outline { background: transparent; color: #fff; border-color: #fff; }
.btn-outline:hover { background: #fff; color: var(--primary); }
.btn-ghost { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-ghost:hover { background: var(--primary-700); color: #fff; }
.btn-wa { background: var(--whatsapp); color: #fff; border-color: var(--whatsapp); }
.btn-wa:hover { background: var(--whatsapp-hover); border-color: var(--whatsapp-hover); color: #fff; }
.btn-sm { padding: .55rem 1rem; font-size: .88rem; }

/* ---------- Tarjetas / Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.card-img {
  height: 180px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.card-img::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.25) 100%);
}
.card-body { padding: 1.5rem; }
.card-body h3 { color: var(--primary); margin-bottom: .6rem; }
.card-body p { font-size: .95rem; color: var(--text-soft); margin-bottom: 1rem; }
.card-link {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--accent); font-weight: 600; font-size: .92rem;
}
.card-link:hover { color: var(--primary); }

/* ---------- Bloques de color ---------- */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.feature.reverse { direction: rtl; }
.feature.reverse > * { direction: ltr; }
.feature-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.feature-img img { width: 100%; height: 360px; object-fit: cover; }
.feature-text h2 { margin-bottom: 1rem; }
.feature-text ul { margin-top: 1rem; }
.feature-text ul li::marker { color: var(--accent); }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1.5rem; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th { background: var(--primary); color: #fff; text-align: left; padding: .9rem 1rem; font-weight: 600; }
td { padding: .85rem 1rem; border-top: 1px solid var(--border); color: var(--text-soft); }
tr:nth-child(even) td { background: var(--bg-soft); }

/* ---------- Cajas de alerta ---------- */
.callout {
  border-left: 5px solid var(--accent);
  background: #eff6ff;
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}
.callout.warn { border-color: var(--warning); background: #fff7ed; }
.callout.danger { border-color: var(--danger); background: #fef2f2; }
.callout.success { border-color: var(--success); background: #f0fdf4; }
.callout strong { color: var(--primary); display: block; margin-bottom: .35rem; }
.callout p { color: var(--text); margin: 0; }

/* ---------- Stepper ---------- */
.stepper {
  display: grid;
  gap: 1.2rem;
  margin: 2rem 0;
}
.step {
  display: flex;
  gap: 1.2rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
  position: relative;
  transition: border-color .25s, transform .25s;
}
.step:hover { border-color: var(--accent); transform: translateX(4px); }
.step-num {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 1.1rem;
}
.step-body h4 { color: var(--primary); margin-bottom: .3rem; }
.step-body p { color: var(--text-soft); font-size: .95rem; margin: 0; }

/* ---------- Plantilla / Modelo de petición ---------- */
.template {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 1.5rem;
  font-family: 'Courier New', monospace;
  font-size: .88rem;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ---------- Formulario de contacto ---------- */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block; margin-bottom: .4rem;
  font-weight: 600; color: var(--primary); font-size: .92rem;
}
.form-control {
  width: 100%;
  padding: .8rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
textarea.form-control { min-height: 140px; resize: vertical; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--primary);
  color: #cbd5e1;
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-grid h4 { color: #fff; margin-bottom: 1rem; font-size: 1rem; }
.footer-grid p, .footer-grid a { color: #cbd5e1; font-size: .9rem; }
.footer-grid ul { list-style: none; padding: 0; }
.footer-grid li { margin-bottom: .5rem; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem;
  font-size: .85rem;
}
.footer-bottom a { color: #93c5fd; }

/* ---------- Banner de Políticas (cookies) ---------- */
.policy-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--primary);
  color: #fff;
  padding: 1.4rem 1.5rem;
  z-index: 9999;
  box-shadow: 0 -8px 30px rgba(0,0,0,.25);
  border-top: 4px solid var(--accent);
  display: none; /* se muestra por JS en cada carga */
}
.policy-banner-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.policy-banner p {
  flex: 1;
  margin: 0;
  color: #e2e8f0;
  font-size: .95rem;
}
.policy-banner p strong { color: #fff; }
.policy-banner-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.policy-banner button.accept, .policy-banner button.reject {
  padding: .7rem 1.3rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: .92rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s;
}
.policy-banner button.accept {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.policy-banner button.accept:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.policy-banner button.reject {
  background: transparent; color: #cbd5e1; border-color: rgba(255,255,255,.3);
}
.policy-banner button.reject:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ---------- Botón flotante WhatsApp ---------- */
.wa-float {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--whatsapp);
  color: #fff;
  width: 64px; height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 24px rgba(37, 211, 102, .5);
  z-index: 9998;
  transition: transform .25s, box-shadow .25s;
  text-decoration: none;
}
.wa-float:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 30px rgba(37, 211, 102, .6);
  color: #fff;
}
.wa-float svg { width: 34px; height: 34px; }

.wa-tooltip {
  position: fixed;
  bottom: 100px; right: 24px;
  background: #fff;
  color: var(--text);
  padding: .8rem 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-size: .85rem;
  max-width: 260px;
  z-index: 9997;
  border: 1px solid var(--border);
}
.wa-tooltip::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 22px;
  width: 16px; height: 16px;
  background: #fff;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
}
.wa-tooltip strong { color: var(--primary); display: block; margin-bottom: .2rem; }
.wa-tooltip small { color: var(--text-muted); }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  background: var(--bg-soft);
  padding: .9rem 0;
  font-size: .88rem;
  border-bottom: 1px solid var(--border);
}
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; margin: 0; padding: 0; gap: .4rem; }
.breadcrumb li { color: var(--text-muted); }
.breadcrumb li:not(:last-child)::after { content: '/'; margin-left: .5rem; color: var(--border-strong); }
.breadcrumb a { color: var(--accent); }
.breadcrumb a:hover { color: var(--primary); }

/* ---------- Página de inicio: secciones rápidas ---------- */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
  margin-top: 1.5rem;
}
.quick-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: border-color .2s, transform .2s;
}
.quick-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.quick-card .icon {
  width: 48px; height: 48px;
  background: #eff6ff;
  color: var(--accent);
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 1.4rem;
  margin-bottom: .9rem;
}
.quick-card h3 { color: var(--primary); margin-bottom: .4rem; font-size: 1.05rem; }
.quick-card p { font-size: .9rem; margin-bottom: .8rem; }

/* ---------- Util ---------- */
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.badge {
  display: inline-block;
  background: #eff6ff;
  color: var(--accent);
  font-size: .75rem;
  font-weight: 600;
  padding: .25rem .7rem;
  border-radius: 999px;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.divider {
  height: 1px; background: var(--border); margin: 2rem 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .feature { grid-template-columns: 1fr; gap: 1.5rem; }
  .feature.reverse { direction: ltr; }
  .feature-img img { height: 240px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav { display: none; width: 100%; flex-direction: column; padding-top: 1rem; }
  .nav.open { display: flex; }
  .nav a { width: 100%; }
  .menu-toggle { display: inline-flex; }
  .hero-content { padding: 3rem 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .policy-banner-inner { flex-direction: column; align-items: stretch; }
  .policy-banner-actions { width: 100%; }
  .policy-banner-actions button { flex: 1; }
  .wa-float { width: 56px; height: 56px; }
}
