/* Loading indicator, see loading.js */
.page-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 3000;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.page-loading-bar::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    background: #56328c;
    box-shadow: 0 0 6px rgba(86, 50, 140, 0.6);
    animation: page-loading-slide 1.1s ease-in-out infinite;
}

.page-loading-bar.is-active {
    opacity: 1;
}

@keyframes page-loading-slide {
    from { left: -40%; }
    to { left: 100%; }
}

/* Large purple spinner in the middle of the screen over a light veil. */
.page-loading-notice {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.55);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
}

.page-loading-notice.is-active {
    opacity: 1;
    visibility: visible;
}

.page-loading-circle {
    width: 56px;
    height: 56px;
    border: 5px solid rgba(86, 50, 140, 0.2);
    border-top-color: #56328c;
    border-radius: 50%;
    animation: page-loading-spin 0.8s linear infinite;
}

.is-loading::after {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: page-loading-spin 0.7s linear infinite;
}

/* Spinner next to the text of the clicked button. */
.is-loading {
    cursor: progress !important;
    opacity: 0.85;
}

.is-loading::after {
    content: "";
    margin-left: 0.5em;
    vertical-align: -0.15em;
}

.page-is-loading,
.page-is-loading * {
    cursor: progress !important;
}

@keyframes page-loading-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .page-loading-bar::before {
        left: 0;
        width: 100%;
        animation: none;
        opacity: 0.7;
    }

    .page-loading-circle,
    .is-loading::after {
        animation-duration: 2s;
    }
}
