/* ============================================================
   CONTROL DIARIO DE PRECINTOS – QUICK
   Identidad: amarillo Quick (acción), negro, blanco, gris claro (apoyo)
   Mobile-first. Sin degradados, sin azules/morados.
   ============================================================ */
/* Fuentes autoalojadas (mismas del Status de Distribución Quick; licencia OFL en /fonts) */
@font-face { font-family: "Big Shoulders Display"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/big-shoulders-display-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Big Shoulders Display"; font-weight: 800; font-style: normal; font-display: swap; src: url("/fonts/big-shoulders-display-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 800; font-style: normal; font-display: swap; src: url("/fonts/barlow-latin-800-normal.woff2") format("woff2"); }

:root {
  /* Paleta tomada del Status de Distribución Quick (status-quick.pages.dev) */
  --amarillo: #fdd402;
  --amarillo-oscuro: #e6c000;
  --dorado: #9c6b03;
  --amarillo-wash: rgba(253,212,2,.16);
  --negro: #15130d;
  --gris-900: #1c170f;
  --gris-700: #463c2b;
  --gris-600: #8a8070;
  --gris-300: #ece6d5;
  --gris-100: #f7f4ec;
  --crema: #faf7ee;
  --blanco: #FFFFFF;
  --borde: rgba(28,23,15,.10);
  --borde-fuerte: rgba(28,23,15,.18);
  --verde: #1f9d55;
  --verde-texto: #188a48;
  --rojo: #c8511b;
  --rojo-texto: #ad4416;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(28,23,15,.05), 0 6px 18px rgba(28,23,15,.07);
  --fuente: "Barlow", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --display: "Big Shoulders Display", "Barlow", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--fuente);
  color: var(--gris-900);
  background-color: var(--gris-100);
  background-image:
    radial-gradient(900px 560px at 0% -10%, rgba(253,212,2,.28), rgba(0,0,0,0) 55%),
    radial-gradient(800px 600px at 100% 106%, rgba(20,17,10,.16), rgba(0,0,0,0) 55%);
  background-attachment: fixed;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button, input { font: inherit; }
[hidden] { display: none !important; }

/* ---------------- Cabecera (mismo lockup del Status) ---------------- */
.cabecera {
  background: var(--negro);
  color: var(--blanco);
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  border-bottom: 4px solid var(--amarillo);
}
.cabecera__fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cabecera__lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cabecera__logo { height: 40px; width: auto; flex: 0 0 auto; }
.cabecera__divisor { width: 1px; height: 40px; background: rgba(255,255,255,.28); flex: 0 0 auto; }
.cabecera__textos { display: flex; flex-direction: column; min-width: 0; }
.cabecera__titulo { margin: 0; font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1; letter-spacing: .01em; color: var(--blanco); }
.cabecera__operacion { margin-top: 3px; font-size: 12px; font-weight: 700; color: var(--amarillo); letter-spacing: .02em; }
.cabecera__loreal { height: 18px; width: auto; flex: 0 0 auto; opacity: .95; }
.cabecera__sub { margin: 10px 0 0; font-size: 13px; color: #c9c2ae; font-weight: 500; }

/* ---------------- Contenido ---------------- */
.contenido { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
.formulario { display: flex; flex-direction: column; gap: 14px; }

.tarjeta { background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); padding: 18px 16px; box-shadow: var(--sombra); }
.tarjeta__titulo { margin: 0 0 6px; font-family: var(--display); font-size: 22px; font-weight: 800; letter-spacing: .02em; display: flex; align-items: center; gap: 10px; }
.tarjeta__texto { margin: 0 0 14px; color: var(--gris-600); font-size: 14px; line-height: 1.4; }

/* Marca de dato completo: círculo vacío que se llena con ✓ */
.marca {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--borde-fuerte); background: var(--crema); color: var(--negro);
  font-size: 15px; font-weight: 800; line-height: 1;
  transition: background-color .18s ease, border-color .18s ease;
}
.es-listo .marca { background: var(--verde); border-color: var(--verde); color: var(--blanco); }
.es-listo .marca::after { content: "✓"; }
.tarjeta--dato { border-left: 4px solid var(--gris-300); }
.tarjeta--dato.es-listo { border-left-color: var(--verde); }

