/* Estilos de la web móvil del club y del panel. Mobile-first, sin frameworks. */
:root {
  --fondo: #f4f1ea;
  --superficie: #ffffff;
  --texto: #1d1d1b;
  --texto-suave: #5f5d57;
  --marca: #1f3a2e;
  --marca-texto: #ffffff;
  --acento: #c8862a;
  --borde: #e2ddd2;
  --ok-fondo: #e3f1e7;
  --ok-texto: #1d5a33;
  --error-fondo: #fbe5e1;
  --error-texto: #8f2a1c;
  --info-fondo: #e8eef6;
  --info-texto: #284a73;
  --radio: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #141513;
    --superficie: #1e201d;
    --texto: #f1efe9;
    --texto-suave: #a9a69d;
    --marca: #7fc4a0;
    --marca-texto: #10231a;
    --acento: #e2a54f;
    --borde: #33362f;
    --ok-fondo: #183324;
    --ok-texto: #a9dfbd;
    --error-fondo: #3a1d18;
    --error-texto: #f2b3a8;
    --info-fondo: #1b2737;
    --info-texto: #b3c9e6;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--marca); }

.contenedor {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.panel .contenedor { max-width: 760px; justify-content: flex-start; }

.tarjeta {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 24px 20px;
}

h1 { margin: 0 0 12px; font-size: 1.6rem; line-height: 1.2; }
h1 a { color: inherit; text-decoration: none; }
h2 { margin: 0 0 12px; font-size: 1.15rem; }
p { margin: 0 0 12px; }
code { font-size: .9em; word-break: break-all; }

.antetitulo {
  margin-bottom: 4px;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--texto-suave);
}

.destacado { font-size: 1.05rem; }
.nota { color: var(--texto-suave); font-size: .9rem; margin: 8px 0 0; }

.premios { margin: 0 0 12px; padding-left: 20px; }

/* ── Botones ─────────────────────────────────────────── */
.acciones { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.acciones form { display: contents; }

.boton {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--marca);
  color: var(--marca);
  background: transparent;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.boton-principal { background: var(--marca); color: var(--marca-texto); }
.boton-grande { padding: 20px; font-size: 1.15rem; }
.boton.peligro { border-color: var(--error-texto); color: var(--error-texto); width: auto; }

.boton-enlace {
  background: none;
  border: 0;
  padding: 0;
  color: var(--marca);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.boton-enlace.peligro { color: var(--error-texto); }

/* ── Formularios ─────────────────────────────────────── */
.formulario { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > span { font-weight: 600; }
.campo small { color: var(--texto-suave); }

input:not([type="checkbox"]), textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: var(--fondo);
  color: var(--texto);
  font: inherit;
  font-size: 16px; /* evita el zoom automático de iOS */
}
input:focus, textarea:focus { outline: 2px solid var(--marca); outline-offset: 1px; }

.casilla { display: flex; gap: 10px; align-items: flex-start; }
.casilla input { width: 22px; height: 22px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--marca); }

.con-error input { border-color: var(--error-texto); }
.error, .campo small.error { color: var(--error-texto); font-weight: 600; }

.buscador { display: flex; gap: 8px; margin-bottom: 16px; }
.buscador .boton { width: auto; padding: 12px 16px; }

.fila-ajuste {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 12px 0;
  border-top: 1px solid var(--borde);
  margin-top: 12px;
  font-size: .95rem;
}

/* ── Avisos ──────────────────────────────────────────── */
.aviso { padding: 12px 16px; border-radius: 12px; font-weight: 600; }
.aviso-ok { background: var(--ok-fondo); color: var(--ok-texto); }
.aviso-error { background: var(--error-fondo); color: var(--error-texto); }
.aviso-info { background: var(--info-fondo); color: var(--info-texto); }
.aviso-grande { font-size: 1.2rem; text-align: center; padding: 18px; }

/* ── Tarjeta del club ────────────────────────────────── */
.tarjeta-club { text-align: center; }
.tarjeta-secundaria h2 { font-size: 1rem; }

.progreso { margin: 16px 0 4px; }
.puntos { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.punto {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--marca);
}
.punto.lleno { background: var(--marca); }
.barra { height: 14px; border-radius: 7px; background: var(--borde); overflow: hidden; }
.barra span { display: block; height: 100%; background: var(--marca); }
.progreso-texto { margin: 10px 0 0; font-size: 1.05rem; }
.tarjeta:not(.tarjeta-club) .puntos { justify-content: flex-start; }

.regalo {
  margin: 12px 0;
  padding: 16px;
  border-radius: 12px;
  border: 2px dashed var(--acento);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.regalo p { margin: 0; }
.regalo-titulo { font-size: 1.3rem; font-weight: 700; }

.qr {
  margin: 20px auto 8px;
  max-width: 260px;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  line-height: 0;
}
.qr svg { width: 100%; height: auto; }
.qr-grande { max-width: 340px; }
.qr-pie { font-weight: 600; margin: 0; }

/* ── Panel ───────────────────────────────────────────── */
.panel-barra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.panel-marca { font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--texto); }
.panel-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.panel-nav form { margin: 0; }

.cifras { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 600px) { .cifras { grid-template-columns: repeat(4, 1fr); } }
.cifra {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 14px;
  display: flex;
  flex-direction: column;
}
.cifra strong { font-size: 1.6rem; line-height: 1.1; }
.cifra span { color: var(--texto-suave); font-size: .85rem; }

.tabla-scroll { overflow-x: auto; margin: 0 -4px; }
.tabla { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabla th, .tabla td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--borde); white-space: nowrap; }
.tabla th { color: var(--texto-suave); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }

.lista-enlaces, .lista-tarjetas { list-style: none; margin: 0; padding: 0; }
.lista-enlaces li, .lista-tarjetas li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--borde);
}
.lista-tarjetas form { margin: 0; }

.etiqueta {
  font-size: .75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--borde);
  color: var(--texto-suave);
}

.datos { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.datos dt { color: var(--texto-suave); }
.datos dd { margin: 0; }

.zona-peligro { border-color: var(--error-texto); }

.escaner {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 1;
  max-width: 420px;
  margin: 0 auto;
}
.escaner video { width: 100%; height: 100%; object-fit: cover; }

.texto-legal h2 { margin-top: 20px; font-size: 1rem; }
.texto-legal ul { padding-left: 20px; }

.url-local { font-family: ui-monospace, monospace; word-break: break-all; text-align: center; }
.imprimible { text-align: center; }

@media print {
  body { background: #fff; color: #000; }
  .panel-barra, .no-imprimir { display: none; }
  .tarjeta { border: 0; }
  .contenedor { min-height: auto; }
}
