/* =====================================================================
   V11.41 · EFECTOS (movimiento, cristal, glow y 3D)
   Todo usa los colores de zp-tema.css. Con "reducir movimiento" se apaga.
   ===================================================================== */

/* ---------- 1. Barra de progreso de lectura ---------- */
#zp-read-progress{position:fixed;top:0;left:0;right:0;height:3px;z-index:9998;pointer-events:none;
  background:var(--zp-grad);transform-origin:0 50%;transform:scaleX(var(--zp-read,0));
  box-shadow:0 0 12px hsl(var(--zp-hue) 100% 50% / .55)}

/* ---------- 2. Transición entre páginas ---------- */
@keyframes zpPageIn{from{opacity:0}to{opacity:1}}
html body main{animation:zpPageIn .45s ease-out both}
html.zp-leaving body main{opacity:0;transition:opacity .22s ease}

/* ---------- 3. Títulos de sección: línea que se dibuja ---------- */
html body .zp-title-line{display:block;width:min(180px,40%);height:3px;margin:14px auto 0;border-radius:3px;
  background:var(--zp-grad);transform:scaleX(0);transform-origin:50% 50%;
  box-shadow:0 0 14px hsl(var(--zp-hue) 100% 50% / .45);transition:transform .9s cubic-bezier(.2,.8,.2,1) .1s}
html body .zp-title-line.is-in{transform:scaleX(1)}

/* ---------- 4. Tarjetas de cristal (glassmorphism) ---------- */
html body main :is(.workflow-card,.result-card,.stat-card,.benefit-card,.faq-item){
  background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(255,255,255,.012))!important;
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  border:1px solid hsl(var(--zp-hue) 100% 50% / .14)!important;position:relative;overflow:hidden}

/* Barrido de luz (se activa con .zp-sweep) */
html body .zp-sweep-layer{position:absolute;inset:0;pointer-events:none;z-index:1;border-radius:inherit;
  background:linear-gradient(110deg,transparent 35%,hsl(var(--zp-hue) 100% 60% / .16) 50%,transparent 65%);
  background-size:250% 100%;background-position:150% 0;opacity:0}
html body .is-lit>.zp-sweep-layer,html body .zp-sweep-on>.zp-sweep-layer{opacity:1;animation:zpSweep 1.4s ease-out 1}
html body .zp-sweep-loop>.zp-sweep-layer{opacity:1;animation:zpSweep 4.5s ease-in-out infinite}
@keyframes zpSweep{0%{background-position:150% 0}100%{background-position:-150% 0}}

/* ---------- 5. Inclinación 3D genérica (escritorio con ratón) ---------- */
@media (hover:hover) and (pointer:fine) and (min-width:1024px) and (prefers-reduced-motion:no-preference){
  html body main .zp-tilt3d{transform:perspective(1000px) rotateX(var(--zp-rx,0deg)) rotateY(var(--zp-ry,0deg)) translateY(var(--zp-lift,0px))!important;
    transition:transform .5s cubic-bezier(.2,.8,.2,1),box-shadow .35s ease,border-color .35s ease!important;will-change:transform}
  html body main .zp-tilt3d.is-tilting{--zp-lift:-6px;transition:transform .08s linear,box-shadow .35s ease,border-color .35s ease!important;
    border-color:hsl(var(--zp-hue) 100% 55% / .45)!important;
    box-shadow:0 24px 50px rgba(0,0,0,.5),0 0 34px hsl(var(--zp-hue) 100% 50% / .16)!important}
  html body main .zp-tilt3d .zp-tilt-glare{position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:1;opacity:0;transition:opacity .35s;mix-blend-mode:screen;
    background:radial-gradient(420px circle at var(--zp-gx,50%) var(--zp-gy,0%),hsl(var(--zp-hue) 100% 55% / .16),transparent 60%)}
  html body main .zp-tilt3d.is-tilting .zp-tilt-glare{opacity:1}
}
html body main :is(.workflow-card,.result-card,.stat-card,.benefit-card)>*:not(.zp-tilt-glare):not(.zp-sweep-layer):not(.zp-dot){position:relative;z-index:2}

/* ---------- 6. ¿Qué hago exactamente? → raíl de progreso + pasos que se encienden ---------- */
html body .zp-wf-rail{position:relative;height:4px;margin:6px 0 22px;border-radius:4px;background:rgba(255,255,255,.07);overflow:visible}
html body .zp-wf-rail>b{position:absolute;inset:0 auto 0 0;width:calc(var(--zp-wf,0) * 100%);border-radius:4px;background:var(--zp-grad);
  box-shadow:0 0 14px hsl(var(--zp-hue) 100% 50% / .55);transition:width .25s linear}
html body .zp-wf-rail>i{position:absolute;top:50%;width:14px;height:14px;margin:-7px 0 0 -7px;border-radius:50%;background:#1b2227;
  border:2px solid rgba(255,255,255,.12);transition:background .4s,box-shadow .4s,border-color .4s}
