/* Círculo de checada: la cámara dentro de un círculo y un anillo que avanza con cada paso.
   Se carga después de prueba.css y solo cambia el aspecto. */
.lens {
  --d: min(72vw, 46svh, 21rem);
  --avance: 0;
  --anillo: #22b573;
  min-height: calc(var(--d) + 4rem);
  background: radial-gradient(circle at 50% 50%, #12305c 0, #0b1a36 62%, #061322 100%);
}
.lens[data-estado="error"] { --anillo: #e2566b; }

.lens video, .lens img {
  inset: auto; left: 50%; top: 50%;
  width: var(--d); height: var(--d);
  border-radius: 50%; object-fit: cover;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 6px #0b1a36, 0 18px 40px #0009;
}
.lens video { transform: translate(-50%, -50%) scaleX(-1); }

/* Círculo de espera (antes de abrir la cámara) */
.guide {
  width: var(--d); height: var(--d); max-height: none;
  border-radius: 50%; border: 2px dashed #ffffff38;
  background: radial-gradient(circle at 50% 42%, #ffffff10 0 22%, transparent 23%),
              radial-gradient(ellipse 38% 26% at 50% 88%, #ffffff10 0 98%, transparent 100%);
}
.guide i { display: none; }

/* Anillo de avance */
.anillo {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--d) + 1.7rem); height: calc(var(--d) + 1.7rem);
  transform: translate(-50%, -50%) rotate(-90deg);
  pointer-events: none; overflow: visible;
}
.anillo circle { fill: none; stroke-width: 3.2; }
.anillo .fondo { stroke: #ffffff1f; }
.anillo .avance {
  stroke: var(--anillo); stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--avance) * 100);
  transition: stroke-dashoffset .45s ease, stroke .3s;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--anillo) 70%, transparent));
}
.anillo .marca { stroke: #ffffff40; stroke-width: 1.2; stroke-dasharray: .25 2.25; }

/* Línea que barre la cara mientras reconoce */
.barrido {
  position: absolute; left: 50%; top: 50%;
  width: var(--d); height: var(--d); border-radius: 50%;
  transform: translate(-50%, -50%); overflow: hidden; pointer-events: none; display: none;
}
.barrido::after {
  content: ""; position: absolute; left: 0; right: 0; height: 22%;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--anillo) 30%, transparent), transparent);
  animation: barrer 2.4s linear infinite;
}
[data-stage="camera"] .barrido { display: block; }
.lens[data-estado="error"] .barrido, .lens[data-estado="ok"] .barrido { display: none; }
@keyframes barrer { from { top: -22%; } to { top: 100%; } }

/* Flecha para girar: a un lado del círculo */
.turn-guide {
  border-radius: 50%; border: 0; background: #f5b324; color: #0b1a36;
  width: 3rem; box-shadow: 0 6px 16px #0007;
  animation: empujar 1s ease-in-out infinite;
}
.turn-guide svg { stroke-width: 3; }
@keyframes empujar { 50% { margin-right: -.35rem; margin-left: -.35rem; } }

/* La etiqueta "Cámara frontal" ya no hace falta a la vista */
#lens-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Paso actual más visible */
#progress { border: 0; padding: .2rem .7rem; border-radius: 99px; background: #22b57326; color: #8fe8bb; }
.identity { border: 0; padding: .6rem .8rem; border-radius: .8rem; background: #ffffff0d; }
.primary { background: #f5b324; border-color: #f5b324; color: #0b1a36; box-shadow: 0 .6rem 1.4rem #f5b32433; }

/* Recibo con foto y etiqueta */
.receipt-foto { display: flex; align-items: center; gap: .9rem; margin-top: clamp(.8rem, 2.5vw, 1.35rem); }
.receipt-foto img { width: 4.2rem; height: 4.2rem; border-radius: 50%; object-fit: cover; border: 3px solid #22b573; flex: none; }
.receipt-foto #receipt-identity { margin: 0; }
.receipt-etiqueta {
  display: inline-block; margin-top: .9rem; padding: .35rem .85rem; border-radius: 99px;
  font-weight: 750; font-size: .95rem; background: #22b57326; color: #8fe8bb;
}
.receipt-etiqueta[data-tipo="retardo"] { background: #f5b32429; color: #ffd36b; }

@media (max-width: 46rem) and (orientation: portrait) {
  .lens { --d: min(70vw, 40svh, 19rem); min-height: calc(var(--d) + 3.4rem); }
  .turn-guide { width: 2.6rem; }
}
