/* /prueba.html: la combi de prueba para el jurado. Móvil primero; en escritorio, QR a la izquierda. */
body {
  --fase: var(--amarillo);
  --fase-tinte: rgba(255, 210, 63, 0.12);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.6s;
}
body[data-fase="chofer"] {
  --fase: var(--verde);
  --fase-tinte: rgba(46, 229, 157, 0.12);
}
body[data-fase="cargando"] {
  --fase: var(--borde);
  --fase-tinte: transparent;
}

a {
  color: inherit;
}

/* ---------- Barra ---------- */
.barra {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--borde);
}
.marca {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.marca-logo {
  width: 32px;
  height: 32px;
}
.modo-demo {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: var(--fondo);
  background: var(--azul);
  border-radius: 999px;
  padding: 4px 10px;
}
.vivo {
  margin-left: auto;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tenue);
}
.vivo i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tenue);
}
.vivo[data-estado="conectado"] {
  color: var(--texto);
}
.vivo[data-estado="conectado"] i {
  background: var(--verde);
  box-shadow: 0 0 0 0 rgba(46, 229, 157, 0.6);
  animation: latido 2s infinite;
}
.vivo[data-estado="reconectando"] i {
  background: var(--rosa);
}
@keyframes latido {
  70% {
    box-shadow: 0 0 0 8px rgba(46, 229, 157, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 229, 157, 0);
  }
}

/* ---------- Página ---------- */
.pagina {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 40px) 40px;
}
.eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tenue);
}
h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

/* Pasos */
.pasos {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.pasos li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--borde);
  border-radius: 14px;
  background: var(--panel);
  color: var(--tenue);
  font-size: 16px;
  line-height: 1.3;
  transition:
    border-color 0.3s,
    color 0.3s,
    background 0.3s;
}
.pasos li strong {
  color: var(--texto);
}
.pasos b {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--texto);
  font-size: 15px;
}
.pasos li.actual {
  border-color: var(--fase);
  color: var(--texto);
  background: var(--fase-tinte);
}
.pasos li.actual b {
  background: var(--fase);
  color: #0b0f14;
}
.pasos li.hecho b {
  background: var(--verde);
  color: #0b0f14;
  font-size: 0;
}
.pasos li.hecho b::after {
  content: "✓";
  font-size: 16px;
  font-weight: 900;
}

/* Aviso de celular (solo pantallas angostas) */
.celular-aviso {
  display: none;
  margin: 0 0 16px;
  padding: 16px;
  border-radius: var(--radio);
  background: var(--panel);
  border: 1px solid var(--azul);
}
.celular-aviso .celular-tit {
  margin: 0 0 4px;
  color: var(--texto);
  font-weight: 800;
  font-size: 18px;
}
.celular-aviso p {
  margin: 0 0 12px;
  color: var(--tenue);
  line-height: 1.4;
}
.celular-botones {
  display: grid;
  gap: 8px;
}
.celular-aviso .celular-url {
  margin: 10px 0 0;
  font-size: 14px;
  text-align: center;
  color: var(--texto);
  word-break: break-all;
}

/* Botones */
.boton {
  min-height: 52px;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 16px;
  border: 2px solid transparent;
}
.boton-claro {
  background: var(--texto);
  color: var(--fondo);
}
.boton-borde {
  background: transparent;
  color: var(--texto);
  border-color: var(--borde);
}
.boton:hover {
  filter: brightness(1.08);
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--azul);
  outline-offset: 2px;
}

/* ---------- Escenario: QR + en vivo ---------- */
.escenario {
  display: grid;
  gap: 16px;
}

.qr-tarjeta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--borde);
}
.qr-marco {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 1;
  padding: 14px;
  border-radius: 26px;
  background: var(--fase);
  box-shadow: 0 0 60px -10px var(--fase);
  transition:
    background-color 0.6s,
    box-shadow 0.6s;
}
.qr {
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.qr svg {
  display: block;
  width: 100%;
  height: 100%;
}
.qr-espera {
  margin: 0;
  padding: 20px;
  color: #3b4654;
  font-size: 17px;
  line-height: 1.4;
}
.qr-ping {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  pointer-events: none;
  border: 4px solid var(--fase);
  opacity: 0;
}
.qr-marco.pagado .qr-ping {
  animation: ping 1.1s ease-out;
}
.qr-marco.cambia .qr {
  animation: cambia 0.7s ease;
}
@keyframes ping {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.12);
  }
}
@keyframes cambia {
  0% {
    transform: rotateY(90deg);
  }
  100% {
    transform: rotateY(0);
  }
}
.qr-instruccion {
  margin: 18px 0 6px;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 700;
  line-height: 1.25;
  max-width: 24ch;
}
.qr-instruccion strong {
  color: var(--fase);
  white-space: nowrap;
}
.qr-destino {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--tenue);
  font-size: 15px;
}
.qr-destino i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--fase);
}
.enlace-boton {
  margin-top: 12px;
  background: none;
  border: 0;
  color: var(--tenue);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 14px;
  padding: 6px;
}
.enlace-boton:hover {
  color: var(--texto);
}

