.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-spinner.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.loading-spinner-container {
    position: relative;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 26px;
}

/* Icon on top, a gentle breathing pulse to feel alive */
.spinner-logo {
    order: -1;                 /* keep the icon above the dots */
    width: 52px;
    height: 52px;
    object-fit: contain;
    z-index: 10001;
    animation: logo-breathe 1.8s ease-in-out infinite;
}

@keyframes logo-breathe {
    0%, 100% { transform: scale(1);    opacity: 0.9; }
    50%      { transform: scale(1.07); opacity: 1; }
}

/* Below the icon: a row of dots riding a smooth wave, navy -> red brand ramp */
.spinner-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 22px;
}

.spinner-circle span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(15, 31, 122, 0.22);
    animation: dot-wave 1.3s cubic-bezier(0.45, 0, 0.35, 1) infinite;
}

.spinner-circle span:nth-child(1) { background: #0f1f7a; animation-delay: -0.60s; }
.spinner-circle span:nth-child(2) { background: #3b1966; animation-delay: -0.45s; }
.spinner-circle span:nth-child(3) { background: #681451; animation-delay: -0.30s; }
.spinner-circle span:nth-child(4) { background: #940e3d; animation-delay: -0.15s; }
.spinner-circle span:nth-child(5) { background: #c10828; animation-delay: 0s; }

@keyframes dot-wave {
    0%, 60%, 100% { transform: translateY(0) scale(0.85); opacity: 0.45; }
    30%           { transform: translateY(-10px) scale(1.25); opacity: 1; }
}

/* Respect users who ask for less motion */
@media (prefers-reduced-motion: reduce) {
    .spinner-logo,
    .spinner-circle span {
        animation-duration: 0.001s;
        animation-iteration-count: 1;
    }
    .spinner-circle span {
        opacity: 0.7;
        transform: none;
    }
}