/* ---------------- Barra de avance (5 datos, cualquier orden) ---------------- */
.avance {
  position: sticky; top: 0; z-index: 8;
  background: var(--negro); color: var(--blanco);
  padding: 10px 16px 12px;
  box-shadow: 0 2px 10px rgba(21,19,13,.25);
}
.avance__fila { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; max-width: 640px; margin: 0 auto 8px; }
.avance__texto { font-family: var(--display); font-size: 18px; font-weight: 800; letter-spacing: .02em; }
.avance__texto b { color: var(--amarillo); font-size: 22px; }
.avance__falta { font-size: 12px; font-weight: 600; color: #c9c2ae; text-align: right; }
.avance.es-completo .avance__falta { color: #7ee2a8; }
.avance__barra { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; max-width: 640px; margin: 0 auto; }
.avance__seg { height: 7px; border-radius: 999px; background: rgba(255,255,255,.18); transition: background-color .2s ease; }
.avance__seg.es-listo { background: var(--amarillo); }
.avance.es-completo .avance__seg.es-listo { background: #43c47c; }

/* ---------------- Tipo de registro ---------------- */
.opciones { display: grid; gap: 10px; }
.opcion {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px; border-radius: 12px; border: 2px solid var(--borde-fuerte);
  background: var(--crema); color: var(--gris-900); cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: border-color .15s ease, background-color .15s ease;
}
.opcion:active { transform: scale(.99); }
.opcion__icono { font-size: 26px; line-height: 1; flex: 0 0 auto; }
.opcion__textos { display: flex; flex-direction: column; min-width: 0; }
.opcion__titulo { font-family: var(--display); font-size: 21px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.opcion__sub { font-size: 13px; color: var(--gris-600); font-weight: 600; }
.opcion.es-activa { border-color: var(--amarillo); background: var(--amarillo-wash); box-shadow: inset 0 0 0 1px var(--amarillo); }
.opcion.es-activa .opcion__sub { color: var(--gris-700); }

/* ---------------- Pendientes por enviar ---------------- */
.pendientes { border-left: 4px solid var(--dorado); margin-bottom: 14px; }
.pendientes__cabeza { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pendientes__lista { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pendiente { border: 1px solid var(--borde); border-radius: 12px; padding: 10px 12px; background: var(--crema); }
.pendiente__fila { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pendiente__placa { font-weight: 800; letter-spacing: .08em; }
.pendiente__hora { margin-left: auto; font-size: 13px; color: var(--gris-600); font-weight: 700; }
.pendiente__cliente { font-size: 14px; font-weight: 600; margin-top: 3px; }
.pendiente__estado { font-size: 13px; color: var(--dorado); font-weight: 700; margin-top: 4px; }
.pendiente__detalle { font-size: 12px; color: var(--gris-600); margin-top: 2px; }

/* Etiquetas de tipo (también usadas en la Traza) */
.etiqueta {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.etiqueta--salida { background: var(--negro); color: var(--amarillo); }
.etiqueta--llegada { background: var(--amarillo); color: var(--negro); }

/* ---------------- Campos ---------------- */
.campo + .campo { margin-top: 18px; }
.campo__etiqueta { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 20px; font-weight: 800; letter-spacing: .02em; margin-bottom: 8px; }
.campo__input {
  width: 100%; min-height: 54px; padding: 12px 14px; font-size: 18px;
  border: 1.5px solid var(--borde-fuerte); border-radius: 12px; background: var(--crema); color: var(--gris-900);
  outline: none; -webkit-appearance: none; appearance: none;
}
.campo__input:focus { border-color: var(--amarillo); box-shadow: 0 0 0 3px var(--amarillo-wash); }
.campo__input--placa { text-transform: uppercase; font-weight: 800; letter-spacing: .12em; font-size: 24px; font-family: var(--mono); }
.campo__input.es-invalido { border-color: var(--rojo); }
.campo__error { margin: 8px 0 0; color: var(--rojo-texto); font-size: 14px; font-weight: 600; }

/* ---------------- Botones ---------------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 56px; padding: 14px 18px; border-radius: 12px; border: 0; cursor: pointer;
  font-weight: 800; font-size: 16px; letter-spacing: .04em; text-transform: uppercase;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none;
  transition: transform .06s ease, background-color .15s ease;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn--principal { background: var(--amarillo); color: var(--gris-900); min-height: 64px; font-size: 18px; box-shadow: 0 6px 18px rgba(253,212,2,.35); }
.btn--principal:hover:not(:disabled) { background: var(--amarillo-oscuro); }
.btn--foto { background: var(--negro); color: var(--blanco); }
.btn--foto:hover { background: var(--gris-900); }
.btn__icono { font-size: 22px; line-height: 1; }
.btn--secundario { background: var(--crema); color: var(--gris-900); border: 1.5px solid var(--borde-fuerte); min-height: 48px; font-size: 14px; }
.btn--reintentar { background: var(--negro); color: var(--amarillo); min-height: 52px; margin-top: 10px; }

/* ---------------- Fotos ---------------- */
.foto__preview { display: flex; flex-direction: column; gap: 10px; }
.foto__img {
  width: 100%; max-height: 320px; object-fit: contain; border-radius: 10px;
  background: var(--negro); border: 2px solid var(--gris-300);
}
.foto__estado { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.foto__meta { font-size: 12px; color: var(--gris-600); font-family: var(--mono); }
.chip { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 800; }
.chip--ok { background: var(--verde); color: var(--blanco); }
.chip--espera { background: var(--dorado); color: var(--blanco); min-width: 30px; justify-content: center; }
.foto__progreso { margin: 10px 0 0; color: var(--gris-600); font-weight: 600; font-size: 14px; }
.foto__progreso::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border-radius: 50%;
  border: 2px solid var(--gris-300); border-top-color: var(--negro); animation: girar .8s linear infinite; vertical-align: -1px; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------------- Avisos ---------------- */
.aviso { border-radius: 12px; padding: 14px 16px; font-size: 15px; font-weight: 600; line-height: 1.4; }
.aviso--offline { background: var(--negro); color: var(--amarillo); }
.aviso--error { background: #fbe9df; color: var(--rojo-texto); border: 1.5px solid rgba(200,81,27,.35); }
.aviso--error p { margin: 0; }
.aviso--faltantes { background: var(--amarillo-wash); color: var(--gris-900); border: 1.5px solid var(--amarillo); }
.aviso--faltantes ul { margin: 6px 0 0; padding-left: 20px; }

/* ---------------- Acción principal ---------------- */
.accion {
  position: sticky; bottom: 0; z-index: 5;
  margin: 4px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(247,244,236,.94); backdrop-filter: blur(6px);
  border-top: 1px solid var(--borde);
}
.accion__estado { margin: 10px 0 0; text-align: center; font-weight: 700; color: var(--gris-900); }
.accion__falta { margin: 8px 0 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--gris-600); }
.btn--principal:disabled { background: var(--gris-300); color: var(--gris-600); box-shadow: none; opacity: 1; }
.btn--principal.es-cargando .btn__texto::after { content: "…"; }

/* ---------------- Éxito ---------------- */
.exito {
  background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); padding: 28px 20px; box-shadow: var(--sombra);
  text-align: center; border-top: 8px solid var(--verde);
}
.exito__icono {
  width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 50%; background: var(--verde); color: var(--blanco);
  font-size: 52px; font-weight: 800; line-height: 84px;
}
.exito__titulo { margin: 0 0 10px; font-family: var(--display); font-size: 34px; font-weight: 800; letter-spacing: .02em; }
.exito__nota { margin: 0 0 16px; font-size: 14px; font-weight: 600; color: var(--gris-700); line-height: 1.4; }
.exito.es-espera { border-top-color: var(--dorado); }
.exito.es-espera .exito__icono { background: var(--dorado); }
.exito.es-espera .exito__icono::after { content: ""; }
.exito__datos { margin: 0 0 22px; text-align: left; border: 1.5px solid var(--borde-fuerte); border-radius: 12px; overflow: hidden; background: var(--crema); }
.exito__datos > div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.exito__datos > div + div { border-top: 1px solid var(--gris-300); }
.exito__datos dt { color: var(--gris-600); font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.exito__datos dd { margin: 0; font-weight: 800; font-size: 17px; text-align: right; word-break: break-word; color: var(--gris-900); }
.mono { font-family: var(--mono); }

/* ---------------- PIN ---------------- */
.pin .campo__input { margin-bottom: 12px; text-align: center; }

/* ---------------- Pie ---------------- */
.pie { display: flex; justify-content: space-between; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--gris-600); }

/* ---------------- Tablet / escritorio ---------------- */
@media (min-width: 720px) {
  .cabecera { padding: 16px 24px 14px; }
  .cabecera__logo { height: 48px; }
  .cabecera__divisor { height: 48px; }
  .cabecera__titulo { font-size: 28px; }
  .cabecera__loreal { height: 24px; }
  .contenido { padding: 24px; }
  .accion { position: static; margin: 0; padding: 0; background: transparent; border: 0; backdrop-filter: none; }
}
@media (min-width: 1024px) {
  .contenido { max-width: 760px; }
}
