/* Portal A8: la app general del lavadero. Pensada para el celular; en pantallas grandes queda centrada.
   Colores de la marca: negro con amarillo. La app se ve igual en tema claro y oscuro. */
@font-face { font-family: "Archivo"; src: url("/fonts/archivo-latin.woff2") format("woff2"); font-weight: 700 900; font-stretch: 100% 125%; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/fonts/dmsans-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --a8-negro: #151412;
  --a8-negro-2: #2a2824;
  --a8-amarillo: #f7d011;
  --fondo: #f1f0eb;
  --tarjeta: #ffffff;
  --texto: #1b1a17;
  --suave: #66625a;
  --borde: #e0ddd2;
  --sobre-negro: #f3f1e8;
  --ok: #17703e;
  --ok-fondo: #e2f2e7;
  --ok-borde: #a9d6b8;
  --rojo: #a3271e;
  --rojo-fondo: #fae7e4;
  --aviso: #5f4c00;
  --aviso-fondo: #fff4c2;
  --wa: #1d8f4e;
  --f-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --f-texto: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --alto-nav: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--a8-negro); color: var(--texto); font-family: var(--f-texto); font-size: 15px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--a8-amarillo); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--fondo); display: flex; flex-direction: column; }
.app-cab {
  position: sticky; top: 0; z-index: 5; background: var(--a8-negro); color: var(--sobre-negro);
  display: flex; align-items: center; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
}
.marca-a8 {
  font-family: var(--f-display); font-weight: 900; font-stretch: 125%; font-size: 21px; line-height: 1; text-decoration: none;
  background: var(--a8-amarillo); color: var(--a8-negro); padding: 7px 8px 6px; border-radius: 8px; letter-spacing: -0.02em;
}
.marca-logo { display: block; flex: none; }
.marca-logo img { display: block; width: 44px; height: 44px; border-radius: 10px; }
.serv .logo { display: block; width: 52px; height: 52px; border-radius: 12px; flex: none; }
.serv.destacada .logo { border: 1px solid var(--a8-negro-2); }
.lugar { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.lugar strong { font-family: var(--f-display); font-stretch: 112%; font-size: 15px; letter-spacing: 0.01em; }
.lugar span { font-size: 12px; opacity: 0.75; }
.wa-cab { margin-left: auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--a8-negro-2); color: var(--a8-amarillo); flex: none; }

.pantalla { flex: 1; padding-bottom: calc(var(--alto-nav) + env(safe-area-inset-bottom, 0px)); outline: none; }
.pant { padding: 16px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 14px; }
.cargando { padding: 40px 16px; text-align: center; color: var(--suave); }

.app-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; z-index: 6;
  display: grid; grid-template-columns: repeat(4, 1fr); background: var(--tarjeta); border-top: 1px solid var(--borde);
  padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
}
.app-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: 11.5px; font-weight: 600; color: var(--suave); text-decoration: none; border-radius: 12px; }
.app-nav svg { width: 22px; height: 22px; padding: 2px 10px; box-sizing: content-box; border-radius: 999px; }
.app-nav a[aria-current="page"] { color: var(--texto); }
.app-nav a[aria-current="page"] svg { background: var(--a8-amarillo); }

