/**
 * PasswordStrengthChecker 密碼強度檢查樣式
 * 
 * @version 1.0.0
 * @author Acer
 * @since 2026-03-11
 */

/* ========== 容器樣式 ========== */
.password-strength-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

/* ========== 強度條外框 ========== */
.password-strength-bar-wrapper {
    width: 160px;
    height: 0.5em;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #ccc;
}

/* ========== 強度條 ========== */
.password-strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* 弱 - 紅色 */
.password-strength-bar.password-strength-weak {
    background-color: #FF3830;
}

/* 中 - 橙色 */
.password-strength-bar.password-strength-medium {
    background-color: #FF902E;
}

/* 強 - 藍色 */
.password-strength-bar.password-strength-strong {
    background-color: #146AB2;
}

/* ========== 強度文字 ========== */
.password-strength-text {
    font-size: 14px;
    font-weight: bold;
    min-width: 40px;
}

/* 根據容器的強度等級設定文字顏色 */
.password-strength-container.password-strength-weak .password-strength-text {
    color: #FF3830;
}

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

.password-strength-container.password-strength-strong .password-strength-text {
    color: #146AB2;
}

/* ========== 替代樣式：內嵌於表單 ========== */
.password-strength-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    vertical-align: middle;
}

.password-strength-inline .password-strength-bar-wrapper {
    width: 120px;
    height: 6px;
}

/* ========== 替代樣式：區塊顯示 ========== */
.password-strength-block {
    display: block;
    margin-top: 8px;
    padding: 8px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.password-strength-block .password-strength-bar-wrapper {
    width: 100%;
    margin-bottom: 5px;
}

.password-strength-block .password-strength-text {
    display: block;
    text-align: center;
}

/* ========== 無障礙支援 ========== */
.password-strength-container:focus-within {
    outline: 2px solid #4A90D9;
    outline-offset: 2px;
}

/* ========== 檢查項目清單樣式 ========== */
.password-complexity-list {
    list-style: none;
    padding: 0;
    margin: 8px 0;
    font-size: 13px;
}

.password-complexity-list li {
    padding: 3px 0;
    padding-left: 24px;
    position: relative;
}

.password-complexity-list li::before {
    content: '✗';
    position: absolute;
    left: 5px;
    color: #FF3830;
    font-weight: bold;
}

.password-complexity-list li.passed::before {
    content: '✓';
    color: #28a745;
}

.password-complexity-list li.passed {
    color: #28a745;
}

.password-complexity-list li.failed {
    color: #FF3830;
}

/* ========== 響應式設計 ========== */
@media (max-width: 480px) {
    .password-strength-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .password-strength-bar-wrapper {
        width: 100%;
    }
}
