/* ============================================================
   MALAGA RESPONDE - Hoja de estilos principal
   Paleta extraída de la identidad visual oficial (logo/slider)
   ============================================================ */

:root {
  --navy: #013f89;
  --navy-deep: #012e6a;
  --blue: #0d91fe;
  --blue-light: #4fb3ff;
  --sky: #eaf4fc;
  --sky-soft: #f5f9fe;
  --orange: #ff7a02;
  --orange-light: #ffb100;
  --white: #ffffff;
  --ink: #16253a;
  --ink-soft: #4c5c72;
  --border: #dbe6f2;

  --cat-alertas: #ef4444;
  --cat-meteo: #38bdf8;
  --cat-forestal: #22a55e;
  --cat-eventos: #f59e0b;
  --cat-info: #ff7a02;
  --cat-campanas: #8b5cf6;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 26px;
  --shadow-sm: 0 4px 14px rgba(1, 63, 137, 0.08);
  --shadow-md: 0 12px 32px rgba(1, 63, 137, 0.14);
  --shadow-lg: 0 24px 60px rgba(1, 63, 137, 0.18);
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-weight: 800; line-height: 1.15; margin: 0 0 .5em; color: var(--navy); }
p { margin: 0 0 1em; color: var(--ink-soft); }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 14px;
}
.eyebrow::before { content: ''; width: 22px; height: 3px; border-radius: 2px; background: var(--orange); display: inline-block; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 28px; border-radius: 999px; font-weight: 700; font-size: 15.5px;
  border: none; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--navy)); color: #fff; box-shadow: 0 10px 26px rgba(13, 145, 254, .35); }
