/* Branded WASM boot splash — pure HTML/CSS before Blazor starts */

.app-splash {
    --splash-primary: #6F3AFA;
    --splash-primary-soft: #e9e4f7;
    --splash-bg: #f8f7fc;
    --splash-text: #18181b;
    --splash-muted: #71717a;
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(111, 58, 250, 0.12) 0%, transparent 55%),
                linear-gradient(180deg, #fafafa 0%, var(--splash-bg) 100%);
    font-family: 'ExpoArabic', 'Noto Kufi Arabic', system-ui, sans-serif;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.app-splash--fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.app-splash__glow {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(111, 58, 250, 0.18) 0%, transparent 70%);
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.app-splash__shell {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: row;
    gap: 0;
    opacity: 0.35;
    pointer-events: none;
    padding: 0;
}

.app-splash__shell--rtl,
html[dir="rtl"] .app-splash__shell {
    flex-direction: row-reverse;
}

.app-splash__shell-sidebar {
    flex: 0 0 280px;
    width: 280px;
    background: #fff;
    border-right: 1px solid #e4e4e7;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.app-splash__shell--rtl .app-splash__shell-sidebar,
html[dir="rtl"] .app-splash__shell-sidebar {
    border-right: none;
    border-left: 1px solid #e4e4e7;
}

.app-splash__shell-main {
    flex: 1;
    min-width: 0;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.app-splash__shell-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #ececf1 0%, #f4f4f5 50%, #ececf1 100%);
    background-size: 200% 100%;
    animation: app-splash-shimmer 1.4s ease-in-out infinite;
}

.app-splash__shell-line--sm { width: 55%; height: 10px; }
.app-splash__shell-line--md { width: 78%; }
.app-splash__shell-line--lg { width: 92%; }

.app-splash__shell-card {
    flex: 1;
    min-height: 200px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e4e4e7;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-splash__panel {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: min(92vw, 360px);
    padding: 36px 32px 28px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #e4e4e7;
    box-shadow: 0 16px 48px rgba(17, 17, 26, 0.1);
    backdrop-filter: blur(8px);
}

.app-splash__logo {
    height: 44px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.app-splash__title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--splash-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.app-splash__status {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--splash-text);
    text-align: center;
    min-height: 1.4em;
}

.app-splash__progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--splash-primary-soft);
    overflow: hidden;
    position: relative;
}

.app-splash__progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #6F3AFA, #8A5CF5);
    transition: width 0.25s ease-out;
}

.app-splash__tip {
    margin: 0;
    min-height: 2.6em;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--splash-muted);
    text-align: center;
    transition: opacity 0.3s ease;
}

.app-splash__tip--fade {
    opacity: 0;
}

.app-splash__percent {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--splash-muted);
    font-variant-numeric: tabular-nums;
}

/* Phase 2: Blazor Authorizing — same look, overlays app */
.app-splash--phase-auth {
    z-index: 3000;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(111, 58, 250, 0.08) 0%, transparent 55%),
                linear-gradient(180deg, #fafafa 0%, var(--splash-bg) 100%);
}

@keyframes app-splash-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.app-splash__progress-bar--indeterminate {
    width: 42% !important;
    animation: app-splash-indeterminate 1.15s ease-in-out infinite;
}

@keyframes app-splash-indeterminate {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(320%); }
}

@media (max-width: 768px) {
    .app-splash__shell {
        display: none;
    }

    .app-splash__panel {
        width: min(94vw, 340px);
        padding: 28px 24px 24px;
    }
}
