/* recibo.css — El recibo como un ticket de papel: siempre claro, borde inferior troquelado, ruta de
   origen a destino y total destacado. Se usa en la app (historial) y en la página que abre el cliente. */

.recibo {
  --papel: #ffffff;
  --tinta: #12161c;
  --gris: #5d6672;
  --suave: #e4e7eb;
  --ambar: #ffbf1f;
  --dientes: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 16px 100%;
  position: relative;
  padding: 22px 22px 36px;
  border-radius: 18px 18px 0 0;
  background: var(--papel);
  color: var(--tinta);
  font: 400 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-mask: var(--dientes);
  mask: var(--dientes);
}

.recibo-marca {
  margin: 0 0 16px;
  padding: 7px;
  border-radius: 8px;
  background: #fde3e2;
  color: #a1201b;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
}

.recibo-cab { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px dashed #cfd4da; }
.chapa-taxi {
  flex: none;
  display: inline-grid;
  place-items: center;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--ambar);
  color: #111;
  font: 900 15px/1 "Arial Black", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.06em;
}
.recibo-emisor { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.recibo-emisor strong { font-size: 15px; }
.recibo-emisor span { color: var(--gris); font-size: 13px; }

.recibo-titulo { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 18px; }
.recibo-titulo h1 { margin: 0; font-size: 23px; font-weight: 800; letter-spacing: -0.015em; }
.recibo-num { color: var(--gris); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.recibo-fecha { margin: 2px 0 0; color: var(--gris); font-size: 14px; font-variant-numeric: tabular-nums; }

.recibo-ruta { margin: 18px 0 16px; padding: 0; list-style: none; }
.recibo-ruta li { position: relative; padding-left: 24px; overflow-wrap: anywhere; }
.recibo-ruta .parada { font-weight: 650; }
.recibo-ruta .parada::before {
  content: "";
  position: absolute;
  top: 0.42em;
  left: 2px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--tinta);
  border-radius: 50%;
  background: var(--papel);
}
.recibo-ruta .parada.destino::before { border-radius: 2px; background: var(--tinta); }
.recibo-ruta .tramo { padding-top: 6px; padding-bottom: 6px; color: var(--gris); font-size: 13px; font-variant-numeric: tabular-nums; }
.recibo-ruta .tramo::before { content: ""; position: absolute; top: -4px; bottom: -4px; left: 7px; border-left: 2px dotted #b4bbc4; }
.recibo-ruta .tramo:only-child { padding-left: 0; }
.recibo-ruta .tramo:only-child::before { display: none; }

.recibo-conceptos { width: 100%; border-collapse: collapse; font-size: 14px; }
.recibo-conceptos td { padding: 8px 0; border-top: 1px solid var(--suave); vertical-align: top; }
.recibo-conceptos td:last-child { padding-left: 12px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.recibo-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 6px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f3f4f6;
}
.recibo-total span { font-size: 13px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.recibo-total strong { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.recibo-iva { margin: 8px 2px 0; color: var(--gris); font-size: 12.5px; }

.recibo-datos {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 14px;
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px dashed #cfd4da;
  font-size: 13.5px;
}
.recibo-datos dt { color: var(--gris); }
.recibo-datos dd { margin: 0; font-weight: 650; text-align: right; }

.recibo-aviso { margin: 12px 0 0; padding: 9px 11px; border-radius: 9px; background: #fff3d6; color: #6e4400; font-size: 13px; }

/* ---------- Página pública del recibo (la que abre el cliente con el QR) ---------- */

.pagina-recibo {
  margin: 0;
  min-height: 100vh;
  padding: max(20px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
  background: #eceef1;
  color: #12161c;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.pagina-recibo main { display: flex; flex-direction: column; gap: 16px; max-width: 480px; margin: 0 auto; }
.recibo-sombra { filter: drop-shadow(0 12px 24px rgb(16 24 40 / 0.12)) drop-shadow(0 2px 4px rgb(16 24 40 / 0.06)); }
.cargando { color: #5d6672; text-align: center; }

.acciones-recibo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acciones-recibo button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: #12161c;
  box-shadow: inset 0 0 0 1px #d6dbe1;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.acciones-recibo .principal { grid-column: 1 / -1; background: #12161c; color: #fff; box-shadow: none; }
.acciones-recibo svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.error-recibo { padding: 22px; border-radius: 18px; background: #fff; }
.error-recibo h1 { margin: 0 0 8px; font-size: 21px; }
.error-recibo p { margin: 8px 0 0; color: #5d6672; }
.nota-privacidad { margin: 0; color: #6b7480; font-size: 12px; line-height: 1.45; text-align: center; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

@media (prefers-color-scheme: dark) {
  .pagina-recibo { background: #0b0d10; color: #eef1f4; }
  .recibo-sombra { filter: drop-shadow(0 16px 32px rgb(0 0 0 / 0.5)); }
  .acciones-recibo button { background: #1b1f25; color: #eef1f4; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1); }
  .acciones-recibo .principal { background: #ffbf1f; color: #1c1400; }
  .error-recibo { background: #121519; }
  .error-recibo p, .cargando { color: #9ca5af; }
  .nota-privacidad { color: #6b7480; }
}

@media print {
  .pagina-recibo { padding: 0; background: #fff; }
  .acciones-recibo, .nota-privacidad { display: none; }
  .recibo-sombra { filter: none; }
  .recibo { padding: 0; -webkit-mask: none; mask: none; }
}
