/* =========================================================
   한국중소기업지원연구소(한중연) — 디자인 시스템 & 공통 컴포넌트
   v3.0 (2026-10-08)
   ========================================================= */

/* ---------- 1. 디자인 토큰 ---------- */
:root {
    /* 색 — 한중연 대표 색상 (블로그와 동일, v3.3)
       #12335F 딥 네이비(메인·신뢰) / #2563EB 블루(보조·강조) / #FFC93C 옐로우(액센트·CTA)
       ※ 기존 변수 이름(green 등)은 코드 호환을 위해 유지하고 값만 블루로 바꿈 */
    --navy: #12335F;
    --navy-90: #1A4479;
    --navy-dark: #0B2241;
    --navy-10: #E3EAF3;
    --ivory: #F4F7FB;
    --white: #FFFFFF;
    --green: #2563EB;          /* = 블루(보조·강조) */
    --green-dark: #1D4ED8;
    --green-10: #EAF1FE;
    --accent: #FFC93C;         /* 옐로우(CTA·하이라이트) */
    --accent-dark: #F2B500;
    --accent-10: #FFF6DB;
    --text: #1E293B;
    --muted: #5B6B80;
    --line: #E1E7EF;
    --kakao: #FEE500;
    --kakao-text: #191600;
    --warn-bg: #FFF7E6;
    --warn-line: #F2C46D;

    /* 글자 크기: 제목 4단계 · 본문 2단계 */
    --fs-h1: clamp(2rem, 4.6vw, 3.4rem);
    --fs-h2: clamp(1.6rem, 3.2vw, 2.4rem);
    --fs-h3: clamp(1.25rem, 2vw, 1.5rem);
    --fs-h4: 1.125rem;
    --fs-body: 1.0625rem;   /* 17px */
    --fs-small: 0.9375rem;  /* 15px */

    /* 여백 단계 */
    --sp-1: 0.5rem;
    --sp-2: 1rem;
    --sp-3: 1.5rem;
    --sp-4: 2rem;
    --sp-5: 3rem;
    --sp-6: 4.5rem;
    --sp-7: 6.5rem;

    --radius: 12px;
    --shadow: 0 6px 24px rgba(18, 51, 95, 0.10);
    --container: 1160px;
    --header-h: 72px;
}

