/* MoneyFit - 깔끔한 모바일 퍼스트 디자인 */

:root {
    --primary: #0066FF;
    --primary-dark: #0052CC;
    --primary-light: #3385FF;
    --success: #00C896;
    --success-light: #E6FFF9;
    --danger: #FF6B6B;
    --warning: #FFA94D;
    --text-1: #191F28;
    --text-2: #4E5968;
    --text-3: #8B95A1;
    --bg-1: #FFFFFF;
    --bg-2: #F8F9FA;
    --bg-3: #F1F3F5;
    --border: #E9ECEF;
    --radius: 16px;
    --radius-sm: 8px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-1);
    background: var(--bg-2);
    line-height: 1.6;
    overflow-x: hidden;
}

#app { min-height: 100vh; }

.container { max-width: 480px; margin: 0 auto; padding: 24px; }
@media (min-width: 768px) { .container { max-width: 560px; } }

/* Step 관리 */
.step { display: none !important; min-height: 100vh; padding: 32px 0; animation: fadeIn 0.3s ease; }
.step.active { display: block !important; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* 스플래시 */
#splash.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}
#splash {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.logo { font-size: 72px; margin-bottom: 12px; animation: bounce 2s infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.brand-name { font-size: 36px; font-weight: 800; margin-bottom: 4px; }
.tagline { font-size: 16px; opacity: 0.9; font-weight: 500; }
.logo-container { margin-bottom: 40px; }

.value-prop { margin-bottom: 40px; }
.headline { font-size: 22px; font-weight: 700; margin-bottom: 24px; line-height: 1.4; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { background: rgba(255,255,255,0.15); backdrop-filter: blur(10px); border-radius: var(--radius); padding: 14px 8px; border: 1px solid rgba(255,255,255,0.2); }
.stat-number { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.stat-label { font-size: 13px; opacity: 0.9; }

.trust-badges { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.badge { background: rgba(255,255,255,0.2); padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }

/* 버튼 */
button { cursor: pointer; border: none; outline: none; font-family: inherit; transition: all 0.2s ease; }

.btn-primary {
    background: var(--bg-1);
    color: var(--primary);
    font-size: 16px;
    font-weight: 700;
    padding: 16px 28px;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-primary:active { transform: translateY(0); }
.btn-large { width: 100%; padding: 18px 28px; font-size: 17px; }
#splash .btn-primary { background: white; color: #667eea; }

/* 질문 화면 */
.progress-bar { width: 100%; height: 4px; background: var(--bg-3); border-radius: 2px; margin-bottom: 28px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 2px; transition: width 0.4s ease; }

.question-header { text-align: center; margin-bottom: 28px; }
.question-number { display: inline-block; background: var(--primary-light); color: white; font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 12px; margin-bottom: 12px; }
.question-title { font-size: 26px; font-weight: 800; margin-bottom: 6px; line-height: 1.3; }
.question-subtitle { font-size: 15px; color: var(--text-2); }

.options-grid { display: grid; gap: 12px; margin-bottom: 24px; }
.option-card {
    background: var(--bg-1);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
}
.option-card:hover { border-color: var(--primary-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.option-card.selected { border-color: var(--primary); background: linear-gradient(135deg, rgba(0,102,255,0.05), rgba(0,102,255,0.1)); box-shadow: 0 0 0 4px rgba(0,102,255,0.1); }
.option-icon { font-size: 40px; margin-bottom: 6px; }
.option-text { font-size: 17px; font-weight: 700; color: var(--text-1); margin-bottom: 2px; }
.option-desc { font-size: 13px; color: var(--text-2); }

.btn-back { background: transparent; color: var(--text-2); font-size: 15px; font-weight: 600; padding: 12px; display: inline-flex; align-items: center; gap: 6px; }
.btn-back:hover { color: var(--text-1); }

/* 결과 화면 */
.result-header { text-align: center; margin-bottom: 24px; }
.celebration { font-size: 72px; margin-bottom: 12px; }
.result-title { font-size: 24px; font-weight: 800; margin-bottom: 12px; }
.result-badge { display: inline-block; background: linear-gradient(135deg, #667eea, #764ba2); color: white; font-size: 18px; font-weight: 700; padding: 10px 24px; border-radius: 24px; }

/* 카드 */
.card { background: var(--bg-1); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.card-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--primary); }

/* 투자 유형 */
.type-description { font-size: 15px; color: var(--text-2); line-height: 1.7; margin-bottom: 20px; text-align: center; }
.type-characteristics { display: flex; flex-direction: column; gap: 12px; }
.char-item { display: flex; align-items: center; gap: 12px; }
.char-label { width: 90px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.char-bar { flex: 1; height: 10px; background: var(--bg-3); border-radius: 5px; overflow: hidden; }
.char-fill { height: 100%; border-radius: 5px; transition: width 0.8s ease; }
.char-value { width: 50px; text-align: right; font-size: 13px; font-weight: 600; }

/* 포트폴리오 */
.portfolio-visual { max-width: 260px; margin: 0 auto 20px; }
.portfolio-list { display: flex; flex-direction: column; gap: 10px; }
.portfolio-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; background: var(--bg-2); border-radius: var(--radius-sm);
}
.portfolio-color { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.portfolio-info { flex: 1; }
.portfolio-name { font-size: 14px; font-weight: 600; }
.portfolio-desc { font-size: 12px; color: var(--text-3); }
.portfolio-pct { font-size: 16px; font-weight: 700; color: var(--primary); }

/* 점수 상세 */
.score-total { text-align: center; margin-bottom: 20px; }
.score-total-label { font-size: 13px; color: var(--text-3); margin-bottom: 4px; }
.score-total-value { font-size: 42px; font-weight: 800; color: var(--primary); }
.score-unit { font-size: 16px; font-weight: 600; color: var(--text-3); }
.score-total-bar { width: 100%; height: 8px; background: var(--bg-3); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.score-total-fill { height: 100%; background: linear-gradient(90deg, var(--success), var(--primary)); border-radius: 4px; transition: width 1s ease; }

.score-items { display: flex; flex-direction: column; gap: 8px; }
.score-row { display: flex; align-items: center; gap: 10px; }
.score-label { width: 75px; font-size: 12px; font-weight: 600; color: var(--text-2); flex-shrink: 0; }
.score-bar { flex: 1; height: 8px; background: var(--bg-3); border-radius: 4px; overflow: hidden; }
.score-bar-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.6s ease; }
.score-val { width: 35px; text-align: right; font-size: 12px; font-weight: 600; color: var(--text-3); }

/* 추천 종목 */
.stock-recommendations { display: flex; flex-direction: column; gap: 10px; }
.stock-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px; background: var(--bg-2); border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.2s;
}
.stock-item:hover { background: var(--bg-3); }
.stock-icon { font-size: 28px; }
.stock-info { flex: 1; }
.stock-name { font-size: 15px; font-weight: 700; }
.stock-reason { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.stock-tag { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 10px; background: rgba(0,102,255,0.1); color: var(--primary); }

/* 구독 */
.subscription-card.highlight { border: 2px solid var(--primary); }
.subscription-desc { font-size: 15px; color: var(--text-2); text-align: center; line-height: 1.6; margin-bottom: 20px; }

.subscribe-stock-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.subscribe-stock-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: 2px solid var(--border); background: var(--bg-1); cursor: pointer; transition: all 0.2s;
}
.subscribe-stock-tag.selected { border-color: var(--primary); background: rgba(0,102,255,0.08); color: var(--primary); }
.subscribe-stock-tag .remove { font-size: 11px; color: var(--text-3); }

.subscribe-form { margin-top: 16px; }

.subscribe-method { display: flex; gap: 16px; margin-bottom: 16px; }
.method-option { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.method-option input { accent-color: var(--primary); }
.method-option span { display: flex; align-items: center; gap: 4px; }

.form-group { margin-bottom: 12px; }
.form-group input { width: 100%; padding: 14px; border: 2px solid var(--border); border-radius: var(--radius-sm); font-size: 15px; font-family: inherit; transition: border-color 0.2s; }
.form-group input:focus { outline: none; border-color: var(--primary); }

.subscribe-frequency { margin-bottom: 20px; }
.subscribe-frequency label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.frequency-options { display: flex; gap: 8px; }
.freq-btn { padding: 8px 18px; border-radius: 20px; font-size: 13px; font-weight: 600; background: var(--bg-3); color: var(--text-2); }
.freq-btn.active { background: var(--primary); color: white; }

.subscribe-note { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 12px; }

/* 공유 */
.share-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-share {
    padding: 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
    display: flex; flex-direction: column; align-items: center; gap: 6px; transition: all 0.2s;
}
.btn-share:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-share i { font-size: 20px; }
.btn-share.kakao { background: #FEE500; color: #000; }
.btn-share.link { background: var(--bg-3); color: var(--text-1); }

/* 다시하기 */
.btn-restart {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 16px; margin-top: 8px; margin-bottom: 24px;
    background: transparent; color: var(--text-2); font-size: 15px; font-weight: 600;
    border: 2px solid var(--border); border-radius: var(--radius);
}
.btn-restart:hover { border-color: var(--primary); color: var(--primary); }

/* Footer */
#footer { background: var(--text-1); color: white; padding: 32px 0 20px; margin-top: 32px; }
.footer-disclaimer p { font-size: 11px; line-height: 1.6; opacity: 0.6; margin-bottom: 12px; }
.footer-disclaimer strong { opacity: 1; }
.footer-copyright { font-size: 12px; opacity: 0.5; text-align: center; }

/* 유틸리티 */
.text-center { text-align: center; }
.hidden { display: none !important; }

/* 토스트 알림 */
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: var(--text-1); color: white; padding: 14px 28px; border-radius: 12px;
    font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg);
    z-index: 9999; animation: toastIn 0.3s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* AI 보고서 */
.report-card { text-align: center; }
.report-desc { font-size: 15px; color: var(--text-2); line-height: 1.6; margin-bottom: 20px; }

.btn-report {
    width: 100%; padding: 16px 24px; border-radius: var(--radius);
    background: linear-gradient(135deg, #667eea, #764ba2); color: white;
    font-size: 16px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: var(--shadow-md); transition: all 0.2s;
}
.btn-report:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-report:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.report-loading {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 32px 0; color: var(--text-2); font-size: 14px;
}
.report-spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--bg-3); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.report-content {
    text-align: left; margin-top: 20px;
    padding: 24px; background: var(--bg-2); border-radius: var(--radius);
    font-size: 14px; line-height: 1.8; color: var(--text-1);
    max-height: 600px; overflow-y: auto;
}
.report-content h1 { font-size: 20px; font-weight: 800; margin: 20px 0 10px; color: var(--text-1); }
.report-content h2 { font-size: 17px; font-weight: 700; margin: 18px 0 8px; color: var(--primary); }
.report-content h3 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; color: var(--text-1); }
.report-content p { margin-bottom: 10px; }
.report-content ul, .report-content ol { margin: 8px 0 12px 20px; }
.report-content li { margin-bottom: 4px; }
.report-content strong { color: var(--primary); }
.report-content blockquote {
    border-left: 3px solid var(--primary); padding: 8px 14px; margin: 10px 0;
    background: rgba(0,102,255,0.04); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 13px; color: var(--text-2);
}
.report-content code { background: var(--bg-3); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.report-content hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.report-error { text-align: center; padding: 20px; color: var(--danger); }
.btn-retry {
    margin-top: 10px; padding: 10px 24px; border-radius: var(--radius-sm);
    background: var(--bg-3); color: var(--text-1); font-size: 14px; font-weight: 600;
}

/* ===== 글로벌 네비게이션 ===== */
#globalNav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border); height: 56px;
}
.nav-inner {
    max-width: 960px; margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between; height: 56px;
}
.nav-logo { font-size: 18px; font-weight: 800; color: var(--text-1); text-decoration: none; }
.nav-links {
    list-style: none; display: flex; gap: 4px; margin: 0; padding: 0;
}
.nav-links a {
    display: block; padding: 8px 14px; font-size: 14px; font-weight: 600;
    color: var(--text-2); text-decoration: none; border-radius: var(--radius-sm); transition: all 0.2s;
}
.nav-links a:hover { color: var(--primary); background: rgba(0,102,255,0.06); }
.nav-toggle { display: none; background: none; font-size: 20px; color: var(--text-2); padding: 8px; }

#app, .page-content { padding-top: 56px; }

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        display: none; position: absolute; top: 56px; left: 0; right: 0;
        background: white; flex-direction: column; padding: 12px;
        border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md);
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 12px 16px; font-size: 15px; }
}

/* ===== 글로벌 푸터 ===== */
#siteFooter {
    background: var(--text-1); color: white; padding: 48px 0 24px; margin-top: 48px;
}
.footer-inner { max-width: 960px; margin: 0 auto; padding: 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-brand { font-size: 20px; font-weight: 800; margin-bottom: 12px; }
.footer-desc { font-size: 13px; opacity: 0.7; line-height: 1.6; }
.footer-col h4 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 13px; transition: color 0.2s; }
.footer-col a:hover { color: white; }
.footer-bottom-bar { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; }
.footer-disclaimer { font-size: 11px; line-height: 1.6; opacity: 0.5; margin-bottom: 12px; }
.footer-copy { font-size: 12px; opacity: 0.4; text-align: center; }

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
    .stats-grid { grid-template-columns: 1fr; }
    .brand-name { font-size: 30px; }
    .question-title { font-size: 22px; }
}
