/* Écran d'ouverture (adapté de helpdesk-clair/splash.html) */
#splash {
    --sp-bg: #f2f2f3;
    --sp-text: #1d1f20;
    --sp-a200: #d3dfeb;
    --sp-a400: #8aa6c2;
    --sp-a700: #35516d;
    position: fixed;
    inset: 0;
    z-index: 1000;
    overflow: hidden;
    font-family: Barlow, sans-serif;
    color: var(--sp-text);
    background-color: var(--sp-bg);
    background-image: linear-gradient(var(--sp-a200) 1px, transparent 1px), linear-gradient(90deg, var(--sp-a200) 1px, transparent 1px);
    background-size: 60px 60px;
    background-position: center;
    cursor: pointer;
    transition: opacity .5s ease, visibility .5s;
}

.no-splash #splash { display: none; }
#splash.is-leaving { opacity: 0; visibility: hidden; }

#splash .sp-frame { position: absolute; inset: 24px; border: 1px solid var(--sp-a400); }
#splash .sp-c { position: absolute; width: 16px; height: 16px; border: 0 solid var(--sp-a700); }
#splash .sp-tl { left: 16px; top: 16px; border-left-width: 2px; border-top-width: 2px; }
#splash .sp-tr { right: 16px; top: 16px; border-right-width: 2px; border-top-width: 2px; }
#splash .sp-bl { left: 16px; bottom: 16px; border-left-width: 2px; border-bottom-width: 2px; }
#splash .sp-br { right: 16px; bottom: 16px; border-right-width: 2px; border-bottom-width: 2px; }

#splash .sp-main { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 0 16px; }
#splash .sp-logo { display: flex; align-items: center; gap: 22px; background: var(--sp-bg); padding: 12px 28px; }
#splash .sp-logo svg { width: 120px; height: 120px; flex: none; }
#splash .sp-name { font-family: 'Barlow Condensed', sans-serif; font-size: 84px; line-height: .9; text-transform: uppercase; letter-spacing: .05em; animation: splash-pop .8s .5s both; }
#splash .sp-name b { font-weight: 700; }
#splash .sp-name span { font-weight: 300; color: #12396b; }

#splash .sp-bar { width: min(300px, 100%); display: flex; flex-direction: column; gap: 12px; animation: splash-pop .6s 1s both; }
#splash .sp-track { height: 3px; background: var(--sp-a200); }
#splash .sp-fill { height: 100%; background: linear-gradient(90deg, #6fb4ec, #12396b); animation: splash-fill 4s 1.2s ease-in-out both; }
#splash .sp-st { position: relative; height: 18px; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--sp-a700); }
#splash .sp-st span { position: absolute; inset: 0; opacity: 0; white-space: nowrap; }
#splash .sp-st span:nth-child(1) { animation: splash-s1 5.2s 1.2s both; }
#splash .sp-st span:nth-child(2) { animation: splash-s2 5.2s 1.2s both; }
#splash .sp-st span:nth-child(3) { animation: splash-s3 5.2s 1.2s both; }

#splash .sp-footer { position: absolute; left: 44px; right: 44px; bottom: 40px; display: flex; justify-content: space-between; gap: 12px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--sp-a700); }

#splash .sp-draw { stroke-dasharray: 1; }
#splash .sp-draw-1 { animation: splash-draw 1.4s ease-out both; }
#splash .sp-draw-2 { animation: splash-draw 1s .6s ease-out both; }
#splash .sp-draw-3 { animation: splash-draw .6s 1.2s ease-out both; }
#splash .sp-core { animation: splash-pop .4s 1.6s both; }

@keyframes splash-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes splash-fill { 0% { width: 0; } 60% { width: 68%; } 100% { width: 100%; } }
@keyframes splash-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes splash-s1 { 0%, 30% { opacity: 1; } 34%, 100% { opacity: 0; } }
@keyframes splash-s2 { 0%, 32% { opacity: 0; } 36%, 64% { opacity: 1; } 68%, 100% { opacity: 0; } }
@keyframes splash-s3 { 0%, 66% { opacity: 0; } 70%, 100% { opacity: 1; } }

@media (max-width: 560px) {
    #splash .sp-logo { flex-direction: column; gap: 14px; padding: 12px 16px; }
    #splash .sp-logo svg { width: 88px; height: 88px; }
    #splash .sp-name { font-size: 56px; }
    #splash .sp-footer { left: 36px; right: 36px; bottom: 36px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    #splash *, #splash *::before, #splash *::after { animation-duration: 1ms !important; animation-delay: 0s !important; }
    #splash .sp-st span { opacity: 0 !important; }
    #splash .sp-st span:nth-child(3) { opacity: 1 !important; }
}
