/**
 * legal.css — 개인정보처리방침(/privacy) · 이용약관(/terms) 공용 스타일
 *
 * 두 문서는 같은 뼈대(머리 · 목차 · 본문 · 문의 창구)를 쓰므로 한 파일로 묶는다.
 * 색·반경은 css/tokens.css 토큰만 쓴다 (화면 팔레트를 바꿀 때 이 파일은 손대지 않는다).
 */

.doc-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

/* ===== 머리 ===== */
.doc-head { grid-column: 1 / -1; border-bottom: 3px solid var(--accent); padding-bottom: 16px; position: relative; }
.doc-head::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; border-bottom: 1px solid var(--ink-surface); }
.doc-head .vol { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--accent-dark); }
.doc-head h1 { font-family: 'Noto Sans KR', sans-serif; font-size: clamp(24px, 3.4vw, 32px); font-weight: 900; margin-top: 6px; }
.doc-head .doc-lead { font-size: 14px; color: var(--ink-3); margin-top: 10px; max-width: 78ch; line-height: 1.85; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.doc-meta .chip { border: 1px solid var(--rule); background: var(--card); padding: 4px 10px; font-weight: 700; }
.doc-meta .chip.beta { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }

/* ===== 목차 ===== */
.doc-toc { position: sticky; top: 68px; border: 1px solid var(--rule); background: var(--card); padding: 14px 16px; }
.doc-toc h2 { font-family: 'Noto Sans KR', sans-serif; font-size: 12px; font-weight: 900; letter-spacing: 1px; color: var(--accent-dark); margin-bottom: 10px; }
.doc-toc ol { list-style: none; counter-reset: toc; }
.doc-toc li { counter-increment: toc; }
.doc-toc a { display: block; font-size: 12.5px; color: var(--ink-2); padding: 5px 0; line-height: 1.5; border-bottom: 1px dashed transparent; }
.doc-toc a::before { content: counter(toc) '. '; color: var(--ink-3); font-weight: 700; }
.doc-toc a:hover { color: var(--accent-dark); border-bottom-color: var(--accent); }

/* ===== 본문 ===== */
.doc-body { min-width: 0; }
.doc-sec { border: 1px solid var(--rule); background: var(--card); padding: 20px 22px 22px; margin-bottom: 16px; scroll-margin-top: 72px; }
.doc-sec > h2 { font-family: 'Noto Sans KR', sans-serif; font-size: 17px; font-weight: 900; border-bottom: 2px solid var(--accent); padding-bottom: 10px; margin-bottom: 14px; display: flex; align-items: baseline; gap: 8px; }
.doc-sec > h2 .no { color: var(--accent-dark); font-size: 13px; }
.doc-sec h3 { font-family: 'Noto Sans KR', sans-serif; font-size: 14.5px; font-weight: 900; margin: 18px 0 8px; }
.doc-sec h3:first-of-type { margin-top: 4px; }
.doc-sec p { font-size: 13.5px; color: var(--ink-2); line-height: 1.95; margin: 8px 0; }
.doc-sec ul, .doc-sec ol { margin: 8px 0 8px 0; padding-left: 20px; }
.doc-sec li { font-size: 13.5px; color: var(--ink-2); line-height: 1.9; margin: 3px 0; }
.doc-sec li > b, .doc-sec p > b { color: var(--ink); }
.doc-sec a { color: var(--accent-dark); font-weight: 700; border-bottom: 1px dashed var(--accent); }
.doc-sec a:hover { color: var(--ink); border-bottom-style: solid; }
.doc-sec .note { font-size: 12.5px; color: var(--ink-3); background: var(--paper-2); border-left: 3px solid var(--accent); padding: 10px 14px; margin: 12px 0; line-height: 1.85; }
.doc-sec .warn { border-left-color: var(--danger); }

/* 표 — 좁은 화면에서는 가로 스크롤 */
.doc-table-scroll { overflow-x: auto; margin: 12px 0; }
table.doc-table { width: 100%; min-width: 460px; border-collapse: collapse; font-size: 12.5px; }
table.doc-table th, table.doc-table td { border: 1px solid var(--rule); padding: 8px 10px; text-align: left; vertical-align: top; line-height: 1.7; color: var(--ink-2); }
table.doc-table th { background: var(--paper-2); font-weight: 800; color: var(--ink); white-space: nowrap; }
table.doc-table td b { color: var(--ink); }

/* 사업자(운영자) 정보 */
.op-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; }
.op-info div { border: 1px solid var(--rule); background: var(--paper); padding: 10px 12px; }
.op-info dt { font-size: 11px; font-weight: 800; letter-spacing: .5px; color: var(--ink-3); }
.op-info dd { font-size: 13px; font-weight: 700; color: var(--ink); margin-top: 3px; }

