/*
 * WP Phone Recycle Wizard - 前台樣式
 * 配色：#b90b26 #FFFFFF #212529
 * Mobile First 設計
 */

/* ===== 全域設定 ===== */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px; /* 1rem = 16px */
}

/* ===== 容器 ===== */
.wpre-container {
    max-width: 480px;
    margin: 20px auto;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(185, 11, 38, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", sans-serif;
}

/* ===== 頂部標題區 ===== */
.wpre-header {
    background: linear-gradient(135deg, #b90b26 0%, #8a0a1d 100%);
    color: #FFFFFF;
    padding: 24px 20px;
    text-align: center;
}

.wpre-header h1 {
    font-size: 2rem; /* 32px - H1 */
    margin: 0 0 8px 0;
    font-weight: 700;
    line-height: 1.2;
}

.wpre-header p {
    font-size: 0.875rem; /* 14px - 小字 */
    margin: 0;
    opacity: 0.9;
}

/* ===== 遊戲化進度條區域 ===== */
.wpre-progress-wrapper {
    background: #FFFFFF;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

/* 圓點步驟 */
.wpre-progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.wpre-step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem; /* 14px */
    color: #999;
    transition: all 0.3s;
}

.wpre-step-dot.active {
    background: #b90b26;
    color: #FFFFFF;
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(185, 11, 38, 0.2);
}

.wpre-step-dot.completed {
    background: #b90b26;
    color: #FFFFFF;
}

.wpre-step-dot.completed::after {
    content: "✓";
}

/* 進度條 */
.wpre-progress-bar-bg {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.wpre-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #b90b26 0%, #e01030 100%);
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 3px;
}

.wpre-step-label {
    text-align: center;
    font-size: 0.75rem; /* 12px */
    color: #666;
    margin-top: 8px;
}

/* ===== 內容區域 (固定高度統一) ===== */
.wpre-content {
    padding: 24px 20px;
    min-height: 450px;
    display: flex;
    flex-direction: column;
}

/* 步驟控制 */
.pe-step {
    display: none; /* 預設隱藏 */
}

.pe-step.active {
    display: flex; /* 啟用時顯示 */
    flex: 1;
    flex-direction: column;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 步驟內容區 */
.wpre-step-content {
    flex: 1;
}

.wpre-step-content h2 {
    font-size: 1.5rem; /* 24px - H2 */
    color: #212529;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.wpre-step-content p {
    font-size: 1rem; /* 16px - 內文 */
    color: #666;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* ===== 表單元素 ===== */
select,
input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem; /* 16px */
    margin-bottom: 16px;
    transition: all 0.2s;
    font-family: inherit;
}

select:focus,
input:focus {
    outline: none;
    border-color: #b90b26;
    box-shadow: 0 0 0 3px rgba(185, 11, 38, 0.1);
}

/* ===== 條件卡片 (含滾動) ===== */
.wpre-condition-card {
    margin-bottom: 16px;
}

/* 標題獨立在外，不進入滾動區 */
.wpre-condition-card h3 {
    font-size: 1.25rem; /* 20px - H3 */
    color: #b90b26;
    display: flex;
    align-items: center;
    font-weight: 700;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px 12px 0 0;
    margin: 0;
}

.wpre-condition-card h3::before {
    content: "🔍";
    margin-right: 8px;
}

/* 勾選計數器 */
.wpre-selection-count {
    margin-left: auto;
    font-size: 0.875rem; /* 14px */
    color: #b90b26;
    font-weight: 700;
    display: none; /* 預設隱藏 */
}

.wpre-selection-count.visible {
    display: inline;
}

/* 可滾動的內容區 */
.wpre-condition-items-wrapper {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 16px;
    max-height: 280px;
    overflow-y: auto;
}

.wpre-condition-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Checkbox 選項 */
.wpre-condition-label {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #FFFFFF;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.wpre-condition-label:hover {
    background: #fff5f6;
    transform: translateX(4px);
}

.wpre-condition-checkbox {
    width: 20px;
    height: 20px;
    margin: 0 12px 0 0;
    cursor: pointer;
    accent-color: #b90b26;
}

.wpre-condition-label span {
    font-size: 1rem; /* 16px */
    color: #212529;
    flex: 1;
}

.wpre-loading {
    text-align: center;
    color: #999;
    font-size: 0.875rem;
    padding: 20px;
}

/* ===== 按鈕區 (固定底部) ===== */
.wpre-button-group {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 24px;
}

/* 單一按鈕時置中 */
.wpre-button-group.single-button {
    justify-content: center;
}

.wpre-button-group.single-button .wpre-btn {
    flex: 0 0 auto;
    min-width: 200px;
}

.wpre-btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 1rem; /* 16px */
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.wpre-btn-primary {
    background: #b90b26;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(185, 11, 38, 0.3);
}

.wpre-btn-primary:hover {
    background: #9a0920;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(185, 11, 38, 0.4);
}

.wpre-btn-secondary {
    background: #FFFFFF;
    color: #666;
    border: 2px solid #e0e0e0;
}

.wpre-btn-secondary:hover {
    border-color: #b90b26;
    color: #b90b26;
}

/* ===== 結果頁面 ===== */
.wpre-result-card {
    background: linear-gradient(135deg, #b90b26 0%, #8a0a1d 100%);
    color: #FFFFFF;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    margin-bottom: 20px;
}

.wpre-result-card h3 {
    font-size: 1.125rem; /* 18px - H4 */
    margin: 0 0 12px 0;
    opacity: 0.9;
    font-weight: 600;
}

.wpre-result-price {
    font-size: 3rem; /* 48px */
    font-weight: 900;
    margin: 16px 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.wpre-result-card p {
    margin: 0;
    font-size: 1rem;
    color: #FFFFFF; /* 改為白色 */
}

.wpre-result-subtitle {
    font-size: 0.875rem; /* 14px */
    opacity: 0.9;
    line-height: 1.4;
}

.wpre-result-info {
    background: #FFFFFF;
    color: #212529;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e0e0e0;
}

.wpre-result-info h4 {
    font-size: 1.125rem; /* 18px - H4 */
    color: #b90b26;
    margin: 0 0 12px 0;
    font-weight: 700;
}

.wpre-result-info > div {
    padding: 12px 0; /* 增加間距 */
    border-bottom: 1px solid #e0e0e0; /* 更明顯的分隔線 */
    font-size: 0.875rem; /* 14px */
}

.wpre-result-info > div:last-child {
    border-bottom: none;
}

/* ===== RWD - 平板 ===== */
@media (min-width: 600px) {
    .wpre-container {
        max-width: 600px;
    }
    
    .wpre-header h1 {
        font-size: 2.25rem; /* 36px */
    }
    
    .wpre-content {
        padding: 32px 28px;
        min-height: 480px;
    }
}

/* ===== RWD - 桌面 ===== */
@media (min-width: 900px) {
    .wpre-container {
        max-width: 700px;
    }
    
    .wpre-header h1 {
        font-size: 2.5rem; /* 40px */
    }
    
    .wpre-content {
        padding: 40px 36px;
        min-height: 500px;
    }
    
    .wpre-condition-card {
        max-height: 320px;
    }
}