/* =============================================================================
   Componente Loading — System Designer (template base)
   Overlay fullscreen bloqueante: impede interação até o processamento concluir.
   Uso global: formulários (submit) e todas as requisições AJAX.
   ============================================================================= */

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

body.dark-mode .loading-overlay {
    background: rgba(30, 30, 30, 0.9);
}

.loading-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.loading-overlay[aria-busy="true"] {
    pointer-events: auto;
}

.loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--surface-2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: loading-spin .8s linear infinite;
}

.loading-message {
    font-size: .9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

@keyframes loading-spin {
    to { transform: rotate(360deg); }
}
