/* =========================================================
   Stepper animado: pasos a la izquierda, escena a la derecha.
   Se usa en rosalia.html y colaboradores.html
   ========================================================= */
.stepper { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(20px, 4vw, 56px); align-items: center; }
.stepper__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: st; }
.stepper__item { all: unset; box-sizing: border-box; cursor: pointer; position: relative; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; width: 100%; padding: 18px 20px 20px; border-radius: 22px; border: 1px solid var(--line); background: rgba(255,255,255,.55); overflow: hidden;
  transition: background .4s var(--ease-out), border-color .4s, transform .4s var(--ease-out), box-shadow .4s; }
.stepper__item:hover { transform: translateX(4px); border-color: var(--lavender); }
.stepper__item:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
.stepper__item[aria-selected="true"] { background: #fff; border-color: transparent; box-shadow: 0 24px 50px -30px rgba(35,25,66,.45); transform: translateX(8px); }
.stepper__n { grid-row: span 2; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; font-family: var(--mono); font-size: 13px; color: var(--violet); background: var(--lilac-2); transition: background .4s, color .4s, transform .5s var(--ease-out); }
.stepper__item[aria-selected="true"] .stepper__n { background: var(--violet); color: #fff; transform: rotate(-6deg) scale(1.06); }
.stepper__item b { font-size: 19px; letter-spacing: -.02em; line-height: 1.2; align-self: end; }
.stepper__item small { font-size: 14.5px; color: var(--ink-2); line-height: 1.45; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .5s var(--ease-out), opacity .4s; }
.stepper__item[aria-selected="true"] small { max-height: 90px; opacity: 1; }
.stepper__bar { position: absolute; left: 20px; right: 20px; bottom: 8px; height: 3px; border-radius: 3px; background: var(--lilac-2); opacity: 0; transition: opacity .3s; }
.stepper__bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--lavender), var(--violet)); }
.stepper__item[aria-selected="true"] .stepper__bar { opacity: 1; }
.stepper.is-playing .stepper__item[aria-selected="true"] .stepper__bar span { animation: stBar var(--ms, 4200ms) linear forwards; }
.stepper.is-paused .stepper__item[aria-selected="true"] .stepper__bar span { animation-play-state: paused; }
@keyframes stBar { to { width: 100%; } }

.stepper__stage { position: relative; aspect-ratio: 5 / 4; border-radius: 32px; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 90% at 10% 0%, #6E4FD0 0%, #2A1D57 55%, #160F2E 100%); color: #fff; box-shadow: 0 50px 100px -50px rgba(35,25,66,.75); }
.stepper__stage::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px); background-size: 20px 20px; mask-image: radial-gradient(80% 70% at 50% 50%, #000, transparent); }
.stepper__dots { position: absolute; left: 22px; top: 20px; display: flex; gap: 6px; z-index: 3; }
.stepper__dots i { width: 22px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.2); transition: background .4s, width .4s; }
.stepper__dots i.on { width: 36px; background: var(--sage); }
.stepper__label { position: absolute; right: 22px; top: 14px; z-index: 3; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.55); }

