/**
 * Validador de Senha v2 - Versão Limpa e Moderna
 * Autor: Dante Testa (https://dantetesta.com.br)
 * Data: 02/11/2025 15:30
 */

.password-validator-v2 {
    margin-top: 8px;
}

/* Barra de força */
.password-strength-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-fill[data-strength="0"] {
    width: 0%;
    background: #e5e7eb;
}

.strength-fill[data-strength="1"] {
    background: #ef4444;
}

.strength-fill[data-strength="2"] {
    background: #f59e0b;
}

.strength-fill[data-strength="3"] {
    background: #3b82f6;
}

.strength-fill[data-strength="4"] {
    background: #10b981;
}

/* Texto de força */
.password-strength-text {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
    min-height: 18px;
}

.password-strength-text.strength-1 {
    color: #ef4444;
}

.password-strength-text.strength-2 {
    color: #f59e0b;
}

.password-strength-text.strength-3 {
    color: #3b82f6;
}

.password-strength-text.strength-4 {
    color: #10b981;
}

/* Ações */
.password-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn-toggle-password,
.btn-generate-password {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-toggle-password {
    padding: 6px 10px;
}

.btn-toggle-password:hover,
.btn-generate-password:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.btn-generate-password {
    color: #2563eb;
    border-color: #2563eb;
}

.btn-generate-password:hover {
    background: #eff6ff;
    border-color: #1d4ed8;
    color: #1d4ed8;
}

/* Animação quando senha é gerada */
.password-generated {
    animation: passwordGenerated 0.5s ease;
}

@keyframes passwordGenerated {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    }
}

/* Toast de notificação */
.password-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1f2937;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10000;
}

.password-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Botão único de gerar senha (entre os campos) */
.password-generate-container {
    margin: 16px 0;
    text-align: center;
}

.btn-generate-both-passwords {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #2563eb;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.btn-generate-both-passwords:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

.btn-generate-both-passwords:active {
    transform: translateY(0);
}

.btn-generate-both-passwords i {
    font-size: 16px;
}

/* Responsivo */
@media (max-width: 640px) {
    .password-actions {
        flex-direction: column;
    }
    
    .btn-toggle-password,
    .btn-generate-password {
        width: 100%;
        justify-content: center;
    }
    
    .btn-generate-both-passwords {
        width: 100%;
        justify-content: center;
    }
}
