/* Splash screen: HTML/CSS puro in index.html, visibile prima del boot di Angular.
   Logo Eurofins Genoma in un riquadro bianco sopra l'immagine di sfondo velata di scuro.
   BrandingService aggiorna a runtime solo logo e immagine di sfondo (inline style). */
body #splash-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    padding: 16px;
    background-image: url('/assets/images/genoma/background.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #0f2a4a; /* fallback finché l'immagine non è caricata */
    z-index: 999999;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
    transition: opacity 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Velo scuro per il contrasto del riquadro sullo sfondo fotografico */
body #splash-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(8, 20, 40, 0.55) 0%, rgba(8, 20, 40, 0.7) 100%);
}

body #splash-screen .splash-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    width: min(420px, 100%);
    box-sizing: border-box;
    padding: 40px 40px 32px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

body #splash-screen #splash-logo {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
}

body #splash-screen .splash-progress {
    position: relative;
    width: 100%;
    height: 4px;
    overflow: hidden;
    border-radius: 2px;
    background: #e2e8f0;
}

body #splash-screen .splash-progress > div {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 40%;
    border-radius: 2px;
    background: #003883; /* blu Eurofins */
    animation: splash-progress 1.4s ease-in-out infinite;
}

@keyframes splash-progress {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(250%);
    }
}

@media (prefers-reduced-motion: reduce) {
    body #splash-screen {
        transition: none;
    }
    body #splash-screen .splash-progress > div {
        animation: none;
        width: 100%;
        opacity: 0.6;
    }
}

body:not(.splash-hidden) {
    overflow: hidden;
}

body.splash-hidden #splash-screen {
    visibility: hidden;
    opacity: 0;
}
