/* EZKLA: página de precios. Se apoya en landing.css (tokens, barra, portada, preguntas, pie).
   Idea: cada paquete es una pila de hojas de contrato que crece con los créditos; la de la portada
   es la cotización del paquete más grande. Solo transform y opacidad en el movimiento. */

/* ---------- Portada ---------- */
.price-hero { min-height: max(640px, 92svh); }
.quote-stack { width: min(540px, 100%); }
.quote-paper { left: 16%; top: 10%; width: 66%; padding: 30px 28px; font-size: 14px; transform: translateZ(50px); }
.quote-paper .contract-title { margin-bottom: 22px; font-size: 14px; }
.quote-under { left: 16%; top: 10%; width: 66%; height: 80%; }
.quote-under-1 { transform: translateZ(10px) rotateZ(-4deg) translate(-14px, 10px); background: #eef3f5; }
.quote-under-2 { transform: translateZ(-40px) rotateZ(-9deg) translate(-34px, 26px); background: #dfe9ec; }
.quote-lines { display: grid; gap: 10px; }
.quote-lines div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 10px; border-radius: 4px; }
.quote-lines div:nth-child(odd) { background: var(--ui-raised); }
.quote-lines dt { color: var(--muted); }
.quote-lines dd { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.quote-saving { margin-top: 18px; padding: 10px 12px; border-radius: 4px; background: var(--accent-tint); color: var(--accent-deep); font-weight: 600; text-align: center; }
.quote-chip { left: auto; right: -4%; top: auto; bottom: 6%; width: 44%; background: #6fb6c8; color: var(--night); font-weight: 500; border-radius: 12px 12px 12px 4px; }
.hero-note b { color: var(--on-night); font-weight: 600; }

/* ---------- Paquetes ---------- */
.packs-section { max-width: calc(1360px + 2 * var(--m)); margin: 0 auto; padding: var(--gap-section) var(--m) 0; }
.packs-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px 48px; align-items: end; margin-bottom: 48px; }
.packs-head h2 { max-width: 12ch; }
.packs-rule { max-width: 62ch; font-weight: 500; }

.packs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
.pack { display: flex; flex-direction: column; gap: 12px; padding: 0 22px 24px; border-radius: 12px; background: var(--field); }
.pack-best { background: var(--accent-tint); }
.pack-name { margin-top: 4px; font-size: var(--t-body); line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; }
.pack-credits { font-size: var(--t-h2); letter-spacing: -0.03em; }
.pack-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.pack-amount { font-size: var(--t-lead); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pack-unit { color: var(--muted); font-size: var(--t-small); }
.pack-total { font-size: 16px; font-variant-numeric: tabular-nums; }
.pack-total span { font-weight: 600; }
.pack-term { font-size: 16px; font-weight: 600; }
.pack-save p { margin-top: 8px; color: var(--accent-deep); font-size: 16px; font-weight: 600; }
.save-meter { display: none; height: 10px; border-radius: 999px; background: var(--field-2); overflow: hidden; }
@media (scripting: enabled) { .save-meter { display: block; } }
.pack-best .save-meter { background: #c3dde4; }
.save-fill { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--accent); transform: scaleX(var(--w, 0)); transform-origin: left; transition: transform 900ms var(--ease-out); }
.pack-reach { color: var(--muted); font-size: 16px; line-height: 1.45; }
.pack-best-note { font-weight: 600; }
.pack-choose { margin-top: auto; width: 100%; }
.packs-note { max-width: 60ch; margin-top: 20px; color: var(--muted); font-size: var(--t-small); }

/* Negocios: una tarjeta oscura bajo los paquetes; sus precios no siguen el selector de plazo. */
.business { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px 48px; align-items: end; margin-top: 8px; padding: 36px 32px; border-radius: 12px; background: var(--night); color: var(--on-night); }
.business-kicker { color: var(--on-night-muted); font-size: var(--t-small); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.business-title { margin-top: 10px; font-size: var(--t-lead); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
.business-price { margin-top: 18px; color: var(--on-night-muted); font-size: var(--t-small); }
.business-price span { margin-right: 4px; color: var(--on-night); font-size: var(--t-lead); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.business-rule { margin-top: 12px; max-width: 52ch; color: var(--on-night-muted); font-size: 16px; line-height: 1.45; }
.business-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.business-option { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 8px; background: var(--night-2); }
.business-credits { font-size: var(--t-body); font-weight: 600; }
.business-credits span { display: block; font-size: var(--t-lead); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.business-unit, .business-total { color: var(--on-night-muted); font-size: var(--t-small); font-variant-numeric: tabular-nums; }
.business-unit span { color: var(--on-night); font-size: var(--t-body); font-weight: 600; }
.business-total span { color: var(--on-night); font-weight: 600; }
.business-choose { margin-top: 10px; width: 100%; }

/* Pila 3D: hojas apiladas en el eje Z; la altura de la pila es el tamaño del paquete.
   Las hojas son un dibujo (como la pila de la portada): llevan canto y sombra. */
.pack-stack { position: relative; height: 250px; margin: 0 -22px; perspective: 1000px; overflow: clip; }
.pile { position: absolute; left: 50%; bottom: 24px; width: 116px; height: 150px; margin-left: -58px; transform-style: preserve-3d; transform: rotateX(calc(58deg + var(--ty, 0deg))) rotateZ(calc(-38deg + var(--tx, 0deg))); transition: transform 600ms var(--ease-out); }
.sheet { position: absolute; inset: 0; border-radius: 3px; background: var(--surface); box-shadow: 0 0 0 1px #d7dde1; transform: translateZ(calc(var(--k) * 7px)); transition: transform 700ms var(--ease-out), opacity 500ms ease; } /* taste-skill-ignore: canto de la hoja dibujada (pila 3D, como .paper en la portada) */
.sheet:first-child { box-shadow: 0 0 0 1px #d7dde1, 18px 22px 30px rgba(19, 20, 22, 0.18); } /* taste-skill-ignore: sombra proyectada de la pila que flota sobre el fondo */
.sheet:last-child { background: var(--surface); box-shadow: 0 0 0 1px #c9d1d6, inset 0 0 0 14px var(--surface), inset 0 -60px 0 0 var(--ui-raised); } /* taste-skill-ignore: renglones de la hoja de encima del dibujo */
.pack-best .sheet:last-child { background: var(--accent); box-shadow: 0 0 0 1px var(--accent-deep); } /* taste-skill-ignore: canto de la hoja dibujada */
.pack:hover .pile, .pack:focus-within .pile { transform: rotateX(calc(52deg + var(--ty, 0deg))) rotateZ(calc(-28deg + var(--tx, 0deg))) translateZ(10px); }
.pack:hover .sheet, .pack:focus-within .sheet { transform: translateZ(calc(var(--k) * 9px)); }
.pile .sheet:nth-child(1) { --k: 0; }
.pile .sheet:nth-child(2) { --k: 1; }
.pile .sheet:nth-child(3) { --k: 2; }
.pile .sheet:nth-child(4) { --k: 3; }
.pile .sheet:nth-child(5) { --k: 4; }
.pile .sheet:nth-child(6) { --k: 5; }
.pile .sheet:nth-child(7) { --k: 6; }
.pile .sheet:nth-child(8) { --k: 7; }
.pile .sheet:nth-child(9) { --k: 8; }
.pile .sheet:nth-child(10) { --k: 9; }
.pile .sheet:nth-child(11) { --k: 10; }
.pile .sheet:nth-child(12) { --k: 11; }
.pile .sheet:nth-child(13) { --k: 12; }
.pile .sheet:nth-child(14) { --k: 13; }
.pile .sheet:nth-child(15) { --k: 14; }
.pile .sheet:nth-child(16) { --k: 15; }

/* ---------- Lo que cuesta cada contrato: la altura de la foto es el precio ---------- */
.costs-section { max-width: calc(1360px + 2 * var(--m)); margin: 0 auto; padding: var(--gap-section) var(--m) 0; }
.costs-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px 48px; align-items: end; margin-bottom: 48px; }
.costs-head p { max-width: 46ch; font-size: var(--t-lead); line-height: 1.35; }
.costs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; align-items: end; }
.cost { display: flex; flex-direction: column; gap: 6px; }
.cost-media { overflow: clip; border-radius: 8px; }
.cost-media picture { display: block; height: 100%; }
.cost-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out); }
.cost:hover .cost-media img { transform: scale(1.05); }
.cost-3 .cost-media { height: 480px; }
.cost-2 .cost-media { height: 320px; }
.cost-1 .cost-media { height: 160px; }
.cost-name { display: grid; gap: 6px; margin-top: 10px; }
.cost-credits { font-size: var(--t-h2); font-weight: 600; line-height: 1; letter-spacing: -0.03em; }
.cost-type { font-size: var(--t-body); font-weight: 500; line-height: 1.3; }

/* ---------- Calculadora: contratos al mes a la izquierda, plan sugerido a la derecha ---------- */
.calc-section { max-width: calc(1360px + 2 * var(--m)); margin: 0 auto; padding: var(--gap-section) var(--m) 0; }
.calc-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px 48px; align-items: end; margin-bottom: 48px; }
.calc-head p { max-width: 46ch; font-size: var(--t-lead); line-height: 1.35; }
.calc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 8px; align-items: stretch; }
.calc-form { padding: 32px; border-radius: 12px; background: var(--field); }
.calc-form fieldset { display: grid; margin: 0; padding: 0; border: 0; }
.calc-form legend { margin-bottom: 14px; font-size: var(--t-body); font-weight: 600; }
.calc-field { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--field-2); }
.calc-field label { display: grid; gap: 2px; }
.calc-type { font-weight: 500; }
.calc-cost { color: var(--muted); font-size: var(--t-small); }
.calc-field input { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--ui-control); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-body); font-variant-numeric: tabular-nums; text-align: right; }
.calc-field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.calc-submit { width: 100%; margin-top: 20px; }
@media (scripting: enabled) { .calc-submit { display: none; } }
.calc-result { padding: 32px; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 1px var(--ui-border); }
.estimate-empty { max-width: 36ch; color: var(--muted); font-size: var(--t-lead); line-height: 1.3; }
.estimate-total b { display: block; font-size: var(--t-h2); font-weight: 600; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.estimate-total { font-weight: 500; }
.estimate-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 24px; }
.estimate-option { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 8px; background: var(--field); }
.estimate-option.is-best { background: var(--accent-tint); box-shadow: inset 0 0 0 2px var(--accent); }
.estimate-period { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: var(--t-body); font-weight: 600; }
.estimate-badge { padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #ffffff; font-size: 12px; font-weight: 600; }
.estimate-need { font-weight: 500; }
.estimate-pack { color: var(--muted); font-size: var(--t-small); }
.estimate-month { margin-top: auto; padding-top: 8px; color: var(--muted); font-size: var(--t-small); }
.estimate-month b { display: block; color: var(--ink); font-size: var(--t-lead); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.estimate-choose { margin-top: 24px; }
.estimate-note { margin-top: 14px; color: var(--muted); font-size: var(--t-small); }

/* ---------- El plazo ---------- */
.term-section { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 48px; align-items: center; margin: var(--gap-section) 0 0; padding: clamp(64px, 8vw, 120px) max(var(--m), calc((100% - 1360px) / 2)); background: var(--night); color: var(--on-night); }
.term-copy { max-width: 640px; justify-self: start; width: 100%; }
.term-rules { display: grid; gap: 28px; margin-top: 40px; }
.term-rules dt { font-size: var(--t-lead); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.term-rules dd { margin-top: 8px; max-width: 52ch; color: var(--on-night-muted); }
.term-example { justify-self: end; width: 100%; max-width: 600px; padding: 32px; border-radius: 12px; background: var(--surface); color: var(--ink); }
.term-example figcaption { font-size: var(--t-lead); font-weight: 500; line-height: 1.3; }
.timeline { display: grid; gap: 18px; margin-top: 28px; }
.timeline p { display: grid; gap: 2px; color: var(--muted); font-size: 16px; }
.timeline b { color: var(--ink); font-weight: 600; }
.timeline-end { text-align: right; }
.timeline-track { display: flex; height: 56px; border-radius: 8px; overflow: hidden; font-size: 14px; font-weight: 600; }
.track-used { display: flex; align-items: center; padding: 0 14px; flex: 19; background: var(--accent); color: #ffffff; }
.track-left { display: flex; align-items: center; justify-content: flex-end; padding: 0 14px; flex: 6 0 auto; white-space: nowrap; background: var(--field-2); color: var(--muted); }

/* ---------- Pantallas medianas ---------- */
@media (max-width: 1100px) {
  .packs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .packs-head, .costs-head, .business, .calc-head, .calc { grid-template-columns: 1fr; }
  .costs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .cost-3, .cost-2 { grid-column: span 3; }
  .cost-1 { grid-column: span 2; }
  .cost-3 .cost-media { height: 420px; }
  .cost-2 .cost-media { height: 280px; }
  .term-section { grid-template-columns: 1fr; }
  .term-copy { justify-self: start; }
}

/* ---------- Teléfono ---------- */
@media (max-width: 640px) {
  .price-hero { min-height: auto; }
  .quote-paper { left: 8%; width: 80%; padding: 18px 16px; font-size: 11px; }
  .quote-under { left: 8%; width: 80%; }
  .quote-chip { display: none; }
  .packs { grid-template-columns: 1fr; }
  .pack { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 6px 14px; padding: 18px 18px 20px 0; }
  .pack > :not(.pack-stack) { grid-column: 2; }
  .pack-stack { grid-row: 1 / span 3; height: 150px; margin: 0; }
  .pile { width: 70px; height: 90px; margin-left: -35px; bottom: 20px; }
  .sheet { transform: translateZ(calc(var(--k) * 4px)); }
  .pack:hover .sheet, .pack:focus-within .sheet { transform: translateZ(calc(var(--k) * 6px)); }
  .business { padding: 24px 18px; }
  .calc-form, .calc-result { padding: 22px 18px; }
  .calc-field { grid-template-columns: minmax(0, 1fr) 96px; }
  .estimate-options { grid-template-columns: 1fr; }
  .estimate-choose { width: 100%; }
  .business-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .costs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cost-3 { grid-column: 1 / -1; }
  .cost-2 { grid-column: span 1; }
  .cost-1 { grid-column: span 1; }
  .cost-3 .cost-media { height: 260px; }
  .cost-2 .cost-media, .cost-1 .cost-media { height: 160px; }
  .cost:last-child { grid-column: 1 / -1; }
  .term-example { padding: 22px; }
  .timeline-end { text-align: left; }
}

/* ---------- Movimiento ---------- */
@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {
  /* Las hojas caen sobre la pila cuando el paquete entra en pantalla (landing.js marca .is-in). */
  .pack.rv .sheet { opacity: 0; transform: translateZ(calc(var(--k) * 7px + 160px)); transition-delay: calc(var(--k) * 45ms + 150ms); }
  .pack.rv.is-in .sheet { opacity: 1; transform: translateZ(calc(var(--k) * 7px)); }
  .pack.rv.is-in:hover .sheet, .js .pack.rv.is-in:focus-within .sheet { transform: translateZ(calc(var(--k) * 9px)); transition-delay: calc(var(--k) * 15ms); }
  .cost-media img { animation: none; }
}
@media (max-width: 640px) and (prefers-reduced-motion: no-preference) and (scripting: enabled) {
  .pack.rv .sheet { transform: translateZ(calc(var(--k) * 4px + 140px)); }
  .pack.rv.is-in .sheet, .js .pack.rv.is-in:hover .sheet { transform: translateZ(calc(var(--k) * 4px)); }
}
@media (prefers-reduced-motion: reduce) {
  .pile, .sheet, .save-fill, .cost-media img { transition: none; }
}