html body .zp-wf-rail>i.is-lit{background:var(--zp-c1);border-color:transparent;box-shadow:0 0 0 5px hsl(var(--zp-hue) 100% 50% / .15),0 0 16px var(--zp-c1)}
html body main .workflow-card{opacity:.45;transition:opacity .5s ease,border-color .5s ease,box-shadow .5s ease}
html body main .workflow-card.is-lit{opacity:1;border-color:hsl(var(--zp-hue) 100% 55% / .38)!important;box-shadow:0 0 30px hsl(var(--zp-hue) 100% 50% / .12)}
html body main .workflow-card .workflow-step{transition:box-shadow .5s,background .5s,color .5s}
html body main .workflow-card.is-lit .workflow-step{background:var(--zp-grad)!important;color:#0b0d10!important;-webkit-text-fill-color:#0b0d10!important;
  box-shadow:0 0 18px hsl(var(--zp-hue) 100% 50% / .5)}
@media (max-width:767px){html body .zp-wf-rail{display:none}html body main .workflow-card{opacity:.55}}

/* ---------- 7. Antes y después → barras que crecen + gráfica de frametime ---------- */
html body .zp-ba{margin-top:16px;display:grid;gap:9px}
html body .zp-ba-row{display:grid;grid-template-columns:62px 1fr auto;align-items:center;gap:10px;font:700 11px/1 Montserrat,system-ui,sans-serif;letter-spacing:.08em;color:#8d989f}
html body .zp-ba-row em{font-style:normal;color:#cfd8dc;letter-spacing:.02em;min-width:64px;text-align:right}
html body .zp-ba-track{height:10px;border-radius:6px;background:rgba(255,255,255,.06);overflow:hidden}
html body .zp-ba-track>b{display:block;height:100%;width:0;border-radius:6px;background:#4a545b;transition:width 1.3s cubic-bezier(.2,.8,.2,1)}
html body .zp-ba-row.is-after .zp-ba-track>b{background:var(--zp-grad);box-shadow:0 0 14px hsl(var(--zp-hue) 100% 50% / .55);transition-delay:.35s}
html body .zp-ba-row.is-after{color:var(--zp-c1)}
html body .zp-ba-row.is-after em{color:#fff}
html body .zp-ba.is-in .zp-ba-track>b{width:var(--w)}
html body .zp-ba-delta{justify-self:start;margin-top:4px;padding:6px 10px;border-radius:999px;font:800 12px/1 Montserrat,system-ui,sans-serif;letter-spacing:.04em;
  color:#0b0d10;background:var(--zp-grad);box-shadow:0 0 18px hsl(var(--zp-hue) 100% 50% / .35);opacity:0;transform:translateY(6px) scale(.9);transition:opacity .5s 1.2s,transform .5s 1.2s}
html body .zp-ba.is-in .zp-ba-delta{opacity:1;transform:none}
html body .zp-ft{margin-top:14px;width:100%;height:auto;display:block}
html body .zp-ft path{fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:var(--len);stroke-dashoffset:var(--len);transition:stroke-dashoffset 1.8s ease}
html body .zp-ft .before{stroke:#5b656c}
html body .zp-ft .after{stroke:var(--zp-c1);filter:drop-shadow(0 0 4px var(--zp-c1));transition-delay:.5s}
html body .zp-ft.is-in path{stroke-dashoffset:0}
html body .zp-ft text{font:700 9px Montserrat,system-ui,sans-serif;letter-spacing:.08em;fill:#8d989f}
html body main .result-side.after{transition:box-shadow .6s ease .9s,border-color .6s ease .9s}
html body main .result-card.is-lit .result-side.after{box-shadow:0 0 26px hsl(var(--zp-hue) 100% 50% / .16),inset 0 0 0 1px hsl(var(--zp-hue) 100% 55% / .3)}

/* ---------- 8. Cifras ---------- */
html body main .stat-card .stat-number{background:var(--zp-grad)!important;-webkit-background-clip:text!important;background-clip:text!important;
  color:transparent!important;-webkit-text-fill-color:transparent!important;text-shadow:none!important;filter:drop-shadow(0 0 14px hsl(var(--zp-hue) 100% 50% / .35))}
html body main .stat-card .zp-dot{position:absolute;top:16px;right:16px;width:8px;height:8px;border-radius:50%;z-index:3;
  background:var(--zp-c1);box-shadow:0 0 10px var(--zp-c1);animation:zpPulse 2.2s ease-in-out infinite}
@keyframes zpPulse{0%,100%{opacity:.4;transform:scale(.85)}50%{opacity:1;transform:scale(1.15)}}

/* ---------- 9. FAQ: borde que se ilumina al abrir ---------- */
@property --zp-spin{syntax:'<angle>';inherits:false;initial-value:0deg}
html body main .faq-item{transition:border-color .4s,box-shadow .4s}
html body main .faq-item.open{border-color:transparent!important;box-shadow:0 0 28px hsl(var(--zp-hue) 100% 50% / .12)}
html body main .faq-item.open::after{content:"";position:absolute;inset:0;border-radius:inherit;padding:1px;pointer-events:none;z-index:3;
  background:conic-gradient(from var(--zp-spin),transparent 0deg,var(--zp-c1) 60deg,var(--zp-c2) 120deg,transparent 180deg,transparent 360deg);
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude;animation:zpSpin 4s linear infinite}
@keyframes zpSpin{to{--zp-spin:360deg}}
html body main .faq-item .faq-answer{transition:opacity .45s ease .05s}

/* ---------- 10. Recomendador: progreso + resultado con barrido ---------- */
html body .zp-adv-progress{grid-column:1/-1;width:100%;flex:0 0 100%;box-sizing:border-box;display:flex;align-items:center;gap:10px;margin:4px 0 14px;font:700 11px/1 Montserrat,system-ui,sans-serif;letter-spacing:.1em;color:#8d989f}
html body .zp-adv-progress>span{flex:1;height:5px;border-radius:5px;background:rgba(255,255,255,.07);overflow:hidden}
html body .zp-adv-progress>span>b{display:block;height:100%;width:0;background:var(--zp-grad);box-shadow:0 0 10px var(--zp-c1);transition:width .5s cubic-bezier(.2,.8,.2,1)}
html body .zp-adv-progress em{font-style:normal;color:var(--zp-c1)}
html body .zp-advisor-result{position:relative;overflow:hidden}
html body .zp-advisor-result.zp-pop{animation:zpPop .6s cubic-bezier(.2,.8,.2,1)}
@keyframes zpPop{0%{transform:perspective(800px) rotateX(10deg) scale(.97);opacity:.4}100%{transform:none;opacity:1}}

/* ---------- 11. Botones magnéticos ---------- */
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
  html body .zp-magnet.zp-magnet.zp-magnet.zp-magnet,html body .zp-magnet.zp-magnet.zp-magnet.zp-magnet:hover{transform:translate(var(--zp-mx,0px),var(--zp-my,0px))!important;transition:transform .35s cubic-bezier(.2,.8,.2,1),box-shadow .25s ease,border-color .25s ease!important}
  html body .zp-magnet.zp-magnet.zp-magnet.zp-magnet.is-pulled{transition:transform .1s linear,box-shadow .25s ease,border-color .25s ease!important}
}

/* ---------- 12. Reseñas en perspectiva (la central más grande) ---------- */
@media (prefers-reduced-motion:no-preference){
  html body .reviews-container.zp-cover{perspective:1100px}
  html body .reviews-container.zp-cover .reviews-track img{transform:perspective(900px) rotateY(var(--zp-ry,0deg)) scale(var(--zp-s,1));
    filter:brightness(var(--zp-b,1));transition:none!important;will-change:transform}
}

/* ---------- 13. Panel del hero sigue al ratón ---------- */
@media (hover:hover) and (pointer:fine) and (min-width:961px) and (prefers-reduced-motion:no-preference){
  html body .zp-hero2-panel.zp-follow{transform:perspective(900px) rotateY(var(--zp-pry,-6deg)) rotateX(var(--zp-prx,3deg));transition:transform .6s cubic-bezier(.2,.8,.2,1)}
}

/* ---------- Accesibilidad ---------- */
@media (prefers-reduced-motion:reduce){
  #zp-read-progress{display:none}
  html body main{animation:none}
  html body .zp-title-line{transform:none;transition:none}
  html body main .workflow-card{opacity:1}
  html body .zp-ba-track>b{width:var(--w);transition:none}
  html body .zp-ba-delta{opacity:1;transform:none;transition:none}
  html body .zp-ft path{stroke-dashoffset:0;transition:none}
  html body main .stat-card .zp-dot,html body main .faq-item.open::after,html body .zp-sweep-layer{animation:none}
}

/* V11.41 · lienzos en vivo de Antes y después */
html body main .result-card .zp-live-canvas{display:block;width:100%;margin-top:16px;border-radius:12px;background:rgba(0,0,0,.35);border:1px solid rgba(255,255,255,.05);position:relative;z-index:2}
html body main .result-card .zp-ba-delta{position:relative;z-index:2}
html body .zp-ba-track>b{transition:width .25s linear}
html body .zp-ba-delta.is-in{opacity:1;transform:none}
html body main .result-card>.zp-ba-delta{display:inline-block;margin-top:14px}

/* V11.41 · botón de sonido */
html body .zp-sound-btn{position:fixed;right:30px;bottom:96px;z-index:9990;width:44px;height:44px;display:grid;place-items:center;border-radius:50%;cursor:pointer;
  color:var(--zp-c1);background:rgba(12,13,16,.82);border:1px solid hsl(var(--zp-hue) 100% 55% / .35);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  box-shadow:0 8px 24px rgba(0,0,0,.45);transition:border-color .25s,box-shadow .25s,color .25s,transform .25s}
html body .zp-sound-btn svg{width:20px;height:20px;fill:currentColor}
html body .zp-sound-btn:hover{border-color:var(--zp-c1);box-shadow:0 0 18px hsl(var(--zp-hue) 100% 50% / .35);transform:translateY(-2px)}
html body .zp-sound-btn.is-off{color:#7f8c93;border-color:rgba(255,255,255,.14)}
html body .zp-sound-btn:focus-visible{outline:2px solid var(--zp-c1);outline-offset:3px}
@media (max-width:767px){html body .zp-sound-btn{display:none}}
