/* Motion: one quiet, consistent system for the whole app.
   - Content arrives: the page header, then cards one after another, rising a few pixels as they fade in.
   - Figures settle: money and counts count up (js/motion.js), bars and progress steps fill, sparklines draw.
   - Everything answers the pointer: hover lifts what can be clicked, buttons press down.
   Short, eased and never in the way. People who ask their device for less motion get none of it (end of file). */

:root {
    --zp-ease-out: cubic-bezier(.16, 1, .3, 1);
    --zp-ease-spring: cubic-bezier(.34, 1.56, .64, 1);
    --zp-step: 55ms;
}

@keyframes zp-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes zp-in-lg { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes zp-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes zp-pop-in { 0% { opacity: 0; transform: scale(.6); } 100% { opacity: 1; transform: none; } }
@keyframes zp-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes zp-grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes zp-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes zp-ring { 0% { box-shadow: 0 0 0 0 var(--zp-ring-color, var(--zp-accent-soft)); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes zp-float { from { transform: translateY(0); } to { transform: translateY(-4px); } }
@keyframes zp-drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-4%, 3%, 0) scale(1.08); } 100% { transform: translate3d(3%, -2%, 0) scale(1); } }

/* ---------- Pages arrive in order ---------- */
.zp-page__inner > .zp-ph { animation: zp-in .45s var(--zp-ease-out) both; }
.zp-page__inner > .zp-hero { animation: zp-in-lg .6s var(--zp-ease-out) .04s both; }
.zp-grid > *, .zp-stack > * { animation: zp-in .55s var(--zp-ease-out) both; animation-delay: calc(80ms + var(--zp-i, 0) * var(--zp-step)); }
.zp-grid > :nth-child(2), .zp-stack > :nth-child(2) { --zp-i: 1; }
.zp-grid > :nth-child(3), .zp-stack > :nth-child(3) { --zp-i: 2; }
.zp-grid > :nth-child(4), .zp-stack > :nth-child(4) { --zp-i: 3; }
.zp-grid > :nth-child(5), .zp-stack > :nth-child(5) { --zp-i: 4; }
.zp-grid > :nth-child(6), .zp-stack > :nth-child(6) { --zp-i: 5; }
.zp-grid > :nth-child(7), .zp-stack > :nth-child(7) { --zp-i: 6; }
.zp-grid > :nth-child(n+8), .zp-stack > :nth-child(n+8) { --zp-i: 7; }
.zp-empty { animation: zp-fade-in .5s var(--zp-ease-out) both; }

/* ---------- Dashboard hero ---------- */
.zp-hero::before { content: ""; position: absolute; inset: -40% -20% auto auto; width: 70%; height: 180%; pointer-events: none; z-index: 0;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--zp-accent-2) 28%, transparent), transparent);
    animation: zp-drift 18s ease-in-out infinite alternate; will-change: transform; }
.zp-hero__fig { animation: zp-in .5s var(--zp-ease-out) both; }
.zp-hero__fig:nth-child(1) { animation-delay: .25s; }
.zp-hero__fig:nth-child(2) { animation-delay: .32s; }
.zp-hero__fig:nth-child(3) { animation-delay: .39s; }
.zp-hero__actions > * { animation: zp-in .45s var(--zp-ease-out) both; }
.zp-hero__actions > :nth-child(1) { animation-delay: .45s; }
.zp-hero__actions > :nth-child(2) { animation-delay: .5s; }
.zp-hero__actions > :nth-child(3) { animation-delay: .55s; }

/* ---------- Payroll progress steps: dots arrive, finished stretches fill, the current step breathes ---------- */
.zp-steps__dot { animation: zp-pop-in .45s var(--zp-ease-spring) both; }
.zp-steps__item::after { transform-origin: left center; animation: zp-grow-x .6s var(--zp-ease-out) both; }
.zp-steps__item:nth-child(1) .zp-steps__dot { animation-delay: .2s; }
.zp-steps__item:nth-child(2) .zp-steps__dot, .zp-steps__item:nth-child(1)::after { animation-delay: .3s; }
.zp-steps__item:nth-child(3) .zp-steps__dot, .zp-steps__item:nth-child(2)::after { animation-delay: .4s; }
.zp-steps__item:nth-child(4) .zp-steps__dot, .zp-steps__item:nth-child(3)::after { animation-delay: .5s; }
.zp-steps__item:nth-child(5) .zp-steps__dot, .zp-steps__item:nth-child(4)::after { animation-delay: .6s; }
.zp-steps__item.is-current .zp-steps__dot { animation: zp-pop-in .45s var(--zp-ease-spring) both, zp-ring 2.4s ease-out 1.2s infinite; }
.zp-hero .zp-steps__item.is-current .zp-steps__dot { --zp-ring-color: color-mix(in srgb, var(--zp-accent-2) 45%, transparent); }

/* ---------- KPI tiles ---------- */
.zp-stat { transition: transform .25s var(--zp-ease-out), box-shadow .25s var(--zp-ease-out), border-color .25s; }
.zp-stat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; transform: scaleX(0); transform-origin: left;
    background: linear-gradient(90deg, var(--zp-accent), var(--zp-accent-2)); transition: transform .45s var(--zp-ease-out); }
.zp-stat:hover { border-color: color-mix(in srgb, var(--zp-accent) 22%, var(--zp-border)); box-shadow: var(--zp-shadow-lg); }
.zp-stat:hover::before { transform: scaleX(1); }
.zp-stat--link:hover { transform: translateY(-3px); }
.zp-stat__icon { transition: transform .3s var(--zp-ease-spring); }
.zp-stat:hover .zp-stat__icon { transform: scale(1.08) rotate(-4deg); }
.zp-stat .zp-delta { animation: zp-pop-in .4s var(--zp-ease-spring) .65s both; }
.zp-stat__spark { animation: zp-draw 1.1s var(--zp-ease-out) .35s both; }

