:root {
  --fondo: #1f2328; --panel: #2b3138; --texto: #f2f4f6; --suave: #aab2bb;
  --rojo: #d92d20; --rojo-osc: #b42318; --verde: #3fb950; --ambar: #e3a008; --azul: #2f81f7;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--fondo); color: var(--texto); }
body {
  font: 18px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }

.barra { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid #39414a; }
.titulo { font-weight: 700; font-size: 17px; }
.demo { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: var(--ambar); color: #1f2328; font-size: 11px; letter-spacing: .04em; vertical-align: 2px; }
.estado { font-size: 14px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.estado-ok { background: rgba(63,185,80,.18); color: var(--verde); }
.estado-no { background: rgba(217,45,32,.2); color: #ff8a80; }
.estado-sin { background: rgba(227,160,8,.2); color: var(--ambar); }
.estado-verificando { background: #39414a; color: var(--suave); }

main { flex: 1; padding: 16px; max-width: 520px; width: 100%; margin: 0 auto; }
h1 { font-size: 24px; margin: 8px 0 12px; }
p { margin: 8px 0; }
.nota { color: var(--suave); font-size: 15px; }
.pasos { padding-left: 22px; } .pasos li { margin: 10px 0; }
.mensaje { min-height: 1.4em; color: #ffb4ab; font-weight: 600; }
.mensaje.bien { color: var(--verde); }

form { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
label { font-size: 15px; color: var(--suave); margin-top: 8px; }
input { font: inherit; font-size: 20px; padding: 14px; border-radius: 10px; border: 1px solid #4a535d; background: var(--panel); color: var(--texto); width: 100%; }
input:focus { outline: 3px solid var(--azul); outline-offset: 1px; }
#codigo { letter-spacing: .12em; text-transform: uppercase; }

button { font: inherit; cursor: pointer; border: 0; border-radius: 12px; color: var(--texto); }
.boton-acento { margin-top: 16px; padding: 16px; font-size: 20px; font-weight: 700; background: var(--azul); }
.boton-acento:disabled { opacity: .5; }
.boton-secundario { margin-top: 16px; padding: 14px 20px; font-size: 18px; background: #39414a; width: 100%; }
.boton-cancelar { width: 100%; padding: 20px; font-size: 24px; font-weight: 800; background: #39414a; border: 3px solid #fff; border-radius: 14px; }

.saludo { color: var(--suave); text-align: center; }
.zona-boton { display: flex; flex-direction: column; align-items: center; margin-top: 12px; }
.boton-panico {
  position: relative; width: min(72vw, 300px); aspect-ratio: 1; border-radius: 50%; background: var(--rojo); box-shadow: 0 8px 28px rgba(217,45,32,.45);
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: none; -webkit-tap-highlight-color: transparent;
  display: grid; place-items: center; padding: 0;
}
.boton-panico:active, .boton-panico.sostenido { background: var(--rojo-osc); }
.boton-panico:disabled { background: #5a3a37; box-shadow: none; opacity: .6; }
.boton-texto { font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: .04em; text-align: center; pointer-events: none; }
.anillo { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); pointer-events: none; }
.anillo-fondo { stroke: rgba(255,255,255,.18); }
.anillo-progreso { stroke: #fff; stroke-linecap: round; }
.ayuda { margin-top: 18px; font-size: 19px; font-weight: 600; }

.folio { font-size: 22px; } .folio strong { font-size: 26px; letter-spacing: .04em; }
.texto-estado { font-size: 24px; font-weight: 800; padding: 14px 16px; border-radius: 12px; background: var(--panel); text-align: center; }
.texto-estado.camino { background: rgba(63,185,80,.2); color: var(--verde); }
.texto-estado.sitio { background: rgba(47,129,247,.22); color: #79b8ff; }
.texto-estado.fin { background: #39414a; color: var(--suave); }
.tipos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.tipo { padding: 14px 8px; font-size: 16px; font-weight: 600; background: var(--panel); border: 2px solid #4a535d; }
.tipo.elegido { border-color: var(--azul); background: rgba(47,129,247,.18); }
.tipo:disabled { opacity: .5; }

.pie { padding: 12px 16px calc(12px + 4px); border-top: 1px solid #39414a; text-align: center; }
.llamar { display: block; margin: 0 auto 6px; max-width: 520px; padding: 14px; border-radius: 12px; background: #39414a; color: var(--texto); text-decoration: none; font-weight: 700; font-size: 18px; }

@media (prefers-reduced-motion: no-preference) { .anillo-progreso { transition: none; } }