.scene { position: absolute; inset: 0; display: grid; place-items: center; padding: 56px 28px 28px; opacity: 0; visibility: hidden; transform: scale(.97); transition: opacity .45s var(--ease-out), transform .6s var(--ease-out), visibility 0s .45s; }
.scene.is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.scene * { box-sizing: border-box; }
/* utilidades: aparecen en secuencia cuando la escena está activa */
.scene .sq { opacity: 0; transform: translateY(12px); }
.scene.is-on .sq { animation: stIn .55s var(--ease-out) forwards; animation-delay: var(--d, 0s); }
@keyframes stIn { to { opacity: 1; transform: none; } }
.sglass { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 18px; }
.swhite { background: #fff; color: var(--ink); border-radius: 18px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); }

/* Escena: llamada entrante */
.s-ring { position: relative; display: grid; place-items: center; gap: 18px; text-align: center; }
.s-ring__ico { position: relative; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 40px; background: linear-gradient(135deg, var(--sage), #5FB394); box-shadow: 0 20px 40px -14px rgba(95,179,148,.8); }
.scene.is-on .s-ring__ico { animation: stShake 1.2s ease-in-out infinite; }
.s-ring__ico::before, .s-ring__ico::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--sage); opacity: 0; }
.scene.is-on .s-ring__ico::before { animation: stRipple 1.8s ease-out infinite; }
.scene.is-on .s-ring__ico::after { animation: stRipple 1.8s .6s ease-out infinite; }
@keyframes stShake { 0%, 50%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } }
@keyframes stRipple { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(2.4); opacity: 0; } }
.s-ring__card { padding: 14px 18px; min-width: 240px; }
.s-ring__card b { display: block; font-size: 17px; }
.s-ring__card small { font-size: 13px; opacity: .75; }
.s-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; background: rgba(255,255,255,.14); }
.s-badge--warn { background: rgba(255, 196, 120, .18); color: #FFD9A8; }

/* Escena: conversación */
.s-talk { width: min(380px, 100%); display: grid; gap: 10px; }
.s-talk__head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.s-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: linear-gradient(135deg, var(--lavender), var(--violet)); flex: none; }
.s-wave { margin-left: auto; display: flex; gap: 3px; height: 22px; align-items: center; }
.s-wave i { width: 3px; height: 100%; border-radius: 3px; background: var(--sage); transform: scaleY(.3); }
.scene.is-on .s-wave i { animation: stWave 1s ease-in-out infinite; }
.s-wave i:nth-child(2n) { animation-delay: -.3s !important; background: var(--lavender); } .s-wave i:nth-child(3n) { animation-delay: -.6s !important; }
@keyframes stWave { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.s-msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.4; }
.s-msg--c { justify-self: end; background: var(--violet); border-bottom-right-radius: 4px; }
.s-msg--r { background: rgba(255,255,255,.12); border-bottom-left-radius: 4px; }

/* Escena: agenda */
.s-cal { width: min(400px, 100%); padding: 16px; }
.s-cal__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; font-size: 14px; }
.s-cal__head b { font-size: 16px; }
.s-cal__grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.s-cal__grid > span { font-family: var(--mono); font-size: 10.5px; text-align: center; color: var(--ink-3); }
.s-slot { height: 30px; border-radius: 8px; background: var(--mist); position: relative; }
.s-slot--busy { background: repeating-linear-gradient(135deg, var(--lilac-2) 0 6px, var(--lilac) 6px 12px); }
.s-slot--new { background: var(--mist); overflow: hidden; }
.s-slot--new::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; background: var(--sage-d); transform: scale(0); border-radius: 8px; }
.scene.is-on .s-slot--new::after { animation: stPop .6s 1.1s var(--ease-out) forwards; }
.scene.is-on .s-slot--new { animation: stGlow 1.6s 1.6s ease-in-out infinite; }
@keyframes stPop { to { transform: scale(1); } }
@keyframes stGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(62,140,110,.55); } 50% { box-shadow: 0 0 0 6px rgba(62,140,110,0); } }
.s-cal__foot { margin-top: 12px; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.s-cal__foot i { font-style: normal; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--lilac-2); }

