/**
 * 前端樣式
 */

/* 通用容器 */
.quotation-register-container,
.quotation-verify-container,
.quotation-login-container,
.quotation-forgot-password-container,
.quotation-reset-password-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quotation-register-container h2,
.quotation-verify-container h2,
.quotation-login-container h2,
.quotation-forgot-password-container h2,
.quotation-reset-password-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    color: #333;
}

/* 表單群組 */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.required {
    color: #d9534f;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #004884;
    box-shadow: 0 0 5px rgba(0, 72, 132, 0.3);
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #999;
}

/* 複選框 */
.checkbox-label {
    display: flex;
    align-items: center;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 5px;
}

/* 按鈕 */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #004884;
    color: #fff;
}

.btn-primary:hover {
    background-color: #003366;
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-secondary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 表單送出區 */
.form-submit {
    margin-top: 20px;
    text-align: center;
}

.form-submit button {
    margin: 0 5px;
}

/* 表單訊息 */
.form-message {
    margin: 15px 0;
    padding: 12px;
    border-radius: 4px;
    display: none;
}

.form-message.success {
    display: block;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.form-message.error {
    display: block;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.form-message.info {
    display: block;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* 欄位錯誤訊息 */
.field-error {
    display: none;
    margin-top: 5px;
    font-size: 12px;
    color: #dc3545;
    font-weight: 500;
}

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

/* 欄位錯誤狀態 */
.form-group.has-error label {
    color: #dc3545;
}

.form-group.has-error input,
.form-group.has-error select {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.form-group.has-error input:focus,
.form-group.has-error select:focus {
    border-color: #dc3545;
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.3);
}

/* 表單連結 */
.form-links {
    margin-top: 20px;
    text-align: center;
}

.form-links p {
    margin: 10px 0;
}

.form-links a {
    color: #004884;
    text-decoration: none;
}

.form-links a:hover {
    text-decoration: underline;
    color: #003366;
}

/* 驗證碼倒計時 */
.verification-timer {
    margin: 15px 0;
    padding: 10px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    text-align: center;
    color: #856404;
}

#timer-countdown {
    font-weight: bold;
    color: #d9534f;
}

/* 驗證碼輔助說明 */
.verification-help {
    margin: 15px 0;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.verification-help a {
    color: #004884;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.verification-help a:hover {
    text-decoration: underline;
    color: #003366;
}

.verification-help a.loading,
.verification-help a.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
    color: #999;
}

.verification-help a.disabled:hover {
    text-decoration: none;
}

/* 載入動畫 */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 確認提交彈窗 */
.confirm-submit-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.confirm-submit-modal.show {
    display: flex;
}

.confirm-modal-content {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: 650px;
    width: 90%;
    overflow: hidden;
}

.confirm-modal-header {
    background-color: #004884;
    padding: 20px;
    text-align: center;
}

.confirm-modal-header h3 {
    margin: 0;
    font-size: 24px;
    color: #fff;
}

.confirm-modal-body {
    padding: 30px 20px;
}

.confirm-modal-body h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
    text-align: center;
    line-height: 1.8;
}

.confirm-modal-body .highlight-red {
    color: #dc3545;
    font-weight: bold;
}

.confirm-modal-body h4.notice {
    margin: 20px 0 0 0;
    font-size: 15px;
    color: #666;
    text-align: center;
    line-height: 1.6;
    font-weight: normal;
}

.confirm-modal-actions {
    display: flex;
    gap: 15px;
    padding: 0 20px 20px;
    justify-content: center;
}

.confirm-modal-actions .btn {
    flex: 1;
    max-width: 200px;
}

.confirm-modal-actions .btn-cancel {
    background-color: #6c757d;
    color: #fff;
}

.confirm-modal-actions .btn-cancel:hover {
    background-color: #5a6268;
}

.confirm-modal-actions .btn-confirm {
    background-color: #004884;
    color: #fff;
}

.confirm-modal-actions .btn-confirm:hover {
    background-color: #003366;
}

/* 成功驗證彈窗 */
.verification-success-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.verification-success-modal.show {
    display: flex;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    overflow: hidden;
}

.modal-header {
    background-color: #004884;
    color: #004884;
    padding: 30px 20px;
    text-align: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 24px;
    color: #004884;
    background-color: #fff;
    padding: 15px;
    border-radius: 4px;
}

.modal-body {
    padding: 30px 20px;
}

.modal-message {
    background-color: #004884;
    color: #fff;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.6;
}

.modal-contact {
    text-align: center;
    margin-bottom: 15px;
}

.modal-contact h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.modal-contact .phone {
    font-size: 20px;
    font-weight: bold;
    color: #004884;
}

.modal-hours {
    text-align: center;
    margin-bottom: 20px;
}

.modal-hours h5 {
    margin: 0;
    font-size: 14px;
    color: #004884;
    line-height: 1.6;
}

.modal-close {
    text-align: center;
    padding: 0 20px 20px;
}

.modal-close .btn {
    background-color: #004884;
    color: #fff;
    min-width: 120px;
}

.modal-close .btn:hover {
    background-color: #003366;
}

/* 購物車圖示短代碼 [quotation_cart_icon] */
.quotation-cart-icon-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.quotation-cart-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.quotation-cart-icon-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: #dc3545;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 4px;
    box-sizing: border-box;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .quotation-register-container,
    .quotation-verify-container,
    .quotation-login-container,
    .quotation-forgot-password-container,
    .quotation-reset-password-container {
        margin: 20px;
        padding: 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .modal-content {
        width: 95%;
    }

    .modal-header h3 {
        font-size: 20px;
    }

    .modal-contact h4 {
        font-size: 16px;
    }

    .modal-contact .phone {
        font-size: 18px;
    }

    .confirm-modal-content {
        width: 95%;
    }

    .confirm-modal-header h3 {
        font-size: 20px;
    }

    .confirm-modal-body h4 {
        font-size: 16px;
    }

    .confirm-modal-body h4.notice {
        font-size: 14px;
    }

    .confirm-modal-actions {
        flex-direction: column;
        gap: 10px;
    }

    .confirm-modal-actions .btn {
        max-width: 100%;
    }
}
