/* Sacamos — base compartida: colores, letras, botones, hojas, avisos. */
:root {
  --marino: #0e2240;
  --marino-2: #14305a;
  --marino-3: #1d3f72;
  --marino-4: #2a5290;
  --lima: #d4f54a;
  --lima-2: #c2e436;
  --lima-tinta: #1f2a00;
  --blanco: #ffffff;
  --hueso: #f4f6fa;
  --gris-1: #e6eaf1;
  --gris-2: #c5cddb;
  --gris-3: #8391a7;
  --gris-4: #56647b;
  --tinta: #0e2240;
  --rojo: #e5484d;
  --rojo-suave: #fde8e8;
  --ambar: #f5a524;
  --ambar-suave: #fff3dc;
  --verde: #2f9e6a;
  --verde-suave: #e3f6ec;
  --azul-suave: #e7eefb;
  --radio: 14px;
  --radio-g: 22px;
  --sombra: 0 1px 2px rgba(14, 34, 64, .06), 0 8px 24px -8px rgba(14, 34, 64, .18);
  --sombra-g: 0 24px 60px -12px rgba(6, 16, 34, .45);
  --letra: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --letra-c: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-cajon: cubic-bezier(.32, .72, 0, 1);
  --rapido: 160ms var(--ease-out);
  --suave: 260ms var(--ease-out);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--letra); font-size: 16px; line-height: 1.4; color: var(--tinta); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; }
.oculto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--lima); outline-offset: 2px; border-radius: 8px; }
.num { font-family: var(--letra-c); font-variant-numeric: tabular-nums; letter-spacing: .01em; }

/* ── botones ── */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 0 20px; border-radius: 999px; border: 0;
  font-weight: 700; font-size: 16px; text-decoration: none; white-space: nowrap;
  transition: transform var(--rapido), background var(--rapido), box-shadow var(--rapido), opacity var(--rapido);
  position: relative;
}
.boton:active:not(:disabled) { transform: scale(.97); }
.boton:disabled { opacity: .55; cursor: default; }
.boton.primario { background: var(--lima); color: var(--lima-tinta); box-shadow: 0 6px 18px -6px rgba(212, 245, 74, .7); }
.boton.primario.peligro { background: var(--rojo); color: #fff; box-shadow: none; }
.boton.secundario { background: var(--gris-1); color: var(--tinta); }
.boton.oscuro { background: var(--marino); color: #fff; }
.boton.borde { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.boton.wa { background: #25d366; color: #06361b; }
.boton.chico { min-height: 38px; padding: 0 14px; font-size: 14px; }
.boton.ancho { width: 100%; }
.boton.cargando { color: transparent !important; }
.boton.cargando::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(0, 0, 0, .25); border-top-color: var(--lima-tinta); animation: girar .7s linear infinite; }
.boton.oscuro.cargando::after, .boton.peligro.cargando::after { border-color: rgba(255, 255, 255, .3); border-top-color: #fff; }
@keyframes girar { to { transform: rotate(360deg); } }
.ico { width: 20px; height: 20px; flex: none; }

@media (hover: hover) and (pointer: fine) {
  .boton.primario:hover:not(:disabled) { background: var(--lima-2); }
  .boton.secundario:hover:not(:disabled) { background: var(--gris-2); }
  .boton.oscuro:hover:not(:disabled) { background: var(--marino-2); }
  .boton.wa:hover:not(:disabled) { background: #1fc05b; }
  .hoja-x:hover { background: var(--gris-2); }
}
.wa-ico { width: 18px; height: 18px; flex: none; }

/* ── campos ── */
.campo { display: grid; gap: 6px; }
.campo > span { font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--gris-4); }
.entrada {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--gris-2); background: #fff; font-size: 17px;
  transition: border-color var(--rapido), box-shadow var(--rapido);
}
.entrada:focus { outline: none; border-color: var(--marino-3); box-shadow: 0 0 0 4px rgba(29, 63, 114, .14); }
textarea.entrada { min-height: 84px; resize: vertical; }
select.entrada { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gris-4) 50%), linear-gradient(135deg, var(--gris-4) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }

/* ── hoja (sube desde abajo; en PC, al centro) ── */
.hoja-fondo { position: fixed; inset: 0; background: rgba(6, 14, 30, .55); opacity: 0; transition: opacity var(--suave); z-index: 50; backdrop-filter: blur(2px); }
.hoja-fondo.abierta { opacity: 1; }
.hoja {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  background: #fff; color: var(--tinta); border-radius: var(--radio-g) var(--radio-g) 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform 420ms var(--ease-cajon);
  box-shadow: var(--sombra-g); touch-action: pan-y;
}
.hoja.abierta { transform: none; }
.hoja.cerrando { transition: transform 200ms var(--ease-out), opacity 200ms var(--ease-out); }
.hoja.arrastrando { transition: none; }
.hoja-asa { touch-action: none; }
.hoja-asa { width: 44px; height: 5px; border-radius: 9px; background: var(--gris-2); margin: 0 auto 14px; box-shadow: 0 0 0 14px transparent; cursor: grab; }
.hoja-x { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--gris-1); font-size: 24px; line-height: 1; color: var(--gris-4); }
@media (min-width: 700px) {
  .hoja { left: 50%; right: auto; bottom: auto; top: 50%; width: min(520px, 94vw); max-height: 88vh; border-radius: var(--radio-g); padding: 22px 26px 24px; transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: transform var(--suave), opacity var(--suave); }
  .hoja.abierta { transform: translate(-50%, -50%); opacity: 1; }
  .hoja-asa { display: none; }
}
body.con-hoja { overflow: hidden; }
.pregunta h3 { font-size: 21px; padding-right: 44px; margin-bottom: 8px; }
.pregunta p { color: var(--gris-4); margin-bottom: 18px; }
.botones { display: flex; gap: 10px; margin-top: 18px; }
.botones .boton { flex: 1; }
.pasos { padding-left: 22px; margin: 10px 0 0; display: grid; gap: 8px; color: var(--gris-4); }

/* ── aviso flotante ── */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 80;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 440px); padding: 13px 18px; border-radius: 14px;
  background: var(--marino); color: #fff; font-weight: 600; box-shadow: var(--sombra-g);
  transition: transform var(--suave), opacity var(--suave);
}
.toast.mostrar { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: var(--rojo); }

/* ── chips de estado ── */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.chip.ok { background: var(--verde-suave); color: #19633f; }
.chip.espera { background: var(--ambar-suave); color: #8a5300; }
.chip.mal { background: var(--rojo-suave); color: #a3262a; }
.chip.info { background: var(--azul-suave); color: var(--marino-3); }
.chip.lima { background: var(--lima); color: var(--lima-tinta); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