/* En vivo */
.envivo {
  padding: 20px;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--borde);
  min-width: 0;
}
.envivo-cab {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.envivo-cab h2 {
  margin: 0;
  font-size: 18px;
}
.boton-sonido {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid var(--rosa);
  background: transparent;
  color: var(--texto);
  font-weight: 700;
  font-size: 15px;
}
.boton-sonido svg {
  width: 22px;
  height: 22px;
}
.boton-sonido .onda {
  display: none;
}
.boton-sonido[aria-pressed="true"] {
  border-color: var(--verde);
  background: rgba(46, 229, 157, 0.12);
}
.boton-sonido[aria-pressed="true"] .onda {
  display: inline;
}
.boton-sonido[aria-pressed="true"] .tache {
  display: none;
}

.cuenta {
  padding: 16px;
  border-radius: 18px;
  background: var(--panel-2);
}
.cuenta-tit {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--tenue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cuenta-num {
  margin: 4px 0 12px;
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
.cuenta-num #avance {
  color: var(--amarillo);
}
.cuenta-num .de {
  font-size: 0.5em;
  font-weight: 700;
  color: var(--tenue);
}
.progreso {
  height: 14px;
  border-radius: 999px;
  background: var(--borde);
  overflow: hidden;
}
.progreso i {
  display: block;
  height: 100%;
  background: var(--amarillo);
  transform-origin: left;
  transform: scaleX(0);
  transition:
    transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 0.6s;
}
body[data-fase="chofer"] .progreso i,
body[data-fase="chofer"] .cuenta-num #avance {
  background-color: var(--verde);
}
body[data-fase="chofer"] .cuenta-num #avance {
  background: none;
  color: var(--verde);
}
.cuenta-falta {
  margin: 10px 0 0;
  font-size: 17px;
  font-weight: 600;
}

.siguiente {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid var(--amarillo);
  background: rgba(255, 210, 63, 0.08);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 800;
}
.siguiente[data-destino="chofer"] {
  border-color: var(--verde);
  background: rgba(46, 229, 157, 0.08);
}
.siguiente-punto {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--amarillo);
}
.siguiente[data-destino="chofer"] .siguiente-punto {
  background: var(--verde);
}

.aviso-pago {
  margin-top: 12px;
  padding: 0 16px;
  max-height: 0;
  overflow: hidden;
  border-radius: 16px;
  background: var(--amarillo);
  color: #0b0f14;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 800;
  opacity: 0;
  transition:
    max-height 0.3s,
    padding 0.3s,
    opacity 0.3s;
}
.aviso-pago[data-destino="chofer"] {
  background: var(--verde);
}
.aviso-pago.visible {
  max-height: 120px;
  padding: 14px 16px;
  opacity: 1;
  animation: salta 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes salta {
  0% {
    transform: scale(0.92);
  }
  100% {
    transform: scale(1);
  }
}

.pagos-tit {
  margin: 18px 0 8px;
  font-size: 15px;
  color: var(--tenue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pagos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow: auto;
}
.pago {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "monto banco destino"
    "monto hora rastreo";
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel-2);
  border-left: 5px solid var(--amarillo);
}
.pago-chofer {
  border-left-color: var(--verde);
}
.pago-excedente {
  border-left-color: var(--azul);
}
.pago.nuevo {
  animation: entra 1.2s ease-out;
}
@keyframes entra {
  0% {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.18);
  }
  100% {
    transform: none;
  }
}
.pago-monto {
  grid-area: monto;
  font-size: 22px;
  font-weight: 800;
}
.pago-banco {
  grid-area: banco;
  font-weight: 700;
}
.pago-hora {
  grid-area: hora;
  color: var(--tenue);
  font-size: 14px;
}
.pago-destino {
  grid-area: destino;
  justify-self: end;
  font-size: 14px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--amarillo);
  color: #0b0f14;
  white-space: nowrap;
}
.pago-chofer .pago-destino {
  background: var(--verde);
}
.pago-excedente .pago-destino {
  background: var(--azul);
}
.pago-rastreo {
  grid-area: rastreo;
  justify-self: end;
  font-size: 12px;
  color: var(--tenue);
}
.vacio {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--borde);
  color: var(--tenue);
  text-align: center;
}

