/* evacu.app — mobile-first wildfire readiness & alert PWA.
   Palette, type and shapes match the designer's V2 (Evacuapp-standalone). */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 600;   /* la fuente es variable 100-900; abrimos hasta el 300 */
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 300 600;   /* la fuente es variable 100-900; abrimos hasta el 300 */
  font-display: swap;
  src: url('fonts/inter-latin-italic.woff2') format('woff2');
}

:root {
  /* Paleta evacu.app (nombres acordados 07/2026). Los iconos SVG dibujados
     desde JavaScript (map.js, map-shared.js, common.js) llevan estos mismos
     valores escritos a mano: si cambias un color aquí, cámbialo también allí. */
  --crema:          #F1E8DC;   /* fondo base de la app, textos sobre verde */
  --arena:          #D6C1AB;   /* tarjetas beige, líneas divisorias y bordes de inputs */
  --hueso:          #FBF7F0;   /* tarjetas blanquecinas (Plan, desplegables) */
  --verde:          #00682D;   /* verde marca: cabecera, botones principales */
  --verde-oscuro:   #004A1E;   /* pestañas inactivas, subpáginas, CTA secundarios */
  --verde-vivo:     #00A13E;   /* guardar / completado / consentimiento */
  --naranja-aviso:  #F08F00;   /* simulacro, humo, preparación incompleta */
  --rojo-fuego:     #EB1600;   /* peligro / fuego */
  --rojo-oscuro:    #B81200;   /* :active de los botones rojos */
  --azul-hidrante:  #0065F4;   /* hidrante y geolocalización */
  --marron-claro:   #744C39;   /* texto secundario, ruta del mapa, acentos */
  --marron-oscuro:  #310C03;   /* texto principal, fondo barra de progreso */

  --r-pill: 20px;          /* buttons, inputs, status pill */
  --r-card: 20px;          /* cards, maps, modals */
  --btn-h:  50px;          /* standard button height */
}

* { box-sizing: border-box; }

/* Foco por teclado: anillo verde vivo de 2px en toda la app
   (sustituye al borde blanco/amarillo por defecto del navegador). */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--verde) !important; outline-offset: 0 !important; }
/* En controles con borde rojo, el anillo de foco adopta ese mismo color:
   se lee como un engrosado del borde y evita el choque verde/rojo. */
.fire-dialog-select:focus-visible,
.eval-going:focus-visible,
.btn-outline:focus-visible { outline-color: var(--rojo-fuego) !important; }

/* ---------- button press feedback (designer spec) ---------- */

button, .btn { transition: transform .15s, box-shadow .15s; }
button:active, .btn:active {
  box-shadow: inset 0 0 0 1000px rgba(49, 12, 3, .15);
  transform: scale(.94);
}
button.no-feedback:active, .no-feedback:active { box-shadow: none !important; }
button.no-scale:active, .no-scale:active { transform: none !important; }

@keyframes spinIn { from { transform: rotate(180deg); } to { transform: rotate(0deg); } }
@keyframes evacPulse {
  0%, 100% { background: var(--verde-oscuro); }
  50% { background: var(--verde-vivo); }
}
@keyframes evacBlink {
  0%, 100% { background: var(--rojo-fuego); color: var(--crema); border-color: var(--rojo-fuego); }
  50% { background: transparent; color: var(--rojo-fuego); border-color: var(--rojo-fuego); }
}

html { font-size: 16px; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--crema);
  color: var(--marron-oscuro);
  line-height: 1.45;
  padding-bottom: 96px;   /* room for the fixed fire bar */
}

body[data-lang="es"] .only-en { display: none !important; }
body[data-lang="en"] .only-es { display: none !important; }

main {
  padding: 4px 20px 24px;
  max-width: 760px;
  margin: 0 auto;
}

h2 { font-size: 1.75rem; margin: 16px 0; font-weight: 400; }    /* títulos de sección: 16px arriba y abajo, igual en toda la app */
h3 { font-size: 1.25rem; font-weight: 600; }

.divider { height: 2px; background: var(--arena); border: none; margin: 20px 0 4px; }

/* ---------- header ---------- */

/* Sticky block: logo row + alert banner + tabs + cream strip. The logo row
   collapses from 100px to 70px after scrolling 50px down (expands again only
   near the top — hysteresis, like the designer's prototype). */
.app-top {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--verde);
}
.hdr-top {
  position: relative;
  height: 100px;
  transition: height .25s ease;
  overflow: hidden;
}
.app-top.scrolled .hdr-top { height: 70px; }

.hdr-logo {
  position: absolute; left: 0; top: 0;
  width: 100px; height: 100px;
  color: var(--crema);
  transform-origin: 50% 0;
  transition: transform .25s ease;
  cursor: pointer;
  background: none; border: none; padding: 0;
}
.app-top.scrolled .hdr-logo { transform: scale(.7); }
.hdr-logo svg { width: 100%; height: 100%; display: block; }

.wordmark {
  position: absolute; left: 100.5px; top: 38px;
  font-size: 22.59px; font-weight: 400;
  color: var(--crema);
  white-space: nowrap; user-select: none;
  transition: opacity .2s ease, transform .25s ease;
}
.lang-btn {
  position: absolute; right: 85.5px; top: 35px;
  width: 45px; height: 30px;
  background: var(--crema);
  color: var(--verde);
  border: none;
  border-radius: 15px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .2s ease, transform .25s ease;
}
.app-top.scrolled .wordmark,
.app-top.scrolled .lang-btn {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}
.icon-btn {
  position: absolute; right: 30px; top: 35px;   /* 30px del borde derecho */
  background: transparent;
  border: none;
  color: var(--crema);
  cursor: pointer;
  padding: 0;
  width: 30px; height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: top .25s ease;
}
.app-top.scrolled .icon-btn { top: 22.5px; }
.icon-btn svg { width: 30px; height: 30px; }

/* cream strip under the tabs, so content slides beneath a rounded edge */
.nav-strip { height: 21px; margin-bottom: -1px; background: var(--crema); }

/* ---------- connected tab bar ---------- */

.app-nav {
  display: flex;
  background: var(--verde);
  padding: 0;
}
.app-nav a {
  flex: 1;
  text-align: center;
  color: var(--crema);
  text-decoration: none;
  padding: 14px 4px;
  font-size: 1.125rem;
  font-weight: 500;
  white-space: nowrap;
  background: var(--verde-oscuro);
  border-radius: var(--r-card) var(--r-card) 0 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-nav a.active {
  background: var(--crema);
  color: var(--verde);
}
.app-nav a:active { box-shadow: inset 0 0 0 1000px rgba(49, 12, 3, .15); }

/* ---------- place title + status pill (map page) ---------- */

/* Primer titular de cada pestaña: menos aire arriba, igual en las cuatro */
main > h2:first-child { margin-top: 4px; }
.place-title { margin: 4px 0 12px; }   /* mismo margen superior que los títulos de Plan / Mi casa / Prepara */
.place-title h2 { margin: 0 0 6px; }
.place-sub { color: var(--marron-oscuro); font-size: 1rem; }

.status-pill {
  display: flex; align-items: center; justify-content: center;
  width: 100%;
  height: var(--btn-h);            /* 50px: altura estándar de botón en toda la app */
  text-align: center;
  font-size: 1.25rem;
  font-weight: 400;
  padding: 0 20px;
  border-radius: var(--r-pill);
  margin: 12px 0;
  border: 2px solid transparent;
}
.status-none      { color: var(--verde-vivo); border-color: var(--verde-vivo); background: transparent; }
.status-drill     { color: var(--naranja-aviso);    border-color: var(--naranja-aviso);    background: transparent; }
.status-smoke     { color: var(--naranja-aviso);    border-color: var(--naranja-aviso);    background: transparent; }
.status-small     { color: var(--naranja-aviso);    border-color: var(--naranja-aviso);    background: transparent; }
.status-sighted   { color: var(--rojo-fuego);       border-color: var(--rojo-fuego);       background: transparent; }
.status-confirmed {
  color: var(--crema); border-color: var(--rojo-fuego); background: var(--rojo-fuego);
  /* sin parpadeo: fill fijo */
}

/* "Puntos de encuentro" collapsible pill (appears during a fire) */
.meet-pill {
  border-radius: var(--r-pill);
  background: var(--verde-oscuro);
  overflow: hidden;
  margin: 12px 0;
}
.meet-pill-btn {
  width: 100%;
  min-height: var(--btn-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  border: none; cursor: pointer;
  background: none;
  color: var(--crema);
  font-size: 1.25rem; font-weight: 500; font-family: inherit;
  /* mismo ritmo que "Evalúa tu evacuación": cada color dura 1 s (ciclo 2 s) */
  animation: evacPulse 2s ease-in-out infinite;
}
.meet-pill.open .meet-pill-btn { animation: none; background: var(--verde-vivo); }
.meet-pill-label { display: flex; align-items: center; gap: 12px; }
.meet-pill-label svg { flex-shrink: 0; }
.meet-arrow { transition: transform .3s ease; transform: rotate(180deg); }
.meet-pill.open .meet-arrow { transform: rotate(0deg); }
.meet-rows { display: flex; flex-direction: column; border-top: 2px solid var(--crema); }
.meet-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  color: var(--crema); text-decoration: none; cursor: pointer;
  background: var(--verde);
  border-bottom: 2px solid var(--crema);
  transition: background .15s;
}
.meet-row:last-child { border-bottom: none; }
.meet-row:hover { background: var(--verde-oscuro); }
.meet-row-label { font-size: 1.0625rem; font-weight: 600; }
.meet-row-sub { font-size: .875rem; margin-top: 2px; }
.meet-maps {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  background: var(--verde-vivo);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: .8125rem; font-weight: 500; white-space: nowrap;
}

/* "Ahora evalúa y actúa" modal */
.overlay-tan { background: rgba(214, 193, 171, .9); }
/* Modal "Ahora evalúa y actúa": separaciones de 20px en toda la columna */
.eval-title { display: flex; align-items: center; gap: 10px; font-size: 1.375rem; font-weight: 400; margin: 0 0 20px; }
.eval-title svg { flex-shrink: 0; }
.eval-warn { font-size: 1rem; font-style: italic; color: var(--rojo-fuego); line-height: 1.4; margin: 0 0 20px; }
.eval-body { font-size: 1rem; line-height: 1.4; margin: 0 0 20px; }
.eval-note { font-size: 1rem; font-style: italic; color: var(--verde); line-height: 1.4; margin: 0 0 20px; }
#eval-dialog .eval-wa-note { margin: 0 0 20px; }   /* gana a la regla .help */
/* Texto del botón "Confirmo mi plan": fundido al cambiar de texto */
#eval-confirm span { transition: opacity .25s ease; }
#eval-confirm span.txt-fade { opacity: 0; }

/* Desplegable visual del "Voy a..." (excepción exclusiva de este modal) */
.eval-going-wrap { position: relative; margin: 0 0 20px; }
.eval-going-btn {
  width: 100%; height: var(--btn-h); box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 2px solid var(--rojo-fuego); border-radius: var(--r-pill);
  background: transparent; color: var(--marron-oscuro);
  font-size: 1.125rem; font-family: inherit; padding: 0 16px;
  cursor: pointer; text-align: left;
}
.eval-going-btn:focus-visible { outline-color: var(--rojo-fuego) !important; }
.eval-going-btn svg { flex-shrink: 0; transition: transform .35s cubic-bezier(.65,0,.35,1); }
.eval-going-btn.open svg { transform: rotate(180deg); }
.eval-going-menu {
  display: none;
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  background: var(--hueso);
  border: 2px solid var(--arena); border-radius: var(--r-card);
  overflow: hidden; z-index: 10;
}
.eval-going-menu.open { display: block; }
.eval-going-menu button {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: none; border: none; cursor: pointer; text-align: left;
  font-family: inherit; font-size: 1.125rem; font-weight: 600; color: var(--marron-oscuro);
  border-bottom: 2px solid var(--marron-oscuro);
}
.eval-going-menu button:last-child { border-bottom: none; }
.eval-going-menu button:active { background: rgba(49, 12, 3, .08); }
.eval-going-menu button svg { flex-shrink: 0; }
.eval-going-menu .eval-opt-warn span { color: var(--naranja-aviso); }
/* "Avisar por Whatsapp": outline en verde vivo; el icono (currentColor) lo sigue */
#eval-wa { color: var(--verde-vivo); border-color: var(--verde-vivo); }
#eval-wa:active { color: #008935; border-color: #008935; }
#eval-wa .wa-ico { width: 24px; height: 24px; }   /* icono mayor sin tocar los 50px del botón */
#eval-dialog .box .fire-dialog-select { height: var(--btn-h); margin: 0 0 20px; }
/* Icono vectorial de WhatsApp dentro de los botones (hereda el color crema) */
.wa-ico { vertical-align: -4px; margin-right: 8px; flex-shrink: 0; }
/* Acceso de coordinadores: 20px entre el campo de código y "Entrar" */
#coord-login .btn { margin-top: 20px; }

/* Botones del modal a 50px exactos y 20px de separación, como en VEO FUEGO */
#eval-dialog .box .btn, #eval-dialog .box a.btn {
  height: var(--btn-h); min-height: 0;
  margin: 0 0 20px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 15px;
}
.eval-going {
  width: 100%; min-height: var(--btn-h);
  border: 2px solid var(--rojo-fuego); border-radius: var(--r-pill);
  /* background-color (no el shorthand): así no se pierde la flechita del select */
  background-color: transparent; color: var(--marron-oscuro);
  font-size: 1.125rem; font-family: inherit;
  padding: 0 16px;
}

/* Blinking "Evalúa tu evacuación" call-to-action during an alert */
.evac-cta {
  display: none;
  width: 100%;
  height: var(--btn-h);              /* 50px: altura estándar de botón */
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--rojo-fuego);
  border-radius: var(--r-pill);
  font-size: 1.25rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  margin: 12px 0;
  padding: 0 12px;
  /* cada color dura 1 s (ciclo de 2 s), al mismo ritmo que "Puntos de encuentro" */
  animation: evacBlink 2s ease-in-out infinite;
}
.evac-cta.show { display: flex; }
@keyframes evacBlink {
  0%, 100% { background: var(--rojo-fuego); color: var(--crema); }
  50%      { background: transparent; color: var(--rojo-fuego); }
}
@media (prefers-reduced-motion: reduce) {
  .evac-cta { animation: none; background: var(--rojo-fuego); color: var(--crema); }
}