.btn-primary:hover { box-shadow: 0 14px 34px rgba(13, 145, 254, .45); transform: translateY(-2px); }
.btn-orange { background: linear-gradient(135deg, var(--orange-light), var(--orange)); color: #fff; box-shadow: 0 10px 26px rgba(255, 122, 2, .35); }
.btn-orange:hover { box-shadow: 0 14px 34px rgba(255, 122, 2, .45); transform: translateY(-2px); }
.btn-outline { background: #fff; color: var(--navy); border: 2px solid var(--border); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-ghost { background: rgba(255,255,255,.15); color: #fff; border: 2px solid rgba(255,255,255,.6); backdrop-filter: blur(2px); }
.btn-block { width: 100%; }
.btn-sm { padding: 10px 18px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 42px; width: auto; }
.main-nav { display: flex; align-items: center; gap: 30px; }
.main-nav a { font-weight: 600; color: var(--navy); font-size: 15px; }
.main-nav a:hover { color: var(--blue); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; background: none; border: none; font-size: 26px; color: var(--navy); cursor: pointer; }

/* ---------------- Hero / Slider ---------------- */
.hero-slider { position: relative; background: var(--navy); overflow: hidden; }
.hero-slider-link { display: block; cursor: pointer; }
.hero-slider-link:focus-visible { outline: 3px solid var(--orange); outline-offset: -3px; }
.hero-slide { display: block; width: 100%; height: auto; transition: transform .5s ease, filter .5s ease; }
.hero-slider-link:hover .hero-slide { transform: scale(1.015); filter: brightness(1.03); }
.hero-caption-mobile { display: none; }

/* ---------------- Hero real (HTML) ---------------- */
.hero {
  background: radial-gradient(circle at 15% 20%, #eaf4fc 0%, #ffffff 45%), var(--sky-soft);
  padding: 76px 0 90px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -2px; height: 90px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 120" preserveAspectRatio="none"><path d="M0,60 C240,120 480,0 720,40 C960,80 1200,20 1440,60 L1440,120 L0,120 Z" fill="%23eaf4fc"/></svg>') bottom / cover no-repeat;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; align-items: center; position: relative; z-index: 2; }
.hero h1 { font-size: clamp(30px, 4vw, 46px); }
.hero h1 .accent { color: var(--blue); }
.hero .lead { font-size: 18px; max-width: 520px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 26px; }
.hero-trust { display: flex; gap: 22px; margin-top: 34px; flex-wrap: wrap; }
.hero-trust div { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--navy); font-size: 14px; }
.hero-trust svg { color: var(--blue); flex: none; }

.phone-mock {
  position: relative; margin-left: auto; width: 300px; max-width: 100%;
  background: #0b1220; border-radius: 40px; padding: 14px; box-shadow: var(--shadow-lg);
}
.phone-mock .screen { background: #fff; border-radius: 28px; overflow: hidden; }
.phone-mock .status { display: flex; justify-content: space-between; padding: 10px 18px 0; font-size: 11px; color: #94a3b8; font-weight: 700; }
.phone-mock .top { padding: 18px 18px 14px; text-align: center; border-bottom: 1px solid var(--border); }
.phone-mock .top img { height: 46px; margin: 0 auto 6px; }
.phone-mock .top .small { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.phone-menu { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.phone-menu .item { display: flex; align-items: center; gap: 12px; background: #f6f9fd; border-radius: 14px; padding: 10px 12px; font-weight: 700; font-size: 13px; color: var(--navy); }
.phone-menu .icon { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.push-toast {
  position: absolute; top: -18px; right: -34px; background: #fff; border-radius: 16px; box-shadow: var(--shadow-md);
  padding: 12px 14px; width: 210px; display: flex; gap: 10px; align-items: flex-start;
  animation: floaty 3.5s ease-in-out infinite;
}
.push-toast .dot { width: 30px; height: 30px; border-radius: 50%; background: var(--cat-alertas); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.push-toast strong { font-size: 12.5px; color: var(--navy); display: block; }
.push-toast span { font-size: 11.5px; color: var(--ink-soft); }
@keyframes floaty { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-8px);} }

/* ---------------- Categorías ---------------- */
.section { padding: 84px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.cat-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 26px 16px; text-align: center; transition: transform .2s ease, box-shadow .2s ease;
}
.cat-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: transparent; }
.cat-icon { width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; color: #fff; }
.cat-card h4 { font-size: 14.5px; margin: 0; color: var(--navy); }

/* ---------------- Cómo funciona ---------------- */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.step-card { background: var(--sky-soft); border-radius: var(--radius-md); padding: 32px 26px; position: relative; }
.step-num {
  width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--navy));
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 18px;
}

/* ---------------- Comunidad / stats ---------------- */
.community { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%); color: #fff; position: relative; overflow: hidden; }
.community::before {
  content: ''; position: absolute; inset: 0; opacity: .18; pointer-events: none;
  background: radial-gradient(circle at 80% 20%, var(--orange) 0, transparent 45%), radial-gradient(circle at 10% 90%, var(--blue-light) 0, transparent 40%);
}
.community h2 { color: #fff; }
.community p { color: rgba(255,255,255,.8); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 40px; position: relative; z-index: 2; }
.stat-card { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius-md); padding: 26px; text-align: center; }
.stat-card .num { font-size: 34px; font-weight: 800; color: #fff; }
.stat-card .lbl { font-size: 13.5px; color: rgba(255,255,255,.75); font-weight: 600; margin-top: 6px; }

/* ---------------- Distritos ---------------- */
.districts-wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.district-chip {
  border: 1px solid var(--border); border-radius: 999px; padding: 12px 18px; font-weight: 700; font-size: 13.5px;
  color: var(--navy); background: #fff; display: flex; align-items: center; gap: 10px;
}
.district-chip .n { width: 26px; height: 26px; border-radius: 50%; background: var(--sky); color: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }

/* ---------------- CTA final ---------------- */
.cta-final { background: linear-gradient(120deg, var(--orange-light), var(--orange)); border-radius: var(--radius-lg); padding: 56px 40px; text-align: center; color: #fff; position: relative; overflow: hidden; }
.cta-final h2 { color: #fff; }
.cta-final p { color: rgba(255,255,255,.92); }

/* ---------------- Footer ---------------- */
.site-footer { background: #061a33; color: rgba(255,255,255,.75); padding: 60px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 34px; }
.site-footer h5 { color: #fff; font-size: 14px; margin-bottom: 16px; text-transform: uppercase; letter-spacing: .05em; }
.site-footer a { color: rgba(255,255,255,.7); font-size: 14px; }
.site-footer a:hover { color: var(--orange-light); }
.footer-logo { height: 40px; margin-bottom: 14px; filter: brightness(0) invert(1); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 40px; padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 12.5px; }

/* ============================================================
   FORMULARIO DE ALTA (wizard multi-paso)
   ============================================================ */
.form-page { background: var(--sky-soft); min-height: 100vh; padding-bottom: 60px; }
.form-shell { max-width: 780px; margin: 0 auto; padding: 34px 20px 0; }
.form-card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 40px; }
.progress-track { display: flex; align-items: center; gap: 6px; margin-bottom: 34px; }
.progress-step { flex: 1; height: 6px; border-radius: 4px; background: var(--border); transition: background .3s ease; }
.progress-step.active, .progress-step.done { background: linear-gradient(90deg, var(--blue), var(--navy)); }
.progress-labels { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .03em; }
.progress-labels span.on { color: var(--blue); }

/* En pantallas estrechas, 6 etiquetas en una fila no caben: mostramos solo el paso activo, centrado. */
@media (max-width: 640px) {
  .progress-labels { justify-content: center; }
  .progress-labels span { display: none; }
  .progress-labels span.current { display: block; font-size: 12.5px; color: var(--blue); }
}

.wizard-step { display: none; animation: fadein .35s ease; }
.wizard-step.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: translateY(0);} }

.step-title { font-size: 22px; margin-bottom: 4px; }
.step-sub { color: var(--ink-soft); margin-bottom: 26px; font-size: 14.5px; }

.profile-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 8px; }
.profile-opt { border: 2px solid var(--border); border-radius: var(--radius-md); padding: 22px 14px; text-align: center; cursor: pointer; transition: all .18s ease; }
.profile-opt:hover { border-color: var(--blue-light); }
.profile-opt.selected { border-color: var(--blue); background: var(--sky); box-shadow: 0 6px 18px rgba(13,145,254,.18); }
.profile-opt .ic { font-size: 30px; margin-bottom: 10px; }
.profile-opt h4 { margin: 0 0 4px; font-size: 15px; color: var(--navy); }
.profile-opt p { margin: 0; font-size: 12.5px; }

.form-group { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: block; font-weight: 700; font-size: 13.5px; color: var(--navy); margin-bottom: 7px; }
label .req { color: var(--orange); }
input[type=text], input[type=email], input[type=tel], input[type=search], select, textarea {
  width: 100%; padding: 13px 15px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  font-family: inherit; font-size: 15px; color: var(--ink); background: #fbfdff; transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(13,145,254,.14); background: #fff; }
.hint { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.error-msg { font-size: 12.5px; color: #dc2626; margin-top: 6px; display: none; font-weight: 600; }
.form-group.has-error input, .form-group.has-error select { border-color: #dc2626; }
.form-group.has-error .error-msg { display: block; }

.repeater-block { border: 1.5px dashed var(--border); border-radius: var(--radius-md); padding: 18px; margin-bottom: 14px; position: relative; background: #fbfdff; }
.repeater-block .remove-btn { position: absolute; top: 10px; right: 10px; background: #fff; border: 1px solid var(--border); color: #dc2626; border-radius: 50%; width: 28px; height: 28px; cursor: pointer; font-weight: 700; line-height: 1; }
.add-more-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--sky); color: var(--blue); border: none; border-radius: 999px; padding: 11px 20px; font-weight: 700; cursor: pointer; font-size: 13.5px; }
.add-more-btn:hover { background: #ddeeff; }
.badge-tag { display: inline-block; background: var(--sky); color: var(--navy); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }

.checkbox-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; cursor: pointer; }
.checkbox-row:hover { border-color: var(--blue-light); }
.checkbox-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
.checkbox-row .txt strong { display: block; font-size: 14px; color: var(--navy); }
.checkbox-row .txt span { font-size: 12.5px; color: var(--ink-soft); }

.pref-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pref-card { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.pref-card input { width: 18px; height: 18px; accent-color: var(--blue); }
.pref-card .ic { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; flex: none; font-size: 15px; }
.pref-card span { font-weight: 700; font-size: 13.5px; color: var(--navy); }
.pref-card.checked { border-color: var(--blue); background: var(--sky); }

.consent-box { background: var(--sky-soft); border-radius: var(--radius-md); padding: 20px; font-size: 13px; color: var(--ink-soft); margin-bottom: 20px; max-height: 160px; overflow-y: auto; }

.wizard-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; }

.success-screen { text-align: center; padding: 30px 10px; }
.success-icon { width: 92px; height: 92px; border-radius: 50%; background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 22px; font-size: 42px; box-shadow: 0 14px 34px rgba(34,197,94,.35); animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(.5); opacity: 0;} 70% { transform: scale(1.08);} 100% { transform: scale(1); opacity: 1;} }
.success-screen h2 { font-size: 26px; }

.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; }

/* ---------------- Toast global ---------------- */
.toast-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14px; font-weight: 600; display: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .phone-mock { margin: 0 auto; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .steps-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .districts-wrap { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .profile-options { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .main-nav { display: none; }
  .nav-toggle { display: block; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 26px 18px; }
  .pref-grid { grid-template-columns: 1fr; }
}
