/* /funcionalidades/firmas-electronicas/ — a proposal out for signature. Four
   scenes (pantallas-escenas.js): 0 the client's link after Empezar, the
   signature box outlined; 1 «Adopta tu firma» open over it; 2 the signature
   in its box and Terminar on; 3 the request in the app, the resting state.
   The client's link is its own page, so scenes 0 to 2 cover the rail, the
   top bar and the address. */

.pn-frame[data-screen="e-signatures"] {
  --sg-accent: #467557;
}

/* ---------- the request, in the app ---------- */

.pn-frame[data-screen="e-signatures"] .pn-body.is-module { gap: 13px; }
.pn-frame[data-screen="e-signatures"] .sg-back { color: var(--sg-accent); font-size: 11px; }

.pn-frame[data-screen="e-signatures"] .sg-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.pn-frame[data-screen="e-signatures"] .sg-number {
  color: var(--ac-mut);
  font-family: var(--ac-mono);
  font-size: 11px;
  font-weight: 400;
}

.pn-frame[data-screen="e-signatures"] .sg-title .pn-badge { font-size: 9.5px; font-weight: 500; }
.pn-frame[data-screen="e-signatures"] .sg-sub { font-size: 11px; }
.pn-frame[data-screen="e-signatures"] .sg-sub u { color: var(--sg-accent); text-decoration: none; }
.pn-frame[data-screen="e-signatures"] .sg-acts { flex-wrap: wrap; justify-content: flex-end; gap: 7px; max-width: 470px; }
.pn-frame[data-screen="e-signatures"] .sg-danger { border-color: #fbd5d5; background: #fdf2f2; color: var(--ac-bad); }

.pn-frame[data-screen="e-signatures"] .sg-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
  gap: 13px;
}

.pn-frame[data-screen="e-signatures"] .sg-main,
.pn-frame[data-screen="e-signatures"] .sg-side {
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-width: 0;
}

.pn-frame[data-screen="e-signatures"] .sg-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ac-line);
}

.pn-frame[data-screen="e-signatures"] .sg-card-icon {
  display: grid;
  flex-shrink: 0;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 8px;
  background: #f1f1f3;
  color: var(--ac-mut);
}

.pn-frame[data-screen="e-signatures"] .sg-card-icon svg { width: 14px; height: 14px; }
.pn-frame[data-screen="e-signatures"] .sg-card-title { font-size: 13px; font-weight: 600; }
.pn-frame[data-screen="e-signatures"] .sg-card-sub { margin-top: 2px; color: var(--ac-mut); font-size: 10.5px; line-height: 1.45; }
.pn-frame[data-screen="e-signatures"] .sg-card-body { padding: 14px 16px 16px; }

/* the validity panel */
.pn-frame[data-screen="e-signatures"] .sg-checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pn-frame[data-screen="e-signatures"] .sg-checks.is-ruled { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ac-line); }

.pn-frame[data-screen="e-signatures"] .sg-check { display: flex; align-items: flex-start; gap: 10px; }

.pn-frame[data-screen="e-signatures"] .sg-tone {
  display: grid;
  flex-shrink: 0;
  width: 21px;
  height: 21px;
  margin-top: 1px;
  place-items: center;
  border-radius: 999px;
}

