/* ─── Theme color variables (set before Angular loads, via html class) ──────── */

fuse-splash-screen {
    --splash-c1: #818cf8;
    --splash-c2: #7C3AED;
}

html.theme-default fuse-splash-screen { --splash-c1: #a075d8; --splash-c2: #7e22ce; }
html.theme-emerald fuse-splash-screen { --splash-c1: #10b981; --splash-c2: #0ea875; }
html.theme-ocean   fuse-splash-screen { --splash-c1: #71acc4; --splash-c2: #0891b2; }
html.theme-rose    fuse-splash-screen { --splash-c1: #f43f5e; --splash-c2: #dd3955; }
html.theme-amber   fuse-splash-screen { --splash-c1: #f59e0b; --splash-c2: #de8f0a; }
html.theme-indigo  fuse-splash-screen { --splash-c1: #6366f1; --splash-c2: #4f52c1; }
html.theme-teal    fuse-splash-screen { --splash-c1: #14b8a6; --splash-c2: #109485; }
html.theme-navy    fuse-splash-screen { --splash-c1: #4f6dbf; --splash-c2: #1e40af; }
html.theme-brand   fuse-splash-screen { --splash-c1: #2196f3; --splash-c2: #1a78c3; }
html.theme-slate   fuse-splash-screen { --splash-c1: #94a3b8; --splash-c2: #64748b; }

/* ─── Base ─────────────────────────────────────────────────────────────────── */

body fuse-splash-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ffffff;
    z-index: 999999;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
    overflow: hidden;
    transition: opacity 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

html.dark fuse-splash-screen {
    background-color: #111827;
}

body:not(.fuse-splash-screen-hidden) {
    overflow: hidden;
}

body.fuse-splash-screen-hidden fuse-splash-screen {
    visibility: hidden;
    opacity: 0;
}

/* ─── Theme backgrounds (light) ─────────────────────────────────────────────── */

html.light.theme-default fuse-splash-screen { background-color: #f5f3ff; }
html.light.theme-emerald fuse-splash-screen { background-color: #ecfdf5; }
html.light.theme-ocean   fuse-splash-screen { background-color: #ecfeff; }
html.light.theme-rose    fuse-splash-screen { background-color: #fff1f2; }
html.light.theme-amber   fuse-splash-screen { background-color: #fffbeb; }
html.light.theme-brand   fuse-splash-screen { background-color: #eff6ff; }
html.light.theme-navy    fuse-splash-screen { background-color: #eff6ff; }
html.light.theme-teal    fuse-splash-screen { background-color: #f0fdfa; }
html.light.theme-indigo  fuse-splash-screen { background-color: #eef2ff; }
html.light.theme-slate   fuse-splash-screen { background-color: #f8fafc; }

/* ─── Theme backgrounds (dark) ──────────────────────────────────────────────── */

html.dark.theme-default fuse-splash-screen { background-color: #0d0417; }
html.dark.theme-emerald fuse-splash-screen { background-color: #011410; }
html.dark.theme-ocean   fuse-splash-screen { background-color: #030f17; }
html.dark.theme-rose    fuse-splash-screen { background-color: #1a040a; }
html.dark.theme-amber   fuse-splash-screen { background-color: #1a1002; }
html.dark.theme-brand   fuse-splash-screen { background-color: #030f1a; }
html.dark.theme-navy    fuse-splash-screen { background-color: #05070f; }
html.dark.theme-teal    fuse-splash-screen { background-color: #02100e; }
html.dark.theme-indigo  fuse-splash-screen { background-color: #0a0918; }
html.dark.theme-slate   fuse-splash-screen { background-color: #07090c; }

/* ─── Background blobs ───────────────────────────────────────────────────────── */

.splash-blob {
    position: absolute;
    width: 384px;
    height: 384px;
    border-radius: 50%;
    pointer-events: none;
    animation: splash-blob-pulse 4s ease-in-out infinite;
}

.splash-blob-tr {
    top: -48px; right: -48px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.12) 0%, transparent 70%);
    animation-direction: normal;
}

.splash-blob-bl {
    bottom: -48px; left: -48px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.10) 0%, transparent 70%);
    animation-direction: reverse;
    animation-delay: -2s;
}

@keyframes splash-blob-pulse {
    0%, 100% { transform: scale(1) translateX(0); }
    50%       { transform: scale(1.15) translateX(20px); }
}

/* ─── Main content ───────────────────────────────────────────────────────────── */

.splash-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

/* ─── Logo + pulse rings ─────────────────────────────────────────────────────── */

.splash-logo-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: splash-scale-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.splash-svg {
    position: relative;
    z-index: 2;
}

.splash-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--splash-c2) 40%, transparent);
    animation: splash-ring-expand 2s ease-out infinite;
}

.splash-ring-1 { animation-delay: 0s; }
.splash-ring-2 { animation-delay: 0.7s; }
.splash-ring-3 { animation-delay: 1.4s; }

@keyframes splash-ring-expand {
    0%   { width: 64px;  height: 64px;  opacity: 0.8; }
    100% { width: 180px; height: 180px; opacity: 0; }
}

@keyframes splash-scale-in {
    from { transform: scale(0.6); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* ─── Brand name ─────────────────────────────────────────────────────────────── */

.splash-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    animation: splash-fade-up 0.4s ease both;
    animation-delay: 0.25s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.splash-name {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--splash-c1), var(--splash-c2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.splash-tagline {
    font-size: 0.75rem;
    color: #9ca3af;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-text-fill-color: #9ca3af;
}

html.dark .splash-tagline {
    color: #6b7280;
    -webkit-text-fill-color: #6b7280;
}

@keyframes splash-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Progress bar ───────────────────────────────────────────────────────────── */

.splash-progress-wrap {
    width: 288px;
    animation: splash-fade-up 0.4s ease both;
    animation-delay: 0.4s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.splash-progress-track {
    position: relative;
    height: 6px;
    background-color: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
}

html.dark .splash-progress-track {
    background-color: #1f2937;
}

.splash-progress-fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--splash-c1), var(--splash-c2));
    animation: splash-progress 1.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.1s;
    width: 0%;
}

@keyframes splash-progress {
    0%   { width: 0%; }
    9%   { width: 20%; }
    23%  { width: 45%; }
    39%  { width: 65%; }
    61%  { width: 85%; }
    79%  { width: 95%; }
    100% { width: 100%; }
}

.splash-progress-shimmer {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: 64px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    border-radius: 999px;
    animation: splash-shimmer 1.4s ease-in-out infinite;
    animation-delay: 0.5s;
}

@keyframes splash-shimmer {
    0%   { transform: translateX(-64px); }
    100% { transform: translateX(352px); }
}
