/* ============================================================
   VARIABLES Y RESET
   ============================================================ */
:root {
  --red:          #D90C16;
  --red-dark:     #b8040d;
  --white:        #ffffff;
  --surface:      #FFFEFE;
  --black:        #000000;
  --muted:        rgba(255,255,255,.8);
  --field-text:   #111111;
  --field-ph:     #a9a9a9;
  --star:         #FFD43B;
  --star-border:  #E3A928;
  --radius-xl:    32px;
  --radius-lg:    28px;
  --shadow:       0 4px 20px rgba(0,0,0,.1);
  --font-stack:   Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--red);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-stack);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.app-shell {
  width: min(100%, 900px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 36px 20px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ============================================================
   PANTALLAS (ocultar/mostrar) — visibilidad maneja x-show
   ============================================================ */
/* x-cloak previne flash de contenido no renderizado */
[x-cloak] { display: none !important; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen--active { animation: screenIn .25s ease-out; }

.is-hidden { display: none !important; }

/* ============================================================
   HERO (pantalla formulario)
   ============================================================ */
.hero { text-align: center; padding-top: 8px; }

.hero__eyebrow {
  margin: 0;
  font-size: clamp(2.4rem, 10vw, 4.2rem);
  font-weight: 900;
  line-height: .95;
  letter-spacing: -.04em;
}

.hero h1 {
  margin: 10px 0 0;
  font-size: clamp(1.65rem, 6.5vw, 2.9rem);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -.03em;
}

.hero__subtitle {
  margin: 32px 0 36px;
  font-size: clamp(1.15rem, 4.8vw, 1.7rem);
  font-weight: 400;
  line-height: 1.35;
}

/* ============================================================
   FORMULARIO
   ============================================================ */
.consult-form {
  display: grid;
  gap: 18px;
  width: min(100%, 600px);
  margin: 0 auto 10px;
}

.field {
  width: 100%;
  min-height: 72px;
  border: 0;
  border-radius: var(--radius-xl);
  background: var(--surface);
  padding: 0 24px;
  color: var(--field-text);
  font-size: clamp(1.15rem, 4.5vw, 1.5rem);
  outline: none;
  transition: box-shadow .2s ease;
}

.field::placeholder { color: var(--field-ph); }
.field:focus { box-shadow: 0 0 0 3px rgba(0,0,0,.18); }
.field[aria-invalid="true"] { box-shadow: 0 0 0 3px rgba(104,0,8,.5); }
input[type="date"] { color-scheme: light; }

.field-error {
  min-height: 0;
  margin: -4px 4px 0;
  color: var(--white);
  font-size: .85rem;
  font-weight: 700;
  padding-left: 8px;
}

/* ============================================================
   BOTONES
   ============================================================ */
.button {
  border: 0;
  border-radius: var(--radius-lg);
  padding: 14px 24px;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: -.01em;
  transition: transform .1s ease, opacity .1s ease, box-shadow .15s ease;
  display: inline-block;
  text-align: center;
}

.button:active { transform: scale(.98); }
.button:disabled { opacity: .5; cursor: not-allowed; }

.button--primary { background: var(--black); color: var(--white); }
.button--primary:hover { background: #222; box-shadow: 0 4px 12px rgba(0,0,0,.25); }

.button--full { width: 100%; }

.button--ghost {
  width: 100%;
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,.35);
  margin-top: 14px;
}
.button--ghost:hover { border-color: rgba(255,255,255,.6); }

/* Botón consultar: ancho menor que el form, centrado */
.consult-form .button--primary {
  width: min(72%, 340px);
  margin: 22px auto 0;
  display: block;
  font-size: 1.2rem;
  padding: 16px 24px;
}

/* Botón comercio: píldora */
.button--commerce {
  background: var(--black);
  color: var(--white);
  border-radius: 999px;
  padding: 14px 36px;
  font-size: 1rem;
  display: inline-block;
  transition: transform .1s ease, box-shadow .15s ease;
}
.button--commerce:hover { transform: scale(1.03); box-shadow: 0 4px 16px rgba(0,0,0,.3); }

/* ============================================================
   BENEFICIOS
   ============================================================ */
.benefits {
  margin-top: 48px;
  display: grid;
  gap: 28px;
  width: min(100%, 600px);
  margin-left: auto;
  margin-right: auto;
}

.benefit {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 16px;
}

.benefit__icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  stroke-width: 1.6;
}

.benefit p {
  margin: 0;
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  font-weight: 800;
  line-height: 1.3;
}

/* ============================================================
   CTA COMERCIO
   ============================================================ */
.commerce-cta {
  text-align: center;
  margin-top: 44px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--black);
  margin: 40px -20px -40px;
  padding: 24px 20px;
  text-align: center;
}

.footer__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.footer__logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.footer__text {
  color: var(--white);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1.25;
}

/* ============================================================
   LOADING — centro de pantalla
   ============================================================ */
.center-stage {
  min-height: calc(100dvh - 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 40px 0;
}

.loader {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 6px solid rgba(255,255,255,.2);
  border-top-color: var(--white);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.center-stage h2 {
  margin: 16px 0 0;
  font-size: clamp(1.5rem, 6.5vw, 2.2rem);
  font-weight: 900;
  line-height: 1.1;
}

.center-stage p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 460px;
}

.progress-dots {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.progress-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--white);
  animation: dotPulse 1.2s ease-in-out infinite;
}
.progress-dots span:nth-child(2) { animation-delay: .2s; }
.progress-dots span:nth-child(3) { animation-delay: .4s; }

@keyframes dotPulse {
  0%, 100% { opacity: .2; transform: scale(.85); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* ============================================================
   RESULTADO — cabecera (aprobado / rechazado)
   ============================================================ */
.result-header { margin-bottom: 24px; }
.result-header h2 {
  margin: 0;
  font-size: clamp(2rem, 8.5vw, 3.2rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.035em;
}
.result-header p {
  margin: 10px 0 0;
  font-size: clamp(1.05rem, 4.2vw, 1.3rem);
  font-weight: 400;
}

/* ============================================================
   BLOQUE DETALLE
   ============================================================ */
.result-detail {
  margin-bottom: 22px;
  font-size: clamp(1rem, 4vw, 1.15rem);
  line-height: 1.4;
}
.result-detail strong {
  display: block;
  font-size: clamp(1.05rem, 4.3vw, 1.25rem);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.detail-row { margin: 2px 0; }

/* ============================================================
   CARDS DE PLANES
   ============================================================ */
.offers { display: grid; gap: 16px; margin-bottom: 24px; }

.offer-card {
  width: 100%;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 14px;
  text-align: left;
  border: 3px solid transparent;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--black);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  cursor: pointer;
}

.offer-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,.14); }
.offer-card[aria-pressed="true"] { border-color: var(--black); box-shadow: 0 0 0 3px rgba(217,12,22,.25); }

.offer-card__star {
  font-size: 1.65rem;
  filter: drop-shadow(1px 1px 0 var(--star-border));
}

.offer-card__amount {
  display: block;
  font-size: clamp(1.6rem, 6.8vw, 2.35rem);
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1.1;
}

.offer-card__installments {
  display: block;
  margin-top: 3px;
  font-size: clamp(.92rem, 3.6vw, 1.12rem);
  color: #444;
  font-weight: 500;
}

.offer-card__check {
  font-size: 1.3rem;
  font-weight: 900;
  opacity: 0;
  transition: opacity .15s ease;
  flex-shrink: 0;
}
.offer-card[aria-pressed="true"] .offer-card__check { opacity: 1; }

/* ============================================================
   INSTRUCCIÓN VENDEDOR
   ============================================================ */
.seller-instruction {
  margin-top: 16px;
  margin-bottom: 20px;
  text-align: center;
}
.seller-instruction p {
  margin: 0;
  font-size: clamp(1.08rem, 4.3vw, 1.32rem);
  font-weight: 700;
  line-height: 1.45;
}

/* #continue-offer posicionado debajo de cards */
#continue-offer { margin-top: 14px; }

/* ============================================================
   PLAN PERSONALIZADO
   ============================================================ */
.custom-offer {
  margin-top: 52px;
}
.custom-offer h3 {
  margin: 0 0 8px;
  font-size: clamp(1.65rem, 7vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -.02em;
}
.custom-offer > p {
  margin: 0 0 16px;
  font-size: clamp(1rem, 4vw, 1.15rem);
  font-weight: 400;
}

.money-input {
  display: flex;
  align-items: center;
  height: 76px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 0 20px;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--black);
}
.money-input span {
  font-size: 1.8rem;
  font-weight: 900;
  flex-shrink: 0;
}
.money-input input {
  width: 100%;
  border: 0;
  outline: 0;
  font-size: 1.8rem;
  font-weight: 900;
  text-align: right;
  min-width: 0;
  color: var(--black);
}
.money-input input::placeholder { color: var(--field-ph); }

/* ============================================================
   BLOQUE MENSAJE (rechazado)
   ============================================================ */
.message-block {
  margin: 40px 0 32px;
  padding: 0 4px;
}
.message-block p {
  margin: 0 0 44px;
  font-size: clamp(1.15rem, 4.8vw, 1.38rem);
  font-weight: 400;
  line-height: 1.45;
}
.message-block h3 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 5.5vw, 1.65rem);
  font-weight: 900;
  text-transform: uppercase;
}

