/* ==========================================
   CENTRALIZED PASSWORD STYLING
   All password-related CSS consolidated here
   ========================================== */

/* ==========================================
   PASSWORD INPUT STYLING
   Basic password field styling
   ========================================== */

.form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background-color: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input[type="password"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    background-color: #fafafa;
}

.form-group input[type="password"]:invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* ==========================================
   PASSWORD HELP AND GUIDANCE
   Helper text and guidance for password fields
   ========================================== */

.password-help {
    margin-top: 5px;
}

.password-help small {
    color: #6c757d;
    font-size: 12px;
}

.password-placeholder {
    color: #6c757d;
}

/* ==========================================
   PASSWORD STRENGTH INDICATORS
   Visual feedback for password strength
   ========================================== */

.password-strength-container {
    margin-top: 8px;
}

.password-strength-meter {
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, #e9ecef 0%, #e9ecef 100%);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.4s ease;
    border-radius: 4px;
    background: linear-gradient(90deg, #dc3545 0%, #fd7e14 25%, #ffc107 50%, #28a745 100%);
    background-size: 400% 100%;
    animation: strengthPulse 2s ease-in-out infinite;
}

@keyframes strengthPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.password-strength-text {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.password-strength-header {
    margin-bottom: 5px;
}

.password-strength-level {
    font-weight: bold;
}

.password-strength-level[data-color="#28a745"] {
    color: #28a745;
}

.password-strength-level[data-color="#ffc107"] {
    color: #ffc107;
}

.password-strength-level[data-color="#dc3545"] {
    color: #dc3545;
}

.password-entropy-info {
    font-size: 11px;
    opacity: 0.8;
    color: #6c757d;
}

/* ==========================================
   PASSWORD REQUIREMENTS SECTIONS
   Requirements display with enhanced styling
   ========================================== */

.password-requirements-enhanced {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 18px;
    margin: 15px 0;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.password-requirements-enhanced:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.password-requirements-enhanced h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-requirements-enhanced h4::before {
    content: "🔒";
    font-size: 18px;
}

.password-requirements {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-top: 10px;
    font-size: 13px;
}

.password-requirements h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 14px;
}

.password-requirements ul {
    margin: 0;
    padding-left: 20px;
    color: #6c757d;
}

.password-requirements li {
    margin-bottom: 4px;
}

/* ==========================================
   REQUIREMENT ITEMS WITH ANIMATIONS
   Individual requirement validation styling
   ========================================== */

.requirement-list {
    margin-bottom: 15px;
}

.requirement-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: rgba(255,255,255,0.5);
    border: 1px solid transparent;
}

.requirement-item:hover {
    background-color: rgba(255,255,255,0.8);
    transform: translateX(4px);
}

.requirement-item.met {
    color: #155724;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #c3e6cb;
    animation: successPulse 0.5s ease;
}

.requirement-item.unmet {
    color: #6c757d;
    background-color: rgba(255,255,255,0.3);
}

.requirement-icon {
    margin-right: 8px;
    font-size: 12px;
    min-width: 16px;
}

.requirement-item.met .requirement-icon {
    color: #28a745;
}

.requirement-item.unmet .requirement-icon {
    color: #6c757d;
}

/* ==========================================
   PASSWORD VALIDATION MESSAGES
   Success, error, and feedback messages
   ========================================== */

.password-missing-requirements {
    font-size: 11px;
    color: #dc3545;
    margin-bottom: 5px;
}

.password-security-warning {
    font-size: 11px;
    color: #dc3545;
    margin-bottom: 5px;
}

.password-recommendation-weak {
    font-size: 10px;
    color: #dc3545;
}

.password-recommendation-good {
    font-size: 10px;
    color: #28a745;
}

.password-recommendation-excellent {
    font-size: 10px;
    color: #28a745;
}

.password-error-message {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #721c24;
    font-size: 14px;
}

.password-success-message {
    margin-top: 15px;
    padding: 12px;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    font-size: 14px;
}

.password-email-confirmation {
    font-size: 12px;
    color: #6c757d;
    margin-top: 8px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #17a2b8;
}

.password-email-notification {
    display: block;
    font-size: 11px;
    opacity: 0.9;
    margin-top: 4px;
}

.password-validation-feedback {
    margin-top: 8px;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
}

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

.password-validation-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.password-match-feedback {
    margin-top: 8px;
    padding: 8px;
    border-radius: 6px;
    font-size: 13px;
}

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

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

/* ==========================================
   PASSWORD FORM BUTTONS
   Submit buttons and disabled states
   ========================================== */

#changePasswordSubmitBtn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ==========================================
   SECURITY NOTES AND TIPS
   Additional guidance and security information
   ========================================== */

.security-notes {
    background-color: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    padding: 12px;
    margin-top: 12px;
}

.security-notes p {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: #0277bd;
    font-size: 13px;
}

.security-notes ul {
    margin: 0;
    padding-left: 16px;
    font-size: 12px;
    color: #0288d1;
}

.security-notes li {
    margin-bottom: 4px;
}

/* ==========================================
   PASSWORD FIELD WRAPPERS AND TOGGLES
   Password show/hide functionality styling
   ========================================== */

.password-field-wrapper {
    position: relative !important;
    display: block !important;
    width: 100% !important;
}

.password-toggle-btn {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 16px !important;
    padding: 4px !important;
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    border-radius: 4px;
}

.password-toggle-btn:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.05) !important;
    border-radius: 50%;
}

.password-toggle-btn:focus {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
    opacity: 1;
}

.password-field-wrapper input[type="password"],
.password-field-wrapper input[type="text"] {
    padding-right: 45px !important;
    box-sizing: border-box !important;
}

.form-group .password-field-wrapper input[type="password"],
.form-group .password-field-wrapper input[type="text"] {
    padding-right: 45px !important;
}

.login-form .password-field-wrapper input[type="password"],
.login-form .password-field-wrapper input[type="text"] {
    padding-right: 45px !important;
}

.password-input-container {
    position: relative !important;
    display: block !important;
    width: 100% !important;
}

.password-input-container input[type="password"],
.password-input-container input[type="text"] {
    padding-right: 45px !important;
}

.login-container .password-field-wrapper input[type="password"],
.login-container .password-field-wrapper input[type="text"] {
    padding-right: 45px !important;
}

/* ==========================================
   RESPONSIVE DESIGN
   Password form responsive adjustments
   ========================================== */

@media (max-width: 768px) {
    .form-group input[type="password"] {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* ==========================================
   DARK MODE COMPATIBILITY
   Password styling for dark/night mode
   ========================================== */

@media (prefers-color-scheme: dark) {
    .form-group input[type="password"] {
        background: rgba(30, 27, 75, 0.8);
        border-color: #475569;
        color: #f1f5f9;
    }
    
    .form-group input[type="password"]:focus {
        border-color: #8b5cf6;
        background: rgba(30, 27, 75, 0.95);
        box-shadow: 
            0 0 0 3px rgba(139, 92, 246, 0.1),
            0 1px 3px 0 rgba(0, 0, 0, 0.1),
            0 1px 2px 0 rgba(0, 0, 0, 0.06);
    }
}

/* ==========================================
   ANIMATIONS
   Keyframes and animations for password UI
   ========================================== */

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}
