html.phoenix-loading {
    overflow: hidden;
}

html.phoenix-loading body > *:not(.phoenix-loader) {
    visibility: hidden;
}

.phoenix-loader {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #bdeeff;
    background:
        radial-gradient(circle at 50% 45%, rgba(12, 102, 183, 0.17), transparent 31%),
        linear-gradient(135deg, #01040a, #020b16 55%, #01040a);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.48s ease, visibility 0.48s ease;
}

.phoenix-loader.is-finished {
    opacity: 0;
    visibility: hidden;
}

.phoenix-loader::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(23, 140, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23, 140, 255, 0.05) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle, black, transparent 75%);
}

.phoenix-loader::after {
    content: "";
    position: absolute;
    left: -20%;
    right: -20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #62d9ff, transparent);
    box-shadow: 0 0 22px #178cff;
    animation: phoenix-loader-scan 1.7s linear infinite;
}

.phoenix-loader-card {
    position: relative;
    z-index: 2;
    width: min(560px, calc(100vw - 36px));
    padding: 42px;
    border: 1px solid rgba(56, 181, 255, 0.48);
    background: rgba(2, 13, 25, 0.86);
    box-shadow:
        0 0 70px rgba(0, 92, 190, 0.16),
        inset 0 0 45px rgba(0, 104, 210, 0.06);
    clip-path: polygon(
        20px 0,
        100% 0,
        100% calc(100% - 20px),
        calc(100% - 20px) 100%,
        0 100%,
        0 20px
    );
}

.phoenix-loader-brand {
    display: flex;
    align-items: center;
    gap: 17px;
}

.phoenix-loader-emblem {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    color: #62d9ff;
    border: 1px solid #4cbcff;
    background: rgba(14, 99, 174, 0.09);
    box-shadow: 0 0 24px rgba(23, 140, 255, 0.24);
    font-size: 26px;
    clip-path: polygon(20% 0, 80% 0, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0 80%, 0 20%);
}

.phoenix-loader-brand strong,
.phoenix-loader-brand span {
    display: block;
}

.phoenix-loader-brand strong {
    color: #e6f8ff;
    font-size: 18px;
    letter-spacing: 7px;
}

.phoenix-loader-brand span {
    margin-top: 5px;
    color: #54758b;
    font: 10px Consolas, monospace;
    letter-spacing: 3px;
}

.phoenix-loader-status {
    min-height: 20px;
    margin-top: 38px;
    color: #62d9ff;
    font: 11px Consolas, monospace;
    letter-spacing: 2px;
}

.phoenix-loader-progress {
    height: 6px;
    margin-top: 15px;
    padding: 1px;
    border: 1px solid rgba(56, 181, 255, 0.38);
    background: rgba(0, 4, 9, 0.8);
}

.phoenix-loader-progress i {
    width: 0;
    height: 100%;
    display: block;
    background: linear-gradient(90deg, #096ad0, #62d9ff);
    box-shadow: 0 0 16px rgba(37, 153, 255, 0.7);
    transition: width 0.18s ease;
}

.phoenix-loader-footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 14px;
    color: #54758b;
    font: 9px Consolas, monospace;
    letter-spacing: 1.5px;
}

.phoenix-loader-percent {
    color: #62d9ff;
}

body.phoenix-page-ready > *:not(.phoenix-loader) {
    animation: phoenix-interface-enter 0.62s ease both;
}

@keyframes phoenix-loader-scan {
    from { top: -4%; opacity: 0; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    to { top: 104%; opacity: 0; }
}

@keyframes phoenix-interface-enter {
    from {
        opacity: 0;
        transform: translateY(9px);
        filter: blur(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@media (max-width: 600px) {
    .phoenix-loader-card {
        padding: 28px 22px;
    }

    .phoenix-loader-brand strong {
        font-size: 14px;
        letter-spacing: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .phoenix-loader::after {
        animation: none;
    }

    .phoenix-loader,
    .phoenix-loader-progress i {
        transition-duration: 0.1s;
    }
}