/* ============================================================
   CONFIRMACIÓN
   ============================================================ */
.confirmation-card {
  background: var(--surface);
  color: var(--black);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  margin: 24px 0 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.confirmation-card .offer-card__amount { margin-bottom: 6px; }
.confirmation-card .offer-card__installments { color: #555; }

/* ============================================================
   ÉXITO / ERROR
   ============================================================ */
.success-mark,
.error-mark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 3px solid var(--white);
  font-size: 2.6rem;
  font-weight: 900;
}

.error-mark {
  color: var(--white);
}

/* ============================================================
   CONFETTI (CSS puro)
   ============================================================ */
.confetti {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  overflow: hidden;
  width: 100%;
  height: 120px;
  left: 0;
}

.confetti--top { top: 0; }
.confetti--bottom { bottom: 0; transform: rotate(180deg); }

.confetti::before,
.confetti::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 2px;
}

/* Top confetti */
.confetti--top::before {
  top: 10px;
  left: 8%;
  background: #F36A21;
  animation: confettiFall 4s ease-in-out infinite;
}
.confetti--top::after {
  top: 25px;
  left: 22%;
  background: #FFD43B;
  animation: confettiFall 5s ease-in-out infinite 0.4s;
}

.confetti--top span:nth-child(1) {
  position: absolute;
  top: 5px;
  left: 40%;
  width: 10px;
  height: 10px;
  background: #2EAD4B;
  border-radius: 2px;
  animation: confettiFall 4.5s ease-in-out infinite 0.8s;
}
.confetti--top span:nth-child(2) {
  position: absolute;
  top: 20px;
  left: 55%;
  width: 12px;
  height: 12px;
  background: #D600A9;
  border-radius: 2px;
  animation: confettiFall 5.2s ease-in-out infinite 1.2s;
}
.confetti--top span:nth-child(3) {
  position: absolute;
  top: 8px;
  left: 72%;
  width: 14px;
  height: 14px;
  background: #F5C400;
  border-radius: 2px;
  animation: confettiFall 3.8s ease-in-out infinite 0.2s;
}
.confetti--top span:nth-child(4) {
  position: absolute;
  top: 30px;
  left: 88%;
  width: 10px;
  height: 10px;
  background: #42AEE8;
  border-radius: 2px;
  animation: confettiFall 4.6s ease-in-out infinite 0.6s;
}
.confetti--top span:nth-child(5) {
  position: absolute;
  top: 15px;
  left: 32%;
  width: 16px;
  height: 8px;
  background: #D90C16;
  border-radius: 2px;
  animation: confettiFall 5.4s ease-in-out infinite 1s;
}
.confetti--top span:nth-child(6) {
  position: absolute;
  top: 28px;
  left: 65%;
  width: 10px;
  height: 10px;
  background: #E3A928;
  border-radius: 50%;
  animation: confettiFall 4.2s ease-in-out infinite 0.3s;
}