/* Escena: aviso en el móvil */
.s-lock { position: relative; width: min(250px, 70%); aspect-ratio: 9 / 15; border-radius: 34px; border: 5px solid #0d0820; overflow: hidden; padding: 30px 12px 12px; text-align: center;
  background: linear-gradient(170deg, #B8A3EE, #7B5BD6 55%, #3E2A86); box-shadow: 0 40px 70px -30px rgba(0,0,0,.7); }
.s-lock__time { font-size: 44px; font-weight: 300; letter-spacing: -.03em; line-height: 1; }
.s-lock__date { font-size: 12px; opacity: .8; margin-top: 4px; }
.s-notif { margin-top: 22px; text-align: left; padding: 12px; font-size: 12.5px; line-height: 1.35; transform: translateY(-140%); opacity: 0; }
.scene.is-on .s-notif { animation: stDrop .7s .5s var(--ease-out) forwards; }
@keyframes stDrop { to { transform: none; opacity: 1; } }
.s-notif small { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.s-notif b { display: block; font-size: 13.5px; margin: 4px 0 2px; }
.s-notif__btns { display: flex; gap: 6px; margin-top: 10px; }
.s-notif__btns span { flex: 1; text-align: center; padding: 7px; border-radius: 10px; font-weight: 600; font-size: 12px; background: var(--lilac-2); color: var(--violet-d); }
.s-notif__btns span:first-child { background: var(--sage-d); color: #fff; }
.scene.is-on .s-notif__btns span:first-child { animation: stTap 2.6s 1.6s ease-in-out infinite; }
@keyframes stTap { 0%, 30%, 100% { transform: scale(1); } 38% { transform: scale(.9); } 46% { transform: scale(1); } }
.s-toast { position: absolute; left: 12px; right: 12px; bottom: 14px; padding: 9px; border-radius: 12px; background: rgba(15,10,35,.85); font-size: 12px; opacity: 0; transform: translateY(10px); }
.scene.is-on .s-toast { animation: stIn .5s 2.4s var(--ease-out) forwards; }

/* Escena: documento / propuesta */
.s-doc { position: relative; width: min(330px, 100%); padding: 20px; }
.s-doc__l { height: 8px; border-radius: 6px; background: var(--lilac-2); margin: 8px 0; }
.s-doc__l.s { width: 60%; } .s-doc__l.m { width: 80%; }
.s-doc__row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.s-doc__row b { font-weight: 700; }
.s-sign { margin-top: 12px; height: 40px; }
.s-sign path { fill: none; stroke: var(--violet); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 300; stroke-dashoffset: 300; }
.scene.is-on .s-sign path { animation: stDraw 1.4s 1s ease-out forwards; }
@keyframes stDraw { to { stroke-dashoffset: 0; } }
.s-stamp { position: absolute; right: 14px; top: 14px; padding: 6px 10px; border: 2px solid var(--sage-d); color: var(--sage-d); border-radius: 10px; font-family: var(--mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; transform: rotate(8deg) scale(2); opacity: 0; }
.scene.is-on .s-stamp { animation: stStamp .45s 2.3s cubic-bezier(.3,1.6,.5,1) forwards; }
@keyframes stStamp { to { transform: rotate(8deg) scale(1); opacity: 1; } }

/* Escena: comisión */
.s-pay { width: min(380px, 100%); display: grid; gap: 12px; }
.s-pay__big { padding: 18px 20px; }
.s-pay__big small { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; font-family: var(--mono); }
.s-pay__big b { display: block; font-size: 44px; letter-spacing: -.03em; line-height: 1.05; color: var(--violet-d); }
.s-pay__bars { display: flex; align-items: flex-end; gap: 8px; height: 90px; padding: 12px 14px; }
.s-pay__bars i { flex: 1; height: var(--h); border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--sage), rgba(156,211,188,.35)); transform-origin: bottom; transform: scaleY(0); }
.scene.is-on .s-pay__bars i { animation: stGrow .7s var(--ease-out) forwards; animation-delay: calc(var(--i) * .09s + .3s); }
@keyframes stGrow { to { transform: scaleY(1); } }

@media (max-width: 900px) {
  .stepper { grid-template-columns: 1fr; }
  .stepper__stage { order: -1; aspect-ratio: 4 / 3.4; }
  .stepper__item[aria-selected="true"] { transform: none; }
}
@media (max-width: 520px) {
  .stepper__stage { aspect-ratio: 4 / 4.4; border-radius: 26px; }
  .scene { padding: 50px 16px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .scene .sq, .s-notif, .s-toast, .s-stamp, .s-pay__bars i { opacity: 1 !important; transform: none !important; animation: none !important; }
  .s-sign path { stroke-dashoffset: 0 !important; animation: none !important; }
  .s-slot--new::after { transform: none !important; animation: none !important; }
  .scene.is-on .s-ring__ico, .scene.is-on .s-ring__ico::before, .scene.is-on .s-ring__ico::after, .scene.is-on .s-wave i { animation: none !important; }
}
.s-ring { gap: 24px; }
@keyframes stRipple { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.9); opacity: 0; } }
@media (max-width: 900px) { .stepper__stage { aspect-ratio: auto; height: clamp(400px, 62vw, 470px); } }
@media (max-width: 520px) { .stepper__stage { height: 430px; } }