/* ---------- Bars, lists and the "coming up" feed ---------- */
.zp-bars__fill { transform-origin: left center; animation: zp-grow-x 1s var(--zp-ease-out) both; animation-delay: calc(.25s + var(--zp-i, 0) * 80ms); }
.zp-bars__row:nth-child(2) .zp-bars__fill { --zp-i: 1; }
.zp-bars__row:nth-child(3) .zp-bars__fill { --zp-i: 2; }
.zp-bars__row:nth-child(4) .zp-bars__fill { --zp-i: 3; }
.zp-bars__row:nth-child(5) .zp-bars__fill { --zp-i: 4; }
.zp-bars__row:nth-child(n+6) .zp-bars__fill { --zp-i: 5; }
.zp-feed__item { animation: zp-in .45s var(--zp-ease-out) both; animation-delay: calc(.2s + var(--zp-i, 0) * 50ms);
    transition: background .2s, transform .25s var(--zp-ease-out); }
.zp-feed__item:nth-child(2) { --zp-i: 1; }
.zp-feed__item:nth-child(3) { --zp-i: 2; }
.zp-feed__item:nth-child(4) { --zp-i: 3; }
.zp-feed__item:nth-child(5) { --zp-i: 4; }
.zp-feed__item:nth-child(n+6) { --zp-i: 5; }
.zp-feed__item:hover { transform: translateX(3px); }
.zp-feed__date { transition: border-color .2s, background .2s, transform .3s var(--zp-ease-spring); }
.zp-feed__item:hover .zp-feed__date { border-color: color-mix(in srgb, var(--zp-accent) 35%, var(--zp-border)); transform: scale(1.05); }
.zp-list__row { transition: background .2s; }
.zp-list__row--total .zp-list__value { animation: zp-pop-in .45s var(--zp-ease-spring) .5s both; }

/* ---------- Cards: a quiet response to the pointer (they are not links, so they do not lift) ---------- */
.zp-card { transition: box-shadow .3s var(--zp-ease-out), border-color .3s; }
.zp-card:hover { border-color: var(--zp-border-2); }
.zp-card__icon { transition: transform .3s var(--zp-ease-spring); }
.zp-card:hover .zp-card__icon { transform: scale(1.06); }

/* ---------- Buttons press, links glide ---------- */
.zp-btn, .dxbl-btn, .zp-iconbtn, .zp-ph__back, .auth-submit, .auth-passkey {
    transition: transform .15s var(--zp-ease-out), box-shadow .2s, background-color .2s, border-color .2s, color .2s, filter .2s; }
.zp-btn:active, .dxbl-btn:not(:disabled):active, .zp-iconbtn:active, .auth-submit:active, .auth-passkey:not(:disabled):active { transform: translateY(1px) scale(.985); }
.zp-btn--primary:hover, .auth-submit:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, .1), 0 10px 22px -8px color-mix(in srgb, var(--zp-accent) 75%, transparent); }
.zp-ph__back:hover { transform: translateX(-2px); }
.zp-nav__link { transition: background .2s, color .2s; }
.zp-nav__link .zp-icon { transition: color .2s, transform .25s var(--zp-ease-out); }
.zp-nav__link:hover .zp-icon { transform: translateX(2px); }
.zp-nav__link.active::before { transform-origin: center; animation: zp-grow-y .35s var(--zp-ease-spring) both; }
.zp-nav__badge { animation: zp-pop-in .4s var(--zp-ease-spring) .3s both; }
.zp-iconbtn__dot { animation: zp-pop-in .45s var(--zp-ease-spring) .5s both; }
.zp-empty__art { animation: zp-float 3.2s ease-in-out infinite alternate; }

/* Tables: rows answer the pointer smoothly. */
.dxbl-grid tr { transition: background-color .15s; }

/* Keyboard users always see where they are. */
a:focus-visible, button:focus-visible, .zp-stat--link:focus-visible { outline: 2px solid var(--zp-accent); outline-offset: 2px; border-radius: 8px; }

/* ---------- Sign-in page ---------- */
.auth-brand::before { content: ""; position: absolute; width: 640px; height: 640px; right: -220px; top: -260px; pointer-events: none; border-radius: 50%;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--zp-accent) 34%, transparent), transparent); animation: zp-drift 20s ease-in-out infinite alternate; }
.auth-brand > div > * { animation: zp-in .7s var(--zp-ease-out) both; }
.auth-brand > div > :nth-child(2) { animation-delay: .08s; }
.auth-brand > div > :nth-child(3) { animation-delay: .16s; }
.auth-brand > div > :nth-child(4) { animation-delay: .24s; }
.auth-points li { animation: zp-in .5s var(--zp-ease-out) both; }
.auth-points li:nth-child(1) { animation-delay: .3s; }
.auth-points li:nth-child(2) { animation-delay: .38s; }
.auth-points li:nth-child(3) { animation-delay: .46s; }
.auth-mock__row, .auth-mock__net { animation: zp-in .5s var(--zp-ease-out) both; }
.auth-mock__row:nth-child(1) { animation-delay: .5s; }
.auth-mock__row:nth-child(2) { animation-delay: .58s; }
.auth-mock__row:nth-child(3) { animation-delay: .66s; }
.auth-mock__row:nth-child(4) { animation-delay: .74s; }
.auth-mock__net { animation-delay: .84s; }
.auth-card { animation: zp-in-lg .6s var(--zp-ease-out) .1s both; }

/* ---------- Less motion when asked ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
        transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
