#loading {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 999999;
    background: rgba(255, 255, 255, 0.95);
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    outline: 0;
}

.loading-body {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    min-width: 320px;
}

.loading-card {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    border-radius: 1rem;
    padding: 2rem 2.5rem;
    box-shadow: 0 20px 60px rgba(8, 145, 178, 0.3);
    text-align: center;
    min-width: 320px;
}

.loading-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
}

.loading-icon i {
    font-size: 64px;
    color: #fff;
    animation: spin 2s linear infinite;
    display: block;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.loading-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.loading-progress {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.loading-progress span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    animation: bounce 1.4s ease-in-out infinite;
}

.loading-progress span:nth-child(1) {
    animation-delay: 0s;
}

.loading-progress span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-progress span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.loading-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.loading-footer-text {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.loading-footer-text i {
    color: #10b981;
}

/* Spinner legado (templates AdminLTE nao migrados: base.xhtml, index.xhtml).
   Preserva o markup `lds-ellipsis` para que essas paginas tenham um loading visivel
   em vez de apenas o overlay branco de #loading. */
.lds-ellipsis {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.lds-ellipsis div {
    position: absolute;
    top: 33px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #0891b2;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.lds-ellipsis div:nth-child(1) {
    left: 8px;
    animation: lds-ellipsis1 0.6s infinite;
}

.lds-ellipsis div:nth-child(2) {
    left: 8px;
    animation: lds-ellipsis2 0.6s infinite;
}

.lds-ellipsis div:nth-child(3) {
    left: 32px;
    animation: lds-ellipsis2 0.6s infinite;
}

.lds-ellipsis div:nth-child(4) {
    left: 56px;
    animation: lds-ellipsis3 0.6s infinite;
}

@keyframes lds-ellipsis1 {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes lds-ellipsis2 {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(24px, 0);
    }
}

@keyframes lds-ellipsis3 {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0);
    }
}
