* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.5;
}

/* 進度指示器 */
.progress-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px 30px 40px;
    background: #f8f9fa;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s ease;
}

.step-label {
    font-size: 12px;
    color: #666;
    text-align: center;
    transition: color 0.3s ease;
}

.progress-step.active .step-number {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.progress-step.active .step-label {
    color: #667eea;
    font-weight: 600;
}

.progress-step.completed .step-number {
    background: #4caf50;
    color: white;
}

.progress-step.completed .step-label {
    color: #4caf50;
    font-weight: 600;
}

.progress-line {
    height: 2px;
    background: #e0e0e0;
    flex: 0.5;
    margin: 0 10px;
    margin-bottom: 20px;
}

.progress-line.active {
    background: #667eea;
}

/* 表單區域 */
.form-section {
    display: none;
    padding: 40px 30px;
    min-height: 400px;
}

.form-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section h2 {
    font-size: 20px;
    margin-bottom: 30px;
    color: #333;
    font-weight: 600;
}

/* 選項卡片 */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

@media (min-width: 480px) {
    .options-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 768px) {
    .options-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}

.option-card {
    position: relative;
    cursor: pointer;
}

.option-card input {
    display: none;
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: white;
}

.option-card input:checked + .card-content {
    border-color: #667eea;
    background: #f0f4ff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.card-icon {
    font-size: 32px;
    display: block;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

/* 金額輸入 */
.amount-input-group {
    margin-bottom: 30px;
}

.amount-input-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #333;
}

.input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.currency {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
}

#amount {
    width: 100%;
    padding: 12px 15px 12px 50px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#amount:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.amount-presets {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
}

.preset-btn {
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f0f4ff;
}

/* 貸款類型選項 */
.loan-type-group {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.loan-type-group label {
    display: block;
    margin-bottom: 16px;
    font-weight: 600;
    color: #333;
}

.checkboxes-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-item input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-label {
    font-size: 14px;
    color: #333;
    user-select: none;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-item input:checked + .checkbox-label {
    color: #667eea;
    font-weight: 600;
}

/* 推薦卡片 */
.recommendation-container {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.recommendation-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    transition: all 0.3s ease;
}

.recommendation-card.primary {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.recommendation-card.primary .card-label {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.card-label {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.recommendation-card.primary .card-label {
    background: rgba(255, 255, 255, 0.3);
}

.card-title-rec {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin: 16px 0;
    padding: 12px 0;
}

.stat-item {
    text-align: center;
    padding: 8px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
}

.recommendation-card.primary .stat-label {
    opacity: 0.9;
}

.card-description {
    font-size: 14px;
    line-height: 1.6;
    margin: 12px 0;
    opacity: 0.9;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.action-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.recommendation-card.primary .action-btn {
    background: white;
    color: #667eea;
}

.recommendation-card.primary .action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-btn.secondary {
    background: #e0e0e0;
    color: #333;
}

.action-btn.secondary:hover {
    background: #d0d0d0;
}

/* 按鈕 */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    border-color: #667eea;
    color: #667eea;
}

/* 響應式設計 */
@media (max-width: 480px) {
    .container {
        border-radius: 0;
        box-shadow: none;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 24px;
    }

    .form-section {
        padding: 30px 20px;
    }

    .progress-container {
        padding: 20px;
    }

    .progress-step {
        gap: 4px;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .step-label {
        font-size: 10px;
    }

    .progress-line {
        margin: 0 5px;
        margin-bottom: 15px;
    }
}
