/* ========================================
   VALIDAÇÃO DE SENHA EM TEMPO REAL
   ======================================== */

/* Container de requisitos de senha */
.password-requirements {
    margin-top: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #6c757d;
    font-size: 0.875rem;
}

.password-requirements.show {
    display: block;
}

.password-requirements.hide {
    display: none;
}

/* Título dos requisitos */
.password-requirements-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.password-requirements-title i {
    font-size: 1rem;
}

/* Lista de requisitos */
.password-requirements-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.password-requirement-item {
    padding: 4px 0;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.password-requirement-item i {
    width: 16px;
    font-size: 0.875rem;
}

/* Requisito não atendido */
.password-requirement-item.invalid {
    color: #dc3545;
}

.password-requirement-item.invalid i {
    color: #dc3545;
}

/* Requisito atendido */
.password-requirement-item.valid {
    color: #28a745;
    font-weight: 500;
}

.password-requirement-item.valid i {
    color: #28a745;
}

/* Barra de força da senha */
.password-strength {
    margin-top: 8px;
}

.password-strength-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

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

/* Níveis de força */
.password-strength-fill.weak {
    width: 33%;
    background: linear-gradient(90deg, #dc3545, #e35d6a);
}

.password-strength-fill.medium {
    width: 66%;
    background: linear-gradient(90deg, #ffc107, #ffcd39);
}

.password-strength-fill.strong {
    width: 100%;
    background: linear-gradient(90deg, #28a745, #48bb78);
}

/* Texto da força */
.password-strength-text {
    margin-top: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: right;
}

.password-strength-text.weak {
    color: #dc3545;
}

.password-strength-text.medium {
    color: #ffc107;
}

.password-strength-text.strong {
    color: #28a745;
}

/* Campo de senha com ícone de visualização */
.password-field-wrapper {
    position: relative;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
    z-index: 5;
}

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

.password-toggle-btn:focus {
    outline: none;
    color: #28a745;
}

/* Ajuste no input quando tem botão de toggle */
.password-field-wrapper input {
    padding-right: 45px;
}

/* Confirmação de senha */
.password-match-feedback {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    display: none;
}

.password-match-feedback.show {
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-match-feedback.match {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.password-match-feedback.mismatch {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.password-match-feedback i {
    font-size: 1rem;
}

/* Estados do campo de senha */
input.password-valid {
    border-color: #28a745 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

input.password-invalid {
    border-color: #dc3545 !important;
}

/* Animações */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.password-requirements.show {
    animation: slideDown 0.3s ease;
}

/* Responsividade */
@media (max-width: 576px) {
    .password-requirements {
        padding: 10px;
        font-size: 0.8125rem;
    }
    
    .password-requirement-item {
        padding: 3px 0;
    }
    
    .password-strength-text {
        font-size: 0.75rem;
    }
}

/* Dark mode support (opcional) */
@media (prefers-color-scheme: dark) {
    .password-requirements {
        background: #2d3748;
        border-left-color: #4a5568;
    }
    
    .password-requirements-title {
        color: #e2e8f0;
    }
    
    .password-requirement-item {
        color: #a0aec0;
    }
    
    .password-strength-bar {
        background: #4a5568;
    }
}

/* Tooltip para requisitos */
.password-requirement-tooltip {
    position: relative;
    cursor: help;
}

.password-requirement-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    bottom: 100%;
    background: #2d3748;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    margin-bottom: 5px;
    z-index: 10;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Indicador de senha forte */
.password-strength-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.password-strength-badge.weak {
    background: #fee;
    color: #dc3545;
}

.password-strength-badge.medium {
    background: #fff8e1;
    color: #f57c00;
}

.password-strength-badge.strong {
    background: #e8f5e9;
    color: #2e7d32;
}