/* ===== 문의 창구 ===== */
.contact-cta { border: 1px solid var(--accent); background: var(--accent-soft); padding: 16px 18px; margin-top: 6px; }
.contact-cta h3 { margin-top: 0; }
.contact-cta p { margin: 6px 0 12px; }
.btn-contact {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: inherit; font-size: 13px; font-weight: 800;
  padding: 10px 18px; border: 0; border-radius: var(--ctrl-radius);
  background: var(--ink-surface); color: var(--paper); cursor: pointer; transition: background .2s;
}
.btn-contact:hover { background: var(--accent-dark); }
.btn-contact[disabled] { opacity: .55; cursor: not-allowed; }

/* 문의 모달 */
.lc-backdrop { position: fixed; inset: 0; z-index: 1400; background: rgba(var(--ink-rgb), .55); display: none; align-items: flex-start; justify-content: center; padding: 24px 16px; overflow-y: auto; }
.lc-backdrop.open { display: flex; }
.lc-card { width: 100%; max-width: 560px; background: var(--card); border: 1px solid var(--rule); border-top: 4px solid var(--accent); }
.lc-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 2px solid var(--accent); }
.lc-head h2 { font-family: 'Noto Sans KR', sans-serif; font-size: 16px; font-weight: 900; }
.lc-head .ui-close { margin-left: auto; }
.lc-body { padding: 16px 18px 20px; }
.lc-intro { font-size: 12.5px; color: var(--ink-3); line-height: 1.8; background: var(--paper-2); border-left: 3px solid var(--accent); padding: 10px 12px; margin-bottom: 14px; }
.lc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lc-field { margin-bottom: 12px; }
.lc-field label { display: block; font-size: 12px; font-weight: 800; color: var(--ink-2); margin-bottom: 5px; }
.lc-field label .opt { font-weight: 600; color: var(--ink-3); }
.lc-field input, .lc-field select, .lc-field textarea {
  width: 100%; font-family: inherit; font-size: 13px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--ctrl-radius);
  padding: 10px 12px; transition: border-color .2s;
}
.lc-field input:focus, .lc-field select:focus, .lc-field textarea:focus { outline: none; border-color: var(--accent); }
.lc-field textarea { min-height: 130px; resize: vertical; line-height: 1.7; }
.lc-counter { text-align: right; font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.lc-check { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; margin-bottom: 12px; }
.lc-check input { width: 16px; height: 16px; margin-top: 2px; flex: 0 0 16px; accent-color: var(--ink-surface); }
.lc-check a { color: var(--accent-dark); font-weight: 700; }
.lc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lc-msg { font-size: 12.5px; line-height: 1.7; margin-bottom: 10px; min-height: 0; }
.lc-msg.error { color: var(--danger); font-weight: 700; }
.lc-msg.ok { color: var(--success); font-weight: 700; }
.lc-actions { display: flex; gap: 8px; align-items: center; }
.lc-actions .spacer { flex: 1; }
.btn-ghost {
  font-family: inherit; font-size: 13px; font-weight: 700; padding: 10px 16px;
  background: transparent; color: var(--ink-2); border: 1px solid var(--rule);
  border-radius: var(--ctrl-radius); cursor: pointer;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-dark); }

/* 문서 하단 문의하기 — 본문(§12)과 별개로, 문서를 다 읽은 지점에서도 접수할 수 있게 둔다 */
.doc-cta {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  border: 1px solid var(--accent); border-left: 4px solid var(--accent);
  background: var(--accent-soft); padding: 16px 20px; margin-top: 8px;
}
.doc-cta-text { flex: 1 1 320px; min-width: 0; }
.doc-cta h3 { font-family: 'Noto Sans KR', sans-serif; font-size: 15px; font-weight: 900; margin-bottom: 4px; }
.doc-cta p { font-size: 13px; color: var(--ink-2); line-height: 1.8; margin: 0; }
.doc-cta .btn-contact { flex: 0 0 auto; }

/* 푸터 (약관·정책 열) */
.doc-foot { grid-column: 1 / -1; border-top: 1px dashed var(--rule); margin-top: 8px; padding-top: 14px; font-size: 12.5px; color: var(--ink-3); line-height: 1.9; }
.doc-foot a { color: var(--accent-dark); font-weight: 700; }

/* 인쇄 — 약관을 종이로 보관하는 경우가 있다 */
@media print {
  [data-site-header], [data-site-footer], .doc-toc, .contact-cta, .doc-cta, .lc-backdrop { display: none !important; }
  body { background: #fff; }
  .doc-wrap { display: block; max-width: none; padding: 0; }
  .doc-sec { border: 0; padding: 0 0 12px; margin-bottom: 14px; break-inside: auto; }
  .doc-sec > h2 { break-after: avoid; }
  .doc-sec h3 { break-after: avoid; }
  table.doc-table { min-width: 0; }
}

@media (max-width: 940px) {
  .doc-wrap { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .doc-toc { position: static; }
}
@media (max-width: 560px) {
  .doc-wrap { padding: 20px 14px 48px; }
  .doc-sec { padding: 16px 15px 18px; }
  .lc-row { grid-template-columns: 1fr; }
}
