/* ==========================================================================
   서식창고 (Seosik Vault) — 전문 서식 자동 작성 사이트
   신뢰감 있는 밝은 테마 (블루/틸)
   ========================================================================== */

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f0f3f9;
  --line: #e2e8f2;
  --line-strong: #cdd7e6;
  --text: #1a2233;
  --text-dim: #5c6880;
  --text-mute: #8b96ab;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #e8f0ff;
  --teal: #0d9488;
  --accent: #f59e0b;
  --danger: #dc2626;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(20,30,60,.06), 0 1px 2px rgba(20,30,60,.04);
  --shadow: 0 8px 24px rgba(30,50,90,.10);
  --shadow-lg: 0 20px 50px rgba(30,50,90,.16);
  --maxw: 1120px;
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
          "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.7; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 16px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--text); letter-spacing: -.5px; }
.brand .logo { width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(135deg, var(--primary), var(--teal)); display: grid; place-items: center; font-size: 18px; color:#fff; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--text-dim); font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 9px; }
.nav-links a:hover { color: var(--primary); background: var(--primary-soft); text-decoration: none; }
.nav-cta { background: var(--primary); color: #fff !important; padding: 9px 16px !important; border-radius: 10px !important; }
.nav-cta:hover { background: var(--primary-dark); }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 26px; cursor: pointer; }

/* ---------- Ad slots ---------- */
.ad-slot {
  margin: 26px auto; max-width: var(--maxw); min-height: 100px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  display: grid; place-items: center; color: var(--text-mute); font-size: 13px; background: var(--surface-2);
}
.ad-slot small { letter-spacing: 1px; text-transform: uppercase; }

/* ---------- Hero ---------- */
.hero { padding: 60px 0 26px; text-align: center; }
.hero h1 { font-size: clamp(30px, 5vw, 50px); line-height: 1.18; margin: 0 0 14px; letter-spacing: -1.4px; }
.hero h1 .grad { background: linear-gradient(120deg, var(--primary), var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: clamp(16px, 2.3vw, 20px); color: var(--text-dim); max-width: 660px; margin: 0 auto 26px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.eyebrow { color: var(--teal); font-weight: 800; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px; }

/* search */
.searchbar { max-width: 560px; margin: 0 auto; position: relative; }
.searchbar input { width: 100%; padding: 15px 18px 15px 46px; border-radius: 14px; border: 1px solid var(--line-strong); background: #fff; font-size: 16px; box-shadow: var(--shadow-sm); font-family: var(--font); }
.searchbar input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.searchbar::before { content: "🔍"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 16px; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 24px; border-radius: 12px; font-weight: 700; font-size: 16px; border: 1px solid transparent; cursor: pointer; transition: transform .12s, box-shadow .2s, background .2s; font-family: var(--font); }
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--line-strong); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-accent { background: var(--accent); color: #3a2a00; }
.btn-sm { padding: 9px 15px; font-size: 14px; border-radius: 9px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Sections ---------- */
section { padding: 32px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(22px, 3.2vw, 30px); margin: 0; letter-spacing: -.8px; }
.section-head .more { color: var(--text-dim); font-weight: 600; font-size: 14px; }

/* ---------- Category chips ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 8px 0 4px; }
.chip { border: 1px solid var(--line-strong); background: #fff; color: var(--text-dim); border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: 14px; cursor: pointer; }
.chip.active, .chip:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Cards grid ---------- */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; transition: transform .15s, border-color .2s, box-shadow .2s; position: relative; box-shadow: var(--shadow-sm);
}
.card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: var(--shadow); text-decoration: none; }
.card .emoji { font-size: 32px; margin-bottom: 10px; }
.card h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.4px; color: var(--text); }
.card p { margin: 0; color: var(--text-dim); font-size: 14px; }
.card .cat { display: inline-block; margin-bottom: 10px; font-size: 11px; font-weight: 800; color: var(--teal); background: #e6f7f4; padding: 3px 9px; border-radius: 999px; }
.card .tag { display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--primary); }
.card .badge-hot { position: absolute; top: 14px; right: 14px; font-size: 11px; font-weight: 800; background: var(--accent); color: #3a2a00; padding: 3px 9px; border-radius: 999px; }

/* ---------- Feature strip ---------- */
.features { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow-sm); }
.feature .fi { font-size: 26px; }
.feature h4 { margin: 8px 0 4px; font-size: 15px; }
.feature p { margin: 0; font-size: 13px; color: var(--text-dim); }

/* ---------- Generator layout ---------- */
.gen-wrap { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
.gen-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); position: sticky; top: 84px; }
.gen-form h2 { margin: 0 0 4px; font-size: 20px; }
.gen-form .sub { color: var(--text-dim); font-size: 14px; margin: 0 0 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; margin-bottom: 5px; font-size: 14px; }
.field input, .field select, .field textarea { width: 100%; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--line-strong); background: #fff; color: var(--text); font-size: 14px; font-family: var(--font); }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field .hint { color: var(--text-mute); font-size: 12px; margin-top: 4px; }
.gen-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* document paper preview */
.paper-scroll { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; overflow: auto; box-shadow: var(--shadow-sm); }
.doc-paper {
  background: #fff; width: 100%; max-width: 720px; margin: 0 auto; padding: 54px 56px;
  box-shadow: var(--shadow); color: #16202e; font-size: 15px; line-height: 1.9; min-height: 400px;
}
.doc-paper h1.doc-title { text-align: center; font-size: 30px; letter-spacing: 14px; margin: 0 0 30px; padding-bottom: 4px; font-weight: 800; }
.doc-paper .doc-sub { text-align: center; color: #555; margin: -18px 0 26px; letter-spacing: 2px; }
.doc-paper table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.doc-paper table th, .doc-paper table td { border: 1px solid #333; padding: 8px 10px; font-size: 14px; }
.doc-paper table th { background: #f1f4f9; }
.doc-paper .kv { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; margin: 10px 0; }
.doc-paper .kv .k { color: #333; font-weight: 700; }
.doc-paper .clause { margin: 10px 0; }
.doc-paper .sign { margin-top: 40px; text-align: right; line-height: 2.2; }
.doc-paper .center { text-align: center; }
.doc-paper .amount-box { border: 2px solid #16202e; padding: 10px 16px; display: inline-block; font-size: 18px; font-weight: 800; letter-spacing: 2px; }
.doc-paper .muted { color: #667; font-size: 13px; }
.doc-paper hr { border: 0; border-top: 1px solid #ccc; margin: 22px 0; }

/* ---------- Prose ---------- */
.prose { max-width: 780px; margin: 0 auto; }
.prose h1 { font-size: clamp(26px, 4.5vw, 38px); letter-spacing: -1px; margin: 0 0 8px; }
.prose .meta { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }
.prose h2 { font-size: 23px; margin: 32px 0 12px; letter-spacing: -.5px; }
.prose h3 { font-size: 18px; margin: 22px 0 8px; }
.prose p, .prose li { color: #33405a; }
.prose p { margin: 0 0 15px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 15px; }
.prose li { margin: 6px 0; }
.prose blockquote { border-left: 4px solid var(--primary); margin: 18px 0; padding: 8px 18px; color: var(--text-dim); background: var(--primary-soft); border-radius: 8px; }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.prose th, .prose td { border: 1px solid var(--line-strong); padding: 10px 12px; text-align: left; font-size: 15px; }
.prose th { background: var(--surface-2); }

/* ---------- Forms (inquiry) ---------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; max-width: 660px; margin: 0 auto; box-shadow: var(--shadow-sm); }
.hint { color: var(--text-dim); font-size: 13px; }

/* ---------- Pricing ---------- */
.price-table { width: 100%; border-collapse: collapse; margin: 16px 0; background:#fff; }
.price-table th, .price-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.price-table th { color: var(--teal); font-size: 14px; background: var(--surface-2); }
.price-table td.price { font-weight: 800; }
.price-table tr:hover td { background: var(--surface-2); }

/* ---------- Callout ---------- */
.callout { background: linear-gradient(135deg, var(--primary-soft), #e6f7f4); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 30px; text-align: center; margin: 30px 0; }
.callout h2 { margin: 0 0 8px; }
.callout p { color: var(--text-dim); margin: 0 0 18px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 50px; padding: 40px 0; color: var(--text-dim); background: #fff; }
.footer-grid { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); font-size: 14px; }
.footer-legal { margin-top: 24px; font-size: 12px; color: var(--text-mute); line-height: 1.8; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: #fff; padding: 12px 20px; border-radius: 10px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 100; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .gen-wrap { grid-template-columns: 1fr; }
  .gen-form { position: static; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 620px) {
  .nav-links { display: none; position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; background: #fff; border-bottom: 1px solid var(--line); padding: 12px; gap: 4px; }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; }
  .nav-toggle { display: block; margin-left: auto; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .doc-paper { padding: 32px 24px; }
  .doc-paper h1.doc-title { font-size: 24px; letter-spacing: 8px; }
}

/* ---------- Print: 문서만 인쇄 ---------- */
@media print {
  body * { visibility: hidden !important; }
  #docPreview, #docPreview * { visibility: visible !important; }
  #docPreview { position: absolute; left: 0; top: 0; width: 100%; }
  .doc-paper { box-shadow: none !important; max-width: 100% !important; padding: 20px 30px !important; }
  @page { margin: 16mm; }
}