/* ---------- forms ---------- */

label { display: block; font-weight: 400; font-size: 1rem; margin: 16px 0 8px; }
.help { font-weight: 400; font-size: .875rem; color: var(--marron-oscuro); margin: 2px 0 8px; font-style: italic; }
.house-note { font-style: italic; color: var(--verde); margin: 6px 0; }
.house-required { color: var(--rojo-fuego); font-style: italic; margin: 6px 0 0; }

input[type="text"], input[type="tel"], input[type="number"],
input[type="password"], input[type="email"], select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1.125rem;
  padding: 12px 20px;
  border: 2px solid var(--arena);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--marron-oscuro);
  min-height: var(--btn-h);
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--verde); }
textarea { min-height: 96px; border-radius: var(--r-card); resize: none; }

/* Campo numérico: flechas propias siempre visibles, con el mismo chevrón que
   los desplegables de la app (las nativas del navegador quedan ocultas). */
.num-field { position: relative; }
.num-field input { padding-right: 52px; appearance: textfield; -moz-appearance: textfield; }
.num-field input::-webkit-inner-spin-button,
.num-field input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.num-steppers {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column;
}
.num-steppers button {
  background: none; border: none; padding: 0 4px; cursor: pointer;
  color: var(--marron-claro); display: flex; line-height: 0;
}
.num-steppers button:first-child { margin-bottom: -6px; }  /* flechas grandes y juntas */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23310C03' stroke-width='1.8' stroke-linecap='square' stroke-linejoin='miter' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px;
  padding-right: 46px;
}

/* House pickers ("Casa a editar" / "Selecciona tu casa") are green pills */
#house-select, #check-select {
  background-color: var(--verde);
  color: var(--crema);
  border-color: var(--verde);
  font-weight: 500;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23F1E8DC' stroke-width='1.8' stroke-linecap='square' stroke-linejoin='miter' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
}

/* Checkboxes propios (Final Icons/Checkboxes): "light" (verde vivo) por
   defecto en toda la app; variante "dark" (verde marca) para casos
   excepcionales añadiendo la clase chk-dark al input. */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 26px; height: 26px; flex-shrink: 0;
  margin: 0; padding: 0; border: none; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath fill='%2300A13E' d='M20,2c4.4112,0,8,3.5888,8,8v10c0,4.4112-3.5888,8-8,8h-10c-4.4112,0-8-3.5888-8-8v-10C2,5.5888,5.5888,2,10,2h10M20,0h-10C4.4772,0,0,4.4771,0,10v10c0,5.5229,4.4772,10,10,10h10c5.5228,0,10-4.4771,10-10v-10c0-5.5229-4.4772-10-10-10h0Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
input[type="checkbox"]:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Crect fill='%2300A13E' width='30' height='30' rx='10' ry='10'/%3E%3Cpolyline fill='none' stroke='%23F1E8DC' stroke-width='3' points='5.9364 15.2843 11.7893 21.1372 24.0636 8.8628'/%3E%3C/svg%3E"); }
input[type="checkbox"].chk-dark { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath fill='%2300682D' d='M20,2c4.4112,0,8,3.5888,8,8v10c0,4.4112-3.5888,8-8,8h-10c-4.4112,0-8-3.5888-8-8v-10C2,5.5888,5.5888,2,10,2h10M20,0h-10C4.4772,0,0,4.4771,0,10v10c0,5.5229,4.4772,10,10,10h10c5.5228,0,10-4.4771,10-10v-10c0-5.5229-4.4772-10-10-10h0Z'/%3E%3C/svg%3E"); }
input[type="checkbox"].chk-dark:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Crect fill='%2300682D' width='30' height='30' rx='10' ry='10'/%3E%3Cpolyline fill='none' stroke='%23F1E8DC' stroke-width='3' points='5.9364 15.2843 11.7893 21.1372 24.0636 8.8628'/%3E%3C/svg%3E"); }
input[type="radio"] { width: 26px; height: 26px; flex-shrink: 0; accent-color: var(--verde-vivo); }

.check-row {
  display: flex;
  align-items: center;        /* checkbox y texto centrados verticalmente */
  gap: 14px;
  padding: 16px 0;            /* más aire arriba y abajo en cada elemento */
  border-bottom: 2px solid var(--arena);
  font-size: 1rem;
}
.check-row label { margin: 0; font-weight: 400; line-height: 1.4; }
.radio-row { display: flex; gap: 18px; align-items: center; margin: 6px 0; }
.radio-row label { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; }

/* consent card (household form) */
.consent-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px; margin-top: 16px;
  border: 2px solid var(--verde-vivo); border-radius: var(--r-card);
  background: transparent;
}
.consent-card label { margin: 0; font-size: .94rem; color: var(--verde-vivo); line-height: 1.4; }

/* ---------- buttons ---------- */

.btn {
  display: block;
  width: 100%;
  font-size: 1.125rem;
  font-weight: 500;
  font-family: inherit;
  padding: 12px 15px;
  min-height: var(--btn-h);
  border-radius: var(--r-pill);
  border: none;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  margin: 10px 0;
}
/* Los botones sólidos llevan borde de 2px del mismo color que su fondo para
   que rendericen con el mismo tamaño que los inputs y botones outline. */
.btn-primary   { background: var(--verde); color: var(--crema); border: 2px solid var(--verde); }
.btn-save      { background: var(--verde-vivo); color: var(--crema); border: 2px solid var(--verde-vivo); }
.btn-deep      { background: var(--verde-oscuro); color: var(--crema); border: 2px solid var(--verde-oscuro); }
.btn-secondary { background: var(--arena); color: var(--marron-claro); border: 2px solid var(--arena); }
.btn-danger    { background: var(--rojo-fuego); color: var(--crema); border: 2px solid var(--rojo-fuego); }
/* Al pulsar, el borde se oscurece igual que el fill (base + 15% marrón oscuro,
   el mismo velo que aplica el box-shadow inset del :active genérico). */
