/* =========================================================================
   Martilleros Río Grande. El semáforo animado de la situación: lo usan la
   ficha del QR (matriculado.html, lo arma ficha.js) y la verificación de la
   credencial (verificar.html). Sin "reducir movimiento":
   - semaforo--ok: el aro y el check se dibujan (stroke) y un anillo pulsa.
   - semaforo--no: el aro y la X se dibujan y el ícono se sacude un poco.
   - semaforo--duda: se dibuja, sin sacudir.
   - semaforo--quieto (dado de baja): nada se mueve.
   Con "reducir movimiento" o sin estos estilos, el ícono se ve entero y quieto.
   ========================================================================= */
.semaforo {
  position: relative; display: grid; place-items: center; flex-shrink: 0;
  width: var(--sem-w, 64px); height: var(--sem-w, 64px); color: currentColor;
}
.semaforo svg { position: relative; width: 100%; height: 100%; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.semaforo .semaforo-circulo { stroke-opacity: .55; }
.semaforo--ok .semaforo-circulo { stroke-opacity: .7; }
/* Disco suave detrás del ícono, para que se lea sobre el degradé. */
.semaforo::before { content: ""; position: absolute; inset: 4%; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.semaforo-aro { position: absolute; inset: 0; border-radius: 50%; border: 2px solid currentColor; opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: no-preference) {
  .semaforo:not(.semaforo--quieto) { animation: sem-entra 620ms var(--ease-resorte) both; }
  .semaforo:not(.semaforo--quieto) path, .semaforo:not(.semaforo--quieto) circle { stroke-dasharray: 1; }
  .semaforo:not(.semaforo--quieto) circle { animation: trazar 760ms var(--ease-salida) 80ms both; }
  .semaforo:not(.semaforo--quieto) path { animation: trazar 520ms cubic-bezier(.65, 0, .35, 1) 420ms both; }
  .semaforo:not(.semaforo--quieto) path + path { animation-delay: 600ms; }
  .semaforo--ok .semaforo-aro { animation: sem-pulso 2.6s ease-out 1.1s infinite; }
  .semaforo--no svg { animation: sem-sacudir 560ms cubic-bezier(.36, .07, .19, .97) 1s both; }
}
@keyframes trazar { from { stroke-dashoffset: 1; } }
@keyframes sem-entra { from { opacity: 0; transform: scale(.6) rotate(-12deg); } }
@keyframes sem-pulso { 0% { opacity: .75; transform: scale(1); } 100% { opacity: 0; transform: scale(1.75); } }
@keyframes sem-sacudir {
  15%, 85% { transform: translateX(-1px) rotate(-1deg); }
  30%, 70% { transform: translateX(3px) rotate(2deg); }
  45%, 55% { transform: translateX(-4px) rotate(-3deg); }
}

/* "En vivo": el punto que late al lado de la hora de la consulta. */
.vivo-punto { position: relative; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; flex-shrink: 0; vertical-align: .08em; margin-right: .45rem; }
@media (prefers-reduced-motion: no-preference) {
  .vivo-punto::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; animation: latido-punto 2s ease-out infinite; }
  .vivo-punto--quieto::after { content: none; }
}
@keyframes latido-punto { 0% { transform: scale(1); opacity: .6; } 70%, 100% { transform: scale(2.8); opacity: 0; } }