/* ---------- 2. 기본 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
    font-size: var(--fs-body);
    line-height: 1.7;
    color: var(--text);
    background: var(--white);
    word-break: keep-all;
    overflow-wrap: break-word;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.3; letter-spacing: -0.02em; font-weight: 800; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-3); }
.section { padding: var(--sp-7) 0; }
.section-ivory { background: var(--ivory); }
.section-navy { background: var(--navy); color: #DCE6F2; }
.section-navy h2, .section-navy h3 { color: var(--white); }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 999; background: var(--white); padding: .5rem 1rem; }

/* 자리표시 */
.tbd { display: inline-block; background: #FFF1C2; color: #7A5A00; border-radius: 4px; padding: 0 6px; font-size: .9em; font-weight: 600; }

/* ---------- 3. 섹션 제목 ---------- */
.section-head { max-width: 720px; margin-bottom: var(--sp-5); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow { display: inline-block; font-size: var(--fs-small); font-weight: 700; color: var(--green); letter-spacing: .02em; margin-bottom: var(--sp-1); }
.section-navy .eyebrow { color: var(--accent); }
.section-head h2 { font-size: var(--fs-h2); margin-bottom: var(--sp-2); }
.section-head p { color: var(--muted); font-size: 1.125rem; }
.section-navy .section-head p { color: #C3D2E5; }

/* ---------- 4. 버튼 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 52px; padding: 0 1.5rem; border-radius: var(--radius);
    font-size: 1.0625rem; font-weight: 700; text-decoration: none; border: 2px solid transparent;
    transition: background .2s, color .2s, border-color .2s, transform .2s;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
/* 주 버튼 = 옐로우 CTA + 네이비 글자 (대비 확보) */
.btn-primary { background: var(--accent); color: var(--navy); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-blue { background: var(--green); color: var(--white); }
.btn-blue:hover { background: var(--green-dark); }
.btn-secondary { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: var(--navy); color: var(--white); }
.btn-kakao { background: var(--kakao); color: var(--kakao-text); }
.btn-light { background: var(--white); color: var(--navy); }
.btn-outline-light { background: transparent; color: var(--white); border-color: rgba(255,255,255,.6); }
.btn-outline-light:hover { background: var(--white); color: var(--navy); }
.btn-sm { min-height: 44px; padding: 0 1.1rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.text-link { color: var(--green); font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* ---------- 5. 카드 ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-4); }
.card-shadow { box-shadow: var(--shadow); border-color: transparent; }
.grid { display: grid; gap: var(--sp-3); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- 6. 헤더 (딥 네이비 띠 — 로고의 네이비 배경과 자연스럽게 이어짐) ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100; height: var(--header-h);
    background: var(--navy);
    border-bottom: 1px solid rgba(255, 255, 255, .08); transition: box-shadow .2s;
}
.site-header.is-scrolled { box-shadow: 0 4px 18px rgba(11, 34, 65, .25); }
.site-header.is-plain { background: var(--navy); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand img { height: 40px; width: auto; }
.brand-name { font-weight: 800; color: var(--white); font-size: 1.05rem; letter-spacing: -0.02em; }
.main-nav { display: flex; align-items: center; gap: var(--sp-4); }
.main-nav ul { display: flex; gap: var(--sp-3); }
.main-nav a { text-decoration: none; font-weight: 600; color: var(--white); font-size: 1rem; }
.main-nav ul a:hover, .main-nav ul a.is-active { color: var(--accent); }
.main-nav ul a.is-active { box-shadow: inset 0 -2px 0 var(--accent); padding-bottom: 4px; }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; align-items: center; justify-content: center; font-size: 1.4rem; color: var(--white); }

/* ---------- 7. 푸터 ---------- */
.site-footer { background: var(--navy-dark); color: #C3D2E5; padding: var(--sp-6) 0 calc(var(--sp-4) + 72px); font-size: var(--fs-small); }
.footer-brandline { color: var(--white); font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: var(--sp-4); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: var(--sp-4); padding-bottom: var(--sp-4); border-bottom: 1px solid rgba(255,255,255,.1); }
.footer-grid h3 { color: var(--white); font-size: 1rem; margin-bottom: var(--sp-2); }
.footer-grid dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem .9rem; }
.footer-grid dt { color: #8FA3BD; }
.footer-grid a { color: #E2E8F0; text-decoration: none; }
.footer-grid a:hover { color: var(--white); text-decoration: underline; }
.footer-grid li { margin-bottom: .4rem; }
.footer-disclaimer { margin-top: var(--sp-3); padding: var(--sp-3); border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius); color: #E2E8F0; line-height: 1.75; }
.footer-bottom { margin-top: var(--sp-3); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2); }
.footer-bottom a { color: #E2E8F0; text-decoration: none; margin-right: var(--sp-2); font-weight: 600; }

/* ---------- 8. 고지문 박스 ---------- */
.disclaimer-box { background: var(--ivory); border-left: 4px solid var(--navy); border-radius: var(--radius); padding: var(--sp-3); font-size: var(--fs-small); color: var(--text); line-height: 1.75; }
.disclaimer-box strong { color: var(--navy); }
.note-small { font-size: var(--fs-small); color: var(--muted); }

/* ---------- 9. 모바일 하단 고정 바 / 데스크톱 상담 버튼 ---------- */
.mobile-bar { display: none; }
.float-consult {
    position: fixed; right: 24px; bottom: 24px; z-index: 90;
    display: inline-flex; align-items: center; gap: .5rem; min-height: 52px; padding: 0 1.25rem;
    background: var(--navy); color: var(--white); border-radius: 999px; text-decoration: none; font-weight: 700;
    box-shadow: var(--shadow);
}
.float-consult:hover { background: var(--accent); color: var(--navy); }

/* ---------- 10. 폼 ---------- */
.form-field { margin-bottom: var(--sp-3); }
.form-label { display: block; font-weight: 700; color: var(--navy); margin-bottom: .45rem; }
.form-label .req { color: #C2410C; margin-left: 2px; }
.form-label .opt { color: var(--muted); font-weight: 500; font-size: .9em; margin-left: 4px; }
.input, .select, .textarea {
    width: 100%; min-height: 52px; padding: .75rem 1rem; font: inherit; font-size: 1.0625rem; color: var(--text);
    background: var(--white); border: 1.5px solid #C9D3E0; border-radius: var(--radius);
}
.textarea { min-height: 130px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-10); }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
    display: flex; align-items: center; min-height: 52px; padding: .6rem 1rem; border: 1.5px solid #C9D3E0; border-radius: var(--radius);
    background: var(--white); cursor: pointer; font-weight: 600; transition: border-color .15s, background .15s;
}
.choice input:checked + span { border-color: var(--green); background: var(--green-10); color: var(--green-dark); }
.choice input:focus-visible + span { outline: 3px solid var(--green); outline-offset: 2px; }
.check-row { display: flex; align-items: flex-start; gap: .6rem; padding: .5rem 0; }
.check-row input { width: 22px; height: 22px; margin-top: 3px; accent-color: var(--green); flex-shrink: 0; }
.consent-box { background: var(--ivory); border-radius: var(--radius); padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-2); }
.consent-detail { font-size: var(--fs-small); color: var(--muted); margin: .25rem 0 .25rem 2rem; }
.form-error { color: #B91C1C; font-size: var(--fs-small); margin-top: .35rem; display: none; }
.form-field.has-error .form-error { display: block; }
.form-field.has-error .input, .form-field.has-error .select { border-color: #B91C1C; }

/* ---------- 11. FAQ (details) ---------- */
.faq-list { max-width: 860px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
    list-style: none; cursor: pointer; padding: var(--sp-3) 2.5rem var(--sp-3) 0; position: relative;
    font-weight: 700; font-size: 1.125rem; color: var(--navy);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); font-size: 1.6rem; color: var(--green); font-weight: 400; }
.faq-item[open] summary::after { content: '−'; }
.faq-item .faq-a { padding: 0 0 var(--sp-3); color: var(--text); }

/* ---------- 12. 페이지 히어로(하위 페이지) ---------- */
.page-hero { background: var(--ivory); padding: var(--sp-6) 0 var(--sp-5); }
.page-hero h1 { font-size: var(--fs-h1); margin-bottom: var(--sp-2); }
.page-hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 720px; margin-bottom: var(--sp-3); }
.breadcrumb { font-size: var(--fs-small); color: var(--muted); margin-bottom: var(--sp-2); }
.breadcrumb a { color: var(--muted); }

/* ---------- 13. 리스트 / 기타 ---------- */
.check-list li { position: relative; padding-left: 1.75rem; margin-bottom: .6rem; }
.check-list li::before { content: ''; position: absolute; left: 0; top: .55em; width: 14px; height: 8px; border-left: 3px solid var(--green); border-bottom: 3px solid var(--green); transform: rotate(-45deg); }
.x-list li { position: relative; padding-left: 2.25rem; margin-bottom: var(--sp-2); font-size: 1.125rem; color: var(--white); font-weight: 600; }
.x-list li::before { content: '×'; position: absolute; left: 0; top: -.1em; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: rgba(255,201,60,.18); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.x-list li small { display: block; font-weight: 400; color: #C3D2E5; font-size: var(--fs-small); }
.badge { display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 700; }
.badge-loan { background: #FDECEC; color: #9B1C1C; }
.badge-grant { background: var(--green-10); color: var(--green-dark); }
.badge-guarantee { background: #EEF2FF; color: #3730A3; }
.badge-cert { background: var(--navy-10); color: var(--navy); }
.badge-employ { background: #FEF3C7; color: #92400E; }
.badge-closed { background: #E5E7EB; color: #4B5563; }
.badge-sample { background: #FFF1C2; color: #7A5A00; }

/* 이미지 모달 */
.img-modal { position: fixed; inset: 0; background: rgba(10, 20, 30, .85); z-index: 300; display: none; align-items: center; justify-content: center; padding: var(--sp-3); }
.img-modal.is-open { display: flex; }
.img-modal figure { max-width: 900px; max-height: 90vh; text-align: center; }
.img-modal img { max-height: 80vh; margin: 0 auto; border-radius: 8px; background: #fff; }
.img-modal figcaption { color: var(--white); margin-top: .75rem; }
.img-modal-close { position: absolute; top: 16px; right: 16px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--white); color: var(--navy); font-size: 1.5rem; }

/* 스크롤 표시 애니메이션 (내용이 숨지 않도록 JS가 없으면 표시) */
.reveal { opacity: 1; }
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- 14. 반응형 ---------- */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .main-nav ul { gap: var(--sp-2); }
}
@media (max-width: 860px) {
    :root { --header-h: 64px; }
    .section { padding: var(--sp-6) 0; }
    .nav-toggle { display: inline-flex; }
    .main-nav {
        position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; background: var(--navy);
        flex-direction: column; align-items: stretch; gap: 0; padding: var(--sp-3); display: none; overflow-y: auto;
    }
    .main-nav.is-open { display: flex; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav li a { display: block; padding: 1rem .25rem; border-bottom: 1px solid rgba(255,255,255,.12); font-size: 1.15rem; }
    .main-nav ul a.is-active { box-shadow: none; padding-bottom: 1rem; }
    .main-nav .btn { margin-top: var(--sp-3); }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .float-consult { display: none; }
    .mobile-bar {
        display: grid; grid-template-columns: 1fr 1fr 1.3fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
        background: var(--white); border-top: 1px solid var(--line); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); gap: 8px;
        box-shadow: 0 -4px 16px rgba(30,58,138,.08);
    }
    .mobile-bar a { display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 50px; border-radius: 10px; text-decoration: none; font-weight: 700; font-size: 1rem; }
    .mobile-bar .mb-call { background: var(--navy-10); color: var(--navy); }
    .mobile-bar .mb-kakao { background: var(--kakao); color: var(--kakao-text); }
    .mobile-bar .mb-diag { background: var(--navy); color: var(--white); }
    .mobile-bar .mb-diag i { color: var(--accent); }
    body.has-mobile-bar { padding-bottom: 76px; }
    .site-footer { padding-bottom: var(--sp-4); }
}
@media (max-width: 560px) {
    .container { padding: 0 1.15rem; }
    .grid-4 { grid-template-columns: 1fr; }
    .choice-grid { grid-template-columns: 1fr; }
    .card { padding: var(--sp-3); }
    .btn-row .btn { flex: 1 1 100%; }
    .brand-name { font-size: .98rem; }
    .brand img { height: 30px; }
}

/* 인쇄 */
@media print {
    .site-header, .site-footer, .mobile-bar, .float-consult, .no-print { display: none !important; }
    body { padding: 0 !important; }
}
