/* Layout y comportamiento de la landing. Colores, espaciado y radios salen de tokens.css;
   los componentes base (ln-*) salen de components.css. Sin sombras: el sistema es plano. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 300 16px/24px var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

.page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }

/* Encabezado */
.header {
  flex: none;
  display: flex;
  align-items: center;
  height: 56px;
  padding-inline: max(var(--space-4), env(safe-area-inset-left)) max(var(--space-4), env(safe-area-inset-right));
}
.header__brand { display: block; }
.header__brand img { height: 28px; width: auto; }

/* Hero: campo plano teal con el patrón de esquinas de la marca */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  padding: var(--space-5) max(var(--space-4), env(safe-area-inset-left)) calc(var(--space-6) + env(safe-area-inset-bottom)) max(var(--space-4), env(safe-area-inset-right));
  background: linear-gradient(90deg, var(--teal-300) 60%, var(--teal-200) 100%);
}
.hero__pattern { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; pointer-events: none; }
.hero__inner {
  position: relative;
  display: grid;
  flex: 1 0 auto;
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto 1fr; /* lo que sobre en pantallas altas queda antes del pie */
  grid-template-areas: "copy" "panel" "steps" "legal";
  gap: var(--space-4);
  max-width: 440px;
  margin-inline: auto;
}
.hero__copy { grid-area: copy; }
.hero__copy h1 { margin: 0; font-size: 30px; line-height: 36px; font-weight: 700; }
.hero__lead { margin: var(--space-2) 0 0; font-size: 18px; line-height: 27px; }

/* Panel de monto (CalculatorCard del design system) */
.panel { grid-area: panel; }
.calc { display: flex; flex-direction: column; }

.amount {
  --amount-size: 56px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin-top: var(--space-1);
  padding-top: 2px;
  border-bottom: 1px solid var(--ink-muted);
}
.amount[data-size="2"] { --amount-size: 50px; }
.amount[data-size="3"] { --amount-size: 46px; }
.amount[data-size="4"] { --amount-size: 40px; }
.amount:focus-within { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.amount__sign, .amount__input {
  font-size: var(--amount-size);
  line-height: 1.1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.amount__input {
  min-width: 0;
  max-width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  outline: none;
  caret-color: var(--brand-500);
}

.calc .help { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0; }
.help__icon { flex: none; color: var(--error-300); }

/* Deslizador: pista y relleno propios, el input nativo solo aporta el pulgar y el gesto */
.slider { --f: 0; position: relative; height: 44px; }
.slider__track, .slider__fill { position: absolute; top: 19px; left: 0; height: 6px; border-radius: var(--radius-sm); }
.slider__track { right: 0; background: var(--surface-sunken); }
.slider__fill { width: calc(14px + (100% - 28px) * var(--f)); background: var(--brand-500); }
.slider__input {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}
.slider__input:focus { outline: none; }
.slider__input:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.slider__input::-webkit-slider-runnable-track { height: 44px; background: transparent; }
.slider__input::-moz-range-track { height: 44px; background: transparent; }
.slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  margin-top: 8px;
  border: 2px solid var(--surface);
  border-radius: var(--radius-md);
  background:
    linear-gradient(var(--on-brand), var(--on-brand)) 6px 50% / 2px 10px no-repeat,
    linear-gradient(var(--on-brand), var(--on-brand)) 11px 50% / 2px 10px no-repeat,
    linear-gradient(var(--on-brand), var(--on-brand)) 16px 50% / 2px 10px no-repeat,
    var(--brand-500);
}
.slider__input::-moz-range-thumb {
  width: 28px;
  height: 28px;
  box-sizing: border-box;
  border: 2px solid var(--surface);
  border-radius: var(--radius-md);
  background:
    linear-gradient(var(--on-brand), var(--on-brand)) 6px 50% / 2px 10px no-repeat,
    linear-gradient(var(--on-brand), var(--on-brand)) 11px 50% / 2px 10px no-repeat,
    linear-gradient(var(--on-brand), var(--on-brand)) 16px 50% / 2px 10px no-repeat,
    var(--brand-500);
}

.scale { display: flex; justify-content: space-between; font-size: 12px; line-height: 18px; color: var(--ink-muted); }

/* Atajos de monto */
.chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); min-height: 44px; margin-top: var(--space-3); }
.chip {
  width: 100%;
  min-height: 44px;
  padding: 0 var(--space-2);
  border: 0;
  text-align: center;
  cursor: pointer;
}
.chip:hover { background: var(--brand-tint); }
.chip[aria-pressed="true"] { background: var(--brand-500); color: var(--on-brand); }

/* CTA a WhatsApp */
.cta { width: 100%; min-height: 56px; justify-content: center; margin-top: var(--space-4); padding: var(--space-3) var(--space-6); }
.cta:active { background: var(--brand-700); }
.cta[aria-disabled="true"] { background: var(--surface-sunken); color: var(--ink-muted); pointer-events: none; }

.notes { display: flex; flex-direction: column; gap: var(--space-1); margin: var(--space-3) 0 0; padding: 0; list-style: none; font-size: 12px; line-height: 18px; color: var(--ink-muted); }
.notes li { display: flex; align-items: center; gap: var(--space-2); }
.notes svg { flex: none; color: var(--brand-500); }

/* Cómo funciona */
.steps { grid-area: steps; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.steps li { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center; font-size: 14px; line-height: 21px; font-weight: 600; }

.legal { grid-area: legal; align-self: end; margin: 0; font-size: 12px; line-height: 18px; text-align: center; }

/* Escritorio: dos columnas, panel a la derecha */
@media (min-width: 960px) {
  .header { height: 72px; padding-inline: var(--space-12); }
  .header__brand img { height: 32px; }

  .hero { flex-direction: row; align-items: center; padding: var(--space-12) var(--space-12) 64px; }
  .hero__inner {
    flex: 0 1 auto;
    max-width: 1120px;
    grid-template-columns: minmax(0, 1fr) 440px;
    grid-template-rows: 1fr auto auto auto 1fr;
    grid-template-areas: ". panel" "copy panel" "steps panel" "legal panel" ". panel";
    column-gap: 64px;
    row-gap: 32px;
  }
  .hero__copy h1 { max-width: 11em; font-size: 45px; line-height: 50px; }
  .hero__lead { max-width: 24em; margin-top: var(--space-4); font-size: 20px; line-height: 30px; }

  .amount { --amount-size: 64px; }
  .amount[data-size="2"] { --amount-size: 58px; }
  .amount[data-size="3"] { --amount-size: 54px; }
  .amount[data-size="4"] { --amount-size: 44px; }

  .steps { max-width: 440px; margin-top: 0; }
  .steps li { align-items: flex-start; text-align: left; font-size: 16px; line-height: 24px; }
  .legal { align-self: start; text-align: left; }
}
