/* Aspire Sign for outside signers (ADR-034, AI-1262) - this page's own rules, on top of the vendored asp- design system.
   Phone first: a 16 px gutter, works at 344 px; compact scale (32 px controls, 13-14 px text, weights 500/600).
   The sg- rules for pages, fields, steps and marks follow app/styles.css (AI-1261) so both signers see the same screen. */

.sg-body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--cds-background); color: var(--cds-text-primary);
  font-size: 0.875rem; line-height: 1.45; display: flex; flex-direction: column; }
.sg-main { box-sizing: border-box; width: 100%; max-width: 52rem; margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
#sg-root { flex: 1 0 auto; padding-top: var(--cds-spacing-06); padding-bottom: var(--cds-spacing-06); }

/* the page's head: who runs it, then the product */
.sg-head { margin-bottom: var(--cds-spacing-05); }
.sg-head__eyebrow { margin: 0; font-size: 0.8125rem; color: var(--cds-text-secondary); }
.sg-head__title { margin: var(--cds-spacing-01) 0 0; font-size: 1.25rem; font-weight: 600; line-height: 1.3; }

.sg-card { padding: var(--cds-spacing-05); }
.sg-card > * + * { margin-top: var(--cds-spacing-04); }
.sg-lede { margin: 0; font-size: 0.875rem; max-width: 60ch; }
.sg-hint { margin: 0; font-size: 0.8125rem; color: var(--cds-text-secondary); }
.sg-card .asp-btn-set { flex-wrap: wrap; overflow: visible; }
.sg-card .asp-inline-notification { max-width: none; }
.sg-doc__title { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.sg-doc > * + * { margin-top: var(--cds-spacing-02); }
.sg-consent, .sg-decline { background: var(--cds-layer-02); }
.sg-consent { padding: var(--cds-spacing-04); }
.sg-consent p { margin: 0; }
.sg-decline { padding: var(--cds-spacing-04); }
.sg-decline .asp-input, .sg-email .asp-input, .sg-grid .asp-input { width: 100%; box-sizing: border-box; }

/* the code */
.sg-code > * + * { margin-top: var(--cds-spacing-04); }
.sg-code__input { width: 10rem; max-width: 100%; font-size: 1rem; letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }

/* the five steps (as app/styles.css .sg-steps) */
.sg-steps { display: flex; flex-wrap: wrap; gap: var(--cds-spacing-02) var(--cds-spacing-05); list-style: none; margin: var(--cds-spacing-04) 0 var(--cds-spacing-05); padding: 0; font-size: 0.8125rem; color: var(--cds-text-secondary); }
.sg-step { white-space: nowrap; }
.sg-step--now { color: var(--cds-text-primary); font-weight: 600; }
.sg-step--done { color: var(--cds-support-success); }

/* the document's pages, with the signer's own fields outlined (as app/styles.css) */
.sg-pages { display: flex; flex-direction: column; gap: var(--cds-spacing-05); min-width: 0; }
.sg-page { position: relative; width: 100%; background: var(--cds-background); border: 1px solid var(--cds-border-subtle-01); user-select: none; }
.sg-page__canvas { display: block; width: 100%; height: 100%; }
.sg-page__no { position: absolute; right: var(--cds-spacing-03); bottom: var(--cds-spacing-02); font-size: 0.75rem; color: var(--cds-text-secondary); }
.sg-field { position: absolute; box-sizing: border-box; border-radius: 2px; overflow: hidden; }
.sg-field--mine { border: 1px solid var(--cds-border-interactive); background: rgba(15, 98, 254, 0.1); }
.sg-field__label { position: absolute; left: 3px; top: 1px; font-size: 0.75rem; line-height: 1.2; color: var(--cds-text-primary); white-space: nowrap; pointer-events: none; }

.sg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--cds-spacing-05); }
.sg-marks { display: flex; flex-wrap: wrap; gap: var(--cds-spacing-02) var(--cds-spacing-05); }
.sg-kind { display: inline-flex; align-items: center; gap: var(--cds-spacing-02); font-size: 0.875rem; min-height: 32px; }
.sg-typed { font-family: "Segoe Script", "Brush Script MT", cursive; font-size: 1.75rem; margin: var(--cds-spacing-04) 0 var(--cds-spacing-02); overflow-wrap: anywhere; }

/* the signature pad: a 1000 x 400 box drawn to the page's width; touch-action none so a finger signs instead of scrolling
   (as app/styles.css .qk-signpad, AI-613) */
.sg-pad { position: relative; width: 100%; max-width: 520px; border: 1px solid var(--cds-border-strong-01); border-radius: var(--cds-radius-container, 4px); background: var(--cds-field-01); }
.sg-pad::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: 24%; border-bottom: 1px solid var(--cds-border-subtle-01); pointer-events: none; }
.sg-pad__canvas { display: block; width: 100%; aspect-ratio: 5 / 2; height: auto; touch-action: none; cursor: crosshair; color: var(--cds-text-primary); }
.sg-pad__canvas:focus-visible { outline: 2px solid var(--cds-focus); outline-offset: 2px; }
.sg-pad__hint { position: absolute; left: 6%; bottom: 10%; font-size: 0.75rem; color: var(--cds-text-secondary); pointer-events: none; }
.sg-pad--inked .sg-pad__hint { visibility: hidden; }

/* the share reader's files (share.html, ADR-035): one row each, a hairline between */
.sh-files { list-style: none; margin: 0; padding: 0; }
.sh-file { display: flex; align-items: center; justify-content: space-between; gap: var(--cds-spacing-04); padding: var(--cds-spacing-04) 0; }
.sh-file + .sh-file { border-top: 1px solid var(--cds-border-subtle-01); }
.sh-file__text { display: flex; flex-direction: column; gap: var(--cds-spacing-01); min-width: 0; }

/* the privacy note, the share reader's help and the foot */
.sg-privacy, .sh-help { padding-bottom: var(--cds-spacing-06); }
.sg-dl { display: grid; grid-template-columns: 9rem 1fr; gap: var(--cds-spacing-03) var(--cds-spacing-05); margin: 0; }
.sg-dl dt { font-weight: 600; color: var(--cds-text-secondary); }
.sg-dl dd { margin: 0; }
.sg-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--cds-spacing-03);
  padding-top: var(--cds-spacing-04); padding-bottom: max(var(--cds-spacing-05), env(safe-area-inset-bottom));
  border-top: 1px solid var(--cds-border-subtle-01); font-size: 0.8125rem; color: var(--cds-text-secondary); }
.sg-linkbtn { min-height: 32px; padding: 0 var(--cds-spacing-02); border: 0; background: none; font: inherit; font-weight: 500;
  color: var(--cds-link-primary); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.sg-linkbtn:focus-visible { outline: 2px solid var(--cds-focus); outline-offset: 2px; }

@media (max-width: 671.98px) {
  #sg-root { padding-top: var(--cds-spacing-05); }
  .sg-card { padding: var(--cds-spacing-04); }
  .sg-dl { grid-template-columns: 1fr; gap: var(--cds-spacing-01); }
  .sg-dl dd { margin-bottom: var(--cds-spacing-03); }
  .sg-grid { grid-template-columns: 1fr; }
  .sg-pad { max-width: none; }
}
