:root {
  --rosa: #e23b8a;
  --rosa-oscuro: #c2186a;
  --tinta: #3a2430;
  --suave: #8a6574;
  --linea: #f3d5e4;
  --fondo: #fff4f8;
  --card: #ffffff;
  --sombra: 0 18px 50px rgba(194, 24, 106, 0.12);
  font-family: "Segoe UI", "Avenir Next", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  color: var(--tinta);
  background:
    radial-gradient(circle at 12% -10%, #ffd0e6 0, transparent 42%),
    radial-gradient(circle at 110% 8%, #ffc4df 0, transparent 36%),
    var(--fondo);
}
.pagina {
  width: min(440px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 48px;
}
.marca { text-align: center; margin-bottom: 18px; }
.marca img {
  width: min(210px, 68%);
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(226, 59, 138, 0.18));
}
.marca p { margin: 8px 0 0; color: var(--suave); font-size: 0.95rem; }
.ficha {
  background: var(--card);
  border-radius: 28px;
  padding: 22px 18px 20px;
  box-shadow: var(--sombra);
}
h1 { margin: 0; font-size: 1.7rem; letter-spacing: -0.03em; }
.ayuda, .nota { color: var(--suave); margin: 6px 0 16px; font-size: 0.95rem; }
.nota { margin: 0 0 10px; }
fieldset { border: 0; margin: 0; padding: 0; }
legend, .leyenda { display: block; font-weight: 700; margin-bottom: 8px; }
label { display: block; font-weight: 700; margin: 12px 0; }
input[type="text"], input[type="email"], input[type="search"], input:not([type]) {
  width: 100%;
  margin-top: 6px;
  border: 1.5px solid var(--linea);
  background: #fff;
  border-radius: 14px;
  padding: 14px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--tinta);
}
input:focus, select:focus { outline: 3px solid rgba(226, 59, 138, 0.25); border-color: var(--rosa); }
.mayuscula { text-transform: uppercase; }
select {
  width: 100%;
  margin-top: 6px;
  border: 1.5px solid var(--linea);
  border-radius: 14px;
  padding: 14px 42px 14px 14px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--tinta);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%23e23b8a' d='M2 4.5 7 10l5-5.5'/%3E%3C/svg%3E") no-repeat right 14px center;
  appearance: none;
}
.opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opciones.tres { grid-template-columns: 1fr 1fr; }
.opcion {
  margin: 0;
  font-weight: 500;
}
.opcion input { position: absolute; opacity: 0; }
.opcion span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 72px;
  justify-content: center;
  border: 1.5px solid var(--linea);
  border-radius: 16px;
  padding: 10px 12px;
  background: #fff;
}
.opcion strong { font-size: 0.98rem; }
.opcion small, .suave { color: var(--suave); font-weight: 500; }
.opcion input:checked + span {
  border-color: var(--rosa);
  background: #fff0f6;
  box-shadow: inset 0 0 0 1px var(--rosa);
}
.opcion input:focus-visible + span { outline: 3px solid rgba(226, 59, 138, 0.35); }
.bloque { margin-top: 16px; }
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  margin: 8px 0;
  min-height: 36px;
}
.check input { width: 20px; height: 20px; accent-color: var(--rosa); }
.buscar, .enviar, .cerrar {
  font: inherit;
  cursor: pointer;
}
.buscar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 1.5px solid var(--linea);
  background: #fff;
  color: var(--tinta);
  border-radius: 14px;
  padding: 14px;
  font-size: 16px;
}
.buscar.elegido { border-color: var(--rosa); background: #fff0f6; }
.enviar {
  width: 100%;
  margin-top: 8px;
  border: 0;
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(180deg, #f25aa0, var(--rosa-oscuro));
  color: white;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 10px 20px rgba(194, 24, 106, 0.28);
}
.enviar:disabled { opacity: 0.65; }
.aviso {
  background: #fff1f2;
  color: #9f1239;
  border-radius: 12px;
  padding: 12px;
  margin: 0 0 12px;
}
.exito p { font-size: 1.05rem; line-height: 1.45; }
.oculto { display: none; }
.hoja {
  position: fixed;
  inset: 0;
  background: rgba(58, 36, 48, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.hoja[hidden] { display: none; }
.hoja-panel {
  width: min(480px, 100%);
  height: min(86vh, 720px);
  background: white;
  border-radius: 24px 24px 0 0;
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hoja-panel header { display: flex; justify-content: space-between; align-items: center; }
.hoja-panel h2 { margin: 0; font-size: 1.2rem; }
.cerrar {
  border: 0;
  background: #fff0f6;
  color: var(--rosa-oscuro);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
}
#listaMunicipios {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex: 1;
}
#listaMunicipios button {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #f6e4ec;
  background: white;
  padding: 14px 6px;
  font: inherit;
  font-size: 16px;
  color: var(--tinta);
}
#listaMunicipios button small { display: block; color: var(--suave); margin-top: 2px; }
@media (min-width: 720px) {
  .hoja { align-items: center; }
  .hoja-panel { border-radius: 24px; height: min(70vh, 640px); }
}
