/* =========================================================
   Red de Emergencia — estilos (todo prefijado .re-)
   ========================================================= */

:root {
	--re-accent: #2563eb;
	--re-success: #059669;
	--re-danger: #dc2626;
	--re-warn: #ea580c;
	--re-purple: #7c3aed;
	--re-ink: #1c1917;
	--re-muted: #78716c;
	--re-line: #e7e5e4;
	--re-bg: #fafaf9;
	--re-card: #ffffff;
	--re-radius: 14px;
	--re-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 3px rgba(0, 0, 0, .06);
}

.re-stats,
.re-mapa-wrap,
.re-cards,
.re-form,
.re-buscar,
.re-sismos {
	color: var(--re-ink);
	font-family: inherit;
	box-sizing: border-box;
}

.re-stats *,
.re-mapa-wrap *,
.re-cards *,
.re-form *,
.re-buscar *,
.re-sismos * {
	box-sizing: border-box;
}

/* ---------- Estadísticas ---------- */

.re-stats {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 4px 2px 8px;
	-ms-overflow-style: none;
	scrollbar-width: none;
}

.re-stats::-webkit-scrollbar {
	display: none;
}

.re-stat {
	flex: 0 0 auto;
	min-width: 86px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 10px 12px;
	background: var(--re-card);
	border: 1px solid var(--re-line);
	border-radius: var(--re-radius);
}

.re-stat-num {
	font-size: 1.35rem;
	font-weight: 800;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.re-stat-label {
	font-size: .7rem;
	color: var(--re-muted);
	text-align: center;
	line-height: 1.15;
}

/* ---------- Mapa ---------- */

.re-mapa-wrap {
	margin: 8px 0;
}

.re-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}

.re-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	font-size: .85rem;
	font-weight: 600;
	color: var(--re-ink);
	background: var(--re-card);
	border: 1px solid var(--re-line);
	border-radius: 999px;
	cursor: pointer;
	transition: background .15s, border-color .15s;
}

.re-chip:hover {
	background: var(--re-bg);
}

.re-chip.is-active {
	border-color: var(--re-accent);
	background: #eff6ff;
	color: var(--re-accent);
}

.re-chip-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
}

.re-mapa {
	width: 100%;
	min-height: 320px;
	border-radius: var(--re-radius);
	border: 1px solid var(--re-line);
	overflow: hidden;
	z-index: 0;
}

.re-leyenda {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 10px;
	font-size: .78rem;
	color: var(--re-muted);
}

.re-leyenda-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.re-leyenda-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
}

/* Marcadores */

.re-pin-dot {
	display: block;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 3px solid #fff;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
}

/* Popups */

.re-pop-foto img {
	width: 100%;
	height: 120px;
	object-fit: cover;
	border-radius: 8px;
	margin-bottom: 8px;
}

.re-pop-badge {
	display: inline-block;
	font-size: .7rem;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 999px;
	background: #f5f5f4;
	color: var(--re-ink);
	margin-bottom: 4px;
}

.re-pop-titulo {
	display: block;
	font-size: .95rem;
	margin-bottom: 2px;
}

.re-pop-ubic,
.re-pop-desc,
.re-pop-tel,
.re-pop-horario {
	margin: 2px 0;
	font-size: .82rem;
	color: var(--re-muted);
}

.re-pop-link {
	display: inline-block;
	margin-top: 6px;
	font-size: .82rem;
	font-weight: 600;
	color: var(--re-accent);
}

/* ---------- Tarjetas / listados ---------- */

.re-cards {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
	margin: 8px 0;
}

.re-card {
	background: var(--re-card);
	border: 1px solid var(--re-line);
	border-radius: var(--re-radius);
	overflow: hidden;
	box-shadow: var(--re-shadow);
	display: flex;
	flex-direction: column;
}

.re-card-foto img {
	width: 100%;
	height: 170px;
	object-fit: cover;
	display: block;
}

.re-card-cuerpo {
	padding: 12px 14px;
}

.re-card-titulo {
	margin: 6px 0 2px;
	font-size: 1.02rem;
	line-height: 1.25;
}

.re-card-ubic {
	margin: 0 0 6px;
	font-size: .82rem;
	color: var(--re-muted);
}

.re-card-desc {
	margin: 0;
	font-size: .88rem;
	color: #57534e;
}

/* Insignias de estado */

.re-badge {
	display: inline-block;
	font-size: .7rem;
	font-weight: 700;
	padding: 3px 9px;
	border-radius: 999px;
	background: #f5f5f4;
	color: var(--re-ink);
}

