/* Pantallas de la app del vecino, del alta y piezas que usa también la central. Los colores vienen de tema.css. */

[hidden] { display: none !important; }
h2, h3 { line-height: 1.25; }
.vista { display: block; }
.centrado { text-align: center; }
.pila > * + * { margin-top: 10px; }
.fila { display: flex; gap: 8px; flex-wrap: wrap; }
.fila > .boton { flex: 1 1 140px; }
label { display: block; font-weight: 600; margin-top: 12px; }
input, select, textarea { width: 100%; min-height: 48px; padding: 10px 12px; margin-top: 4px; font: inherit; color: var(--texto);
  background: var(--superficie); border: 1px solid var(--borde-campo); border-radius: 10px; }
textarea { min-height: 90px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 1px; }
.error { color: var(--peligro-texto); font-weight: 600; }
.boton[disabled] { opacity: .55; cursor: default; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; background: var(--panel); color: var(--texto); }
.chip.rojo { background: var(--peligro); color: #fff; }
.chip.amarillo { background: var(--amarillo); color: #111; }
.chip.verde { background: var(--ok); color: #fff; }

/* Navegación inferior de la app del vecino */
/* Fija al borde inferior de la pantalla (no al final del contenido): con poco contenido, una barra «sticky» subía. */
.navegacion { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--superficie);
  border-top: 1px solid var(--borde); padding-bottom: env(safe-area-inset-bottom); z-index: 500; }
body:has(#navegacion:not([hidden])) main { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.navegacion button { min-height: 56px; border: 0; background: transparent; color: var(--suave); font: inherit; font-size: .78rem; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; }
.navegacion button span { font-size: 1.3rem; }
.navegacion button[aria-current="page"] { color: var(--texto); box-shadow: inset 0 3px 0 var(--rojo); }

/* Botones de emergencia: grandes, con barra que se llena al mantener apretado 2 segundos */
.emergencias { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.emergencia { position: relative; overflow: hidden; min-height: 104px; border: 0; border-radius: 16px; background: var(--peligro); color: #fff;
  font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 10px 6px;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.emergencia:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 80px; }
.emergencia .icono { font-size: 2rem; line-height: 1; }
.emergencia .nombre { font-weight: 800; font-size: 1.02rem; }
.emergencia .detalle { font-size: .75rem; opacity: .92; }
.emergencia .carga { position: absolute; left: 0; bottom: 0; height: 8px; width: 0; background: var(--amarillo); }
.emergencia.apretando { transform: scale(.98); box-shadow: 0 0 0 4px var(--amarillo) inset; }
.emergencia.apretando .carga { width: 100%; transition: width 2s linear; }
.ayuda-apretar { text-align: center; font-weight: 600; margin: 4px 0 10px; }

/* Llamada a la central (solo si hay número) */
.llamar-central { margin-top: 8px; }

/* Estado de la alerta en curso */
.pasos { list-style: none; padding: 0; margin: 10px 0 0; }
.pasos li { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--suave); font-weight: 600; }
.pasos li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--borde-campo); flex: none; }
.pasos li.hecho { color: var(--texto); }
.pasos li.hecho::before { background: var(--ok); border-color: var(--ok); }
.pasos li.actual::before { border-color: var(--amarillo); background: var(--amarillo); }
.urgente-llamar { background: var(--peligro); color: #fff; border-radius: 16px; padding: 16px; animation: latido 1.2s ease-in-out infinite; }
.urgente-llamar h2 { margin: 0 0 6px; }
.urgente-llamar .boton { background: #fff; color: var(--peligro); }
@keyframes latido { 50% { box-shadow: 0 0 0 8px #d6282855; } }
@media (prefers-reduced-motion: reduce) { .urgente-llamar { animation: none; } .emergencia.apretando .carga { transition: none; } }
.cola { background: var(--aviso-bg); color: var(--aviso-texto); border-left: 5px solid var(--amarillo); padding: 12px; border-radius: 10px; font-weight: 600; }

/* Mensajes y bitácora */
.mensajes { list-style: none; margin: 0; padding: 0; }
.mensajes li { padding: 8px 10px; border-radius: 10px; background: var(--panel); margin-top: 6px; }
.mensajes li.de-central { background: var(--ok-bg); border-left: 4px solid var(--ok); }
.mensajes li.nota { background: var(--aviso-bg); border-left: 4px solid var(--amarillo); }
.mensajes small { display: block; color: var(--suave); font-size: .75rem; }

/* Fotos */
.fotos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.fotos img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; cursor: pointer; border: 1px solid var(--borde); }
.visor { position: fixed; inset: 0; background: #000d; z-index: 3000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; }
.visor img { max-width: 100%; max-height: 80vh; border-radius: 8px; }

/* Mapas */
.mapa { height: 260px; border-radius: 12px; margin-top: 8px; border: 1px solid var(--borde); z-index: 0; }
.punto-mapa span { display: flex; width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px #0008;
  align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: .8rem; }

/* Aviso flotante */
#aviso-flotante { position: fixed; left: 16px; right: 16px; bottom: 80px; max-width: 520px; margin: 0 auto; background: var(--navy); color: #fff;
  padding: 12px 16px; border-radius: 12px; z-index: 4000; box-shadow: 0 4px 12px #0006; font-weight: 600; text-align: center; }

/* Pasos de la bienvenida */
.paso-num { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--primario); color: #fff; align-items: center;
  justify-content: center; font-weight: 800; margin-right: 6px; }
.privacidad-texto { max-height: 320px; overflow: auto; background: var(--panel); border-radius: 10px; padding: 10px 12px; font-size: .9rem; }
.privacidad-texto p { margin: 0 0 8px; }
.privacidad-texto ul { margin: 0 0 8px; padding-left: 20px; }
