/* Centered screen veil; scoped to the form area when used inside a modal. */
.crm-wait-global,
.crm-wait-local {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 20px;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
    background: rgb(26 48 59 / 24%);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: crm-wait-reveal 180ms ease-out;
}

.crm-wait-global[hidden],
.crm-wait-local[hidden] {
    display: none;
}

.crm-wait-global {
    position: fixed;
    inset: 0;
    z-index: 21000;
}

.crm-wait-local {
    position: absolute;
    inset: 0;
}

.wm-loading:has(>.crm-wait-local) {
    background: transparent;
}

.crm-wait-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: min(100%, 340px);
    box-sizing: border-box;
    padding: 30px 24px 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--canvas);
    box-shadow: 0 16px 50px rgb(20 48 54 / 20%);
    text-align: center;
    overflow-wrap: anywhere;
}

.crm-wait-card>span:not(.crm-wait-spinner) {
    font-weight: 650;
}

.crm-wait-card small {
    font-size: 12px;
    color: var(--muted);
    max-width: 260px;
}

.crm-wait-card button {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 28px;
    min-height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--muted);
}

/* CSS delay survives suspension of outgoing-page JavaScript timers. */
.crm-wait-native {
    opacity: 0;
    visibility: hidden;
    animation: crm-wait-reveal 180ms ease-out 900ms forwards !important;
}

@keyframes crm-wait-reveal {
    from {
        opacity: 0;
        visibility: visible;
    }

    to {
        opacity: 1;
        visibility: visible;
    }
}

.crm-wait-spinner {
    position: relative;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    box-sizing: border-box;
    border: 3px solid var(--line);
    border-top-color: var(--crm-teal);
    border-right-color: var(--crm-teal);
    border-radius: 50%;
    animation: crm-wait-spin 900ms linear infinite;
}

.crm-wait-spinner::after {
    content: "";
    position: absolute;
    inset: 7px;
    border: 2px solid transparent;
    border-left-color: var(--crm-teal);
    border-bottom-color: var(--crm-teal);
    border-radius: 50%;
    opacity: .5;
    animation: crm-wait-spin 1200ms linear reverse infinite;
}

@keyframes crm-wait-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {

    .crm-wait-spinner,
    .crm-wait-spinner::after,
    .crm-wait-global,
    .crm-wait-local {
        animation: none;
    }

    .crm-wait-native {
        animation: crm-wait-reveal 1ms step-end 900ms forwards !important;
    }
}

@media (max-width: 600px) {

    .crm-wait-global,
    .crm-wait-local {
        padding: 16px;
    }

    .crm-wait-card {
        padding: 28px 20px 22px;
    }
}

@media print {

    .crm-wait-global,
    .crm-wait-local {
        display: none !important;
    }
}