/* Tipografía y piezas comunes */
.saludo h1 { font-family: var(--f-display); font-weight: 850; font-stretch: 112%; font-size: 26px; line-height: 1.08; margin: 4px 0 6px; text-wrap: balance; letter-spacing: -0.01em; }
.saludo p { margin: 0; color: var(--suave); font-size: 13.5px; }
.pregunta { font-family: var(--f-display); font-weight: 800; font-stretch: 105%; font-size: 17px; margin: 2px 0 0; }
.ayuda { margin: -6px 0 0; font-size: 13px; color: var(--suave); }
.titulo-sec { font-family: var(--f-display); font-weight: 800; font-stretch: 108%; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--suave); margin: 6px 0 -4px; }
.nota { border-radius: 12px; padding: 11px 13px; font-size: 13px; line-height: 1.45; background: var(--aviso-fondo); color: var(--aviso); }
.nota.gris { background: var(--tarjeta); color: var(--suave); border: 1px solid var(--borde); }
.nota.error { background: var(--rojo-fondo); color: var(--rojo); }
.etq { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; background: var(--a8-amarillo); color: var(--a8-negro); align-self: flex-start; }
.etq.ok { background: var(--ok-fondo); color: var(--ok); }
.etq.gris { background: var(--fondo); color: var(--suave); border: 1px solid var(--borde); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 12px 16px;
  border-radius: 14px; border: 0; cursor: pointer; font-weight: 700; font-size: 15.5px; text-decoration: none; text-align: center;
}
.btn-pri { background: var(--a8-amarillo); color: var(--a8-negro); }
.btn-pri:disabled, .btn-pri[aria-disabled="true"] { background: var(--borde); color: var(--suave); cursor: not-allowed; pointer-events: none; }
.btn-sec { background: var(--tarjeta); color: var(--texto); border: 1px solid var(--borde); }
.btn-negro { background: var(--a8-negro); color: var(--a8-amarillo); }
.btn-wa { background: var(--wa); color: #fff; }
.enlace { background: none; border: 0; padding: 4px; color: var(--texto); text-decoration: underline; cursor: pointer; font-size: 13.5px; }

.saldo { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; text-align: left; width: 100%; background: var(--tarjeta); border: 1px dashed var(--borde); text-decoration: none; color: inherit; cursor: pointer; }
.saldo .txt { display: flex; flex-direction: column; min-width: 0; }
.saldo strong { font-size: 14px; }
.saldo .txt span { font-size: 12px; color: var(--suave); }
.ico-mini { width: 34px; height: 34px; border-radius: 10px; background: var(--a8-amarillo); color: var(--a8-negro); display: grid; place-items: center; flex: none; }
.ico-mini svg { width: 19px; height: 19px; }

/* Inicio */
.servicios { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.serv {
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 16px; padding: 14px; color: inherit; text-decoration: none;
  display: flex; flex-direction: column; gap: 8px; text-align: left; min-height: 140px; min-width: 0; transition: transform 0.12s ease;
}
.serv:active { transform: scale(0.98); }
.serv .ico { width: 42px; height: 42px; border-radius: 12px; background: var(--a8-negro); color: var(--a8-amarillo); display: grid; place-items: center; flex: none; }
.serv .ico svg { width: 24px; height: 24px; }
.serv h3 { font-family: var(--f-display); font-weight: 800; font-stretch: 110%; font-size: 16px; line-height: 1.15; margin: 0; }
.serv p { margin: 0; font-size: 12.5px; color: var(--suave); line-height: 1.35; }
.serv .precio { margin-top: auto; font-size: 12.5px; color: var(--suave); }
.serv .precio strong { color: var(--texto); font-size: 14px; }
.serv.destacada { grid-column: 1 / -1; background: var(--a8-negro); color: var(--sobre-negro); border-color: var(--a8-negro); min-height: 0; }
.serv.destacada .ico { background: var(--a8-amarillo); color: var(--a8-negro); }
.serv.destacada p, .serv.destacada .precio { color: var(--sobre-negro); opacity: 0.8; }
.serv.destacada .precio strong { color: var(--a8-amarillo); }
.serv.destacada .fila { display: flex; gap: 12px; align-items: center; }

/* Flujos */
.cab-flujo { display: flex; align-items: center; gap: 10px; }
.atras { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--borde); background: var(--tarjeta); display: grid; place-items: center; cursor: pointer; flex: none; text-decoration: none; color: inherit; }
.cab-flujo h2 { font-family: var(--f-display); font-weight: 800; font-stretch: 110%; font-size: 20px; line-height: 1.1; margin: 0; }
.cab-flujo small { display: block; color: var(--suave); font-size: 12px; }
.progreso { display: flex; gap: 4px; }
.progreso i { flex: 1; height: 4px; border-radius: 4px; background: var(--borde); }
.progreso i.hecho { background: var(--a8-negro); }
.opciones { display: flex; flex-direction: column; gap: 10px; }
.opcion { display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer; width: 100%; background: var(--tarjeta); border: 1.5px solid var(--borde); border-radius: 14px; padding: 13px 14px; }
.opcion.fija { cursor: default; }
.opcion[aria-pressed="true"] { border-color: var(--a8-negro); box-shadow: inset 0 0 0 1px var(--a8-negro); }
.opcion .linea { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.opcion .nombre { font-weight: 700; font-size: 15px; }
.opcion .monto { font-family: var(--f-display); font-weight: 800; font-stretch: 105%; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.opcion .monto.gris { font-family: var(--f-texto); font-weight: 600; font-size: 12.5px; color: var(--suave); }
.opcion .sub { font-size: 12.5px; color: var(--suave); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--borde); background: var(--tarjeta); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--a8-negro); border-color: var(--a8-negro); color: var(--a8-amarillo); }
.campo { display: flex; flex-direction: column; gap: 5px; }
.campo label { font-size: 13px; font-weight: 600; }
.campo input, .campo textarea {
  font: inherit; font-size: 16px; padding: 12px; border-radius: 12px; border: 1px solid var(--borde);
  background: var(--tarjeta); color: var(--texto); min-height: 48px; width: 100%;
}
.campo textarea { min-height: 84px; resize: vertical; }
.campo .error { color: var(--rojo); font-size: 12.5px; margin: 0; }
.campo input[aria-invalid="true"] { border-color: var(--rojo); }
.pin { letter-spacing: 0.5em; font-family: var(--f-display); font-weight: 800; text-align: center; }
.subir { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px; border-radius: 14px; cursor: pointer; border: 1.5px dashed var(--borde); background: var(--tarjeta); text-align: center; font-size: 13px; color: var(--suave); }
.subir strong { color: var(--texto); font-size: 14px; }
.subir input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.miniaturas { display: flex; gap: 8px; flex-wrap: wrap; }
.miniaturas img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; border: 1px solid var(--borde); }
.pasos-lista { margin: 0; padding: 0; list-style: none; counter-reset: pl; display: flex; flex-direction: column; gap: 8px; }
.pasos-lista li { counter-increment: pl; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 13.5px; line-height: 1.4; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 12px; padding: 10px 12px; }
.pasos-lista li::before { content: counter(pl); width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--a8-negro); color: var(--a8-amarillo); font-family: var(--f-display); font-weight: 900; }
.tipos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tipo { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px; border-radius: 14px; cursor: pointer; background: var(--tarjeta); border: 1.5px solid var(--borde); font-weight: 700; font-size: 14px; text-align: center; }
.tipo .ico { width: 48px; height: 48px; border-radius: 14px; background: var(--fondo); display: grid; place-items: center; }
.tipo .ico svg { width: 28px; height: 28px; }
.tipo[aria-pressed="true"] { border-color: var(--a8-negro); box-shadow: inset 0 0 0 1px var(--a8-negro); }
.tipo[aria-pressed="true"] .ico { background: var(--a8-amarillo); }
.tipo[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 8px; right: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--a8-negro); color: var(--a8-amarillo); display: grid; place-items: center; font-size: 13px; }
.resumen-caja { display: flex; flex-direction: column; gap: 6px; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 14px; padding: 12px 14px; }
.resumen-caja strong { font-size: 15px; }

/* Listo */
.listo { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 8px 0 2px; }
.listo .check { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--a8-amarillo); color: var(--a8-negro); }
.listo h2 { font-family: var(--f-display); font-weight: 850; font-stretch: 110%; font-size: 23px; margin: 6px 0 0; line-height: 1.1; text-wrap: balance; }
.codigo { font-family: var(--f-display); font-weight: 800; letter-spacing: 0.08em; font-size: 26px; background: var(--tarjeta); border: 2px solid var(--a8-negro); padding: 6px 14px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.pasos-sig { margin: 0; padding-left: 20px; font-size: 13.5px; display: flex; flex-direction: column; gap: 6px; }
.resumen { margin: 0; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 14px; padding: 4px 14px; }
.resumen div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--borde); font-size: 13.5px; }
.resumen div:last-child { border-bottom: 0; }
.resumen dt { color: var(--suave); }
.resumen dd { margin: 0; font-weight: 600; text-align: right; }

/* Puntos */
.tarjeta-puntos { background: var(--a8-negro); color: var(--sobre-negro); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.tarjeta-puntos span { font-size: 13.5px; }
.tarjeta-puntos .lbl { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }
.tarjeta-puntos b { color: var(--a8-amarillo); }
.saldo-pts { font-family: var(--f-display); font-weight: 900; font-stretch: 115%; font-size: 46px; line-height: 1; color: var(--a8-amarillo); font-variant-numeric: tabular-nums; }
.barra { height: 10px; border-radius: 999px; background: var(--a8-negro-2); overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--a8-amarillo); border-radius: 999px; }
.premio { display: flex; align-items: center; gap: 12px; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 14px; padding: 12px; }
.premio .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.premio .txt strong { font-size: 14px; }
.premio .txt span { font-size: 12.5px; color: var(--suave); }
.pts-premio { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 60px; padding: 6px; border-radius: 10px; background: var(--fondo); font-family: var(--f-display); font-weight: 850; font-size: 16px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pts-premio small { font-family: var(--f-texto); font-weight: 600; font-size: 10px; color: var(--suave); }
.premio.alcanza .pts-premio { background: var(--a8-amarillo); }
.premio .chip { flex: none; }
.premio .chip:disabled { cursor: not-allowed; opacity: 0.6; font-size: 12px; }
.premio.alcanza .chip { background: var(--a8-negro); color: var(--a8-amarillo); border-color: var(--a8-negro); }
.reglas { margin: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; line-height: 1.4; }
.reglas li { position: relative; padding-left: 17px; }
.reglas li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 7px; height: 7px; border-radius: 50%; background: var(--a8-amarillo); border: 1.5px solid var(--a8-negro); }
.item { display: flex; gap: 12px; align-items: center; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 14px; padding: 12px 14px; text-decoration: none; color: inherit; }
.item .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--fondo); display: grid; place-items: center; flex: none; }
.item .ico svg { width: 20px; height: 20px; }
.item .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.item .txt strong { font-size: 14px; }
.item .txt span { font-size: 12.5px; color: var(--suave); }
.item .pts { font-family: var(--f-display); font-weight: 850; font-size: 16px; color: var(--ok); font-variant-numeric: tabular-nums; white-space: nowrap; }
.item .pts.neg { color: var(--rojo); }
.vacio { text-align: center; color: var(--suave); font-size: 13.5px; padding: 8px; margin: 0; }

.toast {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); width: calc(100% - 32px); max-width: 488px;
  bottom: calc(var(--alto-nav) + 14px + env(safe-area-inset-bottom, 0px));
  background: var(--a8-negro); color: var(--sobre-negro); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; line-height: 1.4;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.5);
}
.toast.error { background: var(--rojo); }
.toast b { color: var(--a8-amarillo); }

@media (min-width: 560px) { .app { border-left: 1px solid var(--a8-negro-2); border-right: 1px solid var(--a8-negro-2); } }
@media (max-width: 350px) { .servicios, .tipos { grid-template-columns: minmax(0, 1fr); } }