.btn-primary:active       { border-color: #075A27; }
.btn-save:active          { border-color: #078B35; }
.btn-deep:active          { border-color: #07411A; }
.btn-secondary:active     { border-color: #BDA692; }
.btn-danger:active        { border-color: #CF1500; }
.btn-outline:active       { border-color: #CF1500; }
.btn-outline-green:active,
.btn-outline-deep:active  { border-color: #075A27; }
.btn-outline   { background: transparent; color: var(--rojo-fuego); border: 2px solid var(--rojo-fuego); }
.btn-outline-green { background: transparent; color: var(--verde); border: 2px solid var(--verde); }
.btn-outline-deep  { background: transparent; color: var(--verde); border: 2px solid var(--verde); }
.btn-giant {
  font-size: 1.25rem; min-height: var(--btn-h);
  display: flex; align-items: center; justify-content: center;
}

.msg-ok   { background: transparent; border: 2px solid var(--verde-vivo); color: var(--verde-vivo); padding: 12px; border-radius: var(--r-pill); margin: 10px 0; font-weight: 500; text-align: center; }
.msg-err  { background: var(--crema); border: 2px solid var(--rojo-fuego); color: var(--rojo-fuego); padding: 12px; border-radius: var(--r-pill); margin: 10px 0; font-weight: 500; text-align: center; }
.msg-info { background: var(--hueso); border: 2px solid var(--naranja-aviso); color: var(--marron-oscuro); padding: 12px; border-radius: var(--r-card); margin: 10px 0; }
.field-err { font-size: .875rem; font-style: italic; color: var(--rojo-fuego); margin: 6px 0 0 4px; }

.adult-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.adult-row input { flex: 1; min-width: 0; }
.adult-row .remove-adult {
  background: var(--arena); border: 2px solid var(--marron-claro); border-radius: 10px;
  min-width: 48px; min-height: 48px; font-size: 1.3rem; cursor: pointer;
}

/* ---------- maps ---------- */

#map, #form-map, #fire-map, #coord-map {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  border: none;
  border-radius: var(--r-card);
  background: var(--arena);
  position: relative;
  z-index: 0;
  margin-top: 20px;   /* 20px entre el texto de arriba y el mapa */
}
#fire-map { aspect-ratio: auto; height: 240px; }

.map-eye {
  position: absolute;
  top: 20px; right: 20px;
  z-index: 500;
  width: 30px; height: 30px;
  border: none; border-radius: 0;
  overflow: hidden; padding: 0;
  background: none; color: var(--crema);
  font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.map-wrap { position: relative; }

/* "locate me" button — bottom-left of every map, 20px from the edges */
.locate-btn {
  position: absolute;
  bottom: 20px; left: 20px;
  z-index: 500;
  width: 30px; height: 30px;
  border: none; border-radius: 0;
  overflow: hidden; padding: 0;
  background: none; color: var(--crema);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.locate-btn.busy svg { animation: locSpin 1s linear infinite; }
@keyframes locSpin { to { transform: rotate(360deg); } }

/* ---------- iconos de navegación del mapa (Icons Map Nav) ----------
   Variante A (verde) en vista satélite; variante B (marrón) en vista mapa.
   La clase .osm-mode la pone map-shared.js en el envoltorio del mapa. */
.map-eye svg, .locate-btn svg { width: 100%; height: 100%; display: block; }
.nav-ico.ico-b { display: none; }
.osm-mode .nav-ico.ico-a { display: none; }
.osm-mode .nav-ico.ico-b { display: block; }

/* Zoom +/- de Leaflet con los mismos iconos del diseño */
/* Todos los controles de navegación: 30px, sin radio, a 20px de los márgenes */
.leaflet-bar, .leaflet-touch .leaflet-bar { border: none !important; border-radius: 0 !important; overflow: hidden; box-shadow: none !important; }
.leaflet-bar a, .leaflet-bar a:first-child, .leaflet-bar a:last-child,
.leaflet-touch .leaflet-bar a:first-child, .leaflet-touch .leaflet-bar a:last-child { border-radius: 0 !important; }
.leaflet-top .leaflet-control-zoom, .leaflet-touch .leaflet-top .leaflet-control-zoom { margin: 20px 0 0 20px !important; }
.leaflet-touch .leaflet-bar a, .leaflet-control-zoom a {
  width: 30px; height: 30px; line-height: 30px;
  border: none; color: transparent !important;
  background-color: transparent; background-size: 100% 100%; background-repeat: no-repeat;
}
.leaflet-control-zoom-in {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Crect fill='%23004A1E' width='30' height='30'/%3E%3Cline x1='15' y1='6.8182' x2='15' y2='23.1818' stroke='%23F1E8DC' stroke-width='2'/%3E%3Cline x1='23.1818' y1='15' x2='6.8182' y2='15' stroke='%23F1E8DC' stroke-width='2'/%3E%3C/svg%3E");
}
.leaflet-control-zoom-out {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Crect fill='%2300682D' width='30' height='30'/%3E%3Cline x1='23.1818' y1='15' x2='6.8182' y2='15' stroke='%23F1E8DC' stroke-width='2'/%3E%3C/svg%3E");
}
.osm-mode .leaflet-control-zoom-in {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Crect fill='%23744C39' width='30' height='30'/%3E%3Cline x1='15' y1='6.8182' x2='15' y2='23.1818' stroke='%23D6C1AB' stroke-width='2'/%3E%3Cline x1='23.1818' y1='15' x2='6.8182' y2='15' stroke='%23D6C1AB' stroke-width='2'/%3E%3C/svg%3E");
}
.osm-mode .leaflet-control-zoom-out {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Crect fill='%23D6C1AB' width='30' height='30'/%3E%3Cline x1='23.1818' y1='15' x2='6.8182' y2='15' stroke='%23744C39' stroke-width='2'/%3E%3C/svg%3E");
}

/* Pill descriptivo al tocar un marcador del mapa */
.pill-popup .leaflet-popup-content-wrapper {
  background: var(--crema);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.pill-popup .leaflet-popup-content { margin: 9px 20px; line-height: 1.2; }
.map-pill-txt { font-size: 1.25rem; font-weight: 600; color: var(--verde); white-space: nowrap; }
.pill-popup .leaflet-popup-tip-container { display: none; }

/* Atribución de teselas: obligatoria pero discreta. Va girada 90º en el
   margen derecho del mapa, centrada verticalmente. */
.leaflet-bottom.leaflet-right {
  top: 50%; bottom: auto; right: 0;
  transform: translateY(-50%);
}
.leaflet-control-attribution {
  writing-mode: vertical-rl;
  transform: rotate(180deg);      /* mirando hacia fuera */
  margin: 0 !important;
  font-size: 9px;                 /* lo más pequeño posible */
  line-height: 1;
  padding: 10px 4px !important;   /* aire arriba y abajo del texto girado */
  border-radius: 0;
  background: rgba(241, 232, 220, .7) !important;
  color: var(--marron-claro);
}
.leaflet-control-attribution a { color: var(--marron-claro); }

#map-toast {
  position: fixed;
  left: 20px; right: 20px; bottom: 110px;
  width: auto; max-width: 720px; margin: 0 auto;   /* mismo ancho que el mapa */
  transform: translateY(10px);
  background: var(--marron-oscuro); color: var(--crema);
  padding: 10px 18px; border-radius: 12px;
  font-size: .95rem; text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 1000;
}
#map-toast.show { opacity: 1; transform: translateY(0); }

/* legend as icon list; muted rows greyed until an alert is active */
.legend { margin: 12px 0 6px; }
.legend .li {
  display: flex; align-items: center; gap: 10px;
  padding: 0; font-size: 1rem; font-weight: 400;   /* interlineado compacto */
}
/* Los iconos van SIEMPRE a opacidad 100; solo el texto se atenúa. */
.legend .li.muted span:last-child { opacity: .35; }
/* Con alerta activa, los textos de las filas "de fuego" pasan a rojo fuego */
.legend .li.hot span:last-child { color: var(--rojo-fuego); }
.legend .sym {
  width: 24px; text-align: center; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.legend .dot { width: 16px; height: 16px; border-radius: 50%; display: inline-block; }
.dot-green  { background: var(--verde-vivo); }
.dot-orange { background: var(--naranja-aviso); }

/* ---------- neighbour cards / house list ---------- */

.house-card {
  background: var(--arena);
  border: none;
  border-radius: var(--r-card);
  padding: 20px;
  margin: 20px 0;   /* 20px de separación entre pastillas */
}
.house-card h3 { margin: 0 0 6px; color: var(--verde); font-size: 1.375rem; }
.house-card .row { margin: 8px 0; font-size: 1rem; }
.house-card a.tel, .popup-body a.tel {
  display: block; width: 100%; text-align: center;
  background: var(--verde); color: var(--crema);
  padding: 12px; border-radius: var(--r-pill); text-decoration: none;
  font-weight: 500; font-size: 1.125rem; margin: 10px 0; min-height: var(--btn-h);
}
.popup-body { font-size: 1rem; }
.popup-body a.tel { display: inline-block; width: auto; padding: 6px 12px; border-radius: 8px; min-height: 0; }
.evac-status { margin-top: 12px; border-top: 2px solid var(--rojo-fuego); padding-top: 10px; }
.evac-status .lbl { color: var(--rojo-fuego); font-weight: 400; }
.evac-status .val {
  display: block; text-align: center; font-weight: 400; font-size: 1.125rem;
  padding: 12px 20px; border-radius: var(--r-pill); margin-top: 8px;
  border: 2px solid var(--verde-vivo); color: var(--verde-vivo);
}
.evac-status .val.pending { background: var(--crema); border-color: var(--rojo-fuego); color: var(--rojo-fuego); }
.evac-status .val.safe { background: var(--verde-vivo); color: var(--crema); border-color: var(--verde-vivo); }

/* ---------- progress bar ---------- */

.progress-wrap {
  background: var(--marron-oscuro); border: none;
  border-radius: 12px; height: 24px; overflow: hidden; margin: 8px 0;
  position: relative;
}
.progress-bar {
  height: 100%; background: var(--naranja-aviso); color: var(--crema);
  font-weight: 400; display: flex; align-items: center; justify-content: center;
  min-width: 44px; transition: width .3s; font-size: .875rem;
  border-radius: 12px;
}
.progress-bar.full { background: var(--verde-vivo); }

/* ---------- weather ("Climatología") ---------- */

.weather-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 12px 0;
}
.weather-card {
  padding: 16px; border-radius: var(--r-card); background: var(--arena);
  display: flex; flex-direction: column; gap: 4px;
}
.weather-card .wl { font-size: 1rem; color: var(--marron-claro); }
.weather-card .wv { font-size: 1.35rem; font-weight: 600; color: var(--marron-oscuro); }  /* -10% (antes 1.5rem) */
.risk-card {
  padding: 16px; border-radius: var(--r-card); background: var(--arena);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin: 20px 0 4px;   /* 20px respecto a las tarjetas de arriba, como el gap del grid */
}
.risk-card .rl { font-size: 1.25rem; font-weight: 600; color: var(--marron-oscuro); }  /* -10% (antes 1.375rem) */
.risk-pill {
  font-size: 1.125rem; font-weight: 600; border-radius: var(--r-pill);
  padding: 4px 16px; border: 2px solid; white-space: nowrap;
}
.risk-low     { color: var(--verde-vivo); border-color: var(--verde-vivo); }
.risk-mod     { color: var(--naranja-aviso); border-color: var(--naranja-aviso); }
.risk-high    { color: var(--rojo-fuego); border-color: var(--rojo-fuego); }
.risk-extreme { color: var(--crema); border-color: var(--rojo-fuego); background: var(--rojo-fuego); }
.weather-note { font-size: .875rem; font-style: italic; color: var(--marron-claro); margin: 4px 0; }

/* ---------- fire bar (fixed bottom) ---------- */

.fire-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1200;
  padding: 16px 20px;
  background: var(--crema);   /* siempre opaco, sin alfa */
}
.fire-bar button {
  width: 100%;
  background: var(--rojo-fuego);
  color: var(--crema);
  font-size: 1.25rem;
  font-weight: 500;
  font-family: inherit;
  border: 2px solid var(--rojo-fuego);   /* mismo tamaño que inputs/outline */
  border-radius: var(--r-pill);
  min-height: var(--btn-h);
  cursor: pointer;
  letter-spacing: .5px;
}
.fire-bar button:active { background: var(--rojo-oscuro); border-color: #A41100; }

/* ---------- centro de notificaciones (banner de alertas) ----------
   Contraído: pill "N Nueva(s) notificación(es)". Al tocar, se expande y
   muestra una tarjeta por aviso, con X para descartarla en este dispositivo. */

/* Centro de notificaciones del header. El banner vive siempre en el DOM como
   fila de rejilla a 0fr; al aparecer una alerta pasa a 1fr y el header "crece"
   con animación para acomodar la pastilla (y lo mismo al expandir las tarjetas
   o al retirarse la alerta). Misma curva In-Out que el resto de la app. */
.alert-banner {
  display: grid;
  grid-template-rows: 0fr;
  background: var(--verde);
  transition: grid-template-rows .35s cubic-bezier(.65,0,.35,1);
}
.alert-banner.show { grid-template-rows: 1fr; }
.alert-banner .notif-wrap {
  overflow: hidden;               /* imprescindible para que 0fr colapse a 0 */
  min-height: 0;
  max-width: 760px; width: 100%; box-sizing: border-box;
  margin: 0 auto; padding: 0 20px;
}
.notif-pill {
  width: 100%; min-height: var(--btn-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: transparent; border: 2px solid var(--crema); border-radius: var(--r-pill);
  color: var(--crema); font-family: inherit; font-size: 1.125rem; font-weight: 400;
  padding: 0 18px; cursor: pointer; text-align: left;
  margin: 4px 0 14px;             /* el margen inferior hace de padding del banner colapsado */
  transition: margin-bottom .35s cubic-bezier(.65,0,.35,1),
              background-color .12s ease, border-color .12s ease;
}
.notif-pill:active { background: rgba(241, 232, 220, .15); }
.alert-banner.open .notif-pill { margin-bottom: 10px; }   /* hueco pastilla -> primera tarjeta */
.notif-pill svg { transition: transform .35s cubic-bezier(.65,0,.35,1); flex-shrink: 0; }
.alert-banner.open .notif-pill svg { transform: rotate(180deg); }
/* Contenedor de tarjetas: se expande/colapsa con la misma técnica 0fr -> 1fr */
.notif-cards {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .35s cubic-bezier(.65,0,.35,1);
}
.alert-banner.open .notif-cards { grid-template-rows: 1fr; }
.notif-cards-inner { overflow: hidden; min-height: 0; }
.notif-card {
  position: relative;
  background: var(--crema); color: var(--marron-oscuro);
  border-radius: var(--r-card);
  padding: 16px 44px 14px 16px;
  margin: 0 0 10px;
  font-weight: 400;
}
.notif-card:last-child { margin-bottom: 14px; }
.notif-card h4 { margin: 0 0 6px; font-size: 1.125rem; font-weight: 600; color: var(--verde); }
.notif-card.notif-drill h4 { color: var(--naranja-aviso); }
.notif-card.notif-fire h4 { color: var(--rojo-fuego); }
.notif-card p { margin: 0; font-size: 1rem; line-height: 1.45; color: var(--marron-oscuro); }
.notif-card .notif-meta { margin-top: 6px; font-size: .875rem; color: var(--marron-claro); }
.notif-card .notif-cancel { margin: 12px 0 0; width: auto; padding: 8px 16px; font-size: .9375rem; }
.notif-card .notif-close {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px; padding: 4px;
  background: none; border: none; color: var(--verde); cursor: pointer; line-height: 0;
}
.notif-card .notif-close svg { width: 100%; height: 100%; }

/* ---------- modal overlays ---------- */

.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(49, 12, 3, .9);
  z-index: 2000;
  padding: 20px;
  overflow-y: auto;
}
.overlay.show { display: flex; align-items: center; justify-content: center; }
.overlay .box { margin: auto; width: 100%; }   /* centrado; con contenido alto, hace scroll */
.overlay .box {
  background: var(--crema);
  border: none;
  border-radius: var(--r-card);
  max-width: 480px;
  margin: 24px auto;
  padding: 24px;
}
.overlay .box h2 { margin-top: 0; font-size: 1.375rem; }
.fire-warn { color: var(--rojo-fuego); font-style: italic; font-weight: 400; }
.fire-dialog-select { border-color: var(--rojo-fuego) !important; }
/* Título del diálogo con la llama SVG */
.fire-title { display: flex; align-items: center; gap: 12px; color: var(--marron-oscuro); }
/* Controles del diálogo de fuego: 50px de alto y 10px de separación
   (excepción a los 20px generales de la app). */
#fire-dialog .fire-dialog-select { height: var(--btn-h); margin: 0 0 20px; }
#fire-dialog .box .btn, #fire-dialog .box a.btn {
  margin: 0 0 20px;                             /* 20px entre botones */
  height: var(--btn-h); min-height: 0;          /* máximo 50px exactos */
  display: flex; align-items: center; justify-content: center;
  padding: 0 15px;
}
#fire-dialog .box label { display: block; margin: 10px 0 6px; }
#fire-dialog .map-wrap { margin-bottom: 20px; }   /* 20px del mapa al desplegable */
.fire-drill-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: .85rem; color: var(--marron-claro); font-weight: 400; margin-top: 16px;
}
.fire-drill-toggle input { width: 20px; height: 20px; }

/* roster ("Nuestros vecinos") */
.roster-title { border-top: 2px solid var(--arena); padding-top: 16px; margin: 24px 0 16px; font-size: 1.75rem; font-weight: 400; }  /* 16px sobre y bajo el título, como el resto */
.roster-title + .house-card { margin-top: 0; }   /* que la primera pastilla no estire el hueco a 20px */
.roster-privacy { color: var(--marron-claro); font-size: .875rem; margin: 16px 2px; border-top: 2px solid var(--arena); padding-top: 12px; }

/* ---------- login screen ---------- */

.login-screen {
  display: none;
  position: fixed; inset: 0;
  background: var(--crema);
  z-index: 2500;
  overflow-y: auto;
  padding: 40px 30px 20px;
}
.login-screen.show { display: flex; }
.login-inner {
  margin: auto;
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; align-items: center;
  min-height: 100%;
}
.login-logo { width: 150px; height: 125px; color: var(--rojo-fuego); margin-top: 8vh; }
.login-tagline {
  font-size: 1.125rem; font-weight: 300; color: var(--rojo-fuego);  /* 18px: cabe en dos líneas (antes 20px) */
  text-align: center; line-height: 1.3; margin: 10px 0 32px;
}
.login-fields { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.login-fields input {
  border-color: var(--verde);
  color: var(--verde-vivo);
  font-size: 1.25rem;
  font-weight: 500;
  padding: 12px 20px;
}
.login-fields input::placeholder { color: var(--verde-vivo); opacity: .8; }

/* Asterisco de campo obligatorio: siempre en rojo fuego (el texto va sin él,
   lo pinta el CSS para poder darle color). */
label.req::after { content: " *"; color: var(--rojo-fuego); font-weight: 600; }

/* Placeholders de los inputs: color arena, como su borde. */
input::placeholder, textarea::placeholder { color: var(--arena); opacity: 1; }
.login-pw-wrap { position: relative; }
.login-pw-wrap input { padding-right: 52px; }
.login-eye {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 4px;
  display: flex; align-items: center; color: var(--verde-vivo);  /* Eye_Login.svg viene en verde vivo */
}
/* El ojo no debe reaccionar como botón: sin escala, sin oscurecido, sin marco de foco.
   Su centrado vertical va con translateY, así que al pulsar hay que conservarlo
   (transform:none lo haría saltar hacia abajo). */
.login-eye:focus, .login-eye:focus-visible { outline: none; box-shadow: none; }
button.login-eye.no-scale:active { transform: translateY(-50%) !important; }
.login-fields .btn { margin: 0; font-size: 1.25rem; }
.login-divider { width: 100%; height: 2px; background: var(--arena); margin: 40px 0; }
.login-copy { font-size: .875rem; color: var(--rojo-fuego); margin-top: auto; padding: 48px 0 24px; }
/* Mensajes "Próximamente disponible": centrados y a la misma distancia (16px)
   de su botón. El de crear comunidad ya recibe 16px del gap de .login-fields. */
#gate-create-soon, #gate-soon { text-align: center; margin: 0; }
#gate-soon { margin-top: 16px; }

/* ---------- onboarding ---------- */

.onboarding {
  display: none;
  position: fixed; inset: 0;
  background: var(--crema);
  z-index: 2400;
  flex-direction: column;
  overflow-y: auto;
}
.onboarding.show { display: flex; animation: obFadeIn .5s ease both; }
.onboarding.show.hiding { animation: obFadeOut .5s ease both; }
@keyframes obFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes obFadeOut { from { opacity: 1; } to { opacity: 0; } }
/* El hueco sobre las pestañas lo pone #ob-spacer (medido por JS), no un padding
   fijo: así las pestañas falsas caen exactamente sobre las reales. */
.ob-header { background: var(--verde); flex-shrink: 0; }
.ob-tabs { display: flex; }
/* Mismas métricas que .app-nav a para que coincidan pixel a pixel */
.ob-tabs div {
  flex: 1; text-align: center; padding: 14px 4px;
  min-height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.125rem; font-weight: 500; white-space: nowrap;
  color: var(--crema);
  background: var(--verde-oscuro);   /* pestañas no seleccionadas en verde oscuro */
  border-radius: var(--r-card) var(--r-card) 0 0;
  transition: background .4s, color .4s;
}
/* Scroll bloqueado mientras el onboarding está abierto */
body.ob-lock { overflow: hidden; }

/* Vuelta de subpágina al menú: el primer frame del documento de destino se
   pinta en verde y sin contenido hasta que el menú restaurado está listo
   (evita el blink de la página en crema bajo el menú). */
html.menu-restoring body { visibility: hidden; }
.ob-tabs div.on { background: var(--crema); color: var(--verde); font-weight: 500; }
.ob-body {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 12px; padding: 40px 30px;
}
.ob-body h2 { font-size: 1.75rem; font-weight: 600; color: var(--verde); margin: 0; line-height: 1.2; }
.ob-body p { font-size: 1.125rem; color: var(--marron-oscuro); line-height: 1.5; margin: 0; max-width: 340px; }
#ob-actions { flex-direction: column; gap: 12px; width: 100%; max-width: 340px; margin-top: 10px; }
#ob-actions .btn[disabled] { opacity: .75; }
.ob-footer {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 0 30px 56px;
}
.ob-dots { display: flex; gap: 8px; }
.ob-dots div { width: 8px; height: 8px; border-radius: 50%; background: var(--arena); transition: background .3s; }
.ob-dots div.on { background: var(--verde); }
.ob-footer .btn { margin: 0; font-weight: 600; font-size: 1.25rem; max-width: 420px; }
.ob-skip {
  background: none; border: none; cursor: pointer;
  color: var(--marron-oscuro); font-size: 1.25rem; font-weight: 600; font-family: inherit;
}

/* ---------- hamburger menu ---------- */

.menu-overlay {
  display: flex; flex-direction: column;
  position: fixed; inset: 0;
  background: var(--verde);
  color: var(--crema);
  z-index: 2100;
  padding: 35px 40px;   /* 40px de margen a ambos lados, como las subpáginas */
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .35s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .35s;
}
.menu-overlay.show {
  transform: translateX(0);
  visibility: visible;
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
}
/* parallax: the page slides half a screen left and fades while the menu is open */
body.menu-open main, body.menu-open .app-top, body.menu-open .fire-bar {
  transform: translateX(-50%);
  opacity: .3;
}
main, .app-top, .fire-bar {
  transition: transform .35s cubic-bezier(.4, 0, .2, 1), opacity .35s ease;
}
.menu-overlay .menu-close {
  /* la X visible (30px) queda a 30px del borde derecho:
     19px + (52-30)/2 de área táctil = 30px hasta el icono */
  position: absolute; top: 24px; right: 19px;
  background: transparent; border: none; color: var(--crema);
  line-height: 0; cursor: pointer;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
}
.menu-overlay.show .menu-close { animation: spinIn 1s cubic-bezier(.65, 0, .35, 1) both; }
.menu-overlay h2 { margin: 96px 0 24px; font-size: 1.75rem; font-weight: 600; }
.menu-overlay .menu-list a {
  display: block; color: var(--crema); text-decoration: none;
  font-size: 1.375rem; font-weight: 300; padding: 18px 0;   /* un punto menos de peso */
}
.menu-overlay .menu-list { margin-bottom: 70px; }   /* >60px del último item al primer botón */
.menu-overlay .btn { margin: 0 0 20px; }            /* 20px entre botones */
.menu-overlay .btn-secondary {
  background: transparent; color: var(--crema); border: 2px solid var(--crema);
}
.menu-overlay .menu-copy { margin-top: auto; padding-bottom: 24px; opacity: .7; font-size: .875rem; text-align: center; }  /* legal pegado abajo */

/* ---------- deep-green subpages (about / history / coordinator) ----------
   Son overlays a pantalla completa: entran deslizándose desde la derecha
   (sobre el menú, del mismo verde) y salen igual al pulsar la X. */
body.subpage main {
  /* 96px arriba (hueco para la X fija) y 40px de margen lateral,
     igual que el menú principal */
  padding: 96px 40px 24px;
  position: relative; z-index: 500;      /* por encima del menú fantasma */
  background: var(--verde-oscuro); min-height: 100vh;   /* panel opaco al entrar */
  animation: subSlideIn .35s cubic-bezier(.4, 0, .2, 1) both;
}
/* Menú fantasma: decorativo, debajo del contenido entrante; reutiliza la
   regla .menu-overlay.show.menu-leaving para el parallax de -50%. */
.menu-overlay.menu-ghost { z-index: 400; pointer-events: none; }
/* La X del menú fantasma nunca gira: si girase, el corte de navegación a los
   320ms la dejaría a medio giro (glitch). El giro es solo de aperturas manuales. */
.menu-overlay.menu-ghost .menu-close { animation: none; }
body.subpage .app-footer { animation: subSlideIn .35s cubic-bezier(.4, 0, .2, 1) both; }
body.subpage.subpage-leaving main,
body.subpage.subpage-leaving .app-footer { animation: subSlideOut .3s cubic-bezier(.4, 0, .2, 1) both; }
@keyframes subSlideIn  { from { transform: translateX(100%); } to { transform: none; } }
@keyframes subSlideOut { from { transform: none; } to { transform: translateX(100%); } }
.subpage-close {
  /* mismo criterio que la X del menú: icono visible a 30px del borde */
  position: fixed; top: 24px; right: 19px; z-index: 2200;
  width: 52px; height: 52px;
  background: transparent; border: none; color: var(--crema);
  line-height: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  animation: subXin .35s cubic-bezier(.4, 0, .2, 1) both;   /* entra desde la derecha con la página */
}
.subpage-close svg { animation: spinIn 1s cubic-bezier(.65, 0, .35, 1) both; }  /* girando, como la X del menú */
body.subpage-leaving .subpage-close { animation: subXout .3s cubic-bezier(.4, 0, .2, 1) both; }
/* Al cerrar, la X hace un giro de salida limpio y completo */
body.subpage-leaving .subpage-close svg { animation: spinOutX .35s cubic-bezier(.65, 0, .35, 1) both; }
@keyframes spinOutX { from { transform: rotate(0deg); } to { transform: rotate(180deg); } }
/* Cuando el menú se restaura tras cerrar una subpágina, su X NO vuelve a girar
   (ya giró al abrir el menú); girará de nuevo en la próxima apertura manual. */
.menu-overlay.restored .menu-close { animation: none; }
@keyframes subXin  { from { transform: translateX(100vw); } to { transform: none; } }
@keyframes subXout { from { transform: none; } to { transform: translateX(100vw); } }
.menu-overlay.no-anim { transition: none !important; }
html.subpage-doc { background: var(--verde-oscuro); }   /* sin parpadeo blanco al navegar */
/* Panel verde que entra por la derecha al abrir una subpágina desde el menú,
   mientras el menú hace parallax hacia la izquierda (como home→menú). */
.subpage-cover {
  position: fixed; inset: 0; background: var(--verde-oscuro); z-index: 2300;
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.4, 0, .2, 1);
}
.subpage-cover.in { transform: none; }
.menu-overlay.show.menu-leaving {
  transform: translateX(-50%);
  transition: transform .32s cubic-bezier(.4, 0, .2, 1);
}
/* Vuelta de una subpágina: el menú reaparece entrando desde la izquierda
   (parallax inverso) sobre un panel verde, sin destellos del fondo crema. */
.menu-overlay.show.reenter { transform: translateX(-50%); transition: none; }
.menu-overlay.show.reenter-anim { transition: transform .3s cubic-bezier(.4, 0, .2, 1); }
.subpage-cover.under-menu { z-index: 2050; transition: none; }


body.subpage { background: var(--verde-oscuro); color: var(--crema); }
body.subpage h2 { color: var(--crema); font-weight: 600; }
body.subpage h3 { color: var(--crema); }
body.subpage p, body.subpage label { color: rgba(241,232,220,.9); }
body.subpage .help { color: rgba(241,232,220,.75); }
body.subpage a { color: var(--crema); }
/* Sobre evacuapp: cuerpo de texto a 18px (la nota de mapas se queda pequeña) */
body.subpage-about main p:not(.help) { font-size: 1.125rem; }
body.subpage .app-footer { color: rgba(241,232,220,.7); }
body.subpage .app-footer p { border-top-color: rgba(241,232,220,.3); }
body.subpage input, body.subpage select, body.subpage textarea {
  border-color: var(--crema); color: var(--crema);
}
/* En subpáginas (fondo verde oscuro) la flechita de los selects va en crema */
body.subpage select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23F1E8DC' stroke-width='1.8' stroke-linecap='square' stroke-linejoin='miter' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
}
body.subpage input::placeholder { color: rgba(241,232,220,.7); }

/* Área de coordinadores: separaciones de 20px entre controles, "Añadir punto"
   en verde vivo y botones "Borrar" invertidos (fill rojo, texto claro). */
#coord-area .btn, #coord-area select, #coord-area input { margin: 0 0 20px; }
#coord-area .map-wrap { margin-bottom: 20px; }
#feat-add { background: var(--verde-vivo); color: var(--crema); border-color: var(--verde-vivo); }
#feat-add:active { border-color: #008935; }
#feat-list .btn-outline {
  background: var(--crema); color: var(--rojo-fuego); border-color: var(--rojo-fuego);
}
/* "Iniciar simulacro" en naranja aviso con texto claro */
#drill-start { background: var(--naranja-aviso); color: var(--crema); border-color: var(--naranja-aviso); }
#drill-start:active { border-color: #D07C00; }
/* "Descargar copia de seguridad": outline crema sobre el fondo verde oscuro */
#backup-link { background: transparent; color: var(--crema); border: 2px solid var(--crema); }
body.subpage .btn-primary { background: var(--crema); color: var(--verde); border-color: var(--crema); }  /* outline = fill */
body.subpage .fire-bar { background: rgba(0,74,30,.9); }

/* Tarjetas de "Contacto de coordinadores" */
.coord-card {
  background: var(--crema);
  border-radius: var(--r-card);
  padding: 16px 20px;            /* como las tarjetas del Historial */
  margin: 20px 0;
}
body.subpage .coord-card h3 { color: var(--marron-oscuro); margin: 0 0 6px; font-size: 1.125rem; font-weight: 600; }
body.subpage .coord-card a {
  display: block; width: auto; text-align: left; background: none;
  color: var(--verde); text-decoration: underline;
  font-size: 1rem; padding: 0; margin: 4px 0; min-height: 0;
}
/* Texto de cuerpo dentro de las tarjetas crema (reuniones, noticias y
   material del grupo de voluntarios): marrón, no el crema de la subpágina. */
body.subpage .coord-card p { color: var(--marron-oscuro); margin: 4px 0; }
body.subpage .coord-card p.help { color: rgba(49, 12, 3, .7); }

/* history / contact cards on subpages */
.alert-item { background: var(--crema); color: var(--marron-oscuro); border-radius: var(--r-card); padding: 16px 20px; margin: 20px 0; }
.alert-item .row { margin: 0; line-height: 1.35; }   /* interlineado compacto en el historial */
.tag { display: inline-block; font-weight: 600; font-size: .875rem; padding: 3px 12px; border-radius: var(--r-pill); margin: 0 6px 6px 0; border: 1.5px solid; background: transparent; }
.tag-fire { color: var(--rojo-fuego); border-color: var(--rojo-fuego); }
.tag-test { color: var(--naranja-aviso); border-color: var(--naranja-aviso); }
.tag-active { color: var(--crema); border-color: var(--rojo-fuego); background: var(--rojo-fuego); }

/* ---------- footer ---------- */

.app-footer {
  margin: 26px auto 10px;
  max-width: 760px;
  padding: 0 20px;
  font-size: .875rem;
  color: var(--marron-claro);
}
/* la línea divisoria respeta el ancho del contenido (mismos 20px de margen) */
.app-footer p { border-top: 2px solid var(--arena); padding-top: 12px; margin: 12px 0 0; }

/* ---------- plan page ---------- */

.plan-block {
  background: var(--crema);                /* mismo crema que el fondo */
  border: 2px solid var(--arena);          /* outline 2px como la referencia */
  border-radius: var(--r-card);
  padding: 20px;
  margin: 20px 0;   /* 20px entre pastillas, consistente en toda la app */
  font-size: 1rem;
}
.plan-block h3 { display: flex; align-items: center; gap: 10px; }
.plan-ico { flex: 0 0 auto; display: block; }
.plan-block .plan-note { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; }
.plan-block.danger .plan-note { color: var(--rojo-fuego); font-size: 1.125rem; }
.plan-block ul { margin: 8px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.plan-block li { line-height: 1.5; }
.plan-block h3 { margin: 0 0 6px; font-size: 1.125rem; }
.plan-block.danger h3 { color: var(--rojo-fuego); font-size: 1.25rem; }
.plan-block.warn h3   { color: var(--naranja-aviso); font-size: 1.25rem; }
.plan-block.go h3     { color: var(--verde-vivo); }
.plan-scenario-title { font-size: 1.25rem; margin: 20px 0 4px; font-weight: 400; scroll-margin-top: 190px; }  /* cabecera fija (141px colapsada) + los 30px que encoge durante el scroll + aire */
.big-112 {
  display: block; text-align: center; background: var(--rojo-fuego); color: var(--crema);
  font-size: 1.25rem; font-weight: 500; padding: 12px 16px; min-height: var(--btn-h);
  border-radius: var(--r-pill); text-decoration: none; margin: 14px 0;
}
.scenario-tabs { display: flex; flex-direction: column; gap: 16px; margin: 12px 0; }
.scenario-tabs button {
  background: transparent; border: 2px solid var(--rojo-fuego); color: var(--rojo-fuego);
  border-radius: var(--r-pill); font-size: 1.125rem; font-weight: 500; font-family: inherit;
  padding: 12px; min-height: var(--btn-h); cursor: pointer;
}

/* ---------- print ---------- */

@media print {
  .app-top, .app-nav, .fire-bar, .alert-banner, .no-print, .lang-btn, .icon-btn { display: none !important; }
  body { padding-bottom: 0; background: #fff; }
  #scenario-fire, #scenario-created { display: block !important; }
}

@media (min-width: 700px) {
  #map { aspect-ratio: auto; height: 460px; }
}
