/* ==========================================================================
   BluePoint Startup Shell - Futuristic Edition
   Premium loading experience shown while the Blazor circuit establishes.
   Brand palette: #1B4796 (primary), #00A7D8 (accent), #112c53 (deep navy)
   ========================================================================== */

/* --- Keyframes ------------------------------------------------------- */

@keyframes bpt-shell-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes bpt-shell-card-enter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes bpt-shell-orbital-rotate {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes bpt-shell-glow-spin {
    0%   { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes bpt-shell-pulse-soft {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50%      { opacity: 0.8; transform: scale(1.05); }
}

@keyframes bpt-shell-progress-ind {
    0%   { left: -40%; width: 40%; }
    100% { left: 100%; width: 40%; }
}

@keyframes bpt-shell-text-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* --- Full-screen overlay --------------------------------------------- */

.bpt-startup-shell {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    color: #112c53;
    background: #020a1a; /* Darker, more cinematic background */
    animation: bpt-shell-fade-in 600ms ease-out both;
    font-family: 'Poppins', sans-serif;
}

/* Futuristic rotating glow background */
.bpt-startup-shell__glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150vmax;
    height: 150vmax;
    background: conic-gradient(
        from 0deg at 50% 50%,
        rgba(27, 71, 150, 0) 0deg,
        rgba(0, 167, 216, 0.15) 120deg,
        rgba(27, 71, 150, 0) 240deg,
        rgba(0, 167, 216, 0.15) 360deg
    );
    animation: bpt-shell-glow-spin 15s linear infinite;
    pointer-events: none;
    opacity: 0.6;
}

.bpt-startup-shell--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* --- Card ------------------------------------------------------------ */

.bpt-startup-shell__card {
    position: relative;
    width: min(100%, 28rem);
    padding: 3rem 2.5rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(25px) saturate(1.8);
    -webkit-backdrop-filter: blur(25px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 0 80px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 167, 216, 0.05);
    text-align: center;
    animation: bpt-shell-card-enter 800ms cubic-bezier(0.16, 1, 0.3, 1) both;
    color: white;
}

/* --- Brand & Orbital -------------------------------------------------- */

.bpt-startup-shell__brand-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bpt-startup-shell__orbital {
    position: absolute;
    inset: -10px;
    border: 2px solid transparent;
    border-top: 2px solid rgba(0, 167, 216, 0.6);
    border-right: 2px solid rgba(27, 71, 150, 0.4);
    border-radius: 50%;
    animation: bpt-shell-orbital-rotate 2s linear infinite;
}

.bpt-startup-shell__orbital::before {
    content: "";
    position: absolute;
    top: 50%;
    right: -4px;
    width: 8px;
    height: 8px;
    background: #4FC3F7;
    border-radius: 50%;
    box-shadow: 0 0 15px #00A7D8;
}

.bpt-startup-shell__brand {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0, 167, 216, 0.2);
}

.bpt-startup-shell__brand img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0, 167, 216, 0.5));
}

/* --- Typography ------------------------------------------------------ */

.bpt-startup-shell__title {
    margin: 0 0 1.25rem;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    background: linear-gradient(90deg, #fff 0%, #00A7D8 50%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: bpt-shell-text-shimmer 3s linear infinite;
}

.bpt-startup-shell__status {
    margin: 0 0 2rem;
    font-size: 1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.05em;
}

/* --- Progress -------------------------------------------------------- */

.bpt-startup-shell__progress-container {
    width: 100%;
    margin-bottom: 1.5rem;
}

.bpt-startup-shell__progress-bar {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.bpt-startup-shell__progress-fill {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, #1B4796, #00A7D8);
    box-shadow: 0 0 10px #00A7D8;
    animation: bpt-shell-progress-ind 2s ease-in-out infinite;
}

.bpt-startup-shell__progress-steps {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.step-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.step-dot.active {
    background: #00A7D8;
    box-shadow: 0 0 8px #00A7D8;
    transform: scale(1.5);
}

.bpt-startup-shell__hint {
    display: none;
    margin-top: 1rem;
    font-size: 0.75rem;
    font-weight: 200;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

/* --- Retry Button ---------------------------------------------------- */

.bpt-startup-shell__retry {
    appearance: none;
    margin-top: 2rem;
    background: transparent;
    border: 1px solid rgba(0, 167, 216, 0.5);
    color: #00A7D8;
    padding: 0.8rem 2.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.bpt-startup-shell__retry::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 167, 216, 0.2), transparent);
    transition: 0.5s;
}

.bpt-startup-shell__retry:hover {
    background: rgba(0, 167, 216, 0.1);
    box-shadow: 0 0 20px rgba(0, 167, 216, 0.3);
    border-color: #00A7D8;
}

.bpt-startup-shell__retry:hover::before {
    left: 100%;
}

/* --- Error State ----------------------------------------------------- */

.bpt-startup-shell[data-state="error"] .bpt-startup-shell__title {
    background: linear-gradient(90deg, #ff5252, #f44336, #ff5252);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bpt-startup-shell[data-state="error"] .bpt-startup-shell__hint {
    display: block;
}

.bpt-startup-shell[data-state="error"] .bpt-startup-shell__orbital {
    border-top-color: #ff5252;
    border-right-color: #8b1d2c;
}

.bpt-startup-shell[data-state="error"] .bpt-startup-shell__orbital::before {
    background: #ff5252;
    box-shadow: 0 0 15px #ff5252;
}

.bpt-startup-shell[data-state="error"] .bpt-startup-shell__progress-fill {
    background: #f44336;
    box-shadow: 0 0 10px #f44336;
    animation: none;
    width: 100%;
}

.bpt-startup-shell[data-state="error"] .bpt-startup-shell__retry {
    border-color: #ff5252;
    color: #ff5252;
}

/* --- Responsive ------------------------------------------------------ */

@media (max-width: 640px) {
    .bpt-startup-shell__card {
        padding: 2.5rem 1.5rem;
    }

    .bpt-startup-shell__title {
        font-size: 1.2rem;
        letter-spacing: 0.04em;
    }

    .bpt-startup-shell__brand-container {
        width: 120px;
        height: 120px;
    }
}
