/**
 * Estilos para validação de formulário de registro
 * Meu Lucro Financeiro - Sistema de Gestão Financeira
 */

/* ==================== FEEDBACK DE VALIDAÇÃO ==================== */

.is-valid {
    border-color: #198754 !important;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.15) !important;
}

.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15) !important;
}

.feedback-validation {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    animation: fadeIn 0.3s ease-in;
}

.feedback-validation i {
    margin-right: 0.25rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== BARRA DE FORÇA DA SENHA ==================== */

.password-strength-container {
    margin-top: 0.5rem;
    width: 100%;
}

.password-strength-bar {
    height: 6px;
    border-radius: 3px;
    background-color: #e9ecef;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.password-strength-bar.weak {
    background: linear-gradient(90deg, #dc3545 0%, #dc3545 100%);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.password-strength-bar.medium {
    background: linear-gradient(90deg, #ffc107 0%, #ffc107 100%);
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.password-strength-bar.strong {
    background: linear-gradient(90deg, #198754 0%, #198754 100%);
    box-shadow: 0 2px 4px rgba(25, 135, 84, 0.3);
}

.password-strength-text {
    font-size: 0.875rem;
    font-weight: 600;
}

/* ==================== REQUISITOS DE SENHA ==================== */

#password-requirements {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

#password-requirements li {
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

#password-requirements li i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

#password-requirements li.valid {
    color: #198754 !important;
}

#password-requirements li.valid i::before {
    content: "\f26b"; /* bi-check-circle-fill */
    color: #198754;
}

#password-requirements li.invalid {
    color: #dc3545 !important;
}

#password-requirements li.invalid i::before {
    content: "\f623"; /* bi-x-circle-fill */
    color: #dc3545;
}

#password-requirements li.text-muted i::before {
    content: "\f287"; /* bi-circle */
}

/* ==================== INDICADORES DE CAMPO ====================  */

.form-label.required::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ==================== BOTÕES DE VISUALIZAÇÃO DE SENHA ==================== */

.btn-toggle-password {
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    transition: color 0.2s ease;
}

.btn-toggle-password:hover {
    color: #0d6efd;
}

.btn-toggle-password:focus {
    outline: none;
    color: #0d6efd;
}

/* ==================== ALERTAS INFORMATIVOS ==================== */

.alert-info-custom {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f4ff 100%);
    border: 1px solid #90caf9;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.alert-info-custom strong {
    color: #1976d2;
}

.alert-info-custom ul {
    margin-bottom: 0;
    margin-top: 0.5rem;
}

/* ==================== ANIMAÇÕES ==================== */

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake-error {
    animation: shake 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse-success {
    animation: pulse 0.3s ease-in-out;
}

/* ==================== LOADING STATES ==================== */

.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* ==================== RESPONSIVIDADE ==================== */

@media (max-width: 768px) {
    #password-requirements {
        font-size: 0.8rem;
    }
    
    .feedback-validation {
        font-size: 0.8rem;
    }
    
    .password-strength-bar {
        height: 5px;
    }
}

/* ==================== DARK MODE (OPCIONAL) ==================== */

@media (prefers-color-scheme: dark) {
    .is-valid {
        border-color: #20c997 !important;
    }
    
    .is-invalid {
        border-color: #e74c3c !important;
    }
    
    .password-strength-bar {
        background-color: #343a40;
    }
    
    .alert-info-custom {
        background: linear-gradient(135deg, #1e2a3a 0%, #2c3e50 100%);
        border-color: #34495e;
        color: #ecf0f1;
    }
}

/* ==================== ACESSIBILIDADE ==================== */

.form-control:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==================== TOOLTIP DE VALIDAÇÃO ==================== */

.validation-tooltip {
    position: absolute;
    z-index: 1000;
    background-color: #000;
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.validation-tooltip.show {
    opacity: 0.9;
}

/* ==================== MELHORIAS VISUAIS ==================== */

.form-control.is-valid:focus,
.form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

/* Placeholder personalizado */
.form-control::placeholder {
    color: #adb5bd;
    opacity: 0.7;
}

.form-control:focus::placeholder {
    opacity: 0.5;
}




































