/**
 * Overlay chargement Jupiter — style workbench, compteur de profondeur,
 * déblocage auto si notify(false) manquant.
 */
#espocrm-fullscreen-loading {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: min(140px, 18vh);
    overflow: hidden;
    background: rgba(245, 248, 250, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: espocrm-fs-fade-in 0.2s ease-out;
}

@keyframes espocrm-fs-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.espocrm-fullscreen-loading__inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.espocrm-fullscreen-loading__box {
    text-align: center;
    padding: 28px 36px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(15, 32, 61, 0.12);
    border: 1px solid #DFE3EB;
    min-width: 300px;
    max-width: 90vw;
}

.espocrm-fullscreen-loading__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E0F7FA 0%, #ECFDF5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.espocrm-fullscreen-loading__icon i {
    font-size: 26px;
    color: #0091AE;
    position: relative;
    z-index: 1;
}

.espocrm-fullscreen-loading__icon::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 3px solid #E5EBF0;
    border-top-color: #0091AE;
    border-right-color: #008000;
    animation: espocrm-fs-spin 0.85s linear infinite;
}

@keyframes espocrm-fs-spin {
    to { transform: rotate(360deg); }
}

.espocrm-fullscreen-loading__message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.espocrm-fullscreen-loading__line--primary {
    display: block;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #33475B;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.espocrm-fullscreen-loading__line--secondary {
    display: block;
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    color: #64748B;
    line-height: 1.4;
}

body.espocrm-fullscreen-loading-active {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .espocrm-fullscreen-loading__icon::before {
        animation-duration: 2s;
    }

    #espocrm-fullscreen-loading {
        animation: none;
    }
}