.pn-frame[data-screen="e-signatures"] .sg-tone svg { width: 12px; height: 12px; }
.pn-frame[data-screen="e-signatures"] .sg-tone.is-ok { background: #e7f6ec; color: var(--ac-good); }
.pn-frame[data-screen="e-signatures"] .sg-tone.is-warn { background: #fdf3dc; color: var(--ac-warn); }
.pn-frame[data-screen="e-signatures"] .sg-tone.is-bad { background: #fdecec; color: var(--ac-bad); }
.pn-frame[data-screen="e-signatures"] .sg-tone.is-pending { background: #f1f1f3; color: var(--ac-mut); }

.pn-frame[data-screen="e-signatures"] .sg-check em {
  display: block;
  color: var(--ac-dim);
  font-size: 9.5px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pn-frame[data-screen="e-signatures"] .sg-check b { display: block; color: var(--ac-ink); font-size: 11px; font-weight: 400; line-height: 1.45; }

.pn-frame[data-screen="e-signatures"] .sg-who { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ac-line); }
.pn-frame[data-screen="e-signatures"] .sg-who-name { margin-bottom: 10px; font-size: 11.5px; font-weight: 600; }
.pn-frame[data-screen="e-signatures"] .sg-who-name em { margin-left: 7px; color: var(--ac-mut); font-style: normal; font-weight: 400; }

/* events */
.pn-frame[data-screen="e-signatures"] .sg-events { margin: 0; padding: 0; list-style: none; }

.pn-frame[data-screen="e-signatures"] .sg-event {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--ac-line);
  font-size: 11px;
}

.pn-frame[data-screen="e-signatures"] .sg-event:last-child { border-bottom: 0; }
.pn-frame[data-screen="e-signatures"] .sg-seq { width: 22px; flex-shrink: 0; color: var(--ac-dim); font-family: var(--ac-mono); font-size: 10px; }
.pn-frame[data-screen="e-signatures"] .sg-event-text { flex: 1; min-width: 0; }
.pn-frame[data-screen="e-signatures"] .sg-event-text b { color: var(--ac-ink); font-weight: 400; }
.pn-frame[data-screen="e-signatures"] .sg-event-text em { color: var(--ac-mut); font-style: normal; }
.pn-frame[data-screen="e-signatures"] .sg-event-text i { display: block; color: var(--ac-dim); font-family: var(--ac-mono); font-size: 9.5px; font-style: normal; }
.pn-frame[data-screen="e-signatures"] .sg-event-time { flex-shrink: 0; color: var(--ac-mut); font-size: 10px; font-variant-numeric: tabular-nums; }

/* signers */
.pn-frame[data-screen="e-signatures"] .sg-signers,
.pn-frame[data-screen="e-signatures"] .sg-stamps { margin: 0; padding: 0; list-style: none; }

.pn-frame[data-screen="e-signatures"] .sg-signer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--ac-line);
  font-size: 11px;
}

.pn-frame[data-screen="e-signatures"] .sg-signer:last-child,
.pn-frame[data-screen="e-signatures"] .sg-stamp:last-child { border-bottom: 0; }
.pn-frame[data-screen="e-signatures"] .sg-signer-top { display: flex; align-self: stretch; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pn-frame[data-screen="e-signatures"] .sg-signer-who { display: flex; min-width: 0; align-items: flex-start; gap: 8px; }

.pn-frame[data-screen="e-signatures"] .sg-dot {
  display: grid;
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 8.5px;
  font-style: normal;
  font-weight: 600;
}

.pn-frame[data-screen="e-signatures"] .sg-signer-who b,
.pn-frame[data-screen="e-signatures"] .sg-signer-who em,
.pn-frame[data-screen="e-signatures"] .sg-signer-who small { display: block; }
.pn-frame[data-screen="e-signatures"] .sg-signer-who b { font-weight: 500; }
.pn-frame[data-screen="e-signatures"] .sg-signer-who em { color: var(--ac-mut); font-style: normal; word-break: break-all; }
.pn-frame[data-screen="e-signatures"] .sg-signer-who small { color: var(--ac-mut); font-size: 10px; }
.pn-frame[data-screen="e-signatures"] .sg-signer .pn-badge { font-size: 9px; font-weight: 500; }
.pn-frame[data-screen="e-signatures"] .sg-meta { color: var(--ac-mut); font-size: 10px; }
.pn-frame[data-screen="e-signatures"] .sg-meta.is-faint { color: var(--ac-dim); overflow-wrap: anywhere; }
.pn-frame[data-screen="e-signatures"] .sg-sm { gap: 5px; padding: 5px 9px; font-size: 10px; }
.pn-frame[data-screen="e-signatures"] .sg-sm svg { width: 12px; height: 12px; }

/* stamps */
.pn-frame[data-screen="e-signatures"] .sg-stamp {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--ac-line);
  font-size: 11px;
}

.pn-frame[data-screen="e-signatures"] .sg-stamp b,
.pn-frame[data-screen="e-signatures"] .sg-stamp em { display: block; }
.pn-frame[data-screen="e-signatures"] .sg-stamp b { font-weight: 500; }
.pn-frame[data-screen="e-signatures"] .sg-stamp em { color: var(--ac-mut); font-size: 10px; font-style: normal; }
.pn-frame[data-screen="e-signatures"] .sg-stamp .md-ibtn { flex-shrink: 0; }

/* the message */
.pn-frame[data-screen="e-signatures"] .sg-fields { display: flex; flex-direction: column; gap: 9px; font-size: 11px; }

.pn-frame[data-screen="e-signatures"] .sg-field em {
  display: block;
  color: var(--ac-dim);
  font-size: 9.5px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pn-frame[data-screen="e-signatures"] .sg-field b { display: block; font-weight: 400; line-height: 1.45; }

/* ---------- the client's link ---------- */

.pn-frame[data-screen="e-signatures"] .sg-sign {
  position: absolute;
  z-index: 7;
  inset: 0;
  display: none;
  overflow: hidden;
  background: var(--ac-canvas);
}

.pn-frame[data-screen="e-signatures"]:is([data-mk-scene="0"], [data-mk-scene="1"], [data-mk-scene="2"]) .sg-sign { display: block; }

.pn-frame[data-screen="e-signatures"] .sg-bar { border-bottom: 1px solid var(--ac-line); background: #fff; }

.pn-frame[data-screen="e-signatures"] .sg-bar-top,
.pn-frame[data-screen="e-signatures"] .sg-progress {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 13px;
  width: 896px;
  margin: 0 auto;
  padding: 13px 24px;
  box-sizing: border-box;
}

.pn-frame[data-screen="e-signatures"] .sg-progress { align-items: center; padding-top: 11px; border-top: 1px solid var(--ac-line); }
.pn-frame[data-screen="e-signatures"] .sg-org { font-size: 12px; font-weight: 600; }
.pn-frame[data-screen="e-signatures"] .sg-doc-title { font-size: 16px; font-weight: 600; line-height: 1.35; }
.pn-frame[data-screen="e-signatures"] .sg-expires { color: var(--ac-mut); font-size: 11.5px; }
.pn-frame[data-screen="e-signatures"] .sg-bar-acts { display: flex; flex-shrink: 0; align-items: center; gap: 7px; }

.pn-frame[data-screen="e-signatures"] .sg-select {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 112px;
  box-sizing: border-box;
  padding: 6px 9px;
  border: 1px solid var(--ac-line);
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
}

.pn-frame[data-screen="e-signatures"] .sg-select svg { width: 12px; height: 12px; color: var(--ac-dim); }
.pn-frame[data-screen="e-signatures"] .sg-ghost { border-color: transparent; background: transparent; color: var(--ac-mut); }
.pn-frame[data-screen="e-signatures"] .sg-progress p { font-size: 11.5px; }
.pn-frame[data-screen="e-signatures"] .sg-ready { display: none; }

/* scenes 0 and 1: one field to go, Terminar still off */
.pn-frame[data-screen="e-signatures"] .sg-finish { opacity: 0.45; }
.pn-frame[data-screen="e-signatures"][data-mk-scene="2"] .sg-finish { opacity: 1; }
.pn-frame[data-screen="e-signatures"][data-mk-scene="2"] .sg-missing,
.pn-frame[data-screen="e-signatures"][data-mk-scene="2"] .sg-next { display: none; }
.pn-frame[data-screen="e-signatures"][data-mk-scene="2"] .sg-ready { display: block; }

/* the document, its «Firmas» page in view */
.pn-frame[data-screen="e-signatures"] .sg-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 0;
}

.pn-frame[data-screen="e-signatures"] .sg-page {
  position: relative;
  width: 848px;
  height: 1097px;
  box-sizing: border-box;
  padding: 77px 68px 0;
  background: #fff;
  box-shadow: 0 0 0 1px var(--ac-line), 0 1px 2px rgb(17 19 24 / 0.06);
  color: #111318;
}

/* the foot of the proposal's last page, scrolled past */
.pn-frame[data-screen="e-signatures"] .sg-page.is-cut {
  height: 74px;
  padding: 0 68px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
}

.pn-frame[data-screen="e-signatures"] .sg-page.is-cut i { display: block; width: 300px; height: 5px; margin-left: auto; border-radius: 3px; background: #ececef; }
.pn-frame[data-screen="e-signatures"] .sg-page.is-cut i.is-short { width: 180px; }
.pn-frame[data-screen="e-signatures"] .sg-page-title { font-size: 19px; font-weight: 700; }
.pn-frame[data-screen="e-signatures"] .sg-page-intro { width: 712px; margin-top: 18px; color: #6b7080; font-size: 12.5px; line-height: 1.4; }

/* the signer's boxes, at slot 0: x .08, y .24 / .318 / .343, width .38 */
.pn-frame[data-screen="e-signatures"] .sg-box {
  position: absolute;
  left: 68px;
  display: flex;
  align-items: center;
  width: 322px;
  box-sizing: border-box;
  overflow: hidden;
  padding: 0 4px;
  border: 2px dashed var(--sg-color);
  border-radius: 2px;
  font-size: 12px;
}

.pn-frame[data-screen="e-signatures"] .sg-box.is-signature {
  top: 263px;
  height: 77px;
  justify-content: center;
  border-style: solid;
  background: color-mix(in srgb, var(--sg-color) 10%, transparent);
  outline: 3px solid var(--sg-color);
  outline-offset: 3px;
}

.pn-frame[data-screen="e-signatures"] .sg-box.is-name { top: 349px; height: 24px; }
.pn-frame[data-screen="e-signatures"] .sg-box.is-date { top: 376px; height: 22px; }

.pn-frame[data-screen="e-signatures"] .sg-box-empty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--sg-color);
  font-size: 13px;
  font-weight: 600;
}

.pn-frame[data-screen="e-signatures"] .sg-box-empty svg { width: 14px; height: 14px; }
.pn-frame[data-screen="e-signatures"] .sg-box .sg-script { display: none; font-size: 46px; }

.pn-frame[data-screen="e-signatures"][data-mk-scene="2"] .sg-box.is-signature {
  border-style: dashed;
  background: transparent;
  outline: 0;
}

.pn-frame[data-screen="e-signatures"][data-mk-scene="2"] .sg-box-empty { display: none; }
.pn-frame[data-screen="e-signatures"][data-mk-scene="2"] .sg-box .sg-script { display: block; }

/* the two handwriting styles (signing-model SCRIPT_FONTS) */
.pn-frame[data-screen="e-signatures"] .sg-script {
  overflow: hidden;
  color: #171717;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pn-frame[data-screen="e-signatures"] .sg-script.is-script-1 {
  font-family: 'Brush Script MT', 'Segoe Script', 'Bradley Hand', 'Snell Roundhand', cursive;
  font-style: italic;
}

.pn-frame[data-screen="e-signatures"] .sg-script.is-script-2 {
  font-family: 'Snell Roundhand', 'Apple Chancery', 'Lucida Handwriting', 'Segoe Script', cursive;
}

/* «Adopta tu firma» */
.pn-frame[data-screen="e-signatures"] .sg-modal-back {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgb(17 19 24 / 0.25);
}

.pn-frame[data-screen="e-signatures"][data-mk-scene="1"] .sg-modal-back { display: flex; }

.pn-frame[data-screen="e-signatures"] .sg-modal {
  width: 672px;
  border: 1px solid var(--ac-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 25px -5px rgb(17 19 24 / 0.12), 0 8px 10px -6px rgb(17 19 24 / 0.1);
}

.pn-frame[data-screen="e-signatures"] .sg-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 15px;
  border-bottom: 1px solid var(--ac-line);
}

.pn-frame[data-screen="e-signatures"] .sg-modal-head p { font-size: 16px; font-weight: 600; }
.pn-frame[data-screen="e-signatures"] .sg-modal-head svg { width: 16px; height: 16px; color: var(--ac-dim); }
.pn-frame[data-screen="e-signatures"] .sg-modal-body { display: flex; flex-direction: column; gap: 16px; padding: 18px 24px 22px; }
.pn-frame[data-screen="e-signatures"] .sg-muted { color: var(--ac-mut); font-size: 12px; line-height: 1.45; }

.pn-frame[data-screen="e-signatures"] .sg-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--ac-line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgb(17 19 24 / 0.05);
}

.pn-frame[data-screen="e-signatures"] .sg-tabs span { padding: 8px 12px; border-radius: 8px; color: var(--ac-mut); font-size: 12px; font-weight: 600; }
.pn-frame[data-screen="e-signatures"] .sg-tabs .is-on { background: #111318; color: #fff; }
.pn-frame[data-screen="e-signatures"] .sg-input-field em { display: block; margin-bottom: 5px; font-size: 12px; font-style: normal; font-weight: 500; }

.pn-frame[data-screen="e-signatures"] .sg-input {
  display: block;
  padding: 8px 11px;
  border: 1px solid var(--ac-line);
  border-radius: 9px;
  font-size: 12.5px;
}

.pn-frame[data-screen="e-signatures"] .sg-legend { margin-bottom: -8px; font-size: 12px; font-weight: 500; }
.pn-frame[data-screen="e-signatures"] .sg-styles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.pn-frame[data-screen="e-signatures"] .sg-style {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--ac-line);
  border-radius: 9px;
  background: #fff;
}

.pn-frame[data-screen="e-signatures"] .sg-style.is-on { border-color: #111318; box-shadow: 0 0 0 2px rgb(17 19 24 / 0.3); }
.pn-frame[data-screen="e-signatures"] .sg-style em { display: flex; align-items: center; gap: 8px; color: #525252; font-size: 10.5px; font-style: normal; }
.pn-frame[data-screen="e-signatures"] .sg-style .sg-script { min-height: 46px; font-size: 34px; }

.pn-frame[data-screen="e-signatures"] .sg-radio {
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 1px solid #a3a3a3;
  border-radius: 999px;
}

.pn-frame[data-screen="e-signatures"] .sg-style.is-on .sg-radio { border: 4px solid #111318; }
.pn-frame[data-screen="e-signatures"] .sg-modal-acts { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- the motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .pn-frame[data-screen="e-signatures"][data-mk-scene="0"] .sg-box.is-signature { animation: sg-pulse 1.4s ease-in-out infinite; }
  .pn-frame[data-screen="e-signatures"][data-mk-scene="0"] .sg-sign { animation: sg-open 0.3s ease-out both; }
  .pn-frame[data-screen="e-signatures"][data-mk-scene="1"] .sg-modal-back { animation: sg-open 0.25s ease-out both; }
  .pn-frame[data-screen="e-signatures"][data-mk-scene="1"] .sg-modal { animation: sg-rise 0.35s ease-out both; }
  .pn-frame[data-screen="e-signatures"][data-mk-scene="1"] .sg-use { animation: sg-press 0.36s ease 3.9s both; }
  .pn-frame[data-screen="e-signatures"][data-mk-scene="2"] .sg-box .sg-script { animation: sg-open 0.4s ease-out both; }
}

@keyframes sg-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@keyframes sg-open {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sg-rise {
  from { transform: translateY(10px); }
  to { transform: none; }
}

@keyframes sg-press {
  0%, 100% { transform: none; }
  45% { transform: scale(0.94); }
}
