/* =========================================================================
   Collages del hero de subpáginas: seis composiciones (A–F).
   Cada pieza entra escalonada cuando el collage entra en pantalla (al cargar
   y cada vez que se vuelve a scrollear hasta él) y se desplaza con el scroll.
   ========================================================================= */
.cl { position: relative; height: 500px; --e: cubic-bezier(.16,1,.3,1); }
.cl.reveal { opacity: 1 !important; transform: none !important; }
.cl > * { position: absolute; translate: 0 var(--py, 0px); }
.cl-bg { inset: 6% 12% 10% 0; border-radius: 18px; background: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px) 0 0 / 18px 18px, radial-gradient(90% 100% at 70% 0%, #3355ff 0%, #1a2fc2 40%, #020a35 95%); }
.cl-bg--soft { background: radial-gradient(rgba(32,77,229,.14) 1px, transparent 1px) 0 0 / 18px 18px, linear-gradient(160deg, #EEF2FF, #F6F8FD); box-shadow: inset 0 0 0 1px #E3E8F5; }
.cl-bg--full { inset: 0 0 6% 0; overflow: hidden; }
.cl img { display: block; width: 100%; }
.cl-scr { border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px rgba(2,10,53,.06), 0 18px 36px -12px rgba(2,10,53,.35), 0 50px 100px -30px rgba(2,10,53,.55); }
.cl-ni, .cl-ai, .cl-av { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--blue); color: #fff; }
.cl svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cl-ni svg, .cl-ai svg, .cl-av svg { width: 20px; height: 20px; }
.cl-ok { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #E3F6EC; }
.cl-ok svg { width: 12px; height: 12px; stroke: #11804A; stroke-width: 2.2; }
.cl b { color: var(--navy); font-weight: 700; } .cl b span { display: inline; }
.cl small { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.cl-d, .cl-alert span, .cl-pop span, .cl-modal > span, .cl-user span, .cl-tip span { font-size: 13px; color: var(--muted); line-height: 1.35; }
.cl-noti, .cl-alert, .cl-pop, .cl-modal, .cl-user, .cl-card, .cl-list, .cl-tip { background: #fff; border-radius: 14px; box-shadow: 0 0 0 1px rgba(2,10,53,.06), 0 24px 48px -16px rgba(2,10,53,.42); }
.cl-btn { all: unset; padding: 9px 14px; border-radius: 8px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 600; cursor: default; }
.cl-btn--ghost { background: #EEF2FF; color: var(--blue); }
.cl-chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 14px 30px -10px rgba(2,10,53,.6); }
.cl-chip i { width: 8px; height: 8px; border-radius: 50%; background: #34D399; box-shadow: 0 0 0 4px rgba(52,211,153,.25); animation: clPulse 1.6s ease-in-out infinite; }
@keyframes clPulse { 50% { box-shadow: 0 0 0 7px rgba(52,211,153,0); } }

/* --- entrada escalonada (se repite cada vez que el collage vuelve a entrar en pantalla) --- */
.cl > * { opacity: 0; transform: translateY(26px) scale(.98); transition: opacity .7s var(--e), transform .9s var(--e); }
.cl > .cl-bg { transform: scale(.96); }
.cl.is-in > * { opacity: 1; transform: none; }
.cl.is-in > *:nth-child(1) { transition-delay: 0s; } .cl.is-in > *:nth-child(2) { transition-delay: .15s; } .cl.is-in > *:nth-child(3) { transition-delay: .45s; }
.cl.is-in > *:nth-child(4) { transition-delay: .75s; } .cl.is-in > *:nth-child(5) { transition-delay: 1s; }

/* A · pantalla que sobresale + notificación */
.cl--A .cl-scr { left: 8%; top: 18%; width: 100%; }
.cl--A .cl-chip { left: 3%; top: 0; }
.cl--A .cl-noti { right: -5%; bottom: 0; }
.cl-noti { display: grid; grid-template-columns: 40px 1fr 22px; gap: 12px; align-items: center; width: min(340px, 78%); padding: 14px 16px; }
.cl-noti b { display: block; font-size: 15px; margin-top: 2px; } .cl-d { display: block; margin-top: 2px; }

/* B · recorte ampliado + tarjeta de gráfico + alerta */
.cl--B .cl-zoom { left: 6%; top: 0; width: 70%; height: 74%; border-radius: 14px; background-size: 210% auto; background-position: 22% 14%; box-shadow: 0 0 0 1px rgba(2,10,53,.06), 0 40px 80px -30px rgba(2,10,53,.45); }
.cl--B .cl-card--chart { right: 0; top: 30%; width: 44%; padding: 18px 18px 14px; }
.cl--B .cl-alert { left: 0; bottom: 0; }
.cl-ch b { display: block; margin-top: 4px; font-size: 22px; }
.cl-bars { display: flex; align-items: flex-end; gap: 6px; height: 90px; margin-top: 14px; }
.cl-bars i { flex: 1; height: calc(var(--h) * 100%); border-radius: 4px 4px 2px 2px; background: #DCE4FB; transform-origin: bottom; transform: scaleY(0); transition: transform .8s var(--e) calc(1s + var(--d)); }
.cl-bars i.on { background: var(--blue); }
.cl.is-in .cl-bars i { transform: scaleY(1); }
.cl-alert { display: flex; gap: 12px; align-items: center; max-width: 330px; padding: 14px 16px; border-left: 4px solid #F59E0B; }
.cl-alert .cl-ai { background: #FFF4DE; color: #B86A00; }
.cl-alert b { display: block; font-size: 14.5px; }
.cl.is-in .cl-alert { animation: clNudge .5s 2s ease-in-out; }
@keyframes clNudge { 25% { translate: -4px var(--py, 0px); } 75% { translate: 4px var(--py, 0px); } }

/* C · dos pantallas superpuestas + pop-up con botones */
.cl--C .cl-scr--back { left: 18%; top: 0; width: 82%; opacity: .0; filter: saturate(.8); }
.cl.is-in.cl--C .cl-scr--back { opacity: .92; }
.cl--C .cl-scr--front { left: 0; top: 22%; width: 78%; }
.cl--C .cl-pop { right: 2%; bottom: 4%; width: 300px; padding: 16px; }
.cl-pop__h { display: flex; gap: 12px; align-items: center; } .cl-pop__h b { display: block; font-size: 15px; } .cl-pop__h span { display: block; }
.cl-pop__b { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* D · teléfono + modal + conductor */
.cl--D .cl-bg { inset: 10% 6% 10% 6%; }
.cl--D .cl-phone { left: 22%; top: 0; width: 230px; padding: 9px; border-radius: 34px; background: #0b1022; box-shadow: 0 40px 80px -20px rgba(0,0,0,.6); }
.cl--D .cl-phone img { border-radius: 26px; height: 470px; object-fit: cover; object-position: top; }
.cl--D .cl-modal { right: 0; top: 26%; width: 250px; padding: 20px; display: grid; gap: 8px; justify-items: start; }
.cl-modal .cl-ai--ok { background: #E3F6EC; color: #11804A; }
.cl-modal b { font-size: 16px; } .cl-modal .cl-btn { margin-top: 6px; }
.cl--D .cl-user { left: 0; bottom: 6%; display: flex; gap: 10px; align-items: center; padding: 12px 14px; }
.cl-user .cl-av { border-radius: 50%; background: var(--navy); } .cl-user b { display: block; font-size: 14px; } .cl-user span { display: block; }
.cl-dot { width: 9px; height: 9px; border-radius: 50%; background: #34D399; margin-left: 6px; animation: clPulse 1.6s ease-in-out infinite; }

/* E · gráfico grande + miniatura + lista con estados */
.cl--E .cl-card--big { left: 0; top: 4%; width: 74%; padding: 20px 20px 16px; }
.cl--E .cl-thumb { right: 0; top: 0; width: 36%; border-radius: 12px; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(2,10,53,.45); }
.cl--E .cl-list { right: 4%; bottom: 0; width: 56%; margin: 0; padding: 8px 16px; list-style: none; }
.cl--E .cl-bars { height: 150px; }
.cl-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; font-size: 13.5px; color: var(--navy); font-weight: 600; opacity: 0; transform: translateX(10px); transition: opacity .5s, transform .6s var(--e); }
.cl-list li + li { border-top: 1px solid #EEF1F7; }
.cl.is-in .cl-list li { opacity: 1; transform: none; transition-delay: var(--d); }
.cl-pill { font-style: normal; font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.cl-pill--ok { background: #E3F6EC; color: #11804A; } .cl-pill--blue { background: #EAF0FF; color: var(--blue); } .cl-pill--warn { background: #FFF4DE; color: #B86A00; }
.cl-line { width: 100%; height: 150px; margin-top: 14px; overflow: visible; }
.cl-line .band { fill: rgba(79,123,255,.16); opacity: 0; transition: opacity .8s 1.6s; }
.cl-line .hist, .cl-line .fc { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 600; stroke-dashoffset: 600; transition: stroke-dashoffset 1.4s var(--e) .9s; }
.cl-line .hist { stroke: var(--navy); } .cl-line .fc { stroke: var(--blue); stroke-dasharray: 6 6, 600; transition-delay: 1.6s; }
.cl-line .now { stroke: rgba(2,10,53,.25); stroke-dasharray: 3 4; }
.cl.is-in .cl-line .hist, .cl.is-in .cl-line .fc { stroke-dashoffset: 0; } .cl.is-in .cl-line .band { opacity: 1; }

/* F · pantalla entera + tooltip + cursor */
.cl--F .cl-scr--in { position: absolute; left: 6%; right: 6%; top: 8%; translate: 0 var(--py, 0px); }
.cl--F .cl-chip { left: 3%; top: -4%; }
.cl-tip { padding: 12px 14px; max-width: 240px; translate: -50% calc(-100% + var(--py, 0px)); }
.cl-tip::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; margin-left: -7px; background: #fff; transform: rotate(45deg); box-shadow: 3px 3px 6px -3px rgba(2,10,53,.2); }
.cl-tip b { display: block; font-size: 14.5px; } .cl-tip span { display: block; margin-top: 2px; }
.cl-cursor { width: 26px; height: 26px; fill: var(--navy); stroke: #fff; stroke-width: 1.6; filter: drop-shadow(0 4px 6px rgba(2,10,53,.35)); }
.cl.is-in .cl-cursor { animation: clCursor 1.4s .6s var(--e) both; }
@keyframes clCursor { from { translate: 120px 90px; opacity: 0; } 30% { opacity: 1; } }

@media (max-width: 900px) { .cl { height: 420px; } .cl--D .cl-phone { width: 190px; } .cl--D .cl-phone img { height: 390px; } }
@media (prefers-reduced-motion: reduce) { .cl > *, .cl-bars i, .cl-list li { transition: none !important; opacity: 1 !important; transform: none !important; } }
.cl .cl-ni, .cl .cl-av, .cl .cl-ai { color: #fff !important; } .cl .cl-alert .cl-ai { color: #B86A00 !important; } .cl .cl-modal .cl-ai--ok { color: #11804A !important; } .cl .cl-btn span { color: inherit !important; font-size: inherit !important; } .cl .cl-btn { color: #fff; } .cl .cl-btn--ghost { color: var(--blue); }
