/**
 * Splash screen — écran de démarrage plein cadre avant la page de connexion.
 * Reproduction stricte de la maquette fournie (fond vert premium, blason
 * doré, courbe de transition, bandeau blanc, loader animé).
 */

body.splash-lock {
    margin: 0;
    height: 100%;
    overflow: hidden;
    transition: opacity 0.5s ease;
}

body.splash-lock.is-fading-out {
    opacity: 0;
}

.splash {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
}

/* --- Panneau vert --- */
.splash-green {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    background: linear-gradient(165deg, #14624a 0%, #0a3f2e 55%, #051d15 100%);
    overflow: hidden;
    padding: clamp(24px, 5vh, 48px) var(--space-5) clamp(48px, 9vh, 84px);
}

.splash-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url('../images/building-hero.svg');
    background-size: cover;
    background-position: top right;
    opacity: 0.3;
}

.splash-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(200deg, rgba(5, 29, 21, 0.15) 0%, rgba(5, 29, 21, 0.65) 55%, rgba(5, 29, 21, 0.92) 100%);
}

.splash-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 460px;
}

@keyframes splashFadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes splashSpin {
    to {
        transform: rotate(360deg);
    }
}

.splash-logo {
    width: clamp(96px, 18vh, 160px);
    margin-bottom: clamp(12px, 2.2vh, 22px);
    opacity: 0;
    animation: splashFadeUp 0.7s ease forwards 0.1s;
}

.splash-logo-icon {
    width: 100%;
    height: auto;
    display: block;
}

.splash-brand-pre {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(1rem, 2.6vh, 1.4rem);
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--color-gold-500);
    margin-bottom: 2px;
    opacity: 0;
    animation: splashFadeUp 0.7s ease forwards 0.2s;
}

.splash-title {
    font-size: clamp(1.4rem, 4.2vh, 2.1rem);
    font-weight: 800;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
    opacity: 0;
    animation: splashFadeUp 0.7s ease forwards 0.3s;
}

.splash-subtitle {
    font-size: clamp(0.8rem, 1.9vh, 1rem);
    letter-spacing: 0.25em;
    color: var(--color-gold-500);
    font-weight: 600;
    opacity: 0;
    animation: splashFadeUp 0.7s ease forwards 0.4s;
}

.splash-divider {
    width: 68px;
    height: 2px;
    background: var(--color-gold-500);
    margin: clamp(10px, 2vh, 18px) 0;
    opacity: 0;
    animation: splashFadeUp 0.7s ease forwards 0.5s;
}

.splash-tagline {
    font-size: clamp(0.7rem, 1.7vh, 0.9rem);
    line-height: 1.6;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: clamp(16px, 3vh, 30px);
    opacity: 0;
    animation: splashFadeUp 0.7s ease forwards 0.6s;
}

.splash-icons {
    display: grid;
    grid-template-columns: repeat(2, auto);
    column-gap: clamp(70px, 20vw, 160px);
    row-gap: clamp(10px, 1.8vh, 16px);
    justify-content: center;
    opacity: 0;
    animation: splashFadeUp 0.7s ease forwards 0.7s;
}

.splash-icon {
    color: rgba(255, 255, 255, 0.32);
}

.splash-icon .icon {
    width: clamp(18px, 3vh, 24px);
    height: clamp(18px, 3vh, 24px);
}

.splash-icon-card {
    grid-column: 1;
    grid-row: 1;
}

.splash-icon-heart {
    grid-column: 2;
    grid-row: 1;
}

.splash-icon-shield {
    grid-column: 1;
    grid-row: 2;
    justify-self: end;
    margin-right: clamp(-24px, -4vw, -10px);
}

.splash-icon-users {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    margin-left: clamp(-24px, -4vw, -10px);
}

.splash-corner {
    position: absolute;
    width: 130px;
    height: 130px;
    opacity: 0.05;
    background-image:
        repeating-linear-gradient(60deg, white 0 2px, transparent 2px 20px),
        repeating-linear-gradient(-60deg, white 0 2px, transparent 2px 20px);
    pointer-events: none;
    z-index: 1;
}

.splash-corner-left {
    left: 0;
    bottom: 0;
}

.splash-corner-right {
    right: 0;
    bottom: 0;
}

.splash-curve {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    width: 100%;
    height: clamp(36px, 7vh, 64px);
    z-index: 3;
    display: block;
}

/* --- Bandeau blanc --- */
.splash-white {
    flex: 0 0 auto;
    background: var(--color-white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: clamp(14px, 2.5vh, 28px) var(--space-5) clamp(20px, 4vh, 36px);
    opacity: 0;
    animation: splashFadeUp 0.7s ease forwards 0.8s;
}

.splash-partner {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-primary-700);
    font-style: italic;
    font-size: clamp(0.9rem, 2.1vh, 1.1rem);
    margin-bottom: clamp(14px, 2.5vh, 24px);
}

.gold-dash {
    width: 26px;
    height: 2px;
    background: var(--color-gold-500);
    display: inline-block;
}

.splash-loader {
    width: clamp(42px, 6.5vh, 56px);
    height: clamp(42px, 6.5vh, 56px);
    border-radius: 50%;
    border: 4px solid var(--color-primary-600);
    border-top-color: var(--color-gold-500);
    border-right-color: var(--color-gold-500);
    animation: splashSpin 1s linear infinite;
    margin-bottom: clamp(8px, 1.6vh, 14px);
}

.splash-loading-label {
    font-size: clamp(0.7rem, 1.5vh, 0.8rem);
    letter-spacing: 0.2em;
    font-weight: 600;
    color: var(--color-primary-700);
}

@media (prefers-reduced-motion: reduce) {
    .splash-logo,
    .splash-brand-pre,
    .splash-title,
    .splash-subtitle,
    .splash-divider,
    .splash-tagline,
    .splash-icons,
    .splash-white {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .splash-loader {
        animation-duration: 1.6s;
    }
}