.mock-controles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--borde);
}
.mock-controles[hidden] {
  display: none;
}
.mock-controles .boton {
  flex: 1 1 160px;
}

/* ---------- Notas y demos ---------- */
.notas {
  margin: 20px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--borde);
  color: var(--tenue);
  font-size: 14px;
  line-height: 1.5;
}
.notas p {
  margin: 0;
}
.notas p + p {
  margin-top: 4px;
}
.notas strong {
  color: var(--texto);
}

.demos {
  margin-top: 28px;
}
.demos h2 {
  margin: 0;
  font-size: 22px;
}
.demos-sub {
  margin: 4px 0 12px;
  color: var(--tenue);
}
.demos-grid {
  display: grid;
  gap: 10px;
}
.demo-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  min-height: 72px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--borde);
  text-decoration: none;
  transition:
    border-color 0.2s,
    transform 0.2s;
}
.demo-card:hover {
  border-color: var(--texto);
  transform: translateY(-1px);
}
.demo-card strong {
  display: block;
  font-size: 18px;
}
.demo-card strong::after {
  content: " →";
}
.demo-card small {
  display: block;
  margin-top: 2px;
  color: var(--tenue);
  font-size: 14px;
}
.demo-ico {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
}
.demo-ico-chofer {
  background: linear-gradient(135deg, var(--amarillo) 50%, var(--verde) 50%);
}
.demo-ico-duena {
  background:
    linear-gradient(var(--verde), var(--verde)) 9px 26px / 6px 10px no-repeat,
    linear-gradient(var(--amarillo), var(--amarillo)) 19px 16px / 6px 20px no-repeat,
    linear-gradient(var(--verde), var(--verde)) 29px 9px / 6px 27px no-repeat,
    var(--panel-2);
}

.pie {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  padding: 20px;
  border-top: 1px solid var(--borde);
  color: var(--tenue);
  font-size: 14px;
}

/* ---------- Celebración: amarillo → verde ---------- */
.celebracion {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: var(--verde);
  color: #0b0f14;
  cursor: pointer;
}
.celebracion[hidden] {
  display: none;
}
.celebracion.activa {
  animation: aVerde 0.9s ease forwards;
}
.celebracion-caja {
  text-align: center;
  padding: 24px;
}
.celebracion-check {
  width: clamp(110px, 18vw, 180px);
  height: auto;
}
.celebracion.activa .celebracion-check path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: traza 0.5s 0.5s ease forwards;
}
.celebracion-tit {
  margin: 16px 0 8px;
  font-size: clamp(44px, 8vw, 96px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}
.celebracion-sub {
  margin: 0;
  font-size: clamp(22px, 3.4vw, 40px);
  font-weight: 700;
}
@keyframes aVerde {
  0% {
    background: var(--amarillo);
  }
  45% {
    background: var(--amarillo);
  }
  100% {
    background: var(--verde);
  }
}
@keyframes traza {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------- Pantallas angostas: el juez abrió la página en su celular ---------- */
@media (max-width: 820px) {
  .celular-aviso {
    display: block;
  }
  .solo-escritorio {
    display: none;
  }
}
@media (max-width: 420px) {
  .solo-ancho {
    display: none;
  }
  .envivo {
    padding: 16px;
  }
  .pagos {
    max-height: none;
  }
  .pago {
    grid-template-areas:
      "monto banco destino"
      "monto hora hora"
      "monto rastreo rastreo";
  }
  .pago-rastreo {
    justify-self: start;
  }
}

/* ---------- Escritorio ---------- */
@media (min-width: 821px) {
  .pasos {
    grid-template-columns: repeat(4, 1fr);
  }
  .pasos li {
    align-items: flex-start;
  }
  .escenario {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
  .qr-tarjeta {
    padding: 28px;
  }
  .qr-marco {
    width: min(100%, 48vh, 440px);
  }
  .demos-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .celebracion.activa {
    animation: none;
  }
}
