/* =====================================================================
 *  Landing GymOS — movimiento ("flow"), portado de la landing de MediOS.
 *  Mejora progresiva: todo lo que oculta contenido vive bajo html.motion,
 *  clase que pone el <head> solo si el usuario NO pidió reducir movimiento
 *  (y que se quita sola si landing-motion.js no llega). Sin JS, o con
 *  prefers-reduced-motion, la página es la estática.
 * ===================================================================== */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ── Barra de lectura ────────────────────────────────────────────────── */
.lp-read { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 1040;
           background: linear-gradient(90deg, var(--pg), var(--pg2));
           transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }

/* ── Aparición al hacer scroll ───────────────────────────────────────── */
html.motion [data-reveal] { opacity: 0; transform: translateY(28px);
    transition: opacity .8s cubic-bezier(.22,1,.36,1), transform .8s cubic-bezier(.22,1,.36,1);
    transition-delay: calc(var(--d, 0) * 90ms); will-change: opacity, transform; }
html.motion [data-reveal="left"]  { transform: translateX(-36px); }
html.motion [data-reveal="right"] { transform: translateX(36px); }
html.motion [data-reveal="zoom"]  { transform: scale(.94); }
html.motion [data-reveal].is-in   { opacity: 1; transform: none; }

/* ── Hero: entrada escalonada ────────────────────────────────────────── */
@keyframes lpUp   { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes lpMock { from { opacity: 0; transform: translateY(40px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes lpBob  { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

html.motion .lp-hero-text > * { animation: lpUp .9s cubic-bezier(.22,1,.36,1) both; }
html.motion .lp-hero-text > :nth-child(1) { animation-delay: .05s; }
html.motion .lp-hero-text > :nth-child(2) { animation-delay: .15s; }
html.motion .lp-hero-text > :nth-child(3) { animation-delay: .27s; }
html.motion .lp-hero-text > :nth-child(4) { animation-delay: .39s; }
html.motion .lp-hero-text > :nth-child(5) { animation-delay: .50s; }
html.motion .lp-hero-text > :nth-child(6) { animation-delay: .58s; }
html.motion .lp-mock { animation: lpMock 1.1s .45s cubic-bezier(.22,1,.36,1) both; }
html.motion .lp-float { animation: lpUp .8s 1.2s cubic-bezier(.22,1,.36,1) both, lpBob 5s 2.2s ease-in-out infinite; }
html.motion .lp-float.b { animation-delay: 1.35s, 2.9s; }

/* ── Maqueta del hero: recepción en vivo (DEMO) ──────────────────────── */
.lp-mock { position: relative; max-width: 760px; margin: 3rem auto 0; text-align: left; }
.lp-mock-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 20px;
                box-shadow: var(--shadow-lg); backdrop-filter: blur(14px); }
html[data-bs-theme=light] .lp-mock-card { background: #fff; }
.lp-mock-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: 14px; }
.lp-mock-top b { color: var(--head); font-family: 'Mulish', sans-serif; font-weight: 800; }
.lp-mock-top small { color: var(--dim); display: block; font-size: .78rem; }
.lp-demo { font-size: .66rem; font-weight: 800; letter-spacing: 1px; padding: 3px 8px; border-radius: 6px;
           background: var(--pill-bg); border: 1px solid var(--line); color: var(--dim); }
.lp-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.lp-kpi { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.lp-kpi small { color: var(--dim); font-size: .75rem; }
.lp-kpi b { display: block; color: var(--head); font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.lp-sec { color: var(--head); font-weight: 700; font-size: .85rem; margin: 0 0 8px; }
.lp-rows { display: grid; gap: 8px; }
.lp-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.lp-av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
         font-size: .8rem; color: #fff; background: linear-gradient(135deg, var(--pg), var(--pg2)); }
.lp-row .who { flex: 1; min-width: 0; line-height: 1.25; }
.lp-row .who b { display: block; color: var(--head); font-size: .9rem; }
.lp-row .who small { color: var(--dim); font-size: .76rem; }
.lp-st { flex: none; font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.lp-st.ok  { background: var(--ok-bg); color: var(--ok); }
.lp-st.bad { background: rgba(229,62,62,.14); color: #f07171; }
html[data-bs-theme=light] .lp-st.bad { color: #c53030; }
/* Entrada nueva: sin JS se ve normal; con movimiento llega deslizándose. */
html.motion .lp-row.is-new { display: none; }
html.motion .lp-row.is-new.is-in { display: flex; animation: lpRowIn .6s cubic-bezier(.34,1.56,.64,1); }
@keyframes lpRowIn { from { opacity: 0; transform: translateY(-14px) scale(.97); } to { opacity: 1; transform: none; } }
.lp-row.is-new.is-in { border-color: var(--ok-line); }

.lp-toast { position: absolute; right: -18px; top: -26px; z-index: 3; display: flex; align-items: center; gap: .6rem;
            background: #fff; border-radius: 14px; padding: .65rem .9rem; font-size: .82rem; line-height: 1.25;
            box-shadow: 0 12px 34px rgba(0,0,0,.28); border: 1px solid rgba(34,197,94,.35);
            opacity: 0; transform: translateY(10px) scale(.92); pointer-events: none;
            transition: opacity .45s ease, transform .55s cubic-bezier(.34,1.56,.64,1); }
.lp-toast.is-on { opacity: 1; transform: none; }
.lp-toast i { font-size: 1.35rem; color: #16a34a; }
.lp-toast b { display: block; color: #15181d; font-weight: 700; }
.lp-toast span { color: #6c757d; }

.lp-float { position: absolute; z-index: 2; background: var(--pill-bg); border: 1px solid var(--line); color: var(--head);
            border-radius: 30px; padding: 7px 14px; font-size: .8rem; font-weight: 700; box-shadow: var(--shadow-sm);
            backdrop-filter: blur(10px); white-space: nowrap; }
.lp-float i { color: var(--brand-ink); }
.lp-float.a { right: calc(100% + 18px); top: 36%; }
.lp-float.b { left: calc(100% + 18px); bottom: 22%; }
@media (max-width: 1199.98px) { .lp-float { display: none; } }

@media (max-width: 767.98px) {
    .lp-kpis { grid-template-columns: 1fr 1fr; }
    .lp-kpis .lp-kpi:last-child { grid-column: span 2; }
    .lp-toast { right: 8px; top: -34px; }
}

/* ── Cinta infinita: tipos de gimnasio ───────────────────────────────── */
.lp-marquee { overflow: hidden; margin-top: 1.4rem;
              -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
                      mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.lp-marquee-track { display: flex; gap: .5rem; width: max-content; }
.lp-marquee-track .pill { flex: none; }
html:not(.motion) .lp-marquee { -webkit-mask-image: none; mask-image: none; }
html:not(.motion) .lp-marquee-track { width: auto; flex-wrap: wrap; justify-content: center; }
html:not(.motion) .lp-marquee-track [aria-hidden="true"] { display: none; }
@keyframes lpMarquee { to { transform: translateX(calc(-50% - .25rem)); } }
html.motion .lp-marquee-track { animation: lpMarquee 30s linear infinite; }
html.motion .lp-marquee:hover .lp-marquee-track { animation-play-state: paused; }

/* ── Botones principales: destello que recorre el botón ──────────────── */
.lp-shine { position: relative; overflow: hidden; isolation: isolate; }
@keyframes lpShine { 0%, 70% { transform: translateX(-130%) skewX(-20deg); } 100% { transform: translateX(260%) skewX(-20deg); } }
html.motion .lp-shine::after {
    content: ""; position: absolute; inset: 0; width: 40%; z-index: -1; pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
    animation: lpShine 4.5s 2s ease-in-out infinite; }
html.motion .cta-band .lp-shine::after { background: linear-gradient(90deg, transparent, rgba(246,111,20,.25), transparent); }

/* ── WhatsApp: onda que invita sin estorbar ──────────────────────────── */
@keyframes lpPing { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,.55); } 80%, 100% { box-shadow: 0 0 0 18px rgba(37,211,102,0); } }
html.motion .wa-float { animation: lpPing 2.6s 3s ease-out infinite; }

/* ── Tarjetas: el icono responde al hover ────────────────────────────── */
.feat-card i, .mod-ico, .step .n { transition: transform .45s cubic-bezier(.34,1.56,.64,1); }
.feat-card:hover i, .module:hover .mod-ico, .step:hover .n { transform: scale(1.12) rotate(-6deg); }
