/*
 * Estacionamiento Comunidad: sistema de diseño (fuente única).
 * Basado en el kit de marca (Marca/kit-marca-estacionacomunidad). Si cambia el kit, se cambia aquí.
 *
 * Reglas de color que no se negocian:
 *  - --verde (#23CD97) es para rellenos, iconos grandes y el estado «disponible». Nunca como texto
 *    ni con texto blanco encima (contraste 2,05:1, no cumple AA).
 *  - Botones, enlaces y texto de acento usan --verde-oscuro (#0F7352; 5,84:1 con blanco).
 */

/* ---------- Tipografías (auto-alojadas, subconjunto latin) ---------- */
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/nunito-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-400-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-500-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-600-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Variables ---------- */
:root {
  /* Marca */
  --verde: #23cd97;
  --verde-oscuro: #0f7352;
  --verde-hover: #0b5f43;
  --verde-suave: #e3f6ee;
  --hielo: #f3faf7;
  --tinta: #373643;
  --texto: #34405a;
  --texto-2: #5b667d;
  --linea: #dfe7ea;
  --noche: #0f1a2e;
  --blanco: #ffffff;

  /* Estados de un puesto. En etiquetas: fondo claro + texto oscuro (el color puro solo va en puntos y bordes) */
  --ocupado: #c6453c;
  --ocupado-bg: #fdecec;
  --ocupado-texto: #9b1c1c;
  --reservado: #c98c10;
  --reservado-bg: #fff6e0;
  --reservado-texto: #8a5a00;
  --alerta: #b91c1c;
  --alerta-bg: #fde8e8;

  /* Tipografía */
  --fuente-titulo: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fuente-texto: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fuente-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Radios */
  --radio-campo: 10px;
  --radio-boton: 12px;
  --radio: 14px;
  --radio-pildora: 999px;

  /* Sombras (suaves: la marca es plana, la sombra solo separa capas) */
  --sombra-1: 0 1px 2px rgb(15 26 46 / 0.06);
  --sombra-2: 0 10px 30px rgb(15 26 46 / 0.14);

  /* Espaciado (escala de 4 px) */
  --espacio-1: 0.25rem;
  --espacio-2: 0.5rem;
  --espacio-3: 0.75rem;
  --espacio-4: 1rem;
  --espacio-5: 1.5rem;
  --espacio-6: 2rem;
  --espacio-7: 3rem;
  --espacio-8: 4.5rem;

  --ancho-max: 1120px;
  --margen: clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  font-family: var(--fuente-texto);
  color: var(--texto);
}
h1, h2, h3, h4 {
  font-family: var(--fuente-titulo);
  color: var(--tinta);
  letter-spacing: -0.02em;
}
:focus-visible {
  outline: 3px solid var(--verde-oscuro);
  outline-offset: 3px;
  border-radius: 6px;
}
.ec-mono { font-family: var(--fuente-mono); letter-spacing: 0.04em; }
.ec-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Componentes ---------- */
/* Botón: 48 px de alto mínimo. Primario = verde oscuro con texto blanco; el mint no es un botón. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.7rem 1.25rem;
  border: 2px solid transparent; border-radius: var(--radio-boton);
  font-family: var(--fuente-texto); font-weight: 650; font-size: 1rem; line-height: 1.25; text-align: center;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--verde-oscuro); border-color: var(--verde-oscuro); color: #fff; }
.btn-primary:hover { background: var(--verde-hover); border-color: var(--verde-hover); }
.btn-outline { background: transparent; border-color: var(--verde-oscuro); color: var(--verde-oscuro); }
.btn-outline:hover { background: var(--verde-oscuro); color: #fff; }
.btn-suave { background: var(--verde-suave); border-color: var(--verde-suave); color: var(--verde-oscuro); }
.btn-suave:hover { background: #d3efe3; border-color: #d3efe3; }
.btn-peligro { background: var(--alerta); border-color: var(--alerta); color: #fff; }
/* Sobre fondos oscuros (foto con capa, noche o verde oscuro) */
.btn-claro { background: #fff; border-color: #fff; color: var(--verde-oscuro); }
.btn-claro:hover { background: var(--verde-suave); border-color: var(--verde-suave); }
.btn-contorno-claro { background: transparent; border-color: #fff; color: #fff; }
.btn-contorno-claro:hover { background: #fff; color: var(--noche); }
.btn-sm { min-height: 44px; padding: 0.45rem 1rem; font-size: 0.95rem; }
.btn-lg { min-height: 56px; padding: 0.8rem 1.75rem; font-size: 1.05rem; }

/* Tarjeta */
.tarjeta {
  background: var(--hielo); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 1.25rem;
}
.tarjeta-blanca { background: #fff; }

/* Icono en recuadro: trazo verde oscuro sobre verde suave (el mint no lleva iconos blancos encima) */
.icono-recuadro {
  display: grid; place-items: center; width: 48px; height: 48px; flex: none;
  border-radius: 12px; background: var(--verde-suave); color: var(--verde-oscuro);
}

/* Etiquetas y estados */
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.2rem 0.65rem; border-radius: var(--radio-pildora);
  font-size: 0.8rem; font-weight: 650; line-height: 1.4;
}
.badge .punto { width: 8px; height: 8px; border-radius: 50%; }
.badge-libre { background: var(--verde-suave); color: var(--verde-oscuro); }
.badge-libre .punto { background: var(--verde); }
.badge-ocupado { background: var(--ocupado-bg); color: var(--ocupado-texto); }
.badge-ocupado .punto { background: var(--ocupado); }
.badge-reservado { background: var(--reservado-bg); color: var(--reservado-texto); }
.badge-reservado .punto { background: var(--reservado); }
.badge-alerta { background: var(--alerta-bg); color: var(--alerta); }
.badge-pro, .badge-free {
  font-family: var(--fuente-mono); font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.badge-pro { background: var(--verde-oscuro); color: #fff; }
.badge-free { background: var(--hielo); color: var(--tinta); border: 1px solid var(--linea); }

/* Campo de formulario: 48 px, borde línea; foco con anillo verde */
.campo { display: flex; flex-direction: column; gap: 0.3rem; }
.campo label { font-size: 0.85rem; font-weight: 600; color: var(--tinta); }
.campo input, .campo select, .campo textarea {
  min-height: 48px; padding: 0.5rem 0.75rem;
  border: 1px solid var(--linea); border-radius: var(--radio-campo);
  background: #fff; color: var(--tinta); font-family: var(--fuente-texto); font-size: 1rem;
}
.campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: 3px solid rgb(35 205 151 / 0.45); border-color: var(--verde-oscuro);
}
.campo .mono { font-family: var(--fuente-mono); letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- Estructura y piezas compartidas entre páginas ---------- */
.wrap { width: min(var(--ancho-max), 100% - 2 * var(--margen)); margin-inline: auto; }

/* Ventana (<dialog> nativo: trae Escape, foco atrapado y fondo oscuro) */
.modal {
  border: 0; border-radius: 16px; padding: 0; width: calc(100% - 2rem); max-width: 460px; max-height: 88vh;
  color: var(--texto); box-shadow: var(--sombra-2);
}
.modal--ancha { max-width: 680px; }
.modal::backdrop { background: rgb(10 18 30 / 0.6); }
.modal[open] { display: flex; flex-direction: column; }
.modal__cabecera { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--linea); }
.modal__cabecera h2 { margin: 0; font-size: 1.25rem; }
.modal__cerrar { flex: none; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--texto-2); font-size: 2rem; line-height: 1; cursor: pointer; }
.modal__cerrar:hover { background: var(--hielo); color: var(--tinta); }
.modal__cuerpo { padding: 1.25rem; overflow-y: auto; }
.modal__cuerpo p { margin: 0 0 1rem; }
body.modal-abierto { overflow: hidden; }

/* WhatsApp flotante: 48 px en móvil; el verde de WhatsApp oscurecido para que el icono blanco llegue a 3:1 */
.wa-flotante {
  position: fixed; right: 0.75rem; bottom: 1rem; z-index: 50;
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: #1faa59; color: #fff; box-shadow: var(--sombra-2);
  transition: opacity 0.2s;
}
.wa-flotante:hover { background: #178a47; }
.wa-flotante svg { width: 26px; height: 26px; }
.wa-flotante.oculto { opacity: 0; pointer-events: none; }
@media (min-width: 768px) {
  .wa-flotante { right: 1.5rem; bottom: 1.5rem; width: 56px; height: 56px; }
  .wa-flotante svg { width: 30px; height: 30px; }
}