.re-badge-desaparecido { background: #ede9fe; color: #6d28d9; }
.re-badge-hospital { background: #fee2e2; color: #b91c1c; }
.re-badge-a_salvo { background: #dcfce7; color: #047857; }
.re-badge-fallecido { background: #e7e5e4; color: #44403c; }
.re-badge-perdida { background: #fce7f3; color: #be185d; }
.re-badge-encontrada { background: #dcfce7; color: #047857; }
.re-badge-abierta { background: #ffedd5; color: #c2410c; }
.re-badge-cubierta { background: #dcfce7; color: #047857; }

/* ---------- Buscador ---------- */

.re-buscar {
	margin: 8px 0;
}

.re-buscar-barra {
	display: flex;
	gap: 8px;
}

.re-buscar-input {
	flex: 1;
	height: 46px;
	padding: 0 14px;
	font-size: 1rem;
	border: 1px solid var(--re-line);
	border-radius: 12px;
	background: #fff;
	color: var(--re-ink);
}

.re-buscar-input:focus {
	outline: none;
	border-color: var(--re-accent);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}

.re-buscar-resultados {
	margin-top: 12px;
}

.re-res-lista {
	display: grid;
	gap: 8px;
}

.re-res-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	border: 1px solid var(--re-line);
	border-radius: 12px;
	background: #fff;
	text-decoration: none;
	color: var(--re-ink);
	transition: background .15s;
}

.re-res-item:hover {
	background: var(--re-bg);
}

.re-res-foto {
	width: 46px;
	height: 46px;
	border-radius: 10px;
	object-fit: cover;
	flex: 0 0 auto;
}

.re-res-foto-vacia {
	background: #f5f5f4;
}

.re-res-info {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.re-res-nombre {
	font-weight: 700;
	font-size: .92rem;
}

.re-res-estado {
	font-size: .78rem;
	color: var(--re-success);
	font-weight: 600;
}

.re-res-ubic {
	font-size: .76rem;
	color: var(--re-muted);
}

/* ---------- Sismos ---------- */

.re-sismos {
	margin: 8px 0;
}

.re-sismo-lista {
	display: grid;
	gap: 8px;
	margin-top: 8px;
}

.re-sismo {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid var(--re-line);
	border-radius: 12px;
	background: #fff;
}

.re-sismo-mag {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border-radius: 10px;
	color: #fff;
	font-weight: 800;
	font-size: .95rem;
}

.re-sismo-lugar {
	margin: 0;
	font-size: .9rem;
	font-weight: 500;
}

.re-sismo-fecha {
	margin: 0;
	font-size: .78rem;
	color: var(--re-muted);
}

/* ---------- Formularios ---------- */

.re-form {
	max-width: 640px;
	background: var(--re-card);
	border: 1px solid var(--re-line);
	border-radius: var(--re-radius);
	padding: 18px;
	box-shadow: var(--re-shadow);
}

.re-field {
	margin: 0 0 14px;
}

.re-field label {
	display: block;
	font-size: .88rem;
	font-weight: 600;
	margin-bottom: 5px;
}

.re-field input[type="text"],
.re-field input[type="tel"],
.re-field input[type="number"],
.re-field input[type="search"],
.re-field input[type="file"],
.re-field select,
.re-field textarea {
	width: 100%;
	padding: 10px 12px;
	font-size: .98rem;
	border: 1px solid var(--re-line);
	border-radius: 10px;
	background: #fff;
	color: var(--re-ink);
	font-family: inherit;
}

.re-field textarea {
	resize: vertical;
}

.re-field input:focus,
.re-field select:focus,
.re-field textarea:focus {
	outline: none;
	border-color: var(--re-accent);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}

.re-field.re-check label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 500;
	cursor: pointer;
}

.re-field.re-check input {
	width: auto;
}

.re-req {
	color: var(--re-danger);
}

.re-grid2 {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0 14px;
}

.re-hint {
	font-size: .82rem;
	color: var(--re-muted);
	margin: 0 0 8px;
}

.re-locator {
	height: 260px;
	border-radius: 10px;
	border: 1px solid var(--re-line);
	overflow: hidden;
	margin-top: 8px;
	z-index: 0;
}

/* Honeypot anti-spam: fuera de pantalla */
.re-hp {
	position: absolute !important;
	left: -9999px !important;
	top: -9999px !important;
	height: 0;
	overflow: hidden;
}

.re-legal {
	font-size: .76rem;
	color: var(--re-muted);
	margin: 12px 0 0;
	line-height: 1.4;
}

/* ---------- Botones ---------- */

.re-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 11px 18px;
	font-size: .95rem;
	font-weight: 700;
	color: #fff;
	background: var(--re-accent);
	border: none;
	border-radius: 10px;
	cursor: pointer;
	transition: background .15s, opacity .15s;
	font-family: inherit;
}

.re-btn:hover {
	background: #1d4ed8;
}

.re-btn:disabled {
	opacity: .6;
	cursor: default;
}

.re-btn-sec {
	background: #fff;
	color: var(--re-ink);
	border: 1px solid var(--re-line);
}

.re-btn-sec:hover {
	background: var(--re-bg);
}

.re-geoloc {
	margin-bottom: 6px;
}

/* ---------- Avisos ---------- */

.re-alert {
	padding: 12px 14px;
	border-radius: 10px;
	font-size: .9rem;
	margin-bottom: 14px;
	border: 1px solid transparent;
}

.re-alert-ok {
	background: #dcfce7;
	border-color: #86efac;
	color: #065f46;
}

.re-alert-err {
	background: #fee2e2;
	border-color: #fca5a5;
	color: #991b1b;
}

.re-vacio {
	color: var(--re-muted);
	font-size: .9rem;
	padding: 8px 0;
}

/* ---------- Responsive ---------- */

@media (min-width: 560px) {
	.re-cards {
		grid-template-columns: repeat(2, 1fr);
	}
	.re-grid2 {
		grid-template-columns: 1fr 1fr;
	}
}

@media (min-width: 900px) {
	.re-cards {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.re-chip,
	.re-btn,
	.re-res-item {
		transition: none;
	}
}
