/**
 * LOADER REUTILIZÁVEL
 * Componente de loading overlay com fundo transparente
 * Pode ser usado para operações assíncronas (envio de email, upload, etc)
 */

/* Overlay do loader - fundo transparente claro */
.async-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(3px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

.async-loader.active {
    display: flex;
}

/* Caixa do loader */
.async-loader-box {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    min-width: 280px;
}

/* Container do spinner */
.async-spinner-container {
    position: relative;
    width: 60px;
    height: 60px;
}

/* Spinner animado */
.async-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #e3f2fd;
    border-top-color: #003366;
    border-radius: 50%;
    animation: async-spin 1s linear infinite;
}

@keyframes async-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Logo/ícone central no spinner */
.async-loader-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* Texto do loader */
.async-loader-text {
    color: #003366;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin: 0;
}

.async-loader-subtext {
    color: #666;
    font-size: 13px;
    text-align: center;
    margin: -10px 0 0 0;
}

/* Variantes de cor */
.async-loader-box.success {
    border-left: 4px solid #4caf50;
}

.async-loader-box.error {
    border-left: 4px solid #f44336;
}

.async-loader-box.warning {
    border-left: 4px solid #ff9800;
}

.async-loader-box.info {
    border-left: 4px solid #2196f3;
}
