:root {
  --fondo: #0c0b0a;
  --fondo-2: #121009;
  --tarjeta: #171513;
  --tarjeta-2: #1e1b18;
  --borde: rgba(255, 255, 255, .07);
  --borde-fuerte: rgba(255, 255, 255, .13);
  --texto: #f6f1ea;
  --suave: #a0968b;
  --tenue: #6d655c;
  --naranja: #ff6a1a;
  --naranja-2: #ff9a3c;
  --ambar: #ffc163;
  --rojo: #ff4d4d;
  --verde: #3ddc84;
  --degradado: linear-gradient(140deg, #ff8a2a 0%, #ff5a14 55%, #ff3d0a 100%);
  --resplandor: 0 10px 40px -8px rgba(255, 106, 26, .55);
  --sombra: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 40px -24px rgba(0, 0, 0, .8);
  --radio: 26px;
  --radio-p: 16px;
  --cristal: rgba(23, 21, 19, .72);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --fondo: #f2eadb;
    --fondo-2: #ebe1cf;
    --tarjeta: #f8f1e4;
    --tarjeta-2: #f1e7d5;
    --borde: rgba(110, 76, 30, .12);
    --borde-fuerte: rgba(110, 76, 30, .2);
    --texto: #1f1914;
    --suave: #76695b;
    --tenue: #a49684;
    --sombra: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 18px 36px -24px rgba(110, 76, 30, .45);
    --cristal: rgba(248, 241, 228, .8);
    color-scheme: light;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  min-height: 100dvh;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.fondo-brillo {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60% 40% at 85% -5%, rgba(255, 106, 26, .22), transparent 70%),
    radial-gradient(50% 30% at 0% 100%, rgba(255, 154, 60, .12), transparent 70%);
}
main {
  position: relative; z-index: 1;
  max-width: 560px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 110px);
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.oculto { display: none !important; }

/* ---------- cabecera ---------- */
.cabecera { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.marca { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; text-decoration: none; }
.orbe {
  --t: 30px;
  width: var(--t); height: var(--t); border-radius: 50%; position: relative; flex: none;
  background: radial-gradient(circle at 35% 30%, #fff6dd 0%, #ffc163 28%, #ff7a1f 62%, #e8430a 100%);
  box-shadow: 0 0 calc(var(--t) * .7) rgba(255, 122, 31, .65), inset 0 -4px 10px rgba(180, 40, 0, .35);
}
.orbe::before, .orbe::after {
  content: ''; position: absolute; top: 42%; width: 9%; height: 16%; border-radius: 50%; background: #3b1404;
}
.orbe::before { left: 34%; }
.orbe::after { right: 30%; }
.orbe.grande { --t: 168px; }
.orbe.grande::before, .orbe.grande::after { animation: parpadeo 5s infinite; }
.anillo {
  position: absolute; inset: -14% -22%; border-radius: 50%;
  border: 1.5px solid rgba(255, 170, 90, .5); transform: rotate(-16deg) scaleY(.42);
  box-shadow: 0 0 10px rgba(255, 140, 50, .35);
}
@keyframes flotar { 50% { transform: translateY(-8px); } }
@keyframes parpadeo { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }

.boton-icono {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--borde);
  background: var(--tarjeta); display: grid; place-items: center; position: relative; cursor: pointer;
}
.globo {
  position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 10px; background: var(--naranja); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 0 12px rgba(255, 106, 26, .7);
}

/* ---------- iconos ---------- */
.ic { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.p { width: 18px; height: 18px; }
.ic.g { width: 28px; height: 28px; }

/* ---------- tipografía ---------- */
.titulo-xl { font-size: clamp(38px, 11vw, 54px); line-height: 1.02; font-weight: 800; letter-spacing: -.045em; }
.titulo-l { font-size: 28px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; }
.titulo-m { font-size: 19px; font-weight: 700; letter-spacing: -.015em; }
.suave { color: var(--suave); }
.tenue { color: var(--tenue); }
.peq { font-size: 13.5px; }
.mini { font-size: 12px; }
.etiqueta-sec { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--tenue); margin: 28px 4px 12px; }
.brilla { background: linear-gradient(180deg, #fff 30%, #ffc995); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (prefers-color-scheme: light) { .brilla { background: linear-gradient(180deg, #2a1a0c 30%, #c2531a); -webkit-background-clip: text; background-clip: text; } }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.03em; }

/* ---------- tarjetas ---------- */
.tarjeta {
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 20px; box-shadow: var(--sombra); position: relative; overflow: hidden;
}
.tarjeta + .tarjeta { margin-top: 12px; }
.rejilla { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rejilla > .tarjeta { margin: 0; }
.ancho { grid-column: 1 / -1; }
.tarjeta.naranja {
  background: var(--degradado); border-color: rgba(255, 200, 150, .35); color: #fff;
  box-shadow: var(--resplandor), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.tarjeta.naranja .suave { color: rgba(255, 255, 255, .82); }
.tarjeta.enlace { cursor: pointer; text-decoration: none; display: block; transition: transform .15s; }
.tarjeta.enlace.fila { display: flex; }
.tarjeta.enlace:active { transform: scale(.98); }
.tarjeta .flecha-esq {
  position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, .16);
}
.tarjeta:not(.naranja) .flecha-esq { background: var(--tarjeta-2); border: 1px solid var(--borde); }
.tarjeta-mini { min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; }
.circulo-ic {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: radial-gradient(circle at 30% 25%, #3a332c, #1b1814); border: 1px solid var(--borde-fuerte);
  color: var(--texto); box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .8);
}
@media (prefers-color-scheme: light) {
  .circulo-ic { background: radial-gradient(circle at 30% 25%, #fffaf0, #efe2cb); }
}
.circulo-ic.calido { color: var(--naranja-2); box-shadow: 0 0 22px -4px rgba(255, 106, 26, .45); }

/* tarjeta principal del vehículo (estilo resplandor) */
.vehiculo-hero {
  border-radius: 34px; padding: 22px; position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(120% 70% at 50% 120%, #ffb547 0%, #ff7a1f 30%, rgba(255, 106, 26, .0) 70%),
    radial-gradient(70% 50% at 100% 0%, rgba(255, 106, 26, .35), transparent 70%),
    #0f0d0b;
  border: 1px solid rgba(255, 150, 70, .3);
  box-shadow: 0 30px 60px -30px rgba(255, 106, 26, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.vehiculo-hero .suave { color: rgba(255, 255, 255, .62); }
.vehiculo-hero .circulo-ic { background: radial-gradient(circle at 30% 25%, #4a423a, #1b1814); color: #fff; border-color: rgba(255, 255, 255, .12); }
.fila { display: flex; align-items: center; gap: 12px; }
.fila.entre { justify-content: space-between; }
.cifras { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 22px 0 18px; }
.cifra b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.cifra span { font-size: 12.5px; color: rgba(255, 255, 255, .62); }
.ondas { display: flex; align-items: flex-end; gap: 5px; height: 64px; margin-top: 6px; }
.ondas i {
  flex: 1; border-radius: 6px; min-height: 6px;
  background: linear-gradient(180deg, #ffd08a, #ff6a1a);
  box-shadow: 0 0 14px rgba(255, 140, 50, .55);
}
.ondas i.vacio { background: rgba(255, 255, 255, .14); box-shadow: none; }
.ondas-pie { display: flex; justify-content: space-between; font-size: 11px; color: rgba(255, 255, 255, .55); margin-top: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .12);
}
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--verde); box-shadow: 0 0 8px var(--verde); }
.chip.pausa::before { background: var(--ambar); box-shadow: 0 0 8px var(--ambar); }
.chip.sin-punto::before { display: none; }
.chip.estado-pendiente::before { background: var(--ambar); box-shadow: 0 0 8px var(--ambar); }
.chip.estado-preparando::before { background: var(--naranja-2); box-shadow: 0 0 8px var(--naranja-2); }
.chip.estado-enviado::before { background: var(--verde); }
.chip.estado-cancelado::before { background: var(--tenue); box-shadow: none; }
.tarjeta .chip, main > .chip { background: var(--tarjeta-2); border-color: var(--borde); }

/* ---------- botones ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 54px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 700; font-size: 16px; text-decoration: none; transition: transform .12s, opacity .2s;
  background: var(--degradado); color: #fff; box-shadow: var(--resplandor), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.boton:active { transform: scale(.97); }
.boton:disabled { opacity: .6; cursor: default; }
.boton.bloque { width: 100%; }
.boton.sec { background: var(--tarjeta-2); color: var(--texto); border: 1px solid var(--borde-fuerte); box-shadow: none; }
.boton.claro { background: #fff; color: #1a120b; box-shadow: none; }
.boton.peligro { background: transparent; color: var(--rojo); border: 1px solid rgba(255, 77, 77, .35); box-shadow: none; }
.boton.peq { min-height: 42px; padding: 0 16px; font-size: 14.5px; }
.botones { display: grid; gap: 10px; }
.botones.dos { grid-template-columns: 1fr 1fr; }
.texto-boton { background: none; border: 0; padding: 6px 2px; color: var(--naranja-2); font-weight: 600; cursor: pointer; font-size: 14.5px; }
.giro { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: girar .7s linear infinite; }
.boton.sec .giro { border-color: var(--borde-fuerte); border-top-color: var(--texto); }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- formularios ---------- */
.campo { display: grid; gap: 7px; margin-bottom: 14px; }
.campo label { font-size: 13.5px; font-weight: 600; color: var(--suave); padding-left: 4px; }
.entrada {
  width: 100%; min-height: 54px; padding: 14px 18px; border-radius: var(--radio-p);
  background: var(--fondo-2); border: 1px solid var(--borde-fuerte); outline: none; font-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}
textarea.entrada { min-height: 96px; resize: vertical; }
.entrada:focus { border-color: var(--naranja); box-shadow: 0 0 0 4px rgba(255, 106, 26, .15); }
.entrada::placeholder { color: var(--tenue); }
.dos-col { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.ayuda { font-size: 12.5px; color: var(--tenue); padding-left: 4px; }

.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.interruptor input { display: none; }
.interruptor .pista {
  width: 52px; height: 32px; border-radius: 99px; background: var(--tarjeta-2); border: 1px solid var(--borde-fuerte);
  position: relative; transition: background .2s; flex: none;
}
.interruptor .pista::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; transition: transform .2s; box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.interruptor input:checked + .pista { background: var(--naranja); border-color: transparent; box-shadow: 0 0 16px rgba(255, 106, 26, .5); }
.interruptor input:checked + .pista::after { transform: translateX(20px); }

.opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.opcion { position: relative; }
.opcion input { position: absolute; opacity: 0; }
.opcion span {
  display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 18px; cursor: pointer;
  background: var(--fondo-2); border: 1px solid var(--borde-fuerte); font-weight: 600; font-size: 14.5px; min-height: 100%;
}
.opcion span small { font-weight: 400; color: var(--suave); font-size: 12.5px; }
.opcion input:checked + span { border-color: var(--naranja); background: rgba(255, 106, 26, .1); box-shadow: 0 0 0 3px rgba(255, 106, 26, .15); }
.opcion input:checked + span .ic { color: var(--naranja-2); }

/* ---------- listas ---------- */
.lista { display: grid; gap: 10px; }
.elemento {
  display: flex; gap: 14px; padding: 16px; border-radius: 22px; background: var(--tarjeta);
  border: 1px solid var(--borde); position: relative; align-items: flex-start;
}
.elemento.nuevo { border-color: rgba(255, 106, 26, .4); box-shadow: 0 0 0 1px rgba(255, 106, 26, .1), 0 10px 30px -18px rgba(255, 106, 26, .6); }
.elemento.nuevo::after {
  content: ''; position: absolute; top: 18px; right: 16px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--naranja); box-shadow: 0 0 10px var(--naranja);
}
.elemento .cuerpo { flex: 1; min-width: 0; }
.elemento .cuerpo b { display: block; font-weight: 650; padding-right: 18px; }
.elemento .mensaje {
  margin-top: 8px; padding: 10px 13px; border-radius: 14px 14px 14px 4px; background: var(--tarjeta-2);
  font-size: 14.5px; border: 1px solid var(--borde); word-wrap: break-word;
}
.vacio-estado { text-align: center; padding: 36px 20px; }
.vacio-estado .circulo-ic { margin: 0 auto 14px; width: 64px; height: 64px; }

/* ---------- barra inferior ---------- */
#barra {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  width: calc(100% - 28px); max-width: 420px; padding: 7px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  border-radius: 999px; background: var(--cristal); border: 1px solid var(--borde-fuerte);
  -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .7);
}
#barra[hidden] { display: none; }
#barra a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px;
  border-radius: 999px; text-decoration: none; color: var(--tenue); font-size: 11px; font-weight: 600; position: relative;
}
#barra a.activo { color: var(--texto); background: var(--tarjeta-2); }
#barra a.activo .ic { color: var(--naranja-2); filter: drop-shadow(0 0 6px rgba(255, 106, 26, .6)); }
#barra .globo { top: 2px; right: calc(50% - 22px); }

/* ---------- aviso flotante ---------- */
#aviso-flotante {
  position: fixed; z-index: 50; left: 50%; top: calc(env(safe-area-inset-top) + 14px);
  transform: translate(-50%, -150%); transition: transform .35s cubic-bezier(.2, .9, .3, 1.2);
  width: calc(100% - 28px); max-width: 420px; padding: 14px 18px; border-radius: 20px;
  background: var(--cristal); border: 1px solid var(--borde-fuerte); font-weight: 600; font-size: 14.5px;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6);
  display: flex; gap: 10px; align-items: center;
}
#aviso-flotante:not(.ver) { visibility: hidden; transition: transform .35s, visibility 0s .35s; }
#aviso-flotante.ver { transform: translate(-50%, 0); }
#aviso-flotante.error { border-color: rgba(255, 77, 77, .5); }
#aviso-flotante.error .ic { color: var(--rojo); }
#aviso-flotante .ic { color: var(--naranja-2); }

/* ---------- bienvenida ---------- */
.hero { text-align: center; padding: 26px 0 8px; }
.hero .escenario { position: relative; width: 168px; height: 168px; margin: 18px auto 34px; }
.hero p.lead { margin: 16px auto 28px; max-width: 360px; color: var(--suave); font-size: 17px; }
.burbuja {
  display: flex; gap: 11px; align-items: center; padding: 12px 14px; border-radius: 18px; text-align: left;
  background: var(--cristal); border: 1px solid var(--borde-fuerte); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .7);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.burbuja .orbe { --t: 34px; }
.burbuja b { font-size: 13.5px; display: block; }
.burbuja span { font-size: 12.5px; color: var(--suave); }
.lineas-fondo {
  position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background: repeating-linear-gradient(135deg, transparent 0 14px, var(--borde) 14px 15px);
}
.paso-num { font-size: 13px; font-weight: 700; color: var(--naranja-2); }

/* ---------- QR ---------- */
.lienzo-qr { width: 100%; max-width: 330px; display: block; margin: 0 auto; border-radius: 30px; box-shadow: 0 30px 60px -28px rgba(255, 106, 26, .55); }
.codigo-caja {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 15px; letter-spacing: .14em; font-weight: 700;
  padding: 7px 12px; border-radius: 10px; background: var(--tarjeta-2); border: 1px solid var(--borde);
}

/* ---------- página de aviso pública ---------- */
.tipo { position: relative; }
.tipos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tipo input { position: absolute; opacity: 0; pointer-events: none; }
.tipo > span {
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 112px;
  padding: 16px; border-radius: 22px; background: var(--tarjeta); border: 1px solid var(--borde);
  font-weight: 650; font-size: 15px; line-height: 1.2; cursor: pointer; transition: transform .12s;
  box-shadow: var(--sombra);
}
.tipo > span .circulo-ic { width: 42px; height: 42px; }
.tipo > span:active { transform: scale(.97); }
.tipo input:checked + span {
  background: var(--degradado); color: #fff; border-color: rgba(255, 200, 150, .4); box-shadow: var(--resplandor);
}
.tipo input:checked + span .circulo-ic { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .3); color: #fff; box-shadow: none; }
.tipo.ancho > span { min-height: 0; flex-direction: row; align-items: center; justify-content: flex-start; }
.exito { text-align: center; padding: 30px 0; }
.check-brillo {
  width: 110px; height: 110px; border-radius: 50%; margin: 10px auto 26px; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 35% 30%, #ffe2b0, #ff8a2a 55%, #e8430a);
  box-shadow: 0 0 60px rgba(255, 122, 31, .7);
  animation: aparecer .5s cubic-bezier(.2, .9, .3, 1.4);
}
.check-brillo .ic { width: 52px; height: 52px; stroke-width: 2.6; }
@keyframes aparecer { from { transform: scale(.4); opacity: 0; } }

.esqueleto { height: 120px; border-radius: var(--radio); background: linear-gradient(90deg, var(--tarjeta) 0%, var(--tarjeta-2) 50%, var(--tarjeta) 100%); background-size: 200% 100%; animation: brillar 1.3s infinite; margin-bottom: 12px; }
@keyframes brillar { to { background-position: -200% 0; } }

.separador { height: 1px; background: var(--borde); margin: 16px 0; }
.pie-legal { text-align: center; font-size: 12px; color: var(--tenue); margin-top: 30px; }

/* ---------- impresión ---------- */
#zona-impresion { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  body > *:not(#zona-impresion) { display: none !important; }
  #zona-impresion { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10mm; justify-items: center; }
  #zona-impresion img { width: 80mm; height: auto; break-inside: avoid; }
}
