/* 유즈킷 — QR코드·A4 인쇄판 생성기
   외부 폰트·아이콘·스크립트를 불러오지 않는 자체 완결형 스타일시트 */

:root {
  --bg: #f5f7fc;
  --bg-soft: #eef1f9;
  --card: #ffffff;
  --ink: #141b2d;
  --ink-2: #38415a;
  --muted: #68718a;
  --line: #e2e6f0;
  --line-strong: #cdd4e4;
  --brand: #3b5bfd;
  --brand-dark: #2b45d6;
  --brand-soft: #eef1ff;
  --ok: #0a8f52;
  --warn: #b45309;
  --danger: #c2413b;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 14px 32px -18px rgba(16, 24, 40, .28);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui,
          "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: break-word;
}

h1, h2, h3 { line-height: 1.3; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(1.5rem, 3.9vw, 2.3rem); }
h2 { font-size: clamp(1.2rem, 2.4vw, 1.55rem); margin-top: 0; }
h3 { font-size: 1.02rem; font-weight: 700; margin-top: 22px; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
canvas { display: block; }
code {
  font-family: var(--mono); font-size: .86em; background: var(--bg-soft);
  padding: 1px 5px; border-radius: 5px; color: var(--ink-2); word-break: break-all;
}

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.note { color: var(--muted); font-size: .84rem; margin: .5em 0 0; }
.note.warn { color: var(--warn); }
a.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: #fff; color: var(--brand-dark); font-weight: 700; padding: 10px 16px;
  border-radius: 0 0 10px 0;
}
a.skip:focus { left: 0; }

/* ---------------- 자체 헤더(통합 배포 시 공통 헤더로 교체됨) ---------------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head .head-in { display: flex; align-items: center; gap: 16px; height: 64px; }
.site-head .brand, .site-foot .brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.05; }
.brand-txt strong { font-size: 1rem; letter-spacing: -.01em; }
.brand-txt span { font-size: .64rem; color: var(--muted); letter-spacing: .08em; }
.head-nav { display: flex; gap: 18px; margin-left: 10px; }
.head-nav a { color: var(--ink-2); font-size: .92rem; font-weight: 600; }

.btn {
  --btn-bg: #fff; --btn-fg: var(--ink); --btn-bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 11px; border: 1px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg); font-weight: 700; font-size: .92rem;
  cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { --btn-bg: var(--brand); --btn-fg: #fff; --btn-bd: transparent; box-shadow: 0 8px 18px -10px rgba(59, 91, 253, .9); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-ghost { --btn-fg: var(--ink-2); --btn-bd: transparent; --btn-bg: transparent; }
.btn-sm { padding: 7px 11px; font-size: .82rem; border-radius: 9px; }

/* ---------------- 히어로 ---------------- */
.hero { padding: 42px 0 8px; }
.eyebrow {
  display: inline-block; margin: 0 0 10px; padding: 4px 10px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: .76rem; font-weight: 800; letter-spacing: .02em;
}
.hero h1 { margin-bottom: 14px; }
.h1-sub { display: block; margin-top: 6px; font-size: .5em; font-weight: 700; color: var(--ink-2); letter-spacing: -.01em; }
.lead { max-width: 860px; color: var(--ink-2); font-size: 1rem; }
.hero-badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 0; }
.hero-badges li {
  padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  font-size: .82rem; font-weight: 700; color: var(--ink-2); box-shadow: var(--shadow-sm);
}

