/* ------------------------------------------------------------------ */
/* Fuse splash (legacy — markup removed from index.html, kept for      */
/* compatibility with any remaining references).                       */
/* ------------------------------------------------------------------ */
body fuse-splash-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #111827;
    color: #F9FAFB;
    z-index: 999999;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
    transition: opacity 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

body fuse-splash-screen img {
    width: 120px;
    max-width: 120px;
}

body fuse-splash-screen .spinner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 40px;
    width: 56px;
}

body fuse-splash-screen .spinner > div {
    width: 12px;
    height: 12px;
    background-color: #1E96F7;
    border-radius: 100%;
    display: inline-block;
    -webkit-animation: fuse-bouncedelay 1s infinite ease-in-out both;
    animation: fuse-bouncedelay 1s infinite ease-in-out both;
}

body fuse-splash-screen .spinner .bounce1 {
    -webkit-animation-delay: -0.32s;
    animation-delay: -0.32s;
}

body fuse-splash-screen .spinner .bounce2 {
    -webkit-animation-delay: -0.16s;
    animation-delay: -0.16s;
}

@-webkit-keyframes fuse-bouncedelay {
    0%, 80%, 100% {
        -webkit-transform: scale(0)
    }
    40% {
        -webkit-transform: scale(1.0)
    }
}

@keyframes fuse-bouncedelay {
    0%, 80%, 100% {
        -webkit-transform: scale(0);
        transform: scale(0);
    }
    40% {
        -webkit-transform: scale(1.0);
        transform: scale(1.0);
    }
}

body:not(.fuse-splash-screen-hidden) {
    overflow: hidden;
}

body.fuse-splash-screen-hidden fuse-splash-screen {
    visibility: hidden;
    opacity: 0;
}

/* ------------------------------------------------------------------ */
/* Pre-boot splash                                                 */
/* ------------------------------------------------------------------ */
#pre-boot-splash {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    opacity: 1;
    transition: opacity 300ms ease;
}

#pre-boot-splash.hiding {
    opacity: 0;
    pointer-events: none;
}

#pre-boot-splash .pb-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

#pre-boot-splash .pb-logo img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

#pre-boot-splash .pb-label {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #9ca3af;
    font-weight: 600;
    text-align: center;
}

/* Matches .splash-campaign in the Angular splash so the swap is invisible. */
#pre-boot-splash .pb-campaign {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 900;
    color: #111827;
    text-align: center;
    line-height: 1.3;
    min-height: 26px;
}

#pre-boot-splash .pb-campaign-skeleton {
    width: 220px;
    height: 20px;
    margin: 3px 0;
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        #e2efc2 0%,
        #f0f7d9 50%,
        #e2efc2 100%
    );
    background-size: 200% 100%;
    animation: pb-pulse 1.4s ease-in-out infinite;
}

/* Mirrors .splash-spinner in entry-splash.component.scss — same size, colours,
   and animation period — so the pre-boot → Angular handoff stays invisible. */
#pre-boot-splash .pb-spinner {
    width: 36px;
    height: 36px;
    margin-top: 8px;
    /* 3px, not 2px: the lime arc is close in value to its own grey track, so
       the stroke needs the extra area to register on white. */
    border: 3px solid #e4e7ec;
    border-top-color: #a6ce3a;
    border-radius: 50%;
    animation: pb-spin 700ms linear infinite;
}

@keyframes pb-spin {
    to { transform: rotate(360deg); }
}

@keyframes pb-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Stopping the spinner outright would read as a hang, so it just slows down. */
@media (prefers-reduced-motion: reduce) {
    #pre-boot-splash .pb-spinner {
        animation-duration: 2s;
    }

    #pre-boot-splash .pb-campaign-skeleton {
        animation-duration: 3s;
    }
}
