:root {
    --splash-bg: var(--background);
    --splash-foreground: var(--foreground);
    --splash-orange: var(--primary);
    --blueprint-line: rgba(0, 0, 0, 0.05);
}

/* Dark Theme Overrides */
.dark {
    --splash-bg: var(--background);
    --splash-foreground: var(--foreground);
    --splash-orange: var(--primary);
    --blueprint-line: rgba(255, 255, 255, 0.04);
}

#cv-splash-screen {
    view-transition-name: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--splash-bg);

    /* Patrón de Rejilla (Blueprint) */
    background-image:
        linear-gradient(var(--blueprint-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--blueprint-line) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center center;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition:
        opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.6s,
        transform 0.6s;
}

/* Efecto de viñeta para el blueprint */
#cv-splash-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 40%, var(--splash-bg) 100%);
    pointer-events: none;
}

.cv-splash-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

.cv-splash-logo {
    width: 140px;
    height: 140px;

    clip-path: circle(0% at 50% 50%);
    animation: cv-blueprint-reveal 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;

    background: var(--color-primary);

    mask-image: url('/images/logo/logo-sige-app-bar.svg');
    mask-size: contain;
    mask-position: center;
    mask-repeat: no-repeat;

    -webkit-mask-image: url('/images/logo/logo-sige-app-bar.svg');
    -webkit-mask-size: contain;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
}

.cv-splash-loader {
    margin-top: 48px;
    width: 200px;
    height: 2px;
    background-color: rgba(128, 128, 128, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.cv-splash-loader-bar {
    position: absolute;
    width: 40%;
    height: 100%;
    background-color: var(--splash-orange);
    animation: cv-splash-loading 2s infinite ease-in-out;
}

.cv-splash-text {
    margin-top: 16px;
    font-family: var(--font-mono-default);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--foreground, var(--splash-foreground));
    opacity: 0.6;
}

@keyframes cv-blueprint-reveal {
    0% {
        clip-path: circle(0% at 50% 50%);
        transform: scale(0.9);
    }
    100% {
        clip-path: circle(100% at 50% 50%);
        transform: scale(1);
    }
}

@keyframes cv-splash-loading {
    0% {
        left: -40%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: -40%;
    }
}

.fuse-splash-screen-hidden #cv-splash-screen {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.05);
}
