/**
 * Password Validator Styles
 * 
 * Provides styling for password validation indicators and requirements display
 * in the Omeda integration plugin.
 * 
 * @package WordPress_Omeda_Integration
 * @since 1.0.0
 */

/* Password Requirements Container */
.password-requirements {
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 3px;
}

.password-requirements h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    color: #495057;
}

.requirements-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.requirements-list li {
    position: relative;
    padding: 0.25rem 0 0.25rem 1.5rem;
    font-size: 1.25rem;
    color: #6c757d;
    transition: color 0.2s ease;
}

.requirements-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.75rem;
    width: 0.75rem;
    height: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    background-color: #fff;
    transition: all 0.2s ease;
}

/* Valid state */
.requirements-list li.valid {
    color: #198754;
}

.requirements-list li.valid::before {
    background-color: #198754;
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e");
    background-size: 0.5rem 0.5rem;
    background-position: center;
    background-repeat: no-repeat;
}

/* Invalid state */
.requirements-list li.invalid {
    color: #dc3545;
}

.requirements-list li.invalid::before {
    background-color: #dc3545;
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    background-size: 0.5rem 0.5rem;
    background-position: center;
    background-repeat: no-repeat;
}

/* Password Strength Meter */
.password-strength-container {
    margin: 0.5rem 0;
}

.password-strength-meter {
    width: 100%;
    height: 0.25rem;
    background-color: #e9ecef;
    border-radius: 0.125rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.password-strength-meter::before {
    content: '';
    display: block;
    height: 100%;
    width: 0%;
    background-color: #dc3545;
    transition: all 0.3s ease;
}

.password-strength-meter.very-weak::before {
    width: 25%;
    background-color: #dc3545;
}

.password-strength-meter.weak::before {
    width: 50%;
    background-color: #fd7e14;
}

.password-strength-meter.good::before {
    width: 75%;
    background-color: #ffc107;
}

.password-strength-meter.strong::before {
    width: 100%;
    background-color: #198754;
}

.password-strength-label {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
    display: block;
}

/* Password Field States */
.form-control.is-valid {
    border-color: #198754;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .password-requirements {
        margin: 0.75rem 0;
        padding: 0.75rem;
    }
    
    .requirements-list li {
        font-size: 0.8rem;
        padding: 0.2rem 0 0.2rem 1.25rem;
    }
    
    .requirements-list li::before {
        width: 0.625rem;
        height: 0.625rem;
        top: 0.4rem;
    }
}

/* Animation for requirement updates */
.requirements-list li {
    animation: fadeIn 0.3s ease;
}

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

/* Focus states for accessibility */
.password-requirements:focus-within {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .requirements-list li.valid {
        color: #000;
    }
    
    .requirements-list li.valid::before {
        background-color: #000;
        border-color: #000;
    }
    
    .requirements-list li.invalid {
        color: #000;
    }
    
    .requirements-list li.invalid::before {
        background-color: #000;
        border-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .requirements-list li,
    .password-strength-meter,
    .password-strength-meter::before {
        transition: none;
    }
    
    .requirements-list li {
        animation: none;
    }
}
