/* Tour de las luciérnagas – Limoncocha · Estilos públicos (mobile first) */
:root {
  --selva: #1b4622;       /* fondo verde oscuro */
  --verde: #48a02d;       /* verde de marca: números, bordes, etiquetas */
  --verde-texto: #3a854d; /* títulos verdes y horas */
  --verde-boleto: #419343;
  --verde-suave: #f1f7f1; /* baldosas de pasos */
  --crema: #f6ffdf;
  --rojo: #cf2d39;
  --rojo-fondo: #a82b32;
  --tinta: #1b4622;
  --marino: #1a202d;
  --gris: #6b7280;
  --borde: #48a02d;
  --blanco: #fff;
  --radio: 20px;
  --sombra: 0 6px 22px rgba(0, 0, 0, .18);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #fff; }
body {
  margin: 0;
  font: 16px/1.45 "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--tinta);
  background: var(--selva);
  overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
p { margin: 0 0 .8em; }
a { color: var(--verde-texto); }
img { max-width: 100%; }
[hidden] { display: none !important; }
.visualmente-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rojo { color: var(--rojo); }

/* ---------- Portada (capas: foto, logo, Alcaldía, REGISTRO, caimán, sello) ---------- */
.portada { position: relative; max-width: 760px; margin: 0 auto; aspect-ratio: 1000 / 682; z-index: 2; }
.portada__escena {
  position: absolute; inset: 0; overflow: hidden;
  background: #0c1a24 url("../img/portada-fondo.jpg") 50% 40% / cover no-repeat;
}
.portada__escena::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 10%;
  background: linear-gradient(to bottom, rgba(27, 70, 34, 0), rgba(27, 70, 34, .55)); pointer-events: none;
}
.portada__escena img { position: absolute; display: block; height: auto; max-width: none; }
.portada__logo     { left: 12%;   top: 7.6%;  width: 76%; }
.portada__alcaldia { left: 36.5%; top: 67.2%; width: 27.3%; }
.portada__registro { left: 40.5%; top: 82.4%; width: 19.1%; }
.portada__caiman   { left: 54.9%; top: 84.3%; width: 55.8%; }

/* Sellos postales: grabado multiplicado sobre papel verde claro; las líneas quedan verde oscuro */
.sello { position: absolute; z-index: 3; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35)); }
.sello__papel {
  --r: 4px;
  position: relative; display: block; width: 100%; height: 100%; overflow: hidden;
  background: #6ec970; isolation: isolate;
  -webkit-mask:
    radial-gradient(var(--r), #0000 98%, #000) round calc(-1.5 * var(--r)) calc(-1.5 * var(--r)) / calc(3 * var(--r)) calc(3 * var(--r)),
    linear-gradient(#000 0 0) no-repeat 50% / calc(100% - 3 * var(--r)) calc(100% - 3 * var(--r));
  mask:
    radial-gradient(var(--r), #0000 98%, #000) round calc(-1.5 * var(--r)) calc(-1.5 * var(--r)) / calc(3 * var(--r)) calc(3 * var(--r)),
    linear-gradient(#000 0 0) no-repeat 50% / calc(100% - 3 * var(--r)) calc(100% - 3 * var(--r));
}
.sello__papel::after { content: ""; position: absolute; inset: 0; background: var(--selva); mix-blend-mode: lighten; }
.sello__papel img { display: block; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.sello--hoatzin { left: 9.5%; top: 79.9%; width: 21.5%; max-width: 165px; aspect-ratio: 215 / 230; transform: rotate(-9deg); }
.sello--hoatzin img { object-position: 30% 4%; transform: scaleX(-1) scale(2.1); transform-origin: 30% 10%; }
.sello--canoa { right: 12px; top: -44px; width: 96px; aspect-ratio: 1; transform: rotate(8deg); }
.sello--canoa img { position: absolute; height: auto; object-fit: contain; }
.sello--canoa .canoa-1 { width: 125%; left: 2%; top: 6%; transform: rotate(24deg); }
.sello--canoa .canoa-2 { width: 80%; left: -18%; top: 58%; transform: rotate(-32deg); }

/* ---------- Contenedor y tarjetas ---------- */
.contenedor { max-width: 560px; margin: 0 auto; padding: 16px 16px 0; position: relative; }

.tarjeta {
  position: relative;
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 22px 18px;
  margin-bottom: 18px;
}
.tarjeta--crema { background: var(--crema); z-index: 2; }
.tarjeta h2 { font-size: 19px; font-weight: 600; color: var(--tinta); display: flex; align-items: center; gap: 10px; }
.num {
  flex: none; display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--verde); color: #fff; font-size: 15px; font-weight: 600; line-height: 1;
}
.num--rojo { background: var(--rojo); }

/* Información */
.info { text-align: center; padding-top: 26px; }
.info__texto { color: var(--verde-texto); font-size: 18px; line-height: 1.35; margin-bottom: 10px; }
.info__texto strong { font-weight: 700; }
.info__fecha {
  display: inline-block; font-weight: 600; font-size: 14px; color: var(--tinta);
  border: 1.5px solid var(--verde); border-radius: 999px; padding: 3px 14px; margin-bottom: 16px;
}
.info__punto { font-size: 14px; background: var(--verde-suave); padding: 8px 12px; border-radius: 10px; }
.pasos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.pasos li {
  display: flex; align-items: center; gap: 10px;
  background: var(--verde-suave); border-radius: 12px; padding: 12px 10px;
  font-size: 12.5px; font-weight: 600; line-height: 1.25; color: var(--tinta);
}
.pasos li.pasos__final { color: var(--rojo); font-size: 15px; font-weight: 700; }

.cerrado { text-align: center; }
.cerrado h2 { justify-content: center; color: var(--rojo); }

/* ---------- Términos ---------- */
.aviso { font-size: 14.5px; line-height: 1.4; color: var(--tinta); margin-bottom: 16px; text-align: justify; }
.aviso p { margin: 0 0 .75em; }
.aviso__punto { font-style: italic; font-weight: 500; text-align: left; }
.aviso__punto::before { content: "• "; }
.check {
  display: flex; gap: 12px; align-items: center;
  padding: 14px; background: #fff;
  border: 2px solid #e8e3c5; border-radius: 16px; cursor: pointer;
  color: var(--rojo); font-weight: 700; font-size: 16px; line-height: 1.25;
  margin-bottom: 30px;
}
.check input {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0;
  width: 30px; height: 30px; border: 2.5px solid var(--rojo); border-radius: 7px; background: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.check input:checked { background: var(--rojo); }
.check input:checked::after { content: ""; width: 8px; height: 15px; border: solid #fff; border-width: 0 3px 3px 0; transform: translateY(-2px) rotate(45deg); }
.check input:focus-visible { outline: 3px solid var(--verde); outline-offset: 2px; }
.check.marcado { border-color: var(--verde); }
.check--error { border-color: var(--rojo); box-shadow: 0 0 0 3px rgba(207, 45, 57, .15); }
.sticker-camara { position: absolute; right: 4px; bottom: -46px; width: 96px; transform: rotate(-4deg); filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25)); }

/* ---------- Horarios ---------- */
.horarios { display: grid; gap: 12px; }
.horario {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  min-height: 70px; padding: 10px 12px 10px 54px;
  border: 2px solid var(--verde); border-radius: 16px; cursor: pointer; background: #fff;
  transition: background-color .15s, box-shadow .15s;
}
.horario input { position: absolute; opacity: 0; pointer-events: none; }
.horario::before {
  content: ""; position: absolute; left: 12px; top: 50%; width: 30px; height: 30px; margin-top: -15px;
  border: 2.5px solid var(--verde); border-radius: 50%; background: #fff;
}
.horario__hora { font-size: 29px; font-weight: 600; letter-spacing: .02em; color: var(--verde-texto); line-height: 1; }
.horario__cupos { margin-left: auto; white-space: nowrap; font-size: 12px; font-weight: 700; color: var(--tinta); text-align: right; line-height: 1.2; }
.horario:has(input:checked) { background: var(--verde-suave); box-shadow: 0 0 0 3px rgba(72, 160, 45, .25); }
.horario:has(input:checked)::before { background: var(--verde); box-shadow: inset 0 0 0 5px #fff; }
.horario.marcado { background: var(--verde-suave); box-shadow: 0 0 0 3px rgba(72, 160, 45, .25); }
.horario.marcado::before { background: var(--verde); box-shadow: inset 0 0 0 5px #fff; }
.horario:has(input:focus-visible) { outline: 3px solid var(--selva); outline-offset: 2px; }
.horario--agotado { cursor: not-allowed; border-style: dashed; border-color: #c9cfc9; background: #f6f6f6; }
.horario--agotado::before { border-color: #c9cfc9; background: #f6f6f6; }
.horario--agotado .horario__hora { color: #a3aaa4; text-decoration: line-through; }
.horario--agotado .horario__cupos { color: var(--rojo); }
.horario--pocos .horario__cupos { color: var(--rojo); }

/* ---------- Campos ---------- */
.tarjeta--datos { z-index: 1; padding-top: 26px; }
.campo { margin-bottom: 14px; }
.campo label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 15px; color: var(--tinta); }
.campo input, .campo select {
  width: 100%; min-height: 52px; padding: 11px 16px;
  font: inherit; font-size: 17px; color: var(--tinta);
  border: 1.5px solid var(--borde); border-radius: 14px; background: #fff;
  -webkit-appearance: none; appearance: none;
}
.campo select {
  padding-right: 44px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%2348A02D' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 22px;
}
.campo select:invalid { color: #a3a9a4; }
.campo select option { color: var(--tinta); }
.campo input::placeholder { color: #a3a9a4; }
.campo input:focus, .campo select:focus { outline: none; border-color: var(--verde); box-shadow: 0 0 0 4px rgba(72, 160, 45, .2); }
.campo--corto input { max-width: 150px; }
.campo--error input, .campo--error select { border-color: var(--rojo); background-color: #fffafa; }
.campo__error { color: var(--rojo); font-size: 13.5px; font-weight: 600; margin: 6px 0 0; }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Zona roja (botón y recuperación) ---------- */
.zona-roja {
  position: relative;
  background: var(--rojo-fondo);
  box-shadow: 0 0 0 100vmax var(--rojo-fondo);
  clip-path: inset(0 -100vmax);
}
.zona-roja--boton { margin-top: -120px; padding-top: 138px; padding-bottom: 6px; }
.zona-roja--final { padding: 14px 0 0; text-align: center; color: #fff; }
.alcaldia-pestana {
  width: 56%; max-width: 260px; margin: 32px auto 0; padding: 14px 18px 8px;
  background: #fff; border-radius: 26px 26px 0 0;
}
.alcaldia-pestana img { display: block; width: 100%; height: auto; }
.zona-roja__regla { font-weight: 700; font-size: 17px; margin-bottom: 6px; }
.zona-roja__texto { font-size: 15px; line-height: 1.35; max-width: 320px; margin: 0 auto 4px; }
.zona-roja__flecha { width: 26px; height: 26px; display: block; margin: 0 auto 10px; }

/* ---------- Botones ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 56px; padding: 12px 20px;
  font: inherit; font-size: 18px; font-weight: 600; text-align: center; text-decoration: none;
  border: 2px solid transparent; border-radius: 16px; cursor: pointer;
  margin-bottom: 10px; -webkit-tap-highlight-color: transparent;
}
.btn--blanco { background: #fff; color: var(--rojo); font-size: 20px; min-height: 64px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.btn--blanco:active { transform: translateY(1px); }
.btn--verde { background: var(--verde); color: #fff; }
.btn--verde:hover { background: var(--verde-texto); }
.btn--contorno { background: #fff; color: var(--verde-texto); border-color: var(--verde); }
.btn:disabled { opacity: .7; cursor: wait; }
.btn .girando { width: 20px; height: 20px; border: 3px solid rgba(207, 45, 57, .3); border-top-color: var(--rojo); border-radius: 50%; animation: girar .8s linear infinite; }
.btn--verde .girando { border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }
@keyframes girar { to { transform: rotate(360deg); } }

.nota { font-size: 13.5px; color: var(--gris); }
.alerta { padding: 12px 14px; border-radius: 14px; margin-bottom: 16px; font-weight: 600; }
.alerta--error { background: #fde7e9; color: var(--rojo); }

/* ---------- Resultado ---------- */
.resultado {
  position: relative; background: #fff; border-radius: var(--radio); box-shadow: var(--sombra);
  padding: 48px 18px 14px; margin: 8px 0 18px; text-align: center; scroll-margin-top: 16px;
  border-top: 8px solid var(--verde);
}
.resultado--aviso { border-top-color: #f2b705; }
.resultado--error { border-top-color: var(--rojo); padding-bottom: 8px; }
.resultado__pestana {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  background: var(--crema); color: var(--tinta); font-weight: 700; font-size: 18px; white-space: nowrap;
  padding: 4px 22px 6px; border-radius: 0 0 14px 14px;
}
.resultado--error .resultado__pestana { color: var(--rojo); }
.resultado__saludo { font-size: 16px; font-weight: 500; }
.resultado__numero {
  background: var(--selva); color: #fff; border-radius: 14px; padding: 10px 12px; margin: 12px 0;
  font-size: 40px; font-weight: 600; letter-spacing: .04em; line-height: 1.1;
}
.resultado__numero span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.lista-errores { text-align: left; color: var(--rojo); font-size: 14px; }
.recordatorio {
  background: var(--rojo); color: #fff; font-size: 16px; line-height: 1.3;
  padding: 12px 14px; border-radius: 12px; text-align: center; margin: 14px 0;
}

/* ---------- Recuperar ---------- */
.recuperar { text-align: left; margin-bottom: 0; padding: 16px 18px; }
.recuperar summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-weight: 700; font-size: 17px; line-height: 1.25; color: var(--verde-texto);
}
.recuperar summary::-webkit-details-marker { display: none; }
.recuperar summary::after {
  content: "+"; flex: none; display: grid; place-items: center;
  width: 34px; height: 34px; border: 2.5px solid var(--verde); border-radius: 50%;
  color: var(--verde); font-size: 26px; font-weight: 400; line-height: 1;
}
.recuperar[open] summary::after { content: "–"; }
.recuperar[open] summary { margin-bottom: 16px; }

/* ---------- Pie ---------- */
.pie { background: #fff; color: #a9aea9; text-align: center; font-size: 13px; font-weight: 600; padding: 8px 16px 28px; }
.pie p { margin: 0; }

/* =========================================================
   Vista del boleto (boleto.php) — misma composición que el PDF
   ========================================================= */
.pagina-boleto { background: var(--verde-boleto); }
.contenedor--boleto { max-width: 480px; margin: 0 auto; padding: 22px 16px 10px; }
.boleto { position: relative; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.boleto__cabecera { position: relative; aspect-ratio: 732 / 421; background: #0d1a2b url("../img/boleto-foto.jpg") center / cover no-repeat; color: #fff; container-type: inline-size; }
.boleto__pestana {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  background: var(--crema); color: var(--tinta); font-weight: 700; font-size: 4.4cqw;
  padding: .1em .9em .25em; border-radius: 0 0 .7em .7em; white-space: nowrap;
}
.boleto__logo { position: absolute; left: 11.2%; top: 15%; width: 52.7%; height: auto; }
.boleto__alcaldia { position: absolute; left: 32.5%; top: 67.9%; width: 35%; height: auto; }
.boleto__numero { position: absolute; left: 67.4%; top: 29.2%; padding-left: 3.2%; border-left: 1.5px solid var(--verde); }
.boleto__numero span { display: block; font-size: 2.3cqw; font-weight: 700; letter-spacing: .02em; }
.boleto__numero strong { display: block; font-size: 8.2cqw; font-weight: 500; line-height: 1.05; letter-spacing: .02em; }
.boleto__fecha {
  position: absolute; left: 50%; bottom: 4.4%; transform: translateX(-50%); margin: 0;
  border: 1.5px solid #fff; border-radius: .5em; padding: .05em .9em; white-space: nowrap;
  font-weight: 700; font-size: 3.5cqw;
}
.boleto__perforacion { position: relative; height: 0; border-top: 2px dotted var(--verde); }
.boleto__perforacion::before, .boleto__perforacion::after {
  content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--verde-boleto);
}
.boleto__perforacion::before { left: -11px; }
.boleto__perforacion::after { right: -11px; }
.boleto__cuerpo { padding: 22px 7% 22px; }
.boleto__nombre { text-align: center; margin: 0 0 16px; }
.boleto__nombre dt, .boleto__datos dt { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--tinta); }
.boleto__nombre dd { margin: 0; font-size: 22px; color: var(--tinta); line-height: 1.25; }
.boleto__datos { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px 12px; margin: 0 0 18px; padding: 0 4%; }
.boleto__datos dd { margin: 0; font-size: 16px; color: var(--tinta); overflow-wrap: anywhere; }
.boleto .recordatorio { font-size: 16.5px; margin: 0 0 18px; }
.boleto__qr { display: flex; align-items: center; gap: 16px; }
.boleto__qr-imagen { flex: none; width: 34%; max-width: 150px; }
.boleto__qr-imagen svg { display: block; width: 100%; height: auto; }
.boleto__qr-texto { min-width: 0; }
.boleto__qr-texto .etiqueta { color: var(--verde); font-size: 13px; margin: 0; }
.boleto__qr-texto .codigo { color: var(--marino); font-size: 23px; font-weight: 700; line-height: 1.15; margin: 0 0 4px; white-space: nowrap; }
.boleto__qr-texto .escanea { color: var(--verde); font-size: 13.5px; margin: 0 0 6px; line-height: 1.3; }
.boleto__qr-texto .presenta { color: var(--rojo); font-size: 12.5px; font-weight: 600; margin: 0; line-height: 1.3; }
.boleto__registrado { color: #fff; text-align: center; font-size: 15px; margin: 14px 0 18px; }
.acciones { display: grid; gap: 0; }
.acciones .btn--contorno { background: transparent; color: #fff; border-color: #fff; }
.acciones .enlace { display: block; text-align: center; padding: 10px; color: #fff; font-weight: 600; }

@media (max-width: 380px) {
  .boleto__qr-texto .codigo { font-size: 19px; }
  .boleto__datos dd { font-size: 15px; }
  .horario__hora { font-size: 25px; }
  .horario__cupos { font-size: 11px; }
}

@media (min-width: 600px) {
  .tarjeta { padding: 26px; }
  .pasos li { font-size: 13.5px; }
  .acciones { grid-template-columns: 1fr 1fr; gap: 10px; }
  .acciones .enlace { grid-column: 1 / -1; }
}

@media print {
  body, .pagina-boleto { background: #fff; }
  .no-imprimir, .pie { display: none !important; }
  .boleto { box-shadow: none; border: 1px solid #ccc; }
  .boleto__registrado { color: #555; }
  .boleto, .boleto * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
