/*
 * Recepción (kiosco) · "Línea con banda" (DESIGN.md §4). Sobre /estilos/tokens.css.
 * 1 rem = 16 px en la tablet de 1280×800 y escala solo en la TV de 1920×1080: min(1.25vw, 2vh).
 * Una sola animación: la banda entra barriendo en 260 ms (fundido de 120 ms con menos movimiento).
 */

/* Tokens propios de la recepción (tokens.css no se toca) */
:root {
  --texto: #f2f2f2; /* en la recepción no va blanco puro: no deslumbra */
  --k-texto-2: #d4d4d4; /* secundario que sí se lee (plan, vence, visitas) */
  --k-gris: #a3a3a3; /* solo lo que no hace falta leer: hora y saludo */
  --k-dia: #4a4a4a; /* contorno de los días sin visita */
  --k-pendiente: #262626; /* banda de "anotada" sin internet: no es un estado de la membresía */
}
:root[data-modo='madrugada'] {
  --texto: #d9d9d9;
  --k-texto-2: #b8b8b8;
  --k-gris: #949494;
  --ok: #12512d;
  --aviso: #c98a2c;
  --frio: #24578f;
  --vencido-filo: #b83a31;
  --k-dia: #3d3d3d;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}
html.kiosco {
  font-size: min(1.25vw, 2vh);
  height: 100%;
  overflow: hidden;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--letra);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
body {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--fondo);
  overscroll-behavior: none;
  touch-action: manipulation;
}
[hidden] {
  display: none !important;
}
.sprite {
  position: absolute;
}
::selection {
  background: var(--marca-rojo);
  color: #fff;
}
:focus-visible {
  outline: 3px solid var(--texto);
  outline-offset: 3px;
}
input,
button {
  font: inherit;
  color: inherit;
}
input {
  user-select: text;
  -webkit-user-select: text;
  caret-color: var(--marca-rojo);
}
input::placeholder {
  color: var(--k-gris);
  opacity: 1;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
.ico {
  flex: none;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.num,
time {
  font-variant-numeric: tabular-nums;
}

/* ───── Encabezado: casco, letrero, hora y sede ───── */
.tira {
  flex: none;
  height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 2.75rem;
}
.marca {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.casco {
  display: block;
  width: 5.25rem;
  height: auto;
}
.letrero {
  font-family: var(--letrero);
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.letrero b {
  font-weight: 400;
  color: var(--marca-rojo);
}
.hora {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-stretch: var(--angosta);
  font-weight: 600;
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--k-gris);
  white-space: nowrap;
}
/* Sin internet: discreto, en el encabezado, con ícono y palabra */
.red {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 1.4rem;
  font-size: 1.4rem;
  color: var(--aviso-t);
}
.red .ico {
  width: 1.9rem;
  height: 1.9rem;
  stroke-width: 2;
}

/* ───── Pantallas ───── */
.pantalla {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.p-entrada {
  padding-bottom: 5.5rem; /* el renglón de "¿No eres tú?" */
}

/* Nombre: saludo y nombre de pila en un renglón; baja de tamaño, nunca se parte */
.nombre {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1.6rem;
  padding: 0 3rem 2.25rem;
  font-stretch: var(--angosta);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.9;
  white-space: nowrap;
  overflow: hidden;
}
.nombre .saludo {
  flex: none;
  font-weight: 600;
  font-size: 3.4rem;
  letter-spacing: 0.04em;
  color: var(--k-gris);
}
.nombre .pila {
  font-size: var(--tam-nombre, 10rem);
  letter-spacing: 0.01em;
}

/* ───── Banda de estado de lado a lado ───── */
.banda {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  min-height: 17rem;
  padding: 1.25rem 3rem;
  overflow: hidden;
  animation: barre var(--barrido) both;
}
.banda--ok {
  background: var(--ok);
  color: var(--ok-sobre);
}
.banda--aviso {
  background: var(--aviso);
  color: var(--aviso-sobre);
}
.banda--frio {
  background: var(--frio);
  color: var(--frio-sobre);
}
/* Vencida: sin relleno de color, carbón con filos y la palabra en salmón. No exhibe al socio */
.banda--venc {
  background: var(--vencido-banda);
  color: var(--texto);
  border-block: 0.5rem solid var(--vencido-filo);
}
.banda--venc .placa {
  color: var(--vencido-t);
}
.banda--pend {
  background: var(--k-pendiente);
  color: var(--texto);
}
.placa {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-stretch: var(--angosta);
  font-weight: 800;
  font-size: 3.2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}
.placa .ico {
  width: 5.5rem;
  height: 5.5rem;
  stroke-width: 2.75;
}
.sep {
  flex: none;
  align-self: stretch;
  width: 3px;
  margin-block: 1.5rem;
  background: currentColor;
  opacity: 0.35;
}
.frase {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-stretch: var(--angosta);
  font-weight: 700;
  font-size: 4.4rem;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}
.frase--sola {
  font-weight: 800;
  font-size: 6.4rem;
}
.cifra {
  font-weight: 800;
  font-size: 15rem;
  line-height: 0.8;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.accion {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-stretch: var(--angosta);
  font-weight: 800;
  font-size: 7rem;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}
.accion .ico {
  width: 0.86em;
  height: 0.86em;
  stroke-width: 3;
}

/* ───── Debajo de la banda: plan, vence y la semana ───── */
.inf {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  padding: 2.25rem 3rem 0;
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--k-texto-2);
  text-align: center;
}
.inf p,
.semana > span {
  white-space: nowrap;
}
.inf strong {
  font-weight: 600;
  color: var(--texto);
}
.semana {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.dias {
  display: flex;
  gap: 0.6rem;
  list-style: none;
  padding: 0;
}
.dias li {
  width: 3.6rem;
  height: 3.6rem;
  display: grid;
  place-items: center;
  font-stretch: var(--angosta);
  font-weight: 700;
  font-size: 1.4rem;
  text-transform: uppercase;
  border: 2px solid var(--k-dia);
  color: var(--k-gris);
}
.dias li.si {
  background: var(--texto);
  border-color: var(--texto);
  color: var(--fondo);
}
.dias li.hoy {
  outline: 3px solid var(--texto);
  outline-offset: 4px;
}

/* "¿No eres tú?": gris, a la mano, mientras dura la bienvenida */
.no-soy {
  position: fixed;
  right: 2.75rem;
  bottom: 1rem;
  min-height: max(48px, 4rem);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0 1.6rem;
  border: 2px solid var(--linea-fuerte);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--k-texto-2);
}
.no-soy .ico {
  width: 2rem;
  height: 2rem;
}
.no-soy:active {
  background: var(--capa-2);
}

/* ───── Espera ───── */
.titular {
  text-align: center;
  font-stretch: var(--angosta);
  font-weight: 800;
  font-size: 7.5rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
  padding: 0 2rem 3rem;
  text-wrap: balance;
}
.titular b {
  font-weight: 800;
  color: var(--marca-rojo);
}
.titular--chico {
  font-size: 5.5rem;
}
.entrar {
  display: grid;
  grid-template-columns: 1.45fr 1px 1fr;
  gap: 4rem;
  align-items: center;
  width: min(76rem, 100% - 5.5rem);
  margin: 0 auto;
}
.e-sep {
  align-self: stretch;
  background: var(--linea);
}
.etq {
  display: block;
  font-stretch: var(--angosta);
  font-weight: 600;
  font-size: 1.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--k-texto-2);
  margin-bottom: 0.9rem;
}
/* En minúsculas: una "O" suelta en mayúsculas condensadas se lee como cero */
.etq--frase {
  font-stretch: 100%;
  font-size: 1.9rem;
  letter-spacing: 0;
  text-transform: none;
}
.campo {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  height: 6.25rem;
  padding: 0 1.75rem;
  border: 3px solid var(--texto);
  background: var(--fondo);
}
.campo .ico {
  width: 2.6rem;
  height: 2.6rem;
  color: var(--k-gris);
}
.campo input {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  background: none;
  border: 0;
  outline: none;
  font-size: 3rem;
  font-weight: 600;
}
.sug {
  list-style: none;
  padding: 0;
  min-height: 20rem;
}
.sug button {
  width: 100%;
  min-height: 5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 1.75rem;
  border-bottom: 1px solid var(--linea);
  font-size: 2.4rem;
  font-weight: 600;
  text-align: left;
}
.sug li:first-child button {
  background: var(--capa);
}
.sug button:active {
  background: var(--capa-2);
}
.sug button .ico {
  width: 2.2rem;
  height: 2.2rem;
  color: var(--k-gris);
}
.sug mark {
  background: none;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--marca-rojo);
  text-decoration-thickness: 0.2rem;
  text-underline-offset: 0.35rem;
}
.sug-ayuda {
  margin-top: -20rem;
  padding: 1.5rem 1.75rem;
  font-size: 2rem;
  color: var(--k-gris);
  pointer-events: none;
}
.qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}
.qr > .ico {
  width: 11rem;
  height: 11rem;
  stroke-width: 1.5;
}
.visor {
  position: relative;
  width: 15rem;
  height: 15rem;
  overflow: hidden;
  background: var(--capa);
}
.visor video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* como espejo: la cámara de enfrente */
  filter: grayscale(1) contrast(1.1) brightness(0.85);
}
.visor .marco {
  position: absolute;
  inset: 1.5rem;
  border: 3px solid var(--texto);
}
.qr-t {
  font-stretch: var(--angosta);
  font-weight: 800;
  font-size: 3.6rem;
  text-transform: uppercase;
  line-height: 1;
}
.qr-s {
  font-size: 1.8rem;
  color: var(--k-texto-2);
}
/* Campo del lector USB (QR o llavero) cuando no hay cámara con BarcodeDetector */
.lector {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 19rem;
  margin-top: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 2px solid var(--linea-fuerte);
}
.lector:focus-within {
  border-bottom-color: var(--texto);
}
.lector span {
  font-stretch: var(--angosta);
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--k-gris);
}
.lector input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--k-texto-2);
}
/* Con cámara el campo sigue recibiendo lo que teclea el lector del llavero, pero no se ve */
.lector.oculto {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.aviso {
  position: absolute;
  left: 50%;
  bottom: 2.5rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: calc(100% - 5.5rem);
  padding: 1.2rem 2rem;
  background: var(--capa-2);
  font-size: 2.2rem;
  font-weight: 600;
  white-space: nowrap;
}
.aviso .ico {
  width: 2.6rem;
  height: 2.6rem;
  color: var(--vencido-t);
}

/* ───── Emparejar ───── */
.emparejar {
  width: min(52rem, 100% - 5.5rem);
  margin: 0 auto;
}
.emparejar .campo input {
  font-size: 2.4rem;
  letter-spacing: 0.02em;
}
.ayuda {
  margin-top: 1.2rem;
  font-size: 1.8rem;
  color: var(--k-texto-2);
}
.ayuda.error {
  color: var(--vencido-t);
}
.boton {
  width: 100%;
  min-height: max(56px, 6rem);
  margin-top: 2.4rem;
  background: var(--accion);
  color: var(--accion-texto);
  font-stretch: var(--angosta);
  font-weight: 700;
  font-size: 2.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.boton:disabled {
  opacity: 0.5;
  cursor: progress;
}

/* Demo: botón chico para simular un QR */
.demo-qr {
  min-height: 48px;
  margin-right: 1.6rem;
  padding: 0 1.2rem;
  border: 1px solid var(--linea);
  font-stretch: 100%;
  font-weight: 500;
  font-size: max(14px, 1rem);
  letter-spacing: 0;
  text-transform: none;
  color: var(--texto-3);
}

/* ───── Salir a vender (personal): discreto, abajo a la izquierda ───── */
.vender-b {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--linea);
  color: var(--texto-3);
}
.vender-b .ico {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}
.vender-b:active {
  background: var(--capa-2);
}
.vender {
  width: min(36rem, 100% - 2rem);
  max-height: calc(100% - 2rem);
  margin: auto;
  padding: 2.4rem;
  border: 1px solid var(--linea-fuerte);
  background: var(--capa);
  color: var(--texto);
}
.vender::backdrop {
  background: rgb(0 0 0 / 0.82);
}
.vender-t {
  width: max-content;
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--marca-rojo);
  font-stretch: var(--angosta);
  font-weight: 800;
  font-size: 3rem;
  line-height: 1;
  text-transform: uppercase;
}
.vender-s {
  min-height: 2.6em;
  margin-top: 1.4rem;
  font-size: 1.7rem;
  color: var(--k-texto-2);
}
.vender-s.error {
  color: var(--vencido-t);
}
.pin {
  display: flex;
  justify-content: center;
  gap: 1.6rem;
  margin: 1.2rem 0 2rem;
}
.pin span {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--k-texto-2);
}
.pin span.lleno {
  background: var(--texto);
  border-color: var(--texto);
}
.teclado {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}
.teclado button {
  min-height: max(56px, 5.6rem);
  border: 2px solid var(--linea-fuerte);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 2.8rem;
}
.teclado .t-texto {
  font-stretch: var(--angosta);
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--k-texto-2);
}
.teclado button:active {
  background: var(--capa-2);
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* ───── El único movimiento: la banda barre de izquierda a derecha ───── */
@keyframes barre {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}
@keyframes aparece {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .banda {
    animation: aparece var(--fundido) both;
  }
}
