/* Document look (app preview + public signing page) and the signing page itself. */
.doc-paper { background: #fff; border: 1px solid #e6eaf0; border-radius: 6px; padding: 48px 56px; max-width: 820px; margin: 0 auto; color: #1f2937; box-shadow: 0 1px 3px rgba(16,24,40,.06); }
.doc-body { font-size: 15px; line-height: 1.65; }
.doc-body h2 { font-size: 24px; font-weight: 800; margin: 0 0 14px; color: #111827; letter-spacing: -.01em; text-transform: none; }
.doc-body h3 { font-size: 16px; font-weight: 800; margin: 22px 0 6px; color: #111827; text-transform: none; letter-spacing: 0; }
.doc-body h4 { font-size: 14px; font-weight: 800; margin: 16px 0 4px; color: #111827; }
.doc-body p { margin: 0 0 12px; }
.doc-body ul { margin: 0 0 12px; padding-left: 22px; }
.doc-body li { margin: 3px 0; }
.doc-blank { background: #fff4d6; color: #92400e; border: 1px dashed #f0b44c; border-radius: 4px; padding: 0 4px; font-size: .9em; white-space: nowrap; }
.doc-price { width: 100%; border-collapse: collapse; margin: 10px 0 18px; font-size: 14px; }
.doc-price th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #6b7684; border-bottom: 2px solid #e6eaf0; padding: 8px 10px; }
.doc-price td { border-bottom: 1px solid #eef1f5; padding: 9px 10px; vertical-align: top; }
.doc-price .num { text-align: right; white-space: nowrap; }
.doc-price tfoot td { font-weight: 800; font-size: 15px; border-bottom: 0; border-top: 2px solid #1d85f6; }
.doc-price tr.opt td { color: #6b7684; }
.doc-opt { font-size: 11px; background: #f1f4f8; border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.doc-sigs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 28px 36px; margin-top: 36px; padding-top: 22px; border-top: 1px solid #e6eaf0; }
.doc-sig .line { height: 64px; border-bottom: 1.5px solid #1f2937; display: flex; align-items: flex-end; padding-bottom: 4px; }
.doc-sig .line img { max-height: 60px; max-width: 100%; }
.doc-sig .typed { font-family: "Dancing Script", "Brush Script MT", cursive; font-size: 34px; line-height: 1; color: #10243e; }
.doc-sig .who { font-size: 13px; margin-top: 6px; }
.doc-sig .who b { display: block; font-size: 14px; }
.doc-sig .pending { color: #9aa4b2; font-size: 13px; font-style: italic; }
.doc-sig.me-next .line { border-bottom-color: #1d85f6; background: #f3f8ff; }

/* ---- public signing page ---- */
body.signpage { margin: 0; background: #f5f8fc; font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #282828; }
.sp-bar { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid #e6eaf0; padding: 12px 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sp-bar img { width: 32px; height: 32px; border-radius: 7px; object-fit: contain; }
.sp-bar .t { font-weight: 800; font-size: 15px; min-width: 0; }
.sp-bar .s { font-size: 12px; color: #6b7684; }
.sp-bar .sp { flex: 1; }
.sp-btn { font: inherit; font-weight: 700; border: 1px solid #d9dee6; background: #fff; color: #33393d; padding: 9px 16px; border-radius: 6px; cursor: pointer; }
.sp-btn.primary { background: #1d85f6; border-color: #1d85f6; color: #fff; }
.sp-btn.primary:hover { background: #0f74e0; }
.sp-btn:disabled { opacity: .5; cursor: not-allowed; }
.sp-btn.link { border: 0; background: none; color: #6b7684; padding: 9px 8px; }
.sp-wrap { padding: 24px 16px 80px; }
.sp-note { max-width: 820px; margin: 0 auto 16px; background: #eaf3fe; border: 1px solid #cfe3fd; color: #134a87; border-radius: 6px; padding: 12px 16px; font-size: 14px; }
.sp-note.ok { background: #e7f8ef; border-color: #bfe9d2; color: #0b5a35; }
.sp-note.bad { background: #fdecec; border-color: #f6c9c9; color: #8a1c1c; }
.sp-msg { max-width: 520px; margin: 80px auto; text-align: center; background: #fff; border: 1px solid #e6eaf0; border-radius: 8px; padding: 36px 28px; }
.sp-msg h1 { font-size: 20px; margin: 0 0 8px; }
.sp-audit { max-width: 820px; margin: 24px auto 0; background: #fff; border: 1px solid #e6eaf0; border-radius: 6px; padding: 24px 28px; font-size: 13px; }
.sp-audit h2 { font-size: 16px; margin: 0 0 4px; }
.sp-audit table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.sp-audit td { padding: 6px 8px; border-bottom: 1px solid #eef1f5; vertical-align: top; }
.sp-audit .hash { font-family: ui-monospace, Menlo, monospace; font-size: 11px; word-break: break-all; color: #6b7684; }
.sp-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.sp-modal { background: #fff; border-radius: 10px; width: 100%; max-width: 520px; padding: 24px; max-height: calc(100vh - 32px); overflow: auto; }
.sp-modal h2 { margin: 0 0 4px; font-size: 18px; }
.sp-modal label { display: block; font-size: 12px; font-weight: 700; color: #5f6b7a; margin: 14px 0 5px; }
.sp-modal input[type=text], .sp-modal textarea { font: inherit; width: 100%; box-sizing: border-box; border: 1px solid #d9dee6; border-radius: 6px; padding: 9px 11px; }
.sp-tabs { display: flex; gap: 6px; margin-top: 14px; }
.sp-tabs button { font: inherit; font-weight: 700; flex: 1; padding: 8px; border: 1px solid #d9dee6; background: #fff; border-radius: 6px; cursor: pointer; color: #5f6b7a; }
.sp-tabs button.on { background: #eaf3fe; border-color: #1d85f6; color: #1d85f6; }
.sp-typed { margin-top: 10px; height: 90px; border: 1px dashed #c4ccd8; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-family: "Dancing Script", cursive; font-size: 40px; color: #10243e; overflow: hidden; white-space: nowrap; }
.sp-pad { margin-top: 10px; position: relative; }
.sp-pad canvas { width: 100%; height: 150px; border: 1px dashed #c4ccd8; border-radius: 6px; touch-action: none; display: block; background: #fcfdff; cursor: crosshair; }
.sp-pad .clear { position: absolute; top: 6px; right: 8px; font-size: 12px; }
.sp-consent { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; color: #33393d !important; font-size: 13px !important; line-height: 1.45; margin-top: 16px !important; }
.sp-consent input { margin-top: 3px; width: 16px; height: 16px; flex: none; }
.sp-err { color: #c62828; font-size: 13px; min-height: 18px; margin-top: 8px; }
.sp-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
@media (max-width: 640px) {
  .doc-paper { padding: 26px 18px; }
  .sp-bar { padding: 10px 14px; }
  .sp-bar .sp { display: none; }
}
@media print {
  .sp-bar, .sp-note, .no-print { display: none !important; }
  body.signpage { background: #fff; }
  .sp-wrap { padding: 0; }
  .doc-paper, .sp-audit { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .sp-audit { page-break-before: always; }
}
