:root { --c1: #1f3a5f; --c2: #2d5a8e; --fondo: #f4f6fb; --borde: #e3e8ef; --texto: #1d2733; --gris: #6b7684;
  --ok: #e3f6ea; --ok-t: #17794a; --mal: #fde7e4; --mal-t: #b42318; --esp: #fff4dd; --esp-t: #8a5300; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; color: var(--texto); font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; font-size: 16px; }
body { min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--c2) 16%, #fff) 0%, var(--fondo) 60%); }
.oculto { display: none !important; }
.nota { color: var(--gris); font-size: 13px; }
.centro { text-align: center; }

.cabeza { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; display: flex; gap: 12px; align-items: center;
  padding: 14px 18px; padding-top: max(14px, env(safe-area-inset-top)); box-shadow: 0 4px 18px rgba(0,0,0,.12); }
.logo-caja { background: #fff; border-radius: 12px; height: 44px; min-width: 44px; max-width: 140px; padding: 4px 8px; display: flex; align-items: center; justify-content: center; }
.logo-caja img { max-height: 36px; max-width: 124px; object-fit: contain; }
.cab-txt { display: flex; flex-direction: column; line-height: 1.2; }
.cab-txt b { font-size: 17px; }
.cab-txt span { font-size: 13px; opacity: .85; }

main { flex: 1; width: 100%; max-width: 440px; margin: 0 auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 16px; }
footer { padding: 6px 20px 22px; text-align: center; max-width: 440px; margin: 0 auto; }
.cargando { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 50px; color: var(--gris); }
.girar { width: 22px; height: 22px; border: 3px solid var(--borde); border-top-color: var(--c2); border-radius: 50%; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

.tarjeta { background: #fff; border: 1px solid var(--borde); border-radius: 18px; padding: 22px 18px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 6px 24px rgba(20,40,70,.07); }
.tarjeta.chica { padding: 14px 16px; gap: 8px; border-radius: 14px; }
.emoji-grande { font-size: 44px; text-align: center; }
h1 { font-size: 23px; margin: 0; text-align: center; color: var(--c1); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--gris); font-weight: 600; }
input { font: inherit; font-size: 20px; padding: 13px 14px; border: 1.5px solid var(--borde); border-radius: 12px; width: 100%; background: #fbfcfe; }
input:focus { outline: none; border-color: var(--c2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c2) 18%, transparent); }
input.codigo { letter-spacing: .5em; text-align: center; font-weight: 700; }
.btn { font: inherit; font-weight: 700; padding: 15px; border-radius: 12px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--c2), var(--c1)); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--c2) 35%, transparent); }
.btn:disabled { opacity: .55; }
.btn.instalar { background: #fff; color: var(--c1); border: 1.5px solid var(--c2); box-shadow: none; }
.error { color: var(--mal-t); min-height: 1em; margin: 0; white-space: pre-line; text-align: center; }

.saludo { text-align: center; }
.hola { font-size: 22px; font-weight: 700; color: var(--c1); }
.reloj { text-align: center; font-size: 52px; font-weight: 800; color: var(--c1); font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin-top: -6px; }

.boton-zona { position: relative; width: 236px; height: 236px; align-self: center; display: grid; place-items: center; }
.onda { position: absolute; inset: 18px; border-radius: 50%; background: var(--c2); opacity: .22; animation: onda 2.4s ease-out infinite; }
.onda.o2 { animation-delay: 1.2s; }
@keyframes onda { from { transform: scale(.85); opacity: .28; } to { transform: scale(1.12); opacity: 0; } }
.registrar { position: relative; width: 200px; height: 200px; border-radius: 50%; border: 6px solid #fff; cursor: pointer;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c2) 70%, #fff) 0%, var(--c2) 45%, var(--c1) 100%);
  color: #fff; font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: 0 14px 34px color-mix(in srgb, var(--c1) 45%, transparent); transition: transform .12s; }
.registrar svg { width: 34px; height: 34px; fill: #fff; opacity: .95; }
.registrar span { font-size: 25px; font-weight: 800; letter-spacing: .05em; }
.registrar small { font-size: 13px; opacity: .85; }
.registrar:active { transform: scale(.95); }
.registrar:disabled { filter: grayscale(.5) brightness(.95); }
.ocupado .onda { animation-duration: .9s; }

.estado-msg { border-radius: 14px; padding: 14px 16px; font-size: 15px; line-height: 1.45; text-align: center; }
.estado-msg.ok { background: var(--ok); color: var(--ok-t); }
.estado-msg.mal { background: var(--mal); color: var(--mal-t); }
.estado-msg.esp { background: var(--esp); color: var(--esp-t); }
.fila-tit { display: flex; justify-content: space-between; align-items: baseline; }
.hoy { display: flex; flex-wrap: wrap; gap: 8px; }
.hoy span { background: color-mix(in srgb, var(--c2) 10%, #fff); color: var(--c1); border-radius: 999px; padding: 5px 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hoy span.vacio { background: none; color: var(--gris); font-weight: 400; padding: 0; }
.ios ol, .ayuda ol { padding-left: 20px; margin: 6px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.ico-comp { display: inline-block; border: 1.5px solid currentColor; border-radius: 5px; padding: 0 4px; font-size: 12px; }
.ayuda { background: #fff; border: 1px solid var(--borde); border-radius: 14px; padding: 12px 16px; font-size: 14px; }
.ayuda summary { font-weight: 700; cursor: pointer; color: var(--c1); }

.exito { position: fixed; inset: 0; background: rgba(10,20,35,.45); display: grid; place-items: center; z-index: 10; animation: aparece .2s; }
.exito-caja { background: #fff; border-radius: 22px; padding: 28px 34px; text-align: center; min-width: 250px; box-shadow: 0 20px 50px rgba(0,0,0,.25); animation: sube .35s cubic-bezier(.2,1.4,.4,1); }
.palomita { width: 92px; height: 92px; }
.palomita circle { fill: none; stroke: #1fa463; stroke-width: 3; stroke-dasharray: 160; stroke-dashoffset: 160; animation: traza .5s .05s forwards; }
.palomita path { fill: none; stroke: #1fa463; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: traza .35s .45s forwards; }
.exito-tit { font-size: 24px; font-weight: 800; color: #17794a; margin-top: 6px; }
.exito-hora { font-size: 40px; font-weight: 800; color: var(--c1); font-variant-numeric: tabular-nums; }
@keyframes traza { to { stroke-dashoffset: 0; } }
@keyframes aparece { from { opacity: 0; } }
@keyframes sube { from { transform: translateY(20px) scale(.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .onda, .registrar, .exito-caja, .palomita * { animation: none !important; stroke-dashoffset: 0 !important; } }
