/*
 * sign-view.css — the PDF view and its signing steps, for every page that
 * loads public/sign-view.js (the Field App and the desktop gallery).
 *
 * MOVED, not rewritten, out of the Field App's own stylesheet in m.html
 * (Ric, agent-comms #154, 20 Nov 2026: "have our signature engine built that
 * we built already be available on it"). The rules are the phone's, as they
 * were. They read the page's own colour tokens (--bg, --surface, --border,
 * --text, --muted, --label, --accent, --accent-text, --success, --warn); a page
 * that does not define one sets it for #pdfView in its own stylesheet.
 */
/* in-app PDF viewer + signing — same band as the lightbox */
#pdfView {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  flex-direction: column;
  background: var(--bg);
}
.pdfv-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.pdfv-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdfv-sign {
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  background: #ea580c;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 14px;
  cursor: pointer;
}
.pdfv-hint {
  flex: 0 0 auto;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg));
}
.pdfv-pages {
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
}
.pdfv-page {
  position: relative;
  margin: 0 auto 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}
.pdfv-page canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}
/* A saved web page (a report), drawn in its sandboxed frame at the
   viewer's width and its own text size; it scrolls inside the frame,
   and anything wider than the phone scrolls sideways there. The Save
   link sits under it. */
.pdfv-frame {
  display: block;
  width: 100%;
  height: calc(100% - 64px);
  min-height: 240px;
  border: 0;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}
.pdfv-stamp {
  position: absolute;
  pointer-events: none;
  border: 1.5px dashed var(--accent);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
}
.pdfv-stamp img {
  display: block;
  width: 100%;
  height: auto;
}
.pdfv-confirm {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.pdfv-save {
  flex: 1;
  border: 0;
  border-radius: 10px;
  background: var(--success);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  padding: 13px 0;
  cursor: pointer;
}
.pdfv-save:disabled {
  opacity: 0.5;
}
.pdfv-cancel {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  padding: 0 16px;
  cursor: pointer;
}
/* the three signing sheets — disclosure, pad, review. Each closes only
   via its own buttons (modal law) and only one is ever up. */
#sigSheet,
#sigConsent,
#sigReview {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  align-items: flex-end;
  background: rgba(15, 23, 42, 0.45);
}
.sig-box {
  width: 100%;
  max-height: 94%;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 14px 14px 0 0;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
}
.sig-head {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--label);
  margin: 0 0 8px 2px;
}
#sigPad {
  display: block;
  width: 100%;
  /* Ric (#141): "that area that they're signing should be zoomed in so
     they have appropriate space to sign". It was 160px — a strip, on a
     document somebody has to stand behind. The real win is sideways:
     46vh of a phone held landscape is a wide, shallow box, which is the
     shape a signature actually is. */
  height: 46vh;
  min-height: 170px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fff;
  touch-action: none; /* the pad owns the finger — no scroll while signing */
}
.sig-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.sig-row button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
}
.sig-row .sig-use {
  flex: 1;
  border: 0;
  background: var(--accent);
  color: #fff;
}
/* The two new sheets carry the acts that bind somebody, and they are
   pressed on a driveway, often with a glove on. 44px minimum; the pad
   sheet's own row is left as it has been since August. */
#sigConsent .sig-row button,
#sigReview .sig-row button {
  min-height: 44px;
}
.sig-row button:disabled {
  opacity: 0.45;
}
/* the disclosure itself — scrollable, because it is longer than a phone
   and the signer has to be able to reach the end of it */
.sig-disc {
  max-height: 34vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.sig-disc p {
  margin: 0 0 10px;
}
.sig-disc p:last-child {
  margin-bottom: 0;
}
.sig-disc .sig-disc-title {
  font-weight: 800;
}
.sig-field {
  margin-top: 10px;
}
.sig-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--label);
  margin: 0 0 4px 2px;
}
#sigConsentName {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px; /* 16px or iOS zooms the page on focus */
  padding: 11px 12px;
}
/* The global `label` rule is uppercase 800 — right for a field label,
   wrong for a sentence somebody has to read and agree to. Caps make a
   legal acknowledgement harder to read and easier to skip, which is the
   opposite of what this step is for (seen in the phone preview). */
.sig-ack,
.sig-ack span {
  text-transform: none;
  font-weight: 400;
  letter-spacing: normal;
}
.sig-ack {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
}
.sig-ack input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0;
}
.sig-ack.locked {
  opacity: 0.55;
}
/* why a step is still blocked, or what the server refused — said plainly,
   because this is read in a customer's living room */
.sig-why {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--warn);
}
/* Shown only in portrait, where the box is squarer than a signature. */
.sig-turn {
  display: none;
  font-size: 12px;
  color: var(--muted);
  margin: 8px 2px 0;
}
@media (orientation: portrait) {
  .sig-turn {
    display: block;
  }
}
.sig-who {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px 2px;
}
.sig-check {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  padding: 10px 12px;
}
.sig-check-row {
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text);
}
#sigReviewInk {
  display: block;
  width: 100%;
  max-height: 110px;
  object-fit: contain;
  object-position: left center;
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 8px;
}
/* A place handed in (the desktop's signing link, Ric #154): the box is
   outlined on its page, and the ink is previewed inside it, at its left, with
   room at its foot for the "Signed by" line the engine prints there. */
.pdfv-place {
  position: absolute;
  pointer-events: none;
  border: 2px dashed var(--accent);
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.pdfv-stamp-box img {
  width: 100%;
  height: 72%;
  object-fit: contain;
  object-position: left top;
}
