/* ============================================
   驗證碼組件樣式
   ============================================ */

/* === 驗證碼模態框背景 === */
#VerificationCodeModal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-in-out;
}

/* === 淡入動畫 === */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* === 驗證碼容器 === */
.verification-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 480px;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

/* === 上滑動畫 === */
@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* === 驗證碼頭部 === */
.verification-header {
    background: #0d5fa5;
    padding: 16px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.verification-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    width: 100%;
}

/* === 關閉按鈕 === */
.verification-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.verification-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* === 驗證碼主體 === */
.verification-body {
    padding: 24px 20px;
}

/* === 說明文字 === */
.verification-description {
    margin: 0 0 20px 0;
    color: #000000;
    font-size: 14px;
    line-height: 1.6;
}

/* === 驗證碼部分 === */
.verification-code-section {
    margin-bottom: 20px;
}

.verification-code-section label {
    display: block;
    margin-bottom: 8px;
    color: #333333;
    font-size: 14px;
    font-weight: 500;
}

/* === 驗證碼輸入組 === */
.verification-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

/* === 驗證碼輸入框 === */
.verification-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    letter-spacing: 6px;
    text-transform: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.verification-input:focus {
    outline: none;
    border-color: #0d5fa5;
    box-shadow: 0 0 0 3px rgba(0, 153, 255, 0.1);
}

.verification-input::placeholder {
    color: #cccccc;
    letter-spacing: 0;
}

/* === 驗證碼圖片盒子 === */
.verification-image-box {
    position: relative;
    flex: 0 0 auto;
}

/* === Canvas 樣式 === */
.verification-canvas {
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: #f5f5f5;
    cursor: default;
    display: block;
    width: 160px;
    height: 64px;
    object-fit: contain;
}

/* === 刷新按鈕 === */
.verification-refresh {
    position: absolute;
    top: 50%;
    right: 50%;
    transform: translate(50%, -50%);
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: transform 0.2s ease, background 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.verification-image-box:hover .verification-refresh {
    opacity: 1;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.05);
}

.verification-refresh:hover {
    transform: translate(50%, -50%) rotate(180deg);
    background: rgba(0, 0, 0, 0.1);
}

/* === 計時器 === */
.verification-timer {
    font-size: 12px;
    color: #999999;
    text-align: right;
}

#verificationTimer {
    display: inline-block;
}

#verificationTimer.expired {
    color: #ff4d4f;
    font-weight: 500;
}

/* === 錯誤訊息 === */
.verification-error {
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    background: #fff1f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
    display: none;
    animation: slideDown 0.2s ease-out;
}

.verification-error.show {
    display: block;
}

.verification-error.success {
    background: #f6ffed;
    color: #52c41a;
    border-color: #b7eb8f;
}

/* === 下滑動畫 === */
@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* === 按鈕組 === */
.verification-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* === 取消按鈕 === */
.verification-btn-cancel {
    flex: 1;
    padding: 10px 16px;
    background: #f5f5f5;
    color: #333333;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.verification-btn-cancel:hover {
    background: #efefef;
    border-color: #b3b3b3;
}

.verification-btn-cancel:active {
    background: #e6e6e6;
}

/* === 確定按鈕 === */
.verification-btn-confirm {
    flex: 1;
    padding: 10px 16px;
    background: #0d5fa5;
    color: #ffffff;
    border: 1px solid #0d5fa5;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

/* === 全寬按鈕樣式 === */
.verification-btn-full {
    width: 100%;
    flex: none;
}

.verification-btn-confirm:hover {
    background: #0080d0;
    box-shadow: 0 4px 12px rgba(0, 153, 255, 0.3);
}

.verification-btn-confirm:active {
    background: #0066b3;
}

.verification-btn-confirm:disabled {
    background: #cccccc;
    border-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* === 響應式設計 === */
@media (max-width: 600px) {
    .verification-container {
        width: 95%;
        max-width: 100%;
    }

    .verification-body {
        padding: 16px 14px;
    }

    .verification-input-group {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .verification-input {
        width: 100%;
    }

    .verification-image-box {
        flex: 1;
    }

    .verification-canvas {
        width: 100%;
    }

    .verification-actions {
        flex-direction: column;
    }

    .verification-btn-cancel,
    .verification-btn-confirm {
        width: 100%;
    }
}

/* === AQUA 主題覆寫 === */
body.theme-aqua .verification-header {
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
}

body.theme-aqua .verification-header h3 {
    color: #01a0e9;
    text-align: center;
}

body.theme-aqua .verification-close {
    color: #01a0e9;
}

body.theme-aqua .verification-close:hover {
    background: rgba(1, 160, 233, 0.05);
}

body.theme-aqua .verification-btn-confirm {
    background: #0d5fa5;
    border-color: #0d5fa5;
}

body.theme-aqua .verification-btn-confirm:hover {
    background: #0d5fa5;
    box-shadow: 0 4px 12px rgba(1, 160, 233, 0.3);
}

body.theme-aqua .verification-btn-confirm:active {
    background: #0d5fa5;
}
