:root {
    --primary-color: #1a3324;
    --primary-light: #2c4a38;
    --secondary-color: #f4eee0;
    --accent-color: #d4af37; /* Gold */
    --text-dark: #222222;
    --text-light: #f8f9fa;
    --danger-color: #d90429;
    --warning-color: #ff9f1c;
    --success-color: #2b9348;
    --border-color: rgba(26, 51, 36, 0.15);
    --font-heading: 'Noto Serif KR', serif;
    --font-body: 'Pretendard', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-body); color: var(--text-dark); background-color: #fcfbf9; line-height: 1.6; }
h1, h2, h3, h4, h5 { font-family: var(--font-heading); color: var(--primary-color); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.text-primary { color: var(--primary-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-white { color: #fff !important; }
.text-white-50 { color: rgba(255,255,255,0.6) !important; }
.text-muted { color: #6c757d !important; }
.text-center { text-align: center; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.bg-light { background-color: var(--secondary-color); }
.bg-dark { background-color: var(--primary-color); }
.bg-white { background-color: #fff; color: var(--text-dark); }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.rounded { border-radius: 8px; }
.shadow-sm { box-shadow: 0 5px 15px rgba(0,0,0,0.05); }

/* Hero */
.hero { position: relative; height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; background: url('../assets/images/hero_bg.png') center/cover no-repeat; }
.hero-overlay { position: absolute; inset: 0; background: rgba(10,20,15,0.85); z-index: 1; }
.hero-content { position: relative; z-index: 2; color: #fff; }
.badge { display: inline-block; border: 1px solid var(--accent-color); color: var(--accent-color); padding: 8px 20px; border-radius: 30px; margin-bottom: 30px; font-weight: bold; }
.hero .title { font-size: 4.5rem; margin-bottom: 20px; color: #fff; line-height: 1.2; }
.hero .highlight { color: var(--accent-color); }
.hero .subtitle { font-size: 1.3rem; color: #ccc; max-width: 800px; margin: 0 auto 40px auto; }
.info-tags span { display: inline-block; background: rgba(255,255,255,0.1); padding: 10px 20px; border-radius: 5px; margin: 0 10px; font-size: 1.1rem; }

/* Sections */
.section { padding: 100px 0; }
.section-title { text-align: center; margin-bottom: 60px; }
.section-title h2 { font-size: 2.5rem; position: relative; display: inline-block; }
.section-title h2 span { font-size: 1.2rem; position: absolute; top: -15px; left: -30px; color: var(--accent-color); font-weight: bold; }
.section-title p { font-size: 1.2rem; color: #666; margin-top: 15px; max-width: 800px; margin-left: auto; margin-right: auto; }
.sub-title { font-size: 1.8rem; margin-bottom: 20px; border-bottom: 2px solid var(--accent-color); padding-bottom: 10px; display: inline-block; }

/* Components */
.card-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 50px; }
.card { background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); overflow: hidden; }
.card-header { background: var(--primary-color); color: var(--accent-color); padding: 20px; font-size: 1.3rem; font-weight: bold; }
.card.danger .card-header { background: #6a040f; color: #fff; }
.card-body { padding: 30px; }
.styled-list { padding-left: 20px; }
.styled-list li { margin-bottom: 15px; }

.traffic-light-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tl-box { background: #fff; padding: 30px; border-radius: 12px; text-align: center; border-top: 6px solid; box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.tl-box.orange { border-color: var(--warning-color); }
.tl-box.red { border-color: var(--danger-color); }
.tl-box.dark { border-color: #000; background: #111; color: #fff; }
.tl-box .icon { font-size: 3rem; margin-bottom: 15px; }
.tl-box.orange .icon { color: var(--warning-color); }
.tl-box.red .icon { color: var(--danger-color); }
.tl-box.dark .icon { color: var(--accent-color); }
.tl-box.dark h4 { color: var(--accent-color); }

.highlight-box { border-left: 5px solid var(--accent-color); background: #fff; padding: 30px; font-size: 1.2rem; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }

.strategy-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.s-card { background: #fff; padding: 40px; border-radius: 12px; position: relative; border: 1px solid var(--border-color); }
.s-badge { position: absolute; top: -15px; left: 30px; background: var(--primary-color); color: var(--accent-color); padding: 5px 20px; border-radius: 20px; font-weight: bold; }
.s-card h3 { margin-bottom: 15px; font-size: 1.5rem; }

.org-layout { display: flex; flex-direction: column; align-items: center; gap: 15px; }
.org-tier { display: flex; align-items: center; width: 100%; max-width: 900px; padding: 30px; border-radius: 12px; background: #fff; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.tier-gold { border: 2px solid var(--accent-color); }
.tier-silver { border: 2px solid #ccc; }
.o-icon { font-size: 3rem; color: var(--primary-color); margin-right: 30px; width: 80px; text-align: center; }
.tier-gold .o-icon { color: var(--accent-color); }
.o-text h4 { font-size: 1.4rem; margin-bottom: 10px; }
.o-text ul { padding-left: 20px; color: #555; }
.org-arrow { font-size: 2rem; color: #999; }

.action-box { background: var(--primary-color); color: #fff; padding: 40px; border-radius: 12px; }
.action-box h4 { color: var(--accent-color); font-size: 1.5rem; margin-bottom: 20px; }
.action-box ol { padding-left: 20px; font-size: 1.1rem; line-height: 1.8; }
.action-box li { margin-bottom: 10px; }

.tax-simulation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.tax-box, .benefits-box { background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.funnel-chart { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.f-step { width: 100%; display: flex; align-items: center; padding: 15px 20px; border-radius: 8px; color: #fff; }
.s1 { background: var(--primary-color); }
.s2 { background: #3a5a48; width: 90%; }
.s3 { background: #5a7a68; width: 80%; }
.s4 { background: var(--secondary-color); color: var(--text-dark); width: 70%; border: 2px solid var(--accent-color); }
.f-title { flex: 1; font-weight: bold; }
.f-amount { font-size: 1.3rem; font-weight: bold; width: 120px; text-align: right; margin-right: 20px; }
.f-detail { flex: 2; font-size: 0.95rem; opacity: 0.9; border-left: 1px solid rgba(255,255,255,0.3); padding-left: 15px; }
.s4 .f-detail { border-left-color: rgba(0,0,0,0.2); color: #444; }
.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding-left: 30px; margin-bottom: 15px; }
.check-list li::before { content: '\f058'; font-family: 'FontAwesome'; position: absolute; left: 0; color: var(--success-color); font-size: 1.2rem; }

.document-frame { background: #fff; padding: 50px; border: 15px solid #eaeaea; border-radius: 4px; box-shadow: inset 0 0 10px rgba(0,0,0,0.05), 0 10px 30px rgba(0,0,0,0.2); color: #333; font-family: var(--font-heading); }
.doc-title { text-align: center; font-size: 1.8rem; border-bottom: 2px solid #333; padding-bottom: 20px; margin-bottom: 30px; color: #111; }
.doc-intro { font-size: 1.1rem; margin-bottom: 30px; text-align: justify; }
.clause { margin-bottom: 25px; }
.clause h4 { font-size: 1.2rem; color: #333; margin-bottom: 10px; }
.doc-signatures { margin-top: 50px; text-align: right; font-size: 1.2rem; }
.doc-signatures div { margin-bottom: 15px; }
.doc-tips { background: rgba(255,255,255,0.1); padding: 30px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2); }

.timeline { border-left: 3px solid var(--accent-color); padding-left: 30px; margin-left: 15px; }
.t-item { position: relative; margin-bottom: 30px; }
.t-dot { position: absolute; left: -46.5px; top: 0; width: 30px; height: 30px; background: var(--accent-color); color: var(--primary-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-family: var(--font-heading); box-shadow: 0 0 0 5px #fcfbf9; }
.t-item h4 { margin-bottom: 10px; font-size: 1.3rem; }

.qa-container { display: grid; grid-template-columns: 1fr 1.5fr; gap: 50px; }
.quote-card { background: #fff; padding: 30px; border-radius: 12px; margin-bottom: 20px; border-left: 4px solid var(--primary-color); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.quote-card.gold { border-left-color: var(--accent-color); background: var(--primary-color); color: #fff; }
.quote-card.gold p { color: #eee; }
.quote-icon { font-size: 2rem; color: rgba(0,0,0,0.1); margin-bottom: 15px; display: block; }
.quote-card.gold .quote-icon { color: rgba(212,175,55,0.3); }
.quote-card p { font-size: 1.15rem; font-style: italic; }

.chat-wrapper { display: flex; flex-direction: column; gap: 20px; }
.chat-bubble { display: flex; align-items: flex-start; gap: 15px; max-width: 90%; }
.chat-bubble.right { align-self: flex-end; justify-content: flex-end; }
.c-avatar { width: 45px; height: 45px; background: #eee; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; color: #555; flex-shrink: 0; }
.c-avatar.gold { background: var(--accent-color); color: var(--primary-color); }
.c-text { padding: 15px 25px; border-radius: 20px; font-size: 1.05rem; }
.left .c-text { background: #fff; border: 1px solid #e0e0e0; border-top-left-radius: 0; }
.right .c-text { background: var(--primary-color); color: #fff; border-top-right-radius: 0; }

@media (max-width: 992px) {
    .card-grid-2, .strategy-cards, .tax-simulation-grid, .qa-container { grid-template-columns: 1fr; }
    .hero .title { font-size: 3rem; }
}

@media (max-width: 768px) {
    .hero .title { font-size: 2.2rem; }
    .hero .subtitle { font-size: 1.1rem; }
    .section { padding: 50px 0; }
    .section-title h2 { font-size: 1.8rem; }
    .section-title p { font-size: 1rem; }
    
    .traffic-light-container { grid-template-columns: 1fr; gap: 15px; }
    .tl-box { padding: 20px; }
    
    .org-tier { flex-direction: column; text-align: center; padding: 20px; }
    .o-icon { margin-right: 0; margin-bottom: 15px; }
    .org-arrow { transform: rotate(90deg); margin: 15px 0; }
    
    .action-box { padding: 20px; }
    
    .document-frame { padding: 20px; border-width: 5px; }
    .doc-title { font-size: 1.4rem; }
    
    .f-step { flex-direction: column; align-items: flex-start; text-align: left; }
    .f-amount { width: auto; text-align: left; margin: 10px 0; }
    .f-detail { border-left: none; border-top: 1px solid rgba(255,255,255,0.3); padding-left: 0; padding-top: 10px; margin-top: 5px; width: 100%; }
    .s4 .f-detail { border-top-color: rgba(0,0,0,0.2); }
    .s2, .s3, .s4 { width: 100%; }
    
    .chat-bubble { max-width: 100%; }
    .c-text { padding: 12px 18px; font-size: 1rem; }
    
    h1, h2, h3, h4, h5, p, span, li, a { word-break: keep-all; }
}

@media print {
    /* 브라우저 기본 머리글/바닥글(날짜, 주소 등) 강제 제거 */
    @page { margin: 0; }
    
    /* 표지(1페이지)가 종이에 100% 꽉 찰 수 있도록 body의 모든 강제 여백 제거 */
    body { margin: 0 !important; padding: 0 !important; font-size: 10pt; line-height: 1.4; background-color: #f4f6f9 !important; }
    p, li, .content-text { font-size: 10pt !important; margin-bottom: 8px !important; }
    h1, h2, h3, h4, h5 { margin-bottom: 8px !important; }

    /* 1페이지 표지(Hero) 완벽 복원 및 1장 꽉 채우기 */
    .hero { 
        min-height: 100vh !important; 
        height: 100vh !important;
        width: 100% !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        page-break-inside: avoid !important; 
        page-break-after: always !important; /* 표지 끝난 후 무조건 다음 장(2페이지)으로 깔끔하게 넘김 */
    }
    .hero .title { font-size: 28pt !important; margin-bottom: 15px !important; }
    .hero .subtitle { font-size: 14pt !important; }

    /* 본문에만 종이 바깥으로 잘리지 않도록 1.5cm 안전 여백 부여 */
    .container.mt-n5, .section { 
        margin-top: 0 !important; 
        padding: 1.5cm !important; 
    }

    /* 강제로 배경색과 이미지를 모두 인쇄하도록 설정 */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* 인쇄 시 불필요한 요소 숨김 (홈버튼, 푸터) */
    .nav-home, footer, .badge { display: none !important; }
    
    /* 여백 및 컨테이너 100% 사용 */
    .container { width: 100% !important; max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
    
    /* 작은 박스요소들이 페이지 중간에서 잘리는 것 방지 + 패딩/마진 축소 */
    .s-card, .tl-box, .highlight-box, .quote-box, .quote-card, .action-box, .timeline-item, .bg-light-blue, .alert-custom { 
        page-break-inside: avoid; 
        break-inside: avoid; 
        margin-bottom: 15px !important; 
        padding: 15px !important;
    }
    
    /* 거대한 섹션 래퍼(.card-custom)는 자연스럽게 페이지가 나뉘도록 허용 (빈 공간 방지) */
    .card-custom, .document-frame {
        page-break-inside: auto;
        break-inside: auto;
        margin-bottom: 15px !important;
        padding: 15px !important;
    }
    
    /* 헤딩 뒤에서 잘리는 것 방지 */
    h1, h2, h3, h4, h5 { page-break-after: avoid; break-after: avoid; }
    
    /* 다이어그램 잘림 방지 */
    .mermaid { page-break-inside: avoid; break-inside: avoid; text-align: center; margin-bottom: 10px !important; }
    
    /* 링크 기본 스타일 제거 (인쇄시 밑줄이나 파란색 방지) */
    a { text-decoration: none !important; color: inherit; }
}
