/* The sign-in splash (DEV-812). Global, not scoped, because the markup lives in the host page
   (Cim360.cloud.Web/Components/App.razor), outside the interactive tree: Blazor never re-renders it,
   so connecting the circuit cannot restart it or flash the page underneath. It is shown only while
   <html> carries .cim-splash-pending, which a script in <head> sets before the first paint for a tab
   that has not seen it, and it runs on CSS alone. cim360-splash.js ends it (animation end, a click
   or any key) and remembers that this tab has seen it. Colours are --cim360-login-* tokens - R-078. */


.cim-splash {
    display: none;
}

:root.cim-splash-pending .cim-splash {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    background: var(--cim360-login-splash-bg);
    color-scheme: light;
    font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
    animation: cimSplashOut .6s ease 2.3s forwards;
}

    .cim-splash::after {
        content: "";
        position: absolute;
        inset: 0;
        background-image: radial-gradient(var(--cim360-login-dot-grid) 1px, transparent 1px);
        background-size: 22px 22px;
        -webkit-mask-image: var(--cim360-login-splash-mask);
        mask-image: var(--cim360-login-splash-mask);
        pointer-events: none;
        animation: cimSplashFade 1.2s ease both;
    }


.cim-splash-banner {
    position: relative;
    width: min(760px, 82vw);
    aspect-ratio: 5881 / 1012;
    z-index: 1;
    animation: cimSplashBannerOut .6s cubic-bezier(.5, 0, .75, 0) 2.3s forwards;
}

.cim-splash-move {
    position: absolute;
    inset: 0;
    animation: cimSplashMove .7s cubic-bezier(.65, 0, .35, 1) 1s both;
}

.cim-splash-mark,
.cim-splash-text {
    position: absolute;
    top: 0;
    height: 100%;
    overflow: hidden;
}

.cim-splash-mark {
    left: 1.5%;
    width: 13.4%;
    animation: cimSplashMark .85s cubic-bezier(.2, .9, .25, 1.15) .1s both;
}

    .cim-splash-mark img {
        position: absolute;
        top: 0;
        height: 100%;
        left: -11.194%;
        width: 746.27%;
        max-width: none;
    }

.cim-splash-text {
    left: 15%;
    width: 85%;
    animation: cimSplashText .75s cubic-bezier(.4, 0, .2, 1) 1.15s both;
}

    .cim-splash-text img {
        position: absolute;
        top: 0;
        height: 100%;
        left: -17.647%;
        width: 117.647%;
        max-width: none;
    }

/* Real text, near-opaque white on the blue: the design's 60% white is under 3:1 here. */
.cim-splash-hint {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--cim360-login-on-brand-soft);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-align: center;
    animation: cimSplashFade .6s ease 1.4s both;
}

@media (prefers-reduced-motion: reduce) {
    .cim-splash-mark,
    .cim-splash-text,
    .cim-splash-move {
        animation-duration: .01s;
        animation-delay: 0s;
    }

    .cim-splash-hint,
    .cim-splash::after {
        animation: none;
    }

    :root.cim-splash-pending .cim-splash {
        animation-delay: .7s;
        animation-duration: .3s;
    }

    .cim-splash-banner {
        animation: none;
    }
}

@keyframes cimSplashMark {
    0% {
        opacity: 0;
        transform: scale(.3) rotate(-240deg);
    }

    60% {
        opacity: 1;
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

@keyframes cimSplashMove {
    from {
        transform: translateX(41.8%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes cimSplashText {
    from {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
        transform: translateX(-2%);
    }

    to {
        opacity: 1;
        clip-path: inset(0 0 0 0);
        transform: none;
    }
}

@keyframes cimSplashFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes cimSplashOut {
    to {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

@keyframes cimSplashBannerOut {
    to {
        transform: scale(1.12);
        filter: blur(2px);
    }
}
