:root {
  --azul: #10243e;
  --azul-2: #1f5c96;
  --celeste: #74acdf;
  --celeste-claro: #dcebf8;
  --celeste-borde: #a9c9e8;
  --sol: #f2b33d;
  --sol-claro: #fcebc4;
  --sol-texto: #6b4a06;
  --fondo: #f7f9fc;
  --gris: #4a5a70;
  --gris-2: #33465f;
  --error: #a32d2d;
  --display: Anton, 'Arial Narrow', sans-serif;
  --texto: Archivo, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fondo); color: var(--azul); font-family: var(--texto); -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
.oculto { display: none !important; }

.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; padding: 18px 16px 24px; display: flex; flex-direction: column; gap: 16px; }
.barra { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 4px; }
.marca { font-family: var(--display); font-size: 22px; letter-spacing: 0.02em; }
.estado-fase { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pildora { font-size: 12px; font-weight: 600; background: var(--celeste-claro); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pildora.sol { background: var(--sol-claro); color: var(--sol-texto); }
.reloj { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--azul-2); }
.titulo { margin: 0; font-family: var(--display); font-weight: 400; font-size: 44px; line-height: 1; }
.sub { margin: 0; font-size: 15px; line-height: 1.5; color: var(--gris-2); }
.etiqueta { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gris); }
.espacio { flex-grow: 1; }

.carne { background: #fff; border: 2px solid var(--azul); border-radius: 14px; overflow: hidden; }
.carne-cabeza { background: var(--celeste); border-bottom: 2px solid var(--azul); padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; }
.carne-cabeza span:first-child { font-family: var(--display); font-size: 20px; letter-spacing: 0.03em; }
.carne-cabeza span:last-child { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.carne-cuerpo { padding: 16px; display: flex; gap: 14px; }
.carne-datos { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.carne-nombre { font-size: 22px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.dato { display: flex; flex-direction: column; gap: 1px; font-size: 14px; }
.carne-pie { border-top: 1px dashed var(--celeste-borde); padding: 16px; display: flex; gap: 18px; align-items: center; }
.qr { width: 132px; height: 132px; flex-shrink: 0; background: #fff; border: 1px solid var(--celeste-borde); border-radius: 6px; padding: 4px; }
.qr svg { width: 100%; height: 100%; display: block; }
.avales-num { font-family: var(--display); font-size: 64px; line-height: 1; }
.nota { font-size: 13px; line-height: 1.35; color: var(--gris); }

.foto-carne { width: 92px; height: 112px; flex-shrink: 0; border-radius: 8px; object-fit: cover; background: var(--celeste-claro); border: 1px solid var(--celeste-borde); }
.foto-carne.iniciales, .avatar.iniciales, .avatar-chico.iniciales { display: flex; align-items: center; justify-content: center; font-family: var(--display); color: var(--azul-2); }
.foto-carne.iniciales { font-size: 34px; }
.avatar { width: 64px; height: 64px; flex-shrink: 0; border-radius: 50%; object-fit: cover; background: var(--celeste-claro); border: 2px solid var(--azul); font-size: 24px; }
.avatar-chico { width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; object-fit: cover; background: var(--celeste-claro); border: 2px solid var(--azul); font-size: 18px; }

.caja { background: #fff; border: 1px solid var(--celeste-borde); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.fila { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.enlace { background: none; border: 0; padding: 4px 0; color: var(--azul-2); font-size: 14px; font-weight: 600; text-decoration: underline; }
.aviso { background: var(--sol-claro); border: 2px solid var(--azul); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.aviso p { margin: 0; font-size: 17px; line-height: 1.45; }
.destacado { background: var(--azul); color: #fff; border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.destacado .grande { font-family: var(--display); font-size: 30px; line-height: 1.05; color: var(--sol); }

.cadena { display: flex; flex-direction: column; gap: 4px; }
.cadena-paso { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.cadena-paso::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--celeste); border: 2px solid var(--azul); flex-shrink: 0; }
.cadena-paso.candidato::before { background: var(--sol); }
.cadena-paso.candidato { font-weight: 700; }

.botonera { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: 10px; }
.boton-grande { min-height: 86px; border-radius: 12px; border: 2px solid var(--azul); background: #fff; color: var(--azul); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 16px; font-weight: 600; padding: 8px; }
.boton-grande svg { width: 28px; height: 28px; }
.boton-grande.primario { background: var(--azul); color: #fff; }
.contador { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--sol); color: var(--azul); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

.boton { min-height: 52px; border-radius: 10px; border: 2px solid var(--azul); background: #fff; color: var(--azul); font-size: 16px; font-weight: 600; padding: 0 16px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.boton.primario { background: var(--azul); color: #fff; font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: 0.03em; min-height: 58px; }
.boton.chico { min-height: 44px; font-size: 15px; }
.boton:disabled { opacity: 0.55; cursor: default; }
.dos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

label.campo { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; }
.input { height: 52px; border: 2px solid var(--azul); border-radius: 8px; padding: 0 14px; font-size: 17px; background: #fff; width: 100%; }
.selfie { height: 240px; border: 2px dashed var(--azul-2); border-radius: 12px; background: var(--celeste-claro); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-size: 17px; font-weight: 600; overflow: hidden; padding: 0; width: 100%; }
.selfie svg { width: 40px; height: 40px; }
.selfie img { width: 100%; height: 100%; object-fit: cover; }
.error { color: var(--error); font-size: 14px; font-weight: 600; margin: 0; }

.ticket { background: #fff; border: 2px solid var(--azul); border-radius: 12px; display: flex; overflow: hidden; }
.ticket-lado { width: 72px; flex-shrink: 0; background: var(--sol); border-right: 2px dashed var(--azul); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 22px; }
.ticket-lado svg { width: 30px; height: 30px; }
.ticket-cuerpo { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex-grow: 1; }
.ticket-titulo { font-size: 18px; font-weight: 700; }
.ticket.usado { background: #eef1f5; border-color: #a3afbf; color: var(--gris); }
.ticket.usado .ticket-lado { background: #dde3ea; border-right-color: #a3afbf; }

.candidato-op { min-height: 76px; border-radius: 12px; border: 2px solid var(--celeste-borde); background: #fff; text-align: left; padding: 10px 14px; display: flex; align-items: center; gap: 12px; width: 100%; }
.candidato-op.elegido { border: 3px solid var(--azul); background: var(--celeste-claro); }
.candidato-op .punto { width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--azul); background: #fff; }
.candidato-op.elegido .punto { background: var(--azul); }

.escaner { position: fixed; inset: 0; background: #0b1626; z-index: 10; display: flex; flex-direction: column; }
.escaner video { width: 100%; flex-grow: 1; object-fit: cover; min-height: 0; }
.escaner-marco { position: absolute; left: 50%; top: 38%; width: 220px; height: 220px; transform: translate(-50%, -50%); border: 4px solid var(--celeste); border-radius: 16px; pointer-events: none; }
.escaner-pie { background: var(--fondo); border-radius: 22px 22px 0 0; padding: 20px; display: flex; flex-direction: column; gap: 14px; }

.cartel { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--azul); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 15px; font-weight: 600; z-index: 20; max-width: 90vw; text-align: center; }
.cartel.mal { background: var(--error); }

.lista { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.lista li { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; padding: 6px 0; border-bottom: 1px solid #e3e9f1; }
