/* Document pages + fields — shared by the prepare editor and the signing view */
.doc-stack { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 14px 0 40px; }
.page-wrap { position: relative; background: #fff; box-shadow: 0 0 0 1px #d8d6de, 0 2px 6px rgba(0,0,0,.06); flex: none; }
.page-inner { position: absolute; top: 0; left: 0; transform-origin: 0 0; overflow: hidden; }
.page-inner > img.page-img { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.page-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; padding: 8px 6px 22px; }

/* HTML-rendered sample document */
.page-html { width: 100%; height: 100%; padding: 70px 76px 60px; font-family: var(--font-doc); font-size: 14.5px; line-height: 1.42; color: #111; position: relative; }
.page-html p { margin: 0 0 11px; }
.page-html ol { margin: 0 0 12px; padding-left: 24px; }
.page-html li { margin-bottom: 5px; }
.page-html h1.doc-title { font-size: 22px; text-align: center; margin: 4px 0 18px; letter-spacing: .02em; }
.page-html h3 { font-size: 15px; margin: 16px 0 6px; }
.doc-env { position: absolute; top: 20px; left: 22px; font-family: Arial, sans-serif; font-size: 10px; color: #222; }
.doc-runhead { position: absolute; top: 20px; right: 22px; font-family: Arial, sans-serif; font-size: 9.5px; color: #999; }
.doc-foot { position: absolute; bottom: 22px; left: 76px; right: 76px; display: flex; justify-content: space-between; font-size: 11.5px; color: #333; border-top: 1px solid #ccc; padding-top: 6px; }
.doc-brand { display: flex; align-items: center; justify-content: center; gap: 8px; font-family: Georgia, serif; font-size: 22px; color: #1d4d7a; margin-top: 8px; letter-spacing: .01em; }
.doc-brand-mark { width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(#f29a3a 0 25%, #1d4d7a 0 50%, #f29a3a 0 75%, #1d4d7a 0); }
.doc-center { text-align: center; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0 8px; }
.doc-table th, .doc-table td { border: 1px solid #555; padding: 5px 8px; text-align: left; }
.doc-table th { background: #3a3a3a; color: #fff; font-family: Arial, sans-serif; font-size: 11.5px; letter-spacing: .04em; }
.doc-check { display: flex; align-items: center; gap: 10px; padding-left: 20px; }
.doc-box { width: 16px; height: 16px; border: 1px solid #666; flex: none; }
.doc-sigbar { background: #333; color: #fff; text-align: center; font-family: Arial, sans-serif; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; padding: 3px; margin: 22px 0 14px; }
.doc-sigrow { display: flex; gap: 24px; margin-top: 30px; }
.doc-sigline { flex: 1; display: flex; flex-direction: column; }
.doc-sigline > span { min-height: 24px; border-bottom: 1px solid #222; font-size: 14px; display: flex; align-items: flex-end; padding: 0 2px 2px; }
.doc-sigline small { font-family: Arial, sans-serif; font-size: 9.5px; color: #333; margin-top: 3px; letter-spacing: .02em; }
.doc-signed { font-family: "Homemade Apple", cursive; font-size: 15px !important; }

/* Search highlight */
mark.find-hit { background: #ffe58a; color: inherit; padding: 0; border-radius: 2px; }
mark.find-hit.current { background: #ffb02e; box-shadow: 0 0 0 2px #ffb02e; }

/* ---------- fields ---------- */
.fld {
  position: absolute; display: flex; align-items: center; justify-content: center;
  font-family: var(--font); font-size: 12px; color: var(--ink); border-radius: 2px;
}
/* Signing view: unfilled fields */
.fld.todo { cursor: pointer; background: rgba(255, 210, 60, .28); outline: 1px dashed rgba(196, 140, 0, .9); outline-offset: 0; }
.fld.todo:hover { background: rgba(255, 210, 60, .45); }
.fld.todo.optional { background: rgba(130, 170, 255, .18); outline-color: rgba(60, 100, 200, .7); }
.fld.todo.sign-like { flex-direction: column; gap: 1px; background: var(--violet-600); outline: 2px dashed rgba(255,255,255,.65); outline-offset: -4px; color: #fff; font-weight: 600; font-size: 11px; }
.fld.todo.sign-like .ico { width: 18px; height: 18px; }
.fld.todo.sign-like:hover { background: var(--violet-500); }
.fld.current { box-shadow: 0 0 0 3px rgba(242, 169, 59, .85); }
.fld.readonly { cursor: default; background: rgba(0,0,0,.04); outline: 1px dashed #bbb; color: #888; }
.fld input.fld-input {
  width: 100%; height: 100%; border: 0; background: transparent; padding: 0 4px; font-size: 13px; font-family: Arial, sans-serif; outline: none; color: #111;
}
.fld.filled { background: transparent; outline: none; justify-content: flex-start; font-family: Arial, sans-serif; font-size: 14px; color: #111; padding: 0 2px; cursor: default; }
.fld.filled.editable { cursor: pointer; }
.fld.filled.editable:hover { outline: 1px dashed #c6a33a; }
.fld.cb { padding: 0; justify-content: center; }
.fld.cb.filled { outline: none; }
.fld.cb .tick { width: 100%; height: 100%; border: 1.5px solid #222; background: #fff; display: grid; place-items: center; }
.fld.cb .tick svg { width: 90%; height: 90%; }
.fld.cb.todo { outline-offset: 2px; }

/* Adopted signature stamp */
.sig-stamp { position: relative; width: 100%; height: 100%; padding: 12px 6px 11px 14px; display: flex; align-items: center; }
.sig-stamp::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 6px; width: 16px; border: 2px solid var(--violet-600); border-right: 0; border-radius: 8px 0 0 8px; }
.sig-stamp .lbl { position: absolute; left: 12px; top: -2px; font-family: Arial, sans-serif; font-size: 9px; font-weight: 700; color: #111; background: #fff0; }
.sig-stamp .fp { position: absolute; left: 12px; bottom: -3px; font-family: Arial, sans-serif; font-size: 8.5px; color: #111; letter-spacing: .02em; }
.sig-stamp .ink { font-size: 24px; line-height: 1; color: #0d0d0d; white-space: nowrap; overflow: hidden; }
.sig-stamp img.ink-img { max-height: 100%; max-width: 100%; object-fit: contain; }
.sig-stamp.initial .ink { font-size: 20px; }
.doc-sigline > span.tall { min-height: 54px; }
