:root {
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --border: #d8dce3;
  --bg: #f5f6f8;
  --text: #1f2430;
  --muted: #6b7280;
  --danger: #dc2626;
  --ok: #16a34a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  line-height: 1.5;
}

.page-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

h1 { font-size: 22px; margin: 0 0 8px; }
p.desc { color: var(--muted); margin: 0 0 20px; font-size: 14px; }

.error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.ok-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: var(--ok);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-dark); }
.btn.block { display: block; width: 100%; text-align: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* --- PDF 뷰어 & 입력 오버레이 --- */
#pages { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pdf-page { position: relative; box-shadow: 0 1px 4px rgba(0,0,0,.15); background: #fff; }
.pdf-page canvas { display: block; }
.overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.overlay .field-input {
  position: absolute;
  pointer-events: auto;
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  background: rgba(37, 99, 235, .06);
  font-size: 14px;
  padding: 0 6px;
}
.overlay .field-input:focus { outline: none; background: #fff; }
.overlay .sig-wrap { position: absolute; pointer-events: auto; }
.overlay .sig-wrap canvas {
  border: 1.5px dashed var(--accent);
  border-radius: 4px;
  background: rgba(37, 99, 235, .04);
  touch-action: none;
  width: 100%;
  height: 100%;
  display: block;
}
.sig-clear {
  position: absolute;
  top: -28px;
  right: 0;
  font-size: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
}

.submit-bar {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  margin-top: 16px;
  border-radius: 12px 12px 0 0;
}
