/* Escenas animadas de las páginas Funciones, Precios y Calculadora.
   Estados iniciales solo bajo .js; sin JS o con "reducir movimiento" todo se ve en su estado final. */

.scn { margin-top: 20px; max-width: 520px; }
/* Secciones con dos escenas: la de la izquierda ocupa dos filas y la segunda va bajo la lista de la derecha */
@media (min-width: 900px) {
  .fgrid--2 > div:first-child { grid-row: span 2; }
  .fgrid--2 > .scn { grid-column: 2; margin-top: 0; }
}
.scn .mock__tag--c { margin: 14px 0 0; }

/* ---------- Cuadre de caja ---------- */
.cj { padding-top: 14px; }
.js .scn:not(.is-in) .cj li { opacity: 0; transform: translateY(8px); transition: none; }
.js .scn.is-in .cj li { transition: opacity .45s ease calc(var(--i, 0) * .2s), transform .45s ease calc(var(--i, 0) * .2s); }
.cj li em { font-variant-numeric: tabular-nums; }
.cj__tick { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: #137a43; color: #fff; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.js .cj__diff { background: #fff3f2 !important; border-color: #f3c4c0 !important; transition: background .4s ease, border-color .4s ease; }
.js .cj__diff em { color: #b42318 !important; }
.js .cj__tick { opacity: 0; transform: scale(.6); display: inline-block; transition: opacity .3s ease, transform .3s ease; }
.js .cj__diff.is-done { background: #e9f8ef !important; border-color: #b7e4c7 !important; }
.js .cj__diff.is-done em { color: #137a43 !important; }
.js .cj__diff.is-done .cj__tick { opacity: 1; transform: none; }

/* ---------- Ruta de cobranza ---------- */
.rt { display: block; width: 100%; height: auto; background: #f4f1fa; }
.rt__grid line { stroke: #e2dcf0; stroke-width: 1; }
.rt__path { fill: none; stroke: #b9a9e6; stroke-width: 3; stroke-dasharray: 2 7; stroke-linecap: round; }
.rt__done { fill: none; stroke: var(--purple-2); stroke-width: 3.5; stroke-linecap: round; }
.rt__pin circle { fill: #fff; stroke: #b9b4c8; stroke-width: 2.5; transition: fill .3s ease, stroke .3s ease, transform .3s ease; transform-box: fill-box; transform-origin: center; }
.rt__pin text { font-size: 9px; font-weight: 700; fill: #5d5575; text-anchor: middle; transition: fill .3s ease; }
.rt__pin .rt__amt { opacity: 0; font-size: 10px; transition: opacity .3s ease; }
.rt__pin.is-done circle { fill: #137a43; stroke: #0f5d34; transform: scale(1.25); }
.rt__pin.is-done text { fill: #fff; }
.rt__pin.is-done .rt__amt { opacity: 1; fill: #0f5d34; }
.rt__dot { fill: var(--yellow); stroke: var(--ink); stroke-width: 2.5; }
.rt__sum { display: flex; justify-content: space-between; padding: 10px 14px; font-size: .85rem; border-top: 1px solid var(--line); }
.rt__sum strong { color: #137a43; font-variant-numeric: tabular-nums; }
.js .scn:not(.is-in) .rt__dot { opacity: 0; }

/* ---------- Mora por tramos ---------- */
.mo { padding-top: 14px; }
.mo .vbars i { transition: width 1s cubic-bezier(.2, .8, .2, 1) calc(var(--i, 0) * .25s + .2s); }
.js .scn:not(.is-in) .mo .vbars i { width: 0; transition: none; }
.mo .mo__b1 { background: linear-gradient(90deg, var(--blue), var(--purple-2)); }
.mo .mo__b2 { background: linear-gradient(90deg, #ffc20e, #ff9a1f); }
.mo .mo__b3 { background: linear-gradient(90deg, #ff5a93, #e8216b); }
.mo .vbars div { grid-template-columns: 100px 1fr 28px; }
.js .scn:not(.is-in) .mo .mock__list li { opacity: 0; transition: none; }
.js .scn.is-in .mo .mock__list li { transition: opacity .5s ease calc(1.1s + var(--j, 0) * .25s); }

/* ---------- Aviso por WhatsApp ---------- */
.wa { padding: 16px 14px; display: grid; gap: 10px; background: #efeae2; font-size: .85rem; }
.wa__msg, .wa__reply { max-width: 86%; padding: 9px 12px 6px; border-radius: 12px; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); }
.wa__msg { justify-self: end; background: #d9fdd3; border-top-right-radius: 3px; }
.wa__reply { justify-self: start; background: #fff; border-top-left-radius: 3px; }
.wa p { margin: 0 0 2px; color: #1f2933; }
.wa small { display: block; text-align: right; color: #667781; font-size: .7rem; }
.wa__ticks { color: #53bdeb; font-weight: 800; letter-spacing: -2px; }
.wa__log { justify-self: center; padding: 6px 12px; border-radius: 8px; background: #fff7c9; color: #5a4300; font-size: .75rem; font-weight: 700; text-align: center; }
.js .scn:not(.is-in) .wa > * { opacity: 0; transform: translateY(10px); transition: none; }
.js .scn.is-in .wa > * { transition: opacity .4s ease calc(.3s + var(--i, 0) * 1.1s), transform .4s ease calc(.3s + var(--i, 0) * 1.1s); }
.js .scn:not(.is-in) .wa__ticks { color: #aebac1; }
.js .scn.is-in .wa__ticks { animation: ticksAzul .4s ease 1.7s both; }
@keyframes ticksAzul { from { color: #aebac1; } to { color: #53bdeb; } }

/* ---------- Reportes que se construyen ---------- */
.rp { display: block; width: 100%; height: auto; padding: 6px 8px 0; }
.rp__axis { stroke: #e2dcf0; stroke-width: 1; }
.rp__bar { fill: url(#rpGrad); transform-box: fill-box; transform-origin: bottom; transition: transform .7s cubic-bezier(.2, .8, .2, 1) calc(var(--i, 0) * .12s + .2s); }
.js .scn:not(.is-in) .rp__bar { transform: scaleY(0); transition: none; }
.rp__line { fill: none; stroke: #e8216b; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s ease .9s; }
.js .scn:not(.is-in) .rp__line { stroke-dashoffset: 1; transition: none; }
.rp__pt { fill: #fff; stroke: #e8216b; stroke-width: 2; transition: opacity .3s ease calc(1s + var(--i, 0) * .22s); }
.js .scn:not(.is-in) .rp__pt { opacity: 0; transition: none; }
.rp__txt { font-size: 8.5px; fill: #5d5575; text-anchor: middle; }
.rp__legend { display: flex; gap: 16px; padding: 4px 14px 14px; margin: 0; list-style: none; font-size: .78rem; color: var(--muted); }
.rp__legend i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 3px; vertical-align: -2px; background: linear-gradient(var(--blue), var(--purple-2)); }
.rp__legend li + li i { background: #e8216b; border-radius: 50%; }

/* ---------- Instalación incluida: lista que se marca ---------- */
.install ul { list-style: none; padding-left: 0; }
.install li { position: relative; padding-left: 30px; margin-bottom: 6px; }
.install li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; background: #137a43; color: #fff; }
.js .install:not(.is-in) li::before { background: transparent; color: transparent; border: 2px solid rgba(255, 255, 255, .35); }
.js .install.is-in li::before { animation: marcar .45s ease calc(.3s + var(--i, 0) * .5s) both; }
@keyframes marcar { 0% { background: transparent; color: transparent; border: 2px solid rgba(255, 255, 255, .35); transform: scale(.8); } 60% { background: #137a43; color: #fff; border: 0; transform: scale(1.3); } 100% { background: #137a43; color: #fff; border: 0; transform: scale(1); } }

/* ---------- Selector de plan (interactivo) ---------- */
.picker { margin: 0 0 28px; padding: 22px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.picker h2 { margin: 0 0 14px; font-size: 1.25rem; }
.picker__row { display: grid; gap: 18px 32px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .picker__row { grid-template-columns: 1fr 1fr; } }
.picker label { display: grid; gap: 8px; font-weight: 700; font-size: .95rem; }
.picker output { float: right; min-width: 2.2em; padding: 1px 10px; border-radius: 999px; background: var(--purple); color: #fff; text-align: center; font-weight: 800; }
.picker input[type="range"] { width: 100%; accent-color: var(--purple-2); }
.picker__res { margin: 16px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--tint); color: var(--text); }
.plan { position: relative; transition: box-shadow .35s ease, border-color .35s ease, opacity .35s ease; }
.plan__match { position: absolute; top: -13px; right: 18px; margin: 0; padding: 3px 12px; border-radius: 999px; background: #137a43; color: #fff; font-size: .8rem; font-weight: 700; opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.plans.has-pick .plan:not(.is-match) { opacity: .55; }
.plan.is-match { border-color: #137a43; box-shadow: 0 0 0 3px rgba(19, 122, 67, .35), var(--shadow); }
.plan.is-match .plan__match { opacity: 1; }

/* ---------- Barra de cartera de la calculadora ---------- */
.cbar { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .15); }
.cbar__t { margin: 0 0 8px; font-size: .85rem; font-weight: 700; color: #fff; }
.cbar__track { display: flex; height: 22px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .12); }
.cbar__track i { display: block; height: 100%; width: 0; transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.cbar__ok { background: linear-gradient(90deg, var(--blue), var(--purple-2)); }
.cbar__rec { background: #2fbf71; }
.cbar__mora { background: #e8216b; }
.cbar__legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; padding: 0; list-style: none; font-size: .75rem; color: #cfc5ea; }
.cbar__legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; }
.cbar__legend .k-ok { background: var(--blue); } .cbar__legend .k-rec { background: #2fbf71; } .cbar__legend .k-mora { background: #e8216b; }
.cbar.is-off { opacity: .45; }

/* ---------- Botón que late ---------- */
.is-pulse { animation: late 1.1s ease 2; }
@keyframes late { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 194, 14, .6); } 50% { transform: scale(1.06); box-shadow: 0 0 0 14px rgba(255, 194, 14, 0); } }

/* ---------- Aparición escalonada: cada elemento entra en su segundo (--t) ---------- */
.rv { transition: opacity .45s ease, transform .45s ease; transition-delay: calc(var(--t, 0) * 1s); }
.js .scn:not(.is-in) .rv { opacity: 0; transform: translateY(8px); transition: none; }

/* ---------- Créditos y clientes: ficha, solicitud y cronograma ---------- */
.cl { padding: 14px; display: grid; gap: 10px; font-size: .85rem; }
.cl__head { display: flex; align-items: center; gap: 10px; }
.cl__av { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue), var(--purple-2)); color: #fff; font-size: .8rem; font-weight: 800; }
.cl__who { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.cl__who small { color: var(--muted); font-size: .75rem; }
.cl__chip { padding: 3px 10px; border-radius: 999px; background: #e9f8ef; color: #137a43; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.cl__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
.cl__stats li { display: grid; gap: 2px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: center; }
.cl__stats small { color: var(--muted); font-size: .7rem; }
.cl__stats em { font-style: normal; font-weight: 800; font-size: 1rem; color: var(--purple); font-variant-numeric: tabular-nums; }
.cl__req { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; padding: 9px 12px; border-radius: 8px; background: var(--purple); color: #fff; }
.cl__req span { opacity: .8; }
.mock__list.cl__cron { padding: 0; }
.cl__ok { margin: 0; padding: 7px 12px; border-radius: 8px; background: #e9f8ef; border: 1px solid #b7e4c7; color: #0f5d34; font-size: .78rem; font-weight: 700; text-align: center; }

/* ---------- Evaluación crediticia: capacidad de pago, score y semáforo ---------- */
.ev { padding: 14px; display: grid; gap: 10px; font-size: .85rem; }
.mock__list.ev__rows { padding: 0; }
.ev__rows em { font-variant-numeric: tabular-nums; }
.mock__list .ev__cap { background: #f0eafc; border-color: #d8c9f5; }
.mock__list .ev__cap span { font-weight: 700; }
.ev__use { display: grid; gap: 6px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ev__use > div { display: flex; justify-content: space-between; gap: 8px; }
.ev__use strong, .ev__use b { font-variant-numeric: tabular-nums; color: var(--purple); }
.ev__use small { color: var(--muted); font-size: .75rem; }
.ev__bar { display: block; height: 8px; border-radius: 999px; background: #e9e4f5; overflow: hidden; }
.ev__bar i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--purple-2)); transition: width 1.2s cubic-bezier(.2, .8, .2, 1) 2s; }
.js .scn:not(.is-in) .ev__bar i { width: 0; transition: none; }
.ev__soon { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 12px; border: 1px dashed #b9b4c8; border-radius: 8px; background: #f7f6fa; color: #7a7390; }
.ev__badge { padding: 2px 9px; border-radius: 999px; background: #fff3c4; color: #5a4300; font-size: .72rem; }
.ev__verdict { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; padding: 9px 12px; border-radius: 8px; background: #e9f8ef; border: 1px solid #b7e4c7; color: #0f5d34; }

/* ---------- Aprobación y desembolso: niveles por rol, contrato y caja ---------- */
.ap { padding: 14px; display: grid; gap: 10px; font-size: .85rem; }
.ap__top { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 8px; background: var(--purple); color: #fff; }
.ap__steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.ap__steps li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ap__who { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.ap__who small { color: var(--muted); font-size: .72rem; }
.ap__dot { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #137a43; border: 2px solid #137a43; color: #fff; font-style: normal; font-size: .72rem; font-weight: 800; transition: background .3s ease calc(var(--f, 0) * 1s), border-color .3s ease calc(var(--f, 0) * 1s), color .3s ease calc(var(--f, 0) * 1s); }
.ap__dot::before { content: "✓"; }
.js .scn:not(.is-in) .ap__dot { background: #fff; border-color: #b9b4c8; color: transparent; transition: none; }
.ap__st { position: relative; flex: none; width: 86px; height: 1.5em; font-size: .72rem; font-weight: 700; }
.ap__st span { position: absolute; right: 0; top: 0; padding: 2px 9px; border-radius: 999px; white-space: nowrap; transition: opacity .3s ease calc(var(--f, 0) * 1s); }
.ap__wait { background: #eef0f4; color: #5d5575; opacity: 0; }
.ap__ok { background: #137a43; color: #fff; }
.js .scn:not(.is-in) .ap__wait { opacity: 1; transition: none; }
.js .scn:not(.is-in) .ap__ok { opacity: 0; transition: none; }
.ap__doc { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 8px; border: 1px dashed #b9a9e6; background: #f4f1fa; }
.ap__doc b { padding: 2px 8px; border-radius: 6px; background: #e8216b; color: #fff; font-size: .68rem; }
.mock__list.ap__cash { padding: 0; }
.ap__cash em { font-variant-numeric: tabular-nums; }
.ap__badge { padding: 2px 9px; border-radius: 999px; background: #137a43; color: #fff; font-size: .72rem; }

/* ---------- Integraciones y seguridad: conexiones y auditoría ---------- */
.ig svg, .nb svg { display: block; width: 100%; height: auto; background: #f4f1fa; }
.ig__ln { stroke: #b9a9e6; stroke-width: 2; stroke-dasharray: 4 5; }
.js .scn.is-in .ig__ln { animation: igFlujo 1s linear infinite; }
@keyframes igFlujo { to { stroke-dashoffset: -9; } }
.ig__n { transform-box: fill-box; transform-origin: center; transition: opacity .4s ease, transform .4s ease; transition-delay: calc(var(--t, 0) * 1s); }
.js .scn:not(.is-in) .ig__n { opacity: 0; transform: scale(.6); transition: none; }
.ig__n rect { fill: #fff; stroke: #d8c9f5; stroke-width: 1.5; }
.ig__n text { font-size: 9.5px; font-weight: 700; fill: var(--purple); text-anchor: middle; }
.ig__c circle { fill: var(--purple-2); }
.ig__c text { fill: #fff; font-size: 7.5px; }
.ig__t { margin: 0; padding: 12px 14px 0; font-size: .8rem; font-weight: 700; color: var(--purple); }
.ig__log { margin: 0; padding: 8px 14px 14px; list-style: none; display: grid; gap: 6px; font-size: .8rem; }
.ig__log li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ig__log time { flex: none; color: var(--muted); font-size: .72rem; }
.ig__log li.ig__deny { background: #fff3f2; border-color: #f3c4c0; }
.ig__deny time { color: #b42318; font-weight: 700; }

/* ---------- En la nube: oficinas conectadas y copia de seguridad ---------- */
.nb__cloud circle, .nb__cloud rect { fill: var(--purple-2); stroke: none; }
.nb__cloud text { fill: #fff; font-size: 7.5px; }
.nb__bk { margin: 0 14px 14px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: grid; gap: 8px; font-size: .8rem; }
.nb__bk > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.nb__bar { display: block; height: 8px; border-radius: 999px; background: #e9e4f5; overflow: hidden; }
.nb__bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--purple-2)); transition: width 1.6s ease 4.1s; }
.js .scn:not(.is-in) .nb__bar i { width: 0; transition: none; }

/* ---------- Reducir movimiento: estado final, sin transiciones ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .scn:not(.is-in) .cj li, .js .scn:not(.is-in) .wa > *, .js .scn:not(.is-in) .mo .mock__list li { opacity: 1; transform: none; }
  .js .scn:not(.is-in) .mo .vbars i { width: var(--w); }
  .js .scn:not(.is-in) .rp__bar { transform: none; }
  .js .scn:not(.is-in) .rp__line { stroke-dashoffset: 0; }
  .js .scn:not(.is-in) .rp__pt, .js .scn:not(.is-in) .rt__dot { opacity: 1; }
  .js .cj__diff { background: #e9f8ef !important; border-color: #b7e4c7 !important; }
  .js .cj__diff em { color: #137a43 !important; }
  .js .cj__tick { opacity: 1; transform: none; }
  .js .install:not(.is-in) li::before { background: #137a43; color: #fff; border: 0; }
  .js .install.is-in li::before, .js .scn.is-in .wa__ticks, .is-pulse { animation: none; }
  .cj li, .mo .vbars i, .rp__bar, .rp__line, .rp__pt, .plan, .cbar__track i, .rv, .ev__bar i, .ap__dot, .ap__st span, .ig__n, .nb__bar i { transition: none !important; }
  .js .scn.is-in .ig__ln { animation: none; }
}
