.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 42, 141, 0.03) 0%, rgba(255, 255, 255, 0.98) 50%, rgba(0, 81, 187, 0.03) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-overlay.active {
    display: flex;
    opacity: 1;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.loading-content {
    text-align: center;
    padding: 3rem 2.5rem;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 42, 141, 0.15),
                0 0 1px rgba(0, 42, 141, 0.1);
    min-width: 320px;
    max-width: 400px;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.loading-logo {
    width: 96px !important;
    height: 96px !important;
    margin: 0 auto 2rem;
    object-fit: contain;
    animation: logoFadeIn 0.6s ease-out 0.2s both;
}

@keyframes logoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-spinner {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.75rem;
    position: relative;
}

.spinner-ring {
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-radius: 50%;
    position: relative;
}

.spinner-ring::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: #002A8D;
    border-right-color: #0051BB;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.spinner-ring::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-bottom-color: #002A8D;
    border-left-color: rgba(0, 42, 141, 0.3);
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite reverse;
}

.loading-text {
    color: #002A8D;
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
    line-height: 1.4;
    animation: textFade 0.5s ease-out 0.3s both;
}

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

.loading-subtext {
    color: #6B7280;
    font-size: 0.9375rem;
    margin: 0;
    opacity: 0.85;
    font-weight: 500;
    animation: textFade 0.5s ease-out 0.4s both;
}

@keyframes spin {
    0% { 
        transform: rotate(0deg);
    }
    100% { 
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .loading-content {
        padding: 2.5rem 2rem;
        min-width: 280px;
        border-radius: 20px;
    }
    
    .loading-logo {
        width: 96px !important;
        height: 96px !important;
        margin-bottom: 1.75rem;
    }
    
    .loading-spinner {
        width: 48px;
        height: 48px;
        margin-bottom: 1.5rem;
    }
    
    .loading-text {
        font-size: 1rem;
    }
    
    .loading-subtext {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .loading-content {
        padding: 2rem 1.5rem;
        min-width: 260px;
        border-radius: 16px;
    }
    
    .loading-logo {
        width: 96px !important;
        height: 96px !important;
        margin-bottom: 1.5rem;
    }
    
    .loading-spinner {
        width: 44px;
        height: 44px;
    }
    
    .loading-text {
        font-size: 0.9375rem;
    }
    
    .loading-subtext {
        font-size: 0.8125rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .loading-overlay,
    .loading-content,
    .loading-logo,
    .loading-text,
    .loading-subtext {
        animation: none !important;
        transition: none !important;
    }
    
    .spinner-ring::before,
    .spinner-ring::after {
        animation: spin 3s linear infinite !important;
    }
}
