/* 整個網站的基本設定 */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Microsoft JhengHei", Arial, sans-serif;
    background-color: #f4f6f9;
    color: #333;
}

/* 網站標題區域 */
header {
    background-color: #245b78;
    color: white;
    text-align: center;
    padding: 25px 20px;
}

header h1 {
    margin: 0 0 10px;
    font-size: 28px;
}

header p {
    margin: 0;
    font-size: 15px;
}

/* 分頁導覽列 */
.tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    background-color: white;
    border-bottom: 1px solid #ddd;
}

/* 分頁按鈕 */
.tab-button {
    padding: 16px 22px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 16px;
    color: #555;
}

/* 滑鼠移到按鈕上 */
.tab-button:hover {
    background-color: #eef4f8;
}

/* 目前選取的分頁 */
.tab-button.active {
    color: #245b78;
    border-bottom: 3px solid #245b78;
    font-weight: bold;
}

/* 主要內容區域 */
main {
    max-width: 1100px;
    margin: 30px auto;
    padding: 30px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 預設隱藏所有分頁 */
.tab-content {
    display: none;
}

/* 只顯示目前選取的分頁 */
.tab-content.active {
    display: block;
}

/* 分頁標題 */
.tab-content h2 {
    margin-top: 0;
    color: #245b78;
}

/* =========================
   表單區塊
========================= */

.form-section {
    margin-top: 25px;
    padding: 25px;
    border: 1px solid #e0e5ea;
    border-radius: 8px;
    background-color: #fafbfd;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #245b78;
    font-size: 19px;
}

/* 表單使用兩欄排列 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* 單一輸入欄位 */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

/* 輸入框與下拉選單 */
.form-group input,
.form-group select {
    width: 100%;
    padding: 11px;
    border: 1px solid #cbd5df;
    border-radius: 6px;
    font-size: 16px;
    background-color: white;
}

/* 輸入框取得焦點 */
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #245b78;
}

/* 單選選項 */
.radio-option {
    display: block;
    margin-bottom: 12px;
    cursor: pointer;
}

/* 日期提醒訊息 */
.message {
    margin-top: 15px;
    padding: 15px;
    border-radius: 6px;
    line-height: 1.7;
}

.message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffe69c;
}

.message.error {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.message.success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

/* 提前簽約區域 */
.early-sign-section {
    margin-top: 15px;
    padding: 20px;
    background-color: #fff8e6;
    border-left: 4px solid #e0a800;
}

.form-hint {
    color: #666;
    font-size: 14px;
}

/* 確保 hidden 屬性可以正常隱藏元素 */
[hidden] {
    display: none !important;
}

/* 手機或較小螢幕改成單欄 */
@media (max-width: 700px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================
   身分證驗證訊息
========================= */

.field-message {
    margin-top: 6px;
    font-size: 14px;
    min-height: 20px;
}

/* 驗證成功 */
.field-message.valid {
    color: #198754;
}

/* 驗證失敗 */
.field-message.invalid {
    color: #dc3545;
}
/* ========================================
   地址輸入功能
======================================== */

/* 地址輸入模式選擇區 */
.address-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

/* 地址選項 */
.address-mode .radio-option {
    margin-bottom: 0;
}

/* 同步地址預覽區 */
.address-preview {
    padding: 15px 20px;
    background-color: #eef6fb;
    border: 1px solid #c8e1f0;
    border-radius: 6px;
}

/* 預覽地址文字 */
.address-preview p {
    margin-bottom: 0;
    line-height: 1.7;
    color: #245b78;
}

/* 手機版 */
@media (max-width: 700px) {

    .address-mode {
        flex-direction: column;
        gap: 12px;
    }

}