/* Efeito de carregamento para botões de submit */

/* Estados de carregamento do botão */
.btn.loading,
.login-btn.loading {
    cursor: not-allowed !important;
    pointer-events: none;
    transform: none !important;
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%) !important;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 10px 30px rgba(30, 58, 138, 0.4),
        0 0 0 0 rgba(59, 130, 246, 0.7) !important;
    animation: glow 2s infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 
            0 10px 30px rgba(30, 58, 138, 0.4),
            0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        box-shadow: 
            0 10px 30px rgba(30, 58, 138, 0.6),
            0 0 0 10px rgba(59, 130, 246, 0);
    }
}

.btn.loading::before,
.login-btn.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.btn.loading:hover,
.login-btn.loading:hover {
    transform: none !important;
    box-shadow: 0 10px 30px rgba(30, 58, 138, 0.4) !important;
}

.btn.loading .indicator-label,
.login-btn.loading .indicator-label {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
}

.btn.loading .indicator-progress,
.login-btn.loading .indicator-progress {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.4s ease;
}

.indicator-progress {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(10px);
    opacity: 0;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: relative;
}

.spinner::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading dots alternativo */
.loading-dots {
    display: none;
    gap: 4px;
    align-items: center;
}

.btn.loading .loading-dots,
.login-btn.loading .loading-dots {
    display: flex;
}

.loading-dots .dot {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    animation: dots 1.4s infinite ease-in-out;
}

.loading-dots .dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dots .dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dots .dot:nth-child(3) { animation-delay: 0s; }

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

/* Efeito de pulso no botão durante carregamento */
.btn.loading,
.login-btn.loading {
    animation: glow 2s infinite;
}

/* Barra de progresso animada */
.btn.loading::before,
.login-btn.loading::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #10B981, #3B82F6, #EF4444);
    animation: progress 3s ease-in-out infinite;
    z-index: 1;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Garantir que botões tenham posição relativa para o spinner */
.btn,
.login-btn {
    position: relative;
}

/* Efeito de loading para botões sem spinner personalizado */
.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Texto de feedback durante carregamento */
.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading .loading-text {
    opacity: 1;
    animation: fadeInOut 2s infinite;
}

.btn-text,
.loading-text {
    transition: opacity 0.3s ease;
    font-weight: 600;
    color: white;
}

.loading-text {
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Efeito de ondas que se expandem */
.btn.loading::after,
.login-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    animation: ripple 2s infinite;
    pointer-events: none;
}

@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 0.5;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* Efeito de partículas flutuantes */
.btn.loading .particles,
.login-btn.loading .particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 80%, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px, 30px 30px, 40px 40px;
    animation: float 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
} 