/* ---------------- 도구 카드 ---------------- */
.tool {
  margin-top: 26px; padding: 0 0 26px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.tool-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--bg-soft);
}
.tabs { display: flex; gap: 6px; }
.tab {
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-2);
  padding: 9px 15px; border-radius: 999px; font-weight: 800; font-size: .9rem; cursor: pointer;
}
.tab.is-on { background: var(--brand); border-color: transparent; color: #fff; box-shadow: 0 8px 18px -12px rgba(59, 91, 253, .9); }
.privacy-note { margin: 0 0 0 auto; color: var(--ink-2); font-size: .82rem; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.privacy-note .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(10, 143, 82, .12); }

.panel { padding: 18px; }
.panel > * + * { margin-top: 16px; }

/* ---------------- 좌우 배치 ---------------- */
.qr-grid, .sheet-grid { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 18px; align-items: start; }
.qr-controls { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.qr-preview { min-width: 0; display: flex; flex-direction: column; gap: 12px; }

.field-set { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px 14px; margin: 0; background: #fff; }
.field-set legend { padding: 0 6px; font-size: .84rem; font-weight: 800; color: var(--brand-dark); }
.field-set > label, .field > label { display: block; font-size: .8rem; font-weight: 700; color: var(--ink-2); margin: 10px 0 5px; }
.field-set > label:first-of-type { margin-top: 2px; }
.field { display: block; min-width: 0; }
.field > label em { font-style: normal; color: var(--muted); font-weight: 600; }
input[type="text"], textarea, select {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 9px;
  font-family: inherit; font-size: .9rem; color: var(--ink); background: #fff;
}
textarea { resize: vertical; line-height: 1.6; }
input[type="text"]:focus, textarea:focus, select:focus, input[type="color"]:focus, input[type="range"]:focus {
  outline: 2px solid rgba(59, 91, 253, .35); outline-offset: 1px;
}
input[type="color"] { width: 100%; height: 36px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; }
input[type="range"] { width: 100%; accent-color: var(--brand); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checks { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.check { font-size: .84rem; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.check input { accent-color: var(--brand); }
.check-inline { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--ink-2); padding: 8px 0; }
.check-inline input { accent-color: var(--brand); }

/* 프리셋 버튼 */
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.preset {
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-2);
  padding: 7px 12px; border-radius: 999px; font-weight: 800; font-size: .82rem; cursor: pointer;
}
.preset.is-on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.preset-fields { border-top: 1px dashed var(--line); padding-top: 4px; }
.preset-actions { display: flex; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* 담기는 글자 */
.payload {
  margin: 4px 0 0; padding: 10px 12px; max-height: 168px; overflow: auto;
  background: #f8f9fd; border: 1px solid var(--line); border-radius: 9px;
  font-family: var(--mono); font-size: .78rem; line-height: 1.6; color: var(--ink-2);
  white-space: pre-wrap; word-break: break-all;
}

/* 미리보기 */
.canvas-frame {
  border: 1px solid var(--line); border-radius: var(--radius-sm); background:
    repeating-conic-gradient(#f4f6fb 0% 25%, #ffffff 0% 50%) 50% / 20px 20px;
  padding: 12px; display: flex; align-items: center; justify-content: center;
}
.paper-frame { background: #e9edf7; }
.qr-canvas { width: auto; height: auto; max-width: 100%; max-height: 440px; border-radius: 8px; box-shadow: 0 10px 30px -18px rgba(16, 24, 40, .45); }
.sheet-canvas { width: auto; height: auto; max-width: 100%; max-height: 620px; border-radius: 4px; box-shadow: 0 12px 32px -20px rgba(16, 24, 40, .55); background: #fff; }
.qr-info {
  margin: 0; padding: 9px 12px; border-radius: 9px; background: var(--bg-soft);
  font-size: .82rem; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.qr-info.is-error { background: #fdf4f3; color: var(--danger); }
.qr-actions { display: flex; gap: 10px; align-items: end; }
.qr-actions .field { flex: 0 0 220px; }
.qr-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.qr-buttons .btn-primary { flex: 1 1 180px; }
.status-line { min-height: 1.3em; margin-top: 4px; }

/* ---------------- 본문 섹션 ---------------- */
.section { margin-top: 44px; }
.section > h2 { margin-bottom: 14px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li { padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.steps b { display: block; margin-bottom: 6px; font-size: .96rem; color: var(--brand-dark); }
.steps p { margin: 0; color: var(--ink-2); font-size: .9rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; margin-bottom: 18px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-soft); font-size: .82rem; color: var(--ink-2); font-weight: 800; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

.cat-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; list-style: none; padding: 0; margin: 0 0 8px; }
.cat-list li { padding: 11px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .88rem; color: var(--ink-2); }
.cat-list b { display: block; color: var(--ink); margin-bottom: 2px; }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li {
  position: relative; padding: 12px 14px 12px 42px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: .92rem; color: var(--ink-2);
}
.checklist li::before {
  content: "✓"; position: absolute; left: 14px; top: 11px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark);
  font-size: .74rem; font-weight: 900; display: flex; align-items: center; justify-content: center;
}
.checklist b { color: var(--ink); }

.faq { display: grid; gap: 8px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 16px; }
.faq summary {
  cursor: pointer; padding: 13px 0; font-weight: 800; font-size: .95rem;
  list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-weight: 900; font-size: 1.1rem; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; color: var(--ink-2); font-size: .92rem; }

.more-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-list li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.more-list a { font-weight: 800; font-size: .92rem; }
.more-list span { display: block; margin-top: 3px; color: var(--muted); font-size: .82rem; }

/* ---------------- 푸터 ---------------- */
.site-foot { margin-top: 56px; background: #0f1425; color: #c9d2e6; }
.site-foot .foot-in { display: flex; flex-wrap: wrap; gap: 24px; padding-top: 34px; padding-bottom: 22px; justify-content: space-between; }
.site-foot .brand-txt strong { color: #fff; }
.foot-note { margin: 12px 0 0; color: #8e9ab5; font-size: .84rem; max-width: 620px; }
.foot-col { display: flex; flex-direction: column; gap: 6px; }
.foot-col b { color: #fff; font-size: .86rem; margin-bottom: 2px; }
.foot-col a { color: #a9b6d0; font-size: .84rem; }
.foot-base { border-top: 1px solid rgba(255, 255, 255, .08); padding: 14px 20px 24px; color: #7c88a5; font-size: .78rem; text-align: center; }

/* ---------------- 좁은 화면 ---------------- */
@media (max-width: 900px) {
  .qr-grid, .sheet-grid { grid-template-columns: 1fr; }
  .steps, .cat-list, .more-list { grid-template-columns: 1fr; }
  .qr-canvas { max-height: 380px; }
  .sheet-canvas { max-height: 560px; }
}
@media (max-width: 560px) {
  .hero { padding-top: 30px; }
  .tool-head { flex-direction: column; align-items: stretch; }
  .privacy-note { margin: 0; }
  .panel { padding: 12px; }
  .row2 { grid-template-columns: 1fr; }
  .qr-actions { flex-direction: column; align-items: stretch; }
  .qr-actions .field { flex: 1 1 auto; }
  .qr-canvas { max-height: 320px; }
  .sheet-canvas { max-height: 460px; }
  .qr-buttons .btn { flex: 1 1 100%; }
  .presets { gap: 4px; }
  .preset { padding: 6px 10px; font-size: .78rem; }
}

@media print {
  .site-head, .site-foot, .hero, .section, .tool-head, .qr-controls, .qr-actions, .qr-buttons, .note, .qr-info { display: none !important; }
  .tool, .panel, .canvas-frame { border: 0; box-shadow: none; padding: 0; background: #fff; }
  .qr-canvas, .sheet-canvas { max-height: none; box-shadow: none; }
}
