/* Punto de fichaje en el navegador. Mismos colores y mismo recorrido que el modo
   fichaje de la app Nexo, para que no haya que explicar nada nuevo en la sala. */
:root {
  --bg: #f4f6f5;
  --card: #ffffff;
  --border: #e2e7e4;
  --text: #1b2620;
  --muted: #5c6b64;
  --dim: #9daea6;
  --accent: #8abaa0;
  --accent-hover: #6e9c84;
  --accent-soft: #e6f1ea;
  --success: #2e9e6b;
  --danger: #d6463f;
  --sombra-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --sombra-md: 0 8px 20px rgba(15, 23, 42, 0.10);
  --sombra-lg: 0 16px 40px rgba(15, 23, 42, 0.16);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.marca { padding: 32px 16px 8px; text-align: center; cursor: default; }
.marca-txt { font-size: 22px; font-weight: 700; color: var(--accent-hover); letter-spacing: -0.3px; }
.salon { font-size: 14px; color: var(--muted); font-weight: 500; margin-top: 2px; min-height: 18px; }
.reloj { font-size: 13px; color: var(--dim); margin-top: 4px; font-variant-numeric: tabular-nums; }

.pantalla-completa {
  position: fixed; top: 14px; right: 14px; width: 40px; height: 40px;
  border-radius: 12px; color: var(--dim); display: flex; align-items: center; justify-content: center;
}
.pantalla-completa:hover { background: var(--card); color: var(--muted); }
.pantalla-completa svg { width: 20px; height: 20px; }

main { flex: 1; display: flex; }
.vista { flex: 1; width: 100%; padding: 24px 16px; }
.centro {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  max-width: 520px; margin: 0 auto; text-align: center;
}

.saludo { font-size: 26px; font-weight: 600; margin-bottom: 28px; }
.sub { font-size: 14px; color: var(--muted); margin-top: 6px; line-height: 1.45; }

/* Inicio */
.botonera { display: flex; gap: 18px; width: 100%; }
.boton-grande {
  flex: 1; aspect-ratio: 1; border-radius: 24px; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  box-shadow: var(--sombra-md); transition: transform .08s ease, filter .15s ease;
}
.boton-grande:hover { filter: brightness(1.05); }
.boton-grande:active { transform: scale(0.97); }
.boton-grande svg { width: 52px; height: 52px; }
.boton-grande span { font-size: 22px; font-weight: 700; }
.entrada { background: var(--success); }
.salida { background: var(--accent-hover); }

/* Identificación */
.identificar {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  max-width: 460px; margin: 0 auto;
}
.lado-info { display: flex; flex-direction: column; align-items: center; }
.lado-teclado { width: 100%; max-width: 340px; display: flex; justify-content: center; }
.chip { border-radius: 999px; padding: 6px 18px; margin-bottom: 12px; color: #fff; font-size: 14px; font-weight: 600; }
.chip.entrada { background: var(--success); }
.chip.salida { background: var(--accent-hover); }
.pregunta { font-size: 19px; font-weight: 600; margin-bottom: 12px; }
.visor {
  min-height: 64px; min-width: 220px; padding: 0 28px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--sombra-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 700; letter-spacing: 4px; font-variant-numeric: tabular-nums;
}
.visor.vacio { color: var(--dim); }
.teclado { margin-top: 22px; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tecla {
  aspect-ratio: 1.5; border-radius: 16px; background: var(--card); border: 1px solid var(--border);
  box-shadow: var(--sombra-sm); font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; transition: background .1s ease;
}
.tecla:active { background: var(--accent-soft); }
.tecla svg { width: 28px; height: 28px; color: var(--muted); }
.tecla.accion { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; font-size: 15px; font-weight: 600; }
.tecla.accion:disabled { opacity: 0.4; cursor: default; }
.tecla.vacia { visibility: hidden; }
.cancelar { margin-top: 22px; padding: 10px 20px; color: var(--muted); font-size: 16px; font-weight: 500; }

/* En pantallas apaisadas bajas (un PC, una tablet en horizontal): datos a un
   lado y teclado al otro, para que todo quepa sin desplazarse. */
@media (orientation: landscape) and (max-height: 820px) {
  .identificar { flex-direction: row; gap: 48px; max-width: 820px; }
  .lado-teclado { width: 340px; }
}

/* Resultado */
.vista#vResultado { cursor: pointer; }
.icono-grande { width: 80px; height: 80px; stroke-width: 1.8; }
.icono-grande.exito { color: var(--success); }
.icono-grande.peligro { color: var(--danger); margin-bottom: 16px; }
.res-titulo { font-size: 32px; font-weight: 700; margin-top: 18px; }
.res-sub { font-size: 18px; color: var(--muted); margin-top: 6px; }
.res-tocar { font-size: 13px; color: var(--dim); margin-top: 28px; }

/* Cajas (activación y código de IT) */
.caja {
  background: var(--card); border: 1px solid var(--border); border-radius: 24px;
  padding: 28px 24px; width: 100%; max-width: 400px; box-shadow: var(--sombra-lg); text-align: center;
}
.caja h1 { font-size: 20px; font-weight: 700; }
.icono-redondo {
  width: 48px; height: 48px; border-radius: 24px; background: var(--accent-soft); color: var(--accent-hover);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.icono-redondo svg { width: 24px; height: 24px; }
.campo {
  width: 100%; margin-top: 18px; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; font: inherit; font-size: 20px; font-weight: 600; letter-spacing: 4px;
  text-align: center; color: var(--text); outline: none; user-select: text;
}
.campo:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.boton {
  width: 100%; margin-top: 16px; padding: 13px; border-radius: 12px;
  background: var(--accent-hover); color: #fff; font-weight: 600; font-size: 15px;
}
.boton:disabled { opacity: 0.6; cursor: default; }
.boton.secundario { background: none; border: 1px solid var(--border); color: var(--muted); }
.botones { display: flex; gap: 10px; }

.modal-fondo {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10;
}

/* Avisos de error */
.aviso {
  position: fixed; left: 50%; top: 20px; transform: translateX(-50%);
  max-width: calc(100% - 32px); background: var(--danger); color: #fff;
  padding: 14px 22px; border-radius: 14px; font-size: 16px; font-weight: 600;
  box-shadow: var(--sombra-lg); z-index: 20; text-align: center;
}

.rueda {
  width: 44px; height: 44px; margin: 28px auto; border-radius: 50%;
  border: 4px solid var(--accent-soft); border-top-color: var(--accent-hover);
  animation: girar .8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }
