/* Nodalu — nodalu.com
   Mundo: nota de remisión. Papel bond, tinta azul marino, folio rojo, copias rosa y amarilla. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --papel: #FFFFFF;
  --fondo: #EEF0F6;          /* mostrador: gris azulado muy claro */
  --tinta: #1E2A78;          /* azul marino de imprenta */
  --tinta-suave: #47508F;    /* texto secundario, 7.1:1 sobre blanco */
  --tinta-tenue: #C9CDE3;    /* filetes secundarios */
  --rojo: #C8102E;           /* numeradora */
  --rosa: #F7C6D0;
  --amarilla: #FFE98A;
  --foco: #C8102E;
  --tinta-presionada: #2A3891;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-sello: cubic-bezier(0.16, 1, 0.3, 1);

  --gutter: clamp(16px, 4vw, 40px);
  --ancho: 1180px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--tinta);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--amarilla); color: var(--tinta); }

h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 3px; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.saltar {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--tinta); color: var(--papel); padding: 10px 14px;
}
.saltar:focus { top: 12px; }

.marco { width: 100%; max-width: calc(var(--ancho) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

/* Letra de formulario: versalitas condensadas */
.formulario {
  font-stretch: 75%;
  font-weight: 650;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ───────── Encabezado: talón del talonario ───────── */
.talonario {
  position: sticky; top: 0; z-index: 5;
  background: var(--papel);
  color: var(--tinta);
  border-bottom: 2px solid var(--tinta);
}
.talonario__fila {
  display: flex; align-items: center; gap: 24px;
  min-height: 60px;
}
.marca {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-weight: 800; font-stretch: 75%;
  font-size: 1.125rem; letter-spacing: 0.14em; text-transform: uppercase;
}
.marca__sello { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.marca__sello path { stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.talonario nav { margin-left: auto; }
.talonario__nav { display: flex; gap: 22px; }
.talonario__nav a {
  text-decoration: none; font-stretch: 85%; font-weight: 600; font-size: 0.9375rem;
  padding: 10px 0;
}
.talonario__nav a:hover { text-decoration: underline; }
.enlace-wa {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 16px;
  background: var(--tinta); color: var(--papel);
  font-weight: 700; font-stretch: 85%; text-decoration: none;
  transition: transform 160ms var(--ease-out);
}
.enlace-wa:active { transform: scale(0.97); }

@media (max-width: 760px) {
  .talonario nav { display: none; }
  .enlace-wa { margin-left: auto; }
}

/* ───────── Portada: la nota ───────── */
.portada { padding-top: clamp(28px, 5vw, 56px); padding-bottom: clamp(48px, 7vw, 88px); }

.nota { position: relative; isolation: isolate; margin-right: 14px; margin-bottom: 14px; }
.nota__copia {
  position: absolute; inset: 0; z-index: -1;
  border: 1px solid rgba(30, 42, 120, 0.25);
}
.nota__copia--amarilla { background: var(--amarilla); transform: translate(14px, 14px); }
.nota__copia--rosa { background: var(--rosa); transform: translate(7px, 7px); }

.nota__hoja {
  background: var(--papel);
  border: 2px solid var(--tinta);
}
.nota__encabezado {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px clamp(16px, 3vw, 32px);
  border-bottom: 2px solid var(--tinta);
}
.folio { display: flex; white-space: nowrap; align-items: baseline; gap: 10px; color: var(--rojo); }
.folio .formulario { color: var(--tinta); }
.folio__num {
  font-family: "Archivo", ui-monospace, monospace;
  font-stretch: 70%; font-weight: 700; font-size: 1.5rem; letter-spacing: 0.06em;
}

.nota__cuerpo {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}
.nota__mensaje {
  padding: clamp(24px, 4vw, 56px) clamp(16px, 3vw, 40px);
  border-right: 1px solid var(--tinta);
  display: flex; flex-direction: column; justify-content: center;
}

h1 {
  font-weight: 800;
  font-stretch: 88%;
  font-size: clamp(2.75rem, 7.4vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.entrada {
  margin-top: 20px;
  max-width: 34em;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.5;
  color: var(--tinta-suave);
}
.acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 28px; }

.boton {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 22px;
  background: var(--tinta); color: var(--papel);
  font-weight: 700; font-size: 1.0625rem; text-decoration: none;
  border: 2px solid var(--tinta);
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
.boton svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.boton:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .boton:hover { background: var(--tinta-presionada); }
}
.enlace { font-weight: 600; padding: 12px 0; }

.nota__aclaracion { margin-top: 16px; font-size: 0.9375rem; color: var(--tinta-suave); }

/* La tarjeta del cliente dentro de la nota */
.tarjeta { padding: clamp(20px, 3vw, 36px) clamp(16px, 3vw, 32px); display: flex; flex-direction: column; gap: 18px; justify-content: center; }
.tarjeta__cabeza { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tarjeta__cliente { font-size: 1.125rem; }
.tarjeta__tel { font-size: 0.875rem; color: var(--tinta-suave); }

.renglones { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.renglones th {
  text-align: left;
  font-stretch: 75%; font-weight: 650; font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 8px 6px; border-top: 2px solid var(--tinta); border-bottom: 1px solid var(--tinta);
}
.renglones td { padding: 9px 6px; border-bottom: 1px solid var(--tinta-tenue); }
.renglones .num { text-align: right; }
.renglones .centro { text-align: center; width: 3.5em; }
.rojo { color: var(--rojo); font-weight: 600; letter-spacing: 0.04em; }
.ok { width: 16px; height: 16px; fill: none; stroke: var(--tinta); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

.sellos {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px;
}
.sello {
  aspect-ratio: 1;
  border: 1.5px dashed var(--tinta-tenue);
  position: relative;
  display: grid; place-items: center;
}
.sello--lleno { border-style: solid; border-color: var(--tinta); }
.sello--lleno::after {
  content: "";
  width: 72%; aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--tinta);
  box-shadow: inset 0 0 0 3px var(--papel), inset 0 0 0 4.5px var(--tinta);
  background:
    no-repeat center / 46% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M9 25V7l14 18V7' fill='none' stroke='%231E2A78' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transform: rotate(-9deg);
  opacity: 0.92;
}
.sello--premio { border: 1.5px solid var(--rojo); color: var(--rojo); }
.sello--premio svg { width: 60%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }

.tarjeta__pie { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 0.9375rem; }
.muestra {
  display: inline-block;
  padding: 3px 8px;
  border: 1.5px solid var(--rojo);
  color: var(--rojo);
  font-stretch: 75%; font-weight: 700; font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase;
  transform: rotate(-3deg);
}

/* Momento firma: entra el renglón, avanza el folio, aterriza el sello */
/* main.js añade .animar al cargar y .en-vista cuando la tarjeta entra en pantalla. Sin JS: estado final. */
.tarjeta.animar .renglon-nuevo td { clip-path: inset(0 100% 0 0); }
.tarjeta.animar .sello--nuevo::after { opacity: 0; }
.tarjeta.animar .sello--nuevo { border-style: dashed; border-color: var(--tinta-tenue); }
.tarjeta.animar.en-vista .renglon-nuevo td { animation: renglon 150ms linear both, resalte 1400ms ease-out both; }
.tarjeta.animar.en-vista .renglon-nuevo td:nth-child(1) { animation-delay: 300ms, 300ms; }
.tarjeta.animar.en-vista .renglon-nuevo td:nth-child(2) { animation-delay: 450ms, 300ms; }
.tarjeta.animar.en-vista .renglon-nuevo td:nth-child(3) { animation-delay: 600ms, 300ms; }
.tarjeta.animar.en-vista .renglon-nuevo td:nth-child(4) { animation-delay: 750ms, 300ms; }
.tarjeta.animar.en-vista .sello--nuevo::after { animation: sellar 260ms var(--ease-sello) 1050ms both; }
.tarjeta.animar.en-vista .sello--nuevo { animation: casilla 1ms linear 1050ms both; }
@keyframes renglon {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes resalte {
  from, 55% { background: var(--amarilla); }
  to { background: transparent; }
}
@keyframes sellar {
  from { transform: rotate(-22deg) scale(1.6); opacity: 0; }
  to { transform: rotate(-9deg) scale(1); opacity: 0.92; }
}
@keyframes casilla {
  from { border-style: dashed; border-color: var(--tinta-tenue); }
  to { border-style: solid; border-color: var(--tinta); }
}

@media (max-width: 880px) {
  .nota__cuerpo { grid-template-columns: 1fr; }
  .nota__mensaje { border-right: 0; border-bottom: 1px solid var(--tinta); }
}
@media (max-width: 420px) {
  .nota__encabezado > .formulario { font-size: 0.6875rem; }
  .folio__num { font-size: 1.25rem; }
  .sellos { gap: 4px; }
  .renglones td, .renglones th { padding-inline: 3px; }
}

/* ───────── Secciones ───────── */
.seccion { padding-top: clamp(56px, 8vw, 104px); padding-bottom: clamp(16px, 2vw, 24px); }
h2 {
  font-weight: 800; font-stretch: 88%;
  font-size: clamp(1.875rem, 4.2vw, 3.25rem);
  line-height: 1.02; letter-spacing: -0.025em;
  max-width: 18ch; text-wrap: balance;
}
h3 { font-weight: 700; font-size: 1.25rem; line-height: 1.2; }

/* Hojas: el mismo papel bond de la nota */
.hoja {
  background: var(--papel);
  border: 2px solid var(--tinta);
  padding: clamp(24px, 4vw, 48px);
}
.hoja .pasos { margin-bottom: -4px; }

/* Pasos como renglones de formulario */
.pasos {
  counter-reset: paso;
  margin-top: 32px;
  border-top: 2px solid var(--tinta);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
}
.pasos li {
  counter-increment: paso;
  padding: 24px 24px 28px 0;
  display: grid; grid-template-columns: auto 1fr; column-gap: 16px; row-gap: 8px;
}
.pasos li + li { padding-left: 24px; border-left: 1px solid var(--tinta); }
.pasos li::before {
  content: counter(paso);
  grid-row: span 2;
  font-stretch: 70%; font-weight: 700; font-size: 2.25rem; line-height: 1;
  color: var(--rojo);
}
.pasos p { color: var(--tinta-suave); max-width: 32em; }
@media (max-width: 880px) {
  .pasos { grid-template-columns: 1fr; }
  .pasos li { padding: 20px 0; }
  .pasos li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--tinta); }
}

/* Condiciones: letra chica que sí se lee */
.condiciones {
  background: var(--papel);
  border: 2px solid var(--tinta);
  padding: clamp(24px, 4vw, 48px);
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 32px;
}
.condiciones__lista { display: grid; gap: 0; }
.condiciones__lista li {
  padding: 14px 0 14px 36px; position: relative;
  border-bottom: 1px solid var(--tinta-tenue);
  color: var(--tinta-suave);
}
.condiciones__lista li:first-child { padding-top: 0; }
.condiciones__lista li:first-child::before { top: 2px; }
.condiciones__lista strong { color: var(--tinta); }
.condiciones__lista li::before {
  content: ""; position: absolute; left: 0; top: 16px;
  width: 20px; height: 20px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='8.5' fill='none' stroke='%23C8102E' stroke-width='1.6'/%3E%3Cpath d='M4 16 16 4' stroke='%23C8102E' stroke-width='1.6'/%3E%3C/svg%3E");
}
@media (max-width: 880px) { .condiciones { grid-template-columns: 1fr; gap: 20px; } }

/* Piloto: la copia amarilla */
.piloto {
  background: var(--amarilla);
  border: 2px solid var(--tinta);
  padding: clamp(24px, 4vw, 48px);
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px 48px;
  align-items: end;
}
.piloto .entrada { color: var(--tinta); }
.piloto__datos { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--tinta); }
.piloto__datos div { padding: 12px 12px 0 0; }
.piloto__datos div + div { padding-left: 12px; border-left: 1px solid var(--tinta); }
.piloto__datos dt { font-stretch: 75%; font-weight: 650; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
.piloto__datos dd { white-space: nowrap; font-stretch: 75%; font-weight: 800; font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.1; color: var(--rojo); }
.piloto .acciones { grid-column: 1 / -1; margin-top: 8px; }
@media (max-width: 880px) { .piloto { grid-template-columns: 1fr; } }

/* Precio Evolutivo */
.precio {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 56px; align-items: center;
}
.precio p { margin-top: 18px; color: var(--tinta-suave); max-width: 36em; }
.escalera { width: 100%; max-width: 480px; height: auto; justify-self: end; border-left: 1px solid var(--tinta); padding-left: clamp(16px, 3vw, 40px); }
.escalera__eje { fill: none; stroke: var(--tinta); stroke-width: 1.5; }
.escalera__linea { fill: none; stroke: var(--rojo); stroke-width: 3; stroke-linejoin: miter; }
.escalera__minimo { fill: none; stroke: var(--tinta); stroke-width: 1; stroke-dasharray: 4 4; }
.escalera text { font-family: "Archivo", sans-serif; font-size: 11px; font-weight: 600; fill: var(--tinta); letter-spacing: 0.04em; }
@media (max-width: 880px) { .precio { grid-template-columns: 1fr; } .escalera { justify-self: start; border-left: 0; padding-left: 0; border-top: 1px solid var(--tinta); padding-top: 16px; } }

.seccion--quieta { padding-bottom: clamp(56px, 8vw, 104px); }
.nodalu__texto { margin-top: 18px; max-width: 40em; color: var(--tinta-suave); font-size: 1.125rem; }

/* Pie */
.pie { background: var(--tinta); color: var(--papel); }
.pie__fila { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; padding-block: 24px; font-size: 0.9375rem; }

@media (max-width: 560px) { .solo-ancho { display: none; } }

/* Recibí de conformidad: el renglón de firma junto al botón del piloto */
.conformidad {
  flex: 1 1 220px; max-width: 320px;
  padding-top: 26px;
  border-bottom: 1px solid var(--tinta);
  font-stretch: 75%; font-weight: 650; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
  order: 2;
}

/* Talón: la parte que se desprende, con su línea perforada */
.talon {
  border-top: 2px dashed var(--tinta);
  padding-top: clamp(32px, 5vw, 56px);
}

/* Aviso solo en desarrollo: falta el número de WhatsApp */
.aviso-dev {
  position: fixed; left: 12px; bottom: 12px; z-index: 20;
  background: var(--rojo); color: var(--papel);
  padding: 8px 12px; font-size: 0.875rem; font-weight: 700;
}
