/* sellos.css — La Tarjeta de la Casa: el cartón de sellos (en todas partes),
   la página del cliente y el panel del negocio (/gestion/sellos).
   El color de cada negocio llega en --sc-fondo y --sc-texto. */

:root {
  --s-tinta: #1b1d2e;
  --s-gris: #5b5f76;
  --s-linea: #e3e5ee;
  --s-fondo: #f5f6fa;
  --s-verde: #146c43;
  --s-ambar: #8a5200;
  --s-rojo: #b3261e;
  --s-dorado: #7a5c00;
}

/* Lo que lleva «hidden» no se ve, aunque su clase le ponga display: flex o grid. */
[hidden] { display: none !important; }
.sp-oculto { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- El cartón (la tarjeta con sus casillas) ---------- */
.sc {
  --sc-fondo: #5b3a29; --sc-texto: #ffffff;
  background: var(--sc-fondo); color: var(--sc-texto);
  border-radius: 22px; padding: 1.2rem 1.2rem 1.1rem;
  box-shadow: 0 14px 34px rgba(20, 22, 40, .22);
  position: relative; overflow: hidden; max-width: 420px; margin: 0 auto;
}
.sc::after { /* un brillo suave: que parezca una tarjeta, no un recuadro */
  content: ""; position: absolute; inset: -40% -30% auto auto; width: 70%; height: 120%;
  background: radial-gradient(closest-side, rgba(255,255,255,.14), transparent); pointer-events: none;
}
.sc__cab { display: flex; align-items: center; gap: .7rem; margin-bottom: .9rem; }
.sc__logo { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; background: rgba(255,255,255,.15); flex: none; }
.sc__nombre { font-size: 1.15rem; font-weight: 800; line-height: 1.15; margin: 0; }
.sc__sub { font-size: .8rem; opacity: .85; margin: .1rem 0 0; }
.sc__casillas { display: grid; grid-template-columns: repeat(5, 1fr); gap: .55rem; margin: .4rem 0 .9rem; }
.sc__casillas--6 { grid-template-columns: repeat(6, 1fr); }
.sc__casilla {
  aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  border: 2px dashed currentColor; opacity: .55; font-size: 1.05rem; font-weight: 800;
}
.sc__casilla--llena { border-style: solid; opacity: 1; background: var(--sc-texto); color: var(--sc-fondo); }
.sc__casilla--premio { opacity: .9; border-style: solid; }
.sc__casilla--premio.sc__casilla--llena { background: #f5c542; color: #3a2a00; border-color: #f5c542; }
.sc__casilla--nueva { animation: sc-sello .55s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes sc-sello { from { transform: scale(1.8) rotate(-18deg); opacity: 0; } to { transform: none; opacity: 1; } }
.sc__pie { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; font-size: .9rem; }
.sc__cuenta { font-weight: 800; font-size: 1.05rem; }
.sc__regla { opacity: .9; text-align: right; }
@media (prefers-reduced-motion: reduce) { .sc__casilla--nueva { animation: none; } }

/* ---------- Páginas del cliente (/sellos/…) ---------- */
.sp-cuerpo { margin: 0; font-family: Poppins, system-ui, sans-serif; background: var(--s-fondo); color: var(--s-tinta); }
.sp { max-width: 460px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
.sp h1 { font-size: 1.35rem; margin: .2rem 0 .3rem; }
.sp h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.sp-caja { background: #fff; border: 1px solid var(--s-linea); border-radius: 18px; padding: 1.1rem; margin-top: 1rem; }
.sp-texto { color: var(--s-gris); font-size: .92rem; margin: .2rem 0 .8rem; line-height: 1.5; }
.sp-campo { display: grid; gap: .3rem; margin-bottom: .85rem; font-weight: 600; font-size: .92rem; }
.sp-campo input[type="text"], .sp-campo input[type="tel"], .sp-campo input[type="email"] {
  font: inherit; font-weight: 400; padding: .8rem .9rem; border: 1px solid #cfd3e1; border-radius: 12px; width: 100%; box-sizing: border-box; }
.sp-campo small { font-weight: 400; color: var(--s-gris); font-size: .8rem; }
.sp-check { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; margin-bottom: .7rem; line-height: 1.4; }
.sp-check input { width: 1.25rem; height: 1.25rem; margin-top: .1rem; flex: none; accent-color: var(--sc-fondo, #273981); }
.sp-error { color: var(--s-rojo); font-size: .84rem; font-weight: 600; min-height: 1.1em; margin: .2rem 0 .6rem; }
.sp-boton {
  display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; box-sizing: border-box;
  font: inherit; font-weight: 700; font-size: 1rem; padding: .95rem 1rem; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--sc-fondo, #273981); color: var(--sc-texto, #fff); text-decoration: none; }
.sp-boton[disabled] { opacity: .6; cursor: progress; }
.sp-boton--claro { background: #fff; color: var(--s-tinta); border: 1px solid #cfd3e1; }
.sp-boton--negro { background: #111; color: #fff; }
.sp-botones { display: grid; gap: .6rem; margin-top: .8rem; }
.sp-qr { display: grid; justify-items: center; gap: .4rem; padding: .4rem 0; }
.sp-qr__img { background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--s-linea); }
.sp-qr__img img, .sp-qr__img canvas { display: block; }
.sp-codigo { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.25rem; font-weight: 700; letter-spacing: .08em; }
.sp-premio { background: #fff8e1; border: 2px solid #f5c542; border-radius: 16px; padding: .9rem 1rem; margin-top: 1rem; font-weight: 600; }
.sp-premio strong { display: block; font-size: 1.05rem; }
.sp-aviso { background: #e9f7ef; color: #135c3a; border-radius: 14px; padding: .8rem 1rem; margin-top: 1rem; font-size: .92rem; font-weight: 600; }
.sp-pie { color: var(--s-gris); font-size: .78rem; text-align: center; margin-top: 1.6rem; line-height: 1.5; }
.sp-pie a { color: inherit; }
.sp-enlace { background: none; border: 0; padding: 0; font: inherit; color: var(--s-rojo); text-decoration: underline; cursor: pointer; font-size: .86rem; }
.sp-fila { display: flex; justify-content: space-between; align-items: center; gap: .8rem; }
.sp-interruptor { position: relative; width: 52px; height: 30px; flex: none; }
.sp-interruptor input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.sp-interruptor span { position: absolute; inset: 0; border-radius: 30px; background: #c9cdda; transition: background .2s; pointer-events: none; }
.sp-interruptor span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.sp-interruptor input:checked + span { background: var(--s-verde); }
.sp-interruptor input:checked + span::after { transform: translateX(22px); }
.sp-interruptor input:focus-visible + span { outline: 3px solid #273981; outline-offset: 2px; }
.sp-ios { font-size: .86rem; color: var(--s-gris); background: var(--s-fondo); border-radius: 12px; padding: .7rem .8rem; margin-top: .6rem; }

/* ---------- El panel del negocio (/gestion/sellos) ---------- */
.fs { max-width: 1100px; margin: 0 auto; }
.fs-pestanas { display: flex; gap: .3rem; flex-wrap: wrap; border-bottom: 1px solid var(--s-linea); margin: .4rem 0 1rem; }
.fs-pestanas button {
  font: inherit; font-weight: 600; font-size: .95rem; background: none; border: 0; border-bottom: 3px solid transparent;
  padding: .7rem .9rem; cursor: pointer; color: var(--s-gris); }
.fs-pestanas button[aria-selected="true"] { color: var(--s-tinta); border-bottom-color: var(--acento, #273981); }
.fs-caja { background: #fff; border: 1px solid var(--s-linea); border-radius: 16px; padding: 1.1rem 1.2rem; }
.fs-caja + .fs-caja { margin-top: 1rem; }
.fs-caja h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
.fs-gris { color: var(--s-gris); font-size: .9rem; }
.fs-hoy { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; font-size: .9rem; color: var(--s-gris); align-items: center; }
.fs-hoy strong { color: var(--s-tinta); font-size: 1.05rem; }
.fs-doble { background: #f5c542; color: #3a2a00; font-weight: 800; border-radius: 999px; padding: .2rem .7rem; font-size: .8rem; }
.fs-caja-quien { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; justify-content: space-between; }

.fs-mostrador { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.fs-camara { position: relative; background: #0f1124; border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 3; display: grid; place-items: center; color: #fff; }
.fs-camara video { width: 100%; height: 100%; object-fit: cover; display: block; }
.fs-camara__marco { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.85); border-radius: 18px; pointer-events: none; }
.fs-camara__txt { position: absolute; left: 0; right: 0; bottom: .6rem; text-align: center; font-size: .85rem; text-shadow: 0 1px 3px #000; }
.fs-camara__off { padding: 1.2rem; text-align: center; display: grid; gap: .7rem; justify-items: center; }
.fs-codigo { display: flex; gap: .5rem; margin-top: .8rem; }
.fs-codigo input { flex: 1; min-width: 0; font: inherit; font-size: 1.1rem; letter-spacing: .06em; text-transform: uppercase; padding: .75rem .9rem; border: 1px solid #cfd3e1; border-radius: 12px; }
.fs-boton {
  font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: .75rem 1.1rem; cursor: pointer;
  background: var(--acento, #273981); color: var(--acento-texto, #fff); }
.fs-boton--claro { background: #fff; color: var(--s-tinta); border: 1px solid #cfd3e1; }
.fs-boton--grande { font-size: 1.15rem; padding: 1rem 1.3rem; }
.fs-boton--peligro { background: #fff; color: var(--s-rojo); border: 1px solid #e7b4b0; }
.fs-boton[disabled] { opacity: .55; cursor: progress; }
.fs-botones { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }

/* El resultado: cuatro colores, que se vean desde lejos. */
.fs-res { border-radius: 16px; padding: 1.1rem 1.2rem; border: 3px solid transparent; min-height: 9rem; }
.fs-res--vacio { border: 2px dashed var(--s-linea); color: var(--s-gris); display: grid; place-items: center; text-align: center; }
.fs-res--verde { background: #e7f6ee; border-color: var(--s-verde); }
.fs-res--ambar { background: #fff4e0; border-color: var(--s-ambar); }
.fs-res--dorado { background: #fff8e1; border-color: #f5c542; }
.fs-res--rojo { background: #fdecea; border-color: var(--s-rojo); }
.fs-res--carton, .fs-res--listo { background: #eef1fb; border-color: #273981; }
.fs-res__titulo { font-size: 1.35rem; font-weight: 800; margin: 0 0 .25rem; }
.fs-res--verde .fs-res__titulo { color: var(--s-verde); }
.fs-res--ambar .fs-res__titulo { color: var(--s-ambar); }
.fs-res--rojo .fs-res__titulo { color: var(--s-rojo); }
.fs-res--dorado .fs-res__titulo { color: var(--s-dorado); }
.fs-res__quien { font-size: 1.05rem; font-weight: 700; margin: 0; }
.fs-res__linea { margin: .3rem 0 0; color: var(--s-tinta); }
.fs-puntos { display: flex; flex-wrap: wrap; gap: .3rem; margin: .6rem 0 0; }
.fs-puntos span { width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 2px solid #9aa0b8; }
.fs-puntos span.lleno { background: var(--acento, #273981); border-color: var(--acento, #273981); }
.fs-cantidad { display: inline-flex; align-items: center; gap: .4rem; }
.fs-cantidad button { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid #cfd3e1; background: #fff; font-size: 1.3rem; cursor: pointer; }
.fs-cantidad output { min-width: 2ch; text-align: center; font-weight: 800; font-size: 1.2rem; }

.fs-lista { list-style: none; margin: 0; padding: 0; }
.fs-lista li { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .7rem .2rem; border-bottom: 1px solid var(--s-linea); }
.fs-lista li:last-child { border-bottom: 0; }
.fs-lista button.fs-fila { all: unset; cursor: pointer; display: flex; justify-content: space-between; gap: .8rem; width: 100%; align-items: center; }
.fs-lista button.fs-fila:focus-visible { outline: 3px solid #273981; outline-offset: 2px; border-radius: 6px; }
.fs-mini { font-size: .82rem; color: var(--s-gris); }
.fs-buscar { display: flex; gap: .5rem; margin-bottom: .8rem; }
.fs-buscar input { flex: 1; min-width: 0; font: inherit; padding: .7rem .9rem; border: 1px solid #cfd3e1; border-radius: 12px; }
.fs-campos { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; }
.fs-campos label, .fs-campo { display: grid; gap: .3rem; font-weight: 600; font-size: .9rem; }
.fs-campos input, .fs-campos select, .fs-campos textarea, .fs-campo input, .fs-campo textarea, .fs-campo select {
  font: inherit; font-weight: 400; padding: .65rem .8rem; border: 1px solid #cfd3e1; border-radius: 10px; width: 100%; box-sizing: border-box; }
.fs-campos small, .fs-campo small { font-weight: 400; color: var(--s-gris); font-size: .8rem; }
.fs-ancho { grid-column: 1 / -1; }
.fs-check { display: flex !important; align-items: center; gap: .5rem; font-weight: 500 !important; }
.fs-check input { width: 1.15rem; height: 1.15rem; }
.fs-cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .7rem; }
.fs-cifra { background: var(--s-fondo); border-radius: 14px; padding: .8rem .9rem; }
.fs-cifra b { display: block; font-size: 1.6rem; line-height: 1.1; }
.fs-cifra span { font-size: .82rem; color: var(--s-gris); }
.fs-alerta { background: #fff4e0; border-left: 4px solid var(--s-ambar); padding: .55rem .8rem; border-radius: 8px; margin: .4rem 0; font-size: .9rem; }
.fs-estado { font-size: .82rem; font-weight: 700; border-radius: 999px; padding: .15rem .6rem; background: var(--s-fondo); color: var(--s-gris); }
.fs-estado--programada { background: #eef1fb; color: #273981; }
.fs-estado--enviada { background: #e7f6ee; color: var(--s-verde); }
.fs-estado--cancelada { background: #f1f1f4; color: #8a8ea3; text-decoration: line-through; }
.fs-msg { font-size: .88rem; font-weight: 600; min-height: 1.2em; margin: .5rem 0 0; }
.fs-msg--ok { color: var(--s-verde); } .fs-msg--error { color: var(--s-rojo); }
.fs-modal { border: 0; border-radius: 18px; padding: 1.3rem; max-width: min(440px, 92vw); width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.fs-modal::backdrop { background: rgba(15, 17, 36, .55); }
.fs-modal h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
.fs-pin { font-size: 1.6rem !important; letter-spacing: .4em; text-align: center; }
.fs-qr-alta { display: grid; justify-items: center; gap: .5rem; text-align: center; }
.fs-oculto { display: none !important; }
.fs-deshacer { margin-top: .8rem; }

@media (max-width: 820px) {
  .fs-mostrador { grid-template-columns: 1fr; }
  .fs-campos { grid-template-columns: 1fr; }
}
