/* 全局設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth;
    .hidden {
        display: none;
    }
}

/* 背景設定 */
body {
    background: linear-gradient(to bottom, #2C2F33, #1E2023);
    color: #EAEAEA;
}

/* 主要表單容器 */
.multi-step-container {
    max-width: 850px;
    margin: 30px auto;
    padding: 20px;
    background: rgba(40, 44, 52, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* 表單區塊 (卡片樣式) */
.form-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    color: #fff;
    backdrop-filter: blur(6px);
    transition: transform 0.3s ease-in-out;
}
.form-section:hover {
    transform: scale(1.02);
}

/* 進度條 */
#progress-bar {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 25px;
}
#progress-bar::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 5%;
    right: 5%;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    transform: translateY(-50%);
}
.progress-step {
    background: #555;
    color: #aaa;
    padding: 12px 18px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}
.progress-step.active {
    background: #4A90E2;
    color: #fff;
    transform: scale(1.1);
}
.progress-step.active::after {
    content: "";
    font-size: 18px;
    position: absolute;
    top: -5px;
    right: -5px;
    color: white;
}

/* 多步驟表單 */
.form-step {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}
.form-step.active {
    display: block;
}

/* 標籤與輸入框 */
label {
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 8px;
    display: block;
}


input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: #fff;
    color: #333;
    font-size: 14px;
    transition: all 0.3s ease;
}
input:focus,
select:focus,
textarea:focus {
    border: 2px solid #4A90E2;
    box-shadow: 0 0 8px rgba(74, 144, 226, 0.5);
}

/* 核取方塊群組 */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
}
.checkbox-group input[type="checkbox"] {
    transform: scale(1.3);
}

/* 按鈕樣式 */
.step-buttons {
    text-align: center;
    margin-top: 25px;
}
.step-buttons button {
    padding: 12px 22px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(45deg, #4A90E2, #357ABD);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.3);
}
.step-buttons button:hover {
    background: linear-gradient(45deg, #357ABD, #265A99);
    transform: translateY(-2px);
}

/* 錯誤訊息 */
.error {
    font-size: 0.9em;
    color: #ff4d4d;
    margin-left: 10px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .multi-step-container {
        width: 90%;
    }
    .progress-step {
        font-size: 12px;
        padding: 8px 12px;
    }
    button {
        width: 100%;
        font-size: 14px;
    }
}

/* 動畫效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* fieldset 樣式 */
fieldset {
    border: 2px solid rgba(255, 255, 255, 0.3); /* 淡化邊框 */
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05); /* 背景半透明 */
    backdrop-filter: blur(5px); /* 增加模糊效果 */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); /* 添加陰影，讓區塊有浮起感 */
    transition: all 0.3s ease-in-out;
}

/* fieldset hover 提升效果 */
fieldset:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: #4A90E2; /* 滑鼠懸停時變藍 */
}

/* legend 樣式 (標題) */
legend {
    font-size: 18px;
    font-weight: bold;
    color: #4A90E2;
    padding: 5px 15px;
    background: rgba(74, 144, 226, 0.15);
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
}

/* fieldset 內部間距 */
fieldset label {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}


fieldset input,
fieldset select,
fieldset textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: #fff;
    color: #333;
    font-size: 14px;
    transition: all 0.3s ease;
}

fieldset input:focus,
fieldset select:focus,
fieldset textarea:focus {
    border: 2px solid #4A90E2;
    box-shadow: 0 0 8px rgba(74, 144, 226, 0.5);
}

/* fieldset 響應式設計 */
@media (max-width: 768px) {
    fieldset {
        padding: 15px;
    }

    legend {
        font-size: 16px;
        padding: 5px 12px;
    }
}


/* 只讀 (readonly) 輸入框樣式 */
input[readonly],
textarea[readonly] {
    background-color: #2C2F33;
    color: #a0a0a0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    font-weight: bold;
    padding-left: 14px;
    box-shadow: none;
    transition: all 0.3s ease-in-out;
}

/* 滑鼠懸停時，唯讀欄位不變色 */
input[readonly]:hover,
textarea[readonly]:hover {
    background-color: #2C2F33;
    border-color: rgba(255, 255, 255, 0.2);
}

/* 唯讀欄位點擊時不會有額外焦點效果 */
input[readonly]:focus,
textarea[readonly]:focus {
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

/* 唯讀欄位 + 禁用 (disabled) 欄位 */
input[readonly]:disabled,
textarea[readonly]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 預覽區塊 */
#previewContainer {
    margin-top: 20px;
    padding: 20px;
    background: rgba(40, 44, 52, 0.85);
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
}

/* 預覽標題 */
#previewContainer h3 {
    font-size: 1.4em;
    color: #4A90E2;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    border-bottom: 2px solid rgba(74, 144, 226, 0.4);
    padding-bottom: 5px;
}

/* 預覽表格 */
#previewContainer table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: rgba(50, 54, 60, 0.9);
    border-radius: 8px;
    overflow: hidden;
}

/* 預覽表格 標題 (左欄) */
#previewContainer table td:first-child {
    font-weight: bold;
    color: #EAEAEA;
    background: rgba(255, 255, 255, 0.15);
    padding: 12px;
    border-right: 2px solid rgba(255, 255, 255, 0.2);
    text-align: left;
    width: 40%;
}

/* 預覽表格 內容 (右欄) */
#previewContainer table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ddd;
    text-align: left;
}

/* 讓表格最後一行沒有底線 */
#previewContainer table tr:last-child td {
    border-bottom: none;
}

/* 表格 hover 效果 */
#previewContainer table tr:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* RWD - 小螢幕適配 */
@media (max-width: 768px) {
    #previewContainer {
        width: 95%;
        padding: 15px;
    }

    #previewContainer table td,
    #previewContainer table td:first-child {
        padding: 10px;
        font-size: 14px;
    }
}