:root {
  --navy: #1F2B45;
  --navy-2: #2C3A5A;
  --ivory: #F8F4EC;
  --paper: #FFFDF8;
  --gold: #B8935A;
  --gold-line: #DCC9A3;
  --line: #E6DCC8;
  --muted: #6A7284;
  --danger: #B4493A;
  --ok: #3F7A5A;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--navy); color: var(--navy);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 16px; line-height: 1.65; word-break: keep-all; overflow-wrap: break-word;
}
a { color: inherit; }
[hidden] { display: none !important; }

.arch {
  max-width: 680px; margin: 28px auto 40px; background: var(--ivory);
  border-radius: 340px 340px 22px 22px / 220px 220px 22px 22px;
  padding: 18px; position: relative;
}
.arch::before {
  content: ""; position: absolute; inset: 9px; border: 1px solid var(--gold-line);
  border-radius: 332px 332px 16px 16px / 212px 212px 16px 16px; pointer-events: none;
}
.inner { position: relative; padding: 40px 10px 8px; }
@media (min-width: 560px) { .inner { padding: 52px 34px 14px; } .arch { padding: 22px; } }

.brand { text-align: center; }
.brand img { width: 92px; height: 92px; display: block; margin: 0 auto 4px; }
.brand .eyebrow { margin: 0; font-size: 13px; letter-spacing: 0.08em; color: var(--gold); font-weight: 600; }
.brand h1 { margin: 2px 0 0; font-size: 26px; letter-spacing: -0.01em; }
.rule { width: 64%; height: 1px; background: var(--gold-line); margin: 16px auto 22px; }

.lead { font-size: 17px; text-align: center; margin: 0 0 18px; }
.lead b { color: var(--navy); }
.muted { color: var(--muted); }
.center { text-align: center; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; margin: 0 0 16px; }
@media (min-width: 560px) { .card { padding: 22px 24px; } }
.card > h2 { font-size: 18px; margin: 0 0 12px; }

/* 계약서 본문 */
.contract { font-size: 15px; line-height: 1.75; }
.contract h2 { font-size: 17px; margin: 28px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--navy); }
.contract h3 { font-size: 15.5px; margin: 20px 0 6px; color: var(--navy); }
.contract h3::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin: 0 8px 3px 0; }
.contract p { margin: 0 0 8px; }
.contract ol { margin: 0 0 8px; padding-left: 22px; }
.contract li { margin: 0 0 6px; }
.contract ul { margin: 4px 0 6px; padding-left: 18px; }
.contract ul li { margin: 0 0 3px; list-style: "– "; }
.contract table, .tbl-wrap table { width: 100%; border-collapse: collapse; margin: 10px 0 12px; font-size: 14px; }
.contract th, .contract td { border: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
.contract th { background: #F3EDE1; font-weight: 600; white-space: nowrap; }
.contract table.info th { width: 30%; white-space: normal; }
.contract td { overflow-wrap: break-word; word-break: keep-all; }
@media (max-width: 559px) {
  .contract table.tbl, .contract table.tbl tbody, .contract table.tbl tr, .contract table.tbl td { display: block; width: 100%; }
  .contract table.tbl thead { display: none; }
  .contract table.tbl tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 0 0 8px; background: #fff; }
  .contract table.tbl td { border: 0; padding: 3px 0; display: grid; grid-template-columns: 34% 1fr; gap: 8px; }
  .contract table.tbl td::before { content: attr(data-label); color: var(--muted); font-size: 13px; }
  .contract table.tbl td:first-child { font-weight: 700; font-size: 15.5px; grid-template-columns: 1fr; }
  .contract table.tbl td:first-child::before { display: none; }
}
.docmeta { font-size: 12px; color: var(--muted); word-break: break-all; margin-top: 14px; }

/* 동의와 서명 */
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin: 0 0 10px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--navy); flex: none; }
.check span { font-size: 15.5px; }
.check b { color: var(--gold); font-weight: 600; font-size: 13px; }
.privacy-box { font-size: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; margin: 0 0 10px; }
.privacy-box table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.privacy-box th, .privacy-box td { border-bottom: 1px solid var(--line); padding: 8px 4px; text-align: left; vertical-align: top; }
.privacy-box th { width: 25%; white-space: nowrap; font-weight: 600; }
.privacy-box h3 { display: none; }
.privacy-box thead { display: none; }
.privacy-box td:first-child { width: 24%; font-weight: 600; white-space: nowrap; padding-right: 10px; }
.privacy-box .pt { font-weight: 700; margin: 10px 0 0; font-size: 15px; }

.field { display: block; margin: 16px 0 0; }
.field > span { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.field .hint { display: block; font-size: 13px; color: var(--muted); margin: -2px 0 6px; font-weight: 400; }
input[type=text], input[type=tel], input[type=number], input[type=email], textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--navy); background: #fff;
  border: 1px solid #D4C8B2; border-radius: 12px; padding: 12px 14px; outline: none;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31, 43, 69, 0.12); }

.pad-wrap { margin-top: 16px; }
.pad-wrap > span { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.pad { position: relative; background: #fff; border: 1.5px dashed var(--gold); border-radius: 12px; height: 190px; touch-action: none; }
.pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 12px; cursor: crosshair; }
.pad .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #B9AE98; font-size: 15px; pointer-events: none; }
.pad .base { position: absolute; left: 18px; right: 18px; bottom: 44px; border-bottom: 1px solid #EDE4D3; pointer-events: none; }
.pad-tools { display: flex; justify-content: flex-end; margin-top: 6px; }

.btn { appearance: none; border: 0; font: inherit; cursor: pointer; border-radius: 999px; padding: 15px 22px; font-size: 16.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.primary { background: var(--navy); color: var(--ivory); width: 100%; }
.btn.primary:disabled { background: #A9AFBC; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid #CFC2A8; padding: 8px 14px; font-size: 14px; font-weight: 600; }
.btn.gold { background: var(--gold); color: #fff; width: 100%; }
.statement { font-size: 14.5px; margin: 16px 0 12px; text-align: center; }
.fine { font-size: 12.5px; color: var(--muted); margin: 10px 2px 0; }
.err { color: var(--danger); font-size: 14.5px; margin: 10px 2px 0; min-height: 1em; }

.done { text-align: center; }
.done .mark { width: 58px; height: 58px; border-radius: 50%; background: var(--navy); color: var(--ivory); display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; font-size: 28px; }
.done h2 { margin: 0 0 6px; font-size: 21px; }
.steps { text-align: left; margin: 16px 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; padding: 12px 0 12px 40px; position: relative; border-top: 1px solid var(--line); }
.steps li::before { content: counter(s); position: absolute; left: 4px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.copy-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.copy-row code { overflow-wrap: normal; word-break: keep-all; font-family: inherit; font-weight: 700; background: #fff; border: 1px solid var(--line); padding: 6px 10px; border-radius: 8px; }

.loading { text-align: center; padding: 40px 0; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; margin: 0 auto 12px; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { background: #FFF7E6; border: 1px solid #EBD3A0; border-radius: 12px; padding: 12px 14px; font-size: 14.5px; margin: 0 0 16px; }

/* 진행 요청서 */
.req-section { margin-bottom: 16px; }
.req-section > h2 { font-size: 17px; margin: 0 0 4px; }
.req-section > .hint { font-size: 13.5px; color: var(--muted); margin: 0 0 6px; }
.opts { display: grid; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid #D9CDB6; border-radius: 12px; background: #fff; cursor: pointer; font-size: 15px; }
.opt input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy); flex: none; }
.opt:has(input:checked) { border-color: var(--navy); background: #F2F3F7; }
.req { color: var(--gold); font-size: 12px; font-weight: 700; margin-left: 4px; }
.infobox { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14.5px; }
.infobox dt { color: var(--muted); }
.infobox dd { margin: 0; font-weight: 600; }
.sticky-save { position: sticky; bottom: 10px; z-index: 5; }

footer { text-align: center; font-size: 12px; color: var(--muted); padding: 18px 6px 6px; line-height: 1.7; }
footer a { color: var(--muted); }

/* 개인정보처리방침 */
.policy h2 { font-size: 17px; margin: 24px 0 8px; }
.policy p, .policy li { font-size: 15px; }
.policy table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 12px; }
.policy th, .policy td { border: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
.policy th { background: #F3EDE1; }