/* Bottom confetti */
.confetti--bottom::before {
  top: 15px;
  left: 12%;
  background: #42AEE8;
  animation: confettiRise 4.4s ease-in-out infinite 0.5s;
}
.confetti--bottom::after {
  top: 8px;
  left: 35%;
  background: #F36A21;
  animation: confettiRise 5s ease-in-out infinite 1s;
}

.confetti--bottom span:nth-child(1) {
  position: absolute;
  top: 20px;
  left: 50%;
  width: 12px;
  height: 12px;
  background: #2EAD4B;
  border-radius: 2px;
  animation: confettiRise 4s ease-in-out infinite 0.2s;
}
.confetti--bottom span:nth-child(2) {
  position: absolute;
  top: 6px;
  left: 70%;
  width: 14px;
  height: 14px;
  background: #FFD43B;
  border-radius: 2px;
  animation: confettiRise 5.6s ease-in-out infinite 0.8s;
}
.confetti--bottom span:nth-child(3) {
  position: absolute;
  top: 22px;
  left: 85%;
  width: 10px;
  height: 10px;
  background: #D600A9;
  border-radius: 50%;
  animation: confettiRise 4.8s ease-in-out infinite 1.4s;
}
.confetti--bottom span:nth-child(4) {
  position: absolute;
  top: 12px;
  left: 20%;
  width: 16px;
  height: 8px;
  background: #D90C16;
  border-radius: 2px;
  animation: confettiRise 5.2s ease-in-out infinite 0.6s;
}
.confetti--bottom span:nth-child(5) {
  position: absolute;
  top: 25px;
  left: 60%;
  width: 10px;
  height: 10px;
  background: #E3A928;
  border-radius: 2px;
  animation: confettiRise 4.3s ease-in-out infinite 1.2s;
}
.confetti--bottom span:nth-child(6) {
  position: absolute;
  top: 5px;
  left: 45%;
  width: 12px;
  height: 12px;
  background: #F5C400;
  border-radius: 2px;
  animation: confettiRise 4.7s ease-in-out infinite 0.1s;
}

@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  80%  { transform: translateY(100px) rotate(180deg); opacity: .6; }
  100% { transform: translateY(120px) rotate(200deg); opacity: 0; }
}

@keyframes confettiRise {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  20%  { opacity: .7; }
  80%  { transform: translateY(-100px) rotate(-180deg); opacity: .6; }
  100% { transform: translateY(-120px) rotate(-200deg); opacity: 0; }
}

/* ============================================================
   RESPONSIVE — Mobile 320px+ (base ya responsive)
   ============================================================ */

/* Tablets / pantallas medianas */
@media (min-width: 600px) {
  .app-shell { padding: 54px 40px 64px; }
  .consult-form { width: min(100%, 540px); }
  .benefits { width: min(100%, 560px); }
  .benefit { grid-template-columns: 56px 1fr; gap: 18px; }
  .benefit__icon { width: 56px; height: 56px; }
}

/* Desktop grande */
@media (min-width: 900px) {
  .app-shell {
    max-width: 900px;
    box-shadow: 0 0 80px rgba(0,0,0,.12);
    border-radius: 0;
  }
  .footer {
    margin: 56px -40px -64px;
    padding: 28px 40px;
  }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
  }
}
/* ============================================================
   LABEL DE CAMPO (fecha, que no tiene placeholder nativo)
   ============================================================ */
.field-label {
  display: block;
  margin: 6px 10px -6px;
  font-size: .98rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: .01em;
}

/* Utilidad de accesibilidad */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Hint del monto a consultar (se envía en miles) */
.custom-hint {
  margin: -4px 10px 4px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  opacity: .9;
}

/* Bloqueo del formulario mientras se envía la consulta (anti doble submit) */
.consult-form.is-locked {
  pointer-events: none;
  opacity: .7;
}
CS
node --check web/public_html/assets/js/app.js && echo "app.js OK"
echo "=== métodos referenciados ==="; grep -n "clearLoadingTimers()\|clearPoll()" web/public_html/assets/js/app.js | head -8
./scripts/check.sh 2>&1 | tail -1

/* ============================================================
   SLIDER DE MONTO (mismo ancho que el input, thumb centrado)
   ============================================================ */
.amount-slider-wrap {
  width: 100%;
  margin: 12px 0 0;
}

.amount-slider {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

/* WebKit (Chrome, Safari, Edge) */
.amount-slider::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .22);
}
.amount-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 40px;
  margin-top: -14px;            /* (12 - 40) / 2 -> centrado sobre la pista */
  border-radius: 50%;
  background: var(--black);
  border: 4px solid var(--white);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
}
.amount-slider:active::-webkit-slider-thumb { cursor: grabbing; }

/* Firefox */
.amount-slider::-moz-range-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .22);
}
.amount-slider::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--black);
  border: 4px solid var(--white);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
  cursor: grab;
}

.amount-slider:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 4px;
  border-radius: 999px;
}

.amount-slider__scale {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 4px;
  font-size: .95rem;
  font-weight: 800;
  color: var(--white);
  opacity: .92;
}
