.aimesen-loading-modal {
    --loading-backdrop: rgba(246, 248, 252, 0.82);
    --loading-card: rgba(255, 255, 255, 0.94);
    --loading-border: rgba(35, 47, 62, 0.11);
    --loading-shadow: rgba(30, 43, 59, 0.16);
    --loading-accent: #f5c71d;
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    background: var(--loading-backdrop);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    transition: opacity 160ms ease, visibility 0s linear 160ms;
}

.theme-night .aimesen-loading-modal {
    --loading-backdrop: rgba(7, 10, 16, 0.80);
    --loading-card: rgba(19, 24, 34, 0.96);
    --loading-border: rgba(255, 255, 255, 0.12);
    --loading-shadow: rgba(0, 0, 0, 0.35);
    --loading-accent: #ffdc50;
}

.aimesen-loading-modal.is-visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0s;
}

.aimesen-loading-modal__card {
    position: relative;
    display: grid;
    place-items: center;
    width: 132px;
    height: 112px;
    overflow: hidden;
    border: 1px solid var(--loading-border);
    border-radius: 27px;
    background: var(--loading-card);
    box-shadow: 0 18px 50px var(--loading-shadow);
    transform: translateY(7px) scale(0.96);
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.aimesen-loading-modal.is-visible .aimesen-loading-modal__card {
    transform: translateY(0) scale(1);
}

.aimesen-loading-modal__logo-wrap {
    position: relative;
    z-index: 2;
    width: 86px;
}

.aimesen-loading-modal__logo {
    display: block;
    width: 100%;
    height: auto;
    animation: aimesen-loading-logo-float 1.25s ease-in-out infinite;
}

.aimesen-loading-modal__logo--night {
    display: none;
}

.theme-night .aimesen-loading-modal__logo--light {
    display: none;
}

.theme-night .aimesen-loading-modal__logo--night {
    display: block;
}

.aimesen-loading-modal__orbit {
    position: absolute;
    inset: 14px;
    border: 1px solid color-mix(in srgb, var(--loading-accent) 27%, transparent);
    border-radius: 50%;
    animation: aimesen-loading-orbit 1.7s linear infinite;
}

.aimesen-loading-modal__orbit::after {
    position: absolute;
    top: -4px;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--loading-accent);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--loading-accent) 14%, transparent);
    content: "";
}

.aimesen-loading-modal__dots {
    position: absolute;
    bottom: 13px;
    left: 50%;
    z-index: 3;
    display: flex;
    gap: 5px;
    transform: translateX(-50%);
}

.aimesen-loading-modal__dots i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--loading-accent);
    animation: aimesen-loading-dot 900ms ease-in-out infinite;
}

.aimesen-loading-modal__dots i:nth-child(2) {
    animation-delay: 120ms;
}

.aimesen-loading-modal__dots i:nth-child(3) {
    animation-delay: 240ms;
}

@keyframes aimesen-loading-logo-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes aimesen-loading-orbit {
    to { transform: rotate(360deg); }
}

@keyframes aimesen-loading-dot {
    0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
    .aimesen-loading-modal,
    .aimesen-loading-modal__card {
        transition: none;
    }

    .aimesen-loading-modal__logo,
    .aimesen-loading-modal__orbit,
    .aimesen-loading-modal__dots i {
        animation: none;
    }
}
