/* ============================================================================
   GeniusLaw: Retainer Signing
   Copied from the CaseCheck terms app (same design system as the intake agent app):
   SF Pro Display · light + dark · GeniusLaw blues.
============================================================================ */

:root {
  --font: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --brand: #2f6bff;
  --brand-strong: #1d54e8;
  --green: #16a34a;
  --red: #e5484d;

  --r-card: 20px;
  --r-sm: 12px;
}

[data-theme="light"] {
  --bg: #f5f8fd;
  --bg-tint: rgba(47, 107, 255, 0.06);
  --card: #ffffff;
  --card-2: #fbfcfe;
  --text: #0b1220;
  --text-2: #41506b;
  --muted: #5e6c84;
  --line: rgba(13, 27, 62, 0.09);
  --line-2: rgba(13, 27, 62, 0.14);
  --chip-bg: #eaf1ff;
  --chip-text: #2f6bff;
  --soft-bg: #f1f5fb;
  --green-bg: rgba(22, 163, 74, 0.12);
  --red-bg: rgba(229, 72, 77, 0.1);
  --shadow-sm: 0 1px 2px rgba(13, 27, 62, 0.05);
  --shadow: 0 1px 2px rgba(13, 27, 62, 0.05), 0 18px 40px -26px rgba(13, 27, 62, 0.28);
}

[data-theme="dark"] {
  --bg: #080d1a;
  --bg-tint: rgba(92, 147, 255, 0.08);
  --card: #0e1626;
  --card-2: #111b2e;
  --text: #eaf1fb;
  --text-2: #b6c6e2;
  --muted: #7e90af;
  --line: rgba(150, 180, 225, 0.12);
  --line-2: rgba(150, 180, 225, 0.2);
  --chip-bg: rgba(92, 147, 255, 0.14);
  --chip-text: #9dbeff;
  --soft-bg: rgba(255, 255, 255, 0.04);
  --green-bg: rgba(22, 163, 74, 0.18);
  --red-bg: rgba(229, 72, 77, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 50px -28px rgba(0, 0, 0, 0.8);
  --brand: #4d86ff;
}

* { box-sizing: border-box; }
html { height: 100%; }

/* The state sections use display:flex/grid, which would beat the UA's
   [hidden] rule, so force hidden to always win. */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.3s ease, color 0.3s ease;
}

.page-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(80% 50% at 78% -5%, var(--bg-tint), transparent 60%),
    radial-gradient(60% 40% at 5% 0%, var(--bg-tint), transparent 55%);
}

/* ----------------------------- nav ------------------------------------- */
.nav { position: sticky; top: 0; z-index: 20; padding: 16px clamp(14px, 3vw, 28px); }
.nav__inner {
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 12px 10px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
[data-theme="dark"] .brand__mark { filter: drop-shadow(0 2px 8px rgba(77, 134, 255, 0.5)); }
.brand__word { font-weight: 700; font-size: 17px; letter-spacing: 0.02em; line-height: 1; }
.brand__word b { color: var(--text); }
.brand__word i { color: var(--brand); font-style: normal; }
.brand__word sup { font-size: 8px; color: var(--muted); top: -0.9em; position: relative; }

.nav__right { display: flex; align-items: center; gap: 10px; }
.themebtn {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 999px; cursor: pointer; color: var(--text-2);
  background: var(--soft-bg); border: 1px solid var(--line); transition: all 0.2s ease;
}
.themebtn:hover { color: var(--text); border-color: var(--line-2); }
.themebtn .i-moon { display: none; }
[data-theme="dark"] .themebtn .i-sun { display: none; }
[data-theme="dark"] .themebtn .i-moon { display: block; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; padding: 7px 13px;
  border-radius: 999px; color: var(--chip-text); background: var(--chip-bg); white-space: nowrap;
}

/* ----------------------------- layout ---------------------------------- */
.layout {
  flex: 1; position: relative; z-index: 1;
  width: 100%; max-width: 760px; margin: 0 auto;
  padding: 10px clamp(14px, 3vw, 28px) 34px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}

.eyebrow {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 6px;
}

/* ----------------------------- states ---------------------------------- */
.state { padding: 46px 32px; }
.state--center {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; text-align: center;
}
.state__badge {
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--green); background: var(--green-bg);
}
.state__badge--red { color: var(--red); background: var(--red-bg); }
.state__title { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 0; }
.state__text { font-size: 14.5px; line-height: 1.55; color: var(--text-2); margin: 0; max-width: 420px; }
.state__small { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin: 4px 0 0; }

/* ------------------------- no-token splash ------------------------------ */
.splash__badge {
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--chip-bg); border: 1px solid var(--line);
}
.splash__badge img { width: 36px; height: 36px; }
.splash__features {
  list-style: none; width: 100%; max-width: 420px;
  margin: 14px 0 2px; padding: 16px 0 2px;
  display: flex; flex-direction: column; gap: 13px;
  border-top: 1px solid var(--line);
}
.splash__feature { display: flex; align-items: center; gap: 12px; text-align: left; }
.splash__feature-ic {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  color: var(--brand); background: var(--soft-bg);
}
.splash__feature-tx { display: flex; flex-direction: column; line-height: 1.3; }
.splash__feature-tx b { font-size: 14px; font-weight: 600; color: var(--text); }
.splash__feature-tx span { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.splash__callout {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 9px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  color: var(--chip-text); background: var(--chip-bg);
}

.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line-2); border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------- terms ----------------------------------- */
.terms { position: relative; padding: clamp(22px, 4vw, 34px); }
.terms__close {
  position: absolute; top: 14px; right: 14px;
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 999px; cursor: pointer; color: var(--muted);
  background: var(--soft-bg); border: 1px solid var(--line); transition: all 0.2s ease;
}
.terms__close:hover { color: var(--text); border-color: var(--line-2); }
.terms__close:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.terms__title { font-size: clamp(24px, 4.5vw, 30px); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
.terms__hello { font-size: 14.5px; line-height: 1.55; color: var(--text-2); margin: 0 0 18px; }

.terms__doc {
  max-height: 46vh; overflow-y: auto;
  padding: 20px 22px; margin: 0 0 20px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 14px; line-height: 1.65; color: var(--text-2);
}
.terms__doc h2 { font-size: 14.5px; font-weight: 700; color: var(--text); margin: 18px 0 6px; }
.terms__doc h2:first-child { margin-top: 0; }
.terms__doc p { margin: 0 0 10px; }
.terms__doc:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ------------------------- law firm connected --------------------------- */
.lawfirm {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; margin: 0 0 18px;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
}
.lawfirm__ic {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  color: var(--brand); background: var(--soft-bg);
}
.lawfirm__tx { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.lawfirm__label {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.lawfirm__tx b { font-size: 15px; font-weight: 700; color: var(--text); margin-top: 2px; }

/* ---------------------- law firm picker (no firm yet) ------------------- */
.lawfirm--pick { align-items: flex-start; }
.lawfirm--pick .lawfirm__ic { margin-top: 2px; }
.lawfirm__tx--pick { flex: 1; }
.lawfirm__hint {
  margin: 4px 0 10px; font-size: 13px; line-height: 1.5; color: var(--text-2);
}
.firmpick { position: relative; }
.firmpick__input {
  width: 100%; padding: 10px 12px;
  font: 500 14px/1.4 var(--font); color: var(--text);
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.firmpick__input::placeholder { color: var(--muted); }
.firmpick__input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--bg-tint);
}
.firmpick__input:disabled { opacity: 0.6; cursor: wait; }
.firmpick__menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  max-height: 220px; overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow);
  padding: 5px;
}
.firmpick__item {
  display: block; width: 100%; text-align: left;
  padding: 9px 11px; border: 0; border-radius: 9px;
  font: 500 14px/1.35 var(--font); color: var(--text);
  background: transparent; cursor: pointer;
}
.firmpick__item:hover, .firmpick__item:focus-visible {
  background: var(--chip-bg); color: var(--chip-text); outline: none;
}
.firmpick__empty {
  padding: 10px 11px; font-size: 13px; color: var(--muted);
}
.firmpick__confirm {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 10px; padding: 10px 12px;
  background: var(--chip-bg);
  border: 1px solid var(--brand);
  border-radius: var(--r-sm);
}
.firmpick__confirm-tx { font-size: 13.5px; line-height: 1.45; color: var(--text); flex: 1; min-width: 160px; }
.firmpick__confirm-tx b { color: var(--text); }
.firmpick__confirm-actions { display: flex; gap: 8px; flex: none; margin-left: auto; }
.btn--sm { font-size: 13.5px; padding: 8px 16px; }

/* ------------------------- payment terms ------------------------------- */
.payterms {
  padding: 16px 18px; margin: 0 0 18px;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
}
.payterms__title { font-size: 15.5px; font-weight: 700; color: var(--text); margin: 0 0 8px; }
.payterms__list {
  margin: 0; padding: 0 0 0 18px;
  font-size: 13.5px; line-height: 1.6; color: var(--text-2);
}
.payterms__list li { margin: 0 0 6px; }
.payterms__list li:last-child { margin-bottom: 0; }
.payterms__list em { color: var(--muted); }
.payterms__link { color: var(--brand); font-weight: 600; text-decoration: none; }
.payterms__link:hover { text-decoration: underline; }

.terms__doc ul {
  margin: 0; padding: 0 0 0 18px;
  line-height: 1.65;
}
.terms__doc ul li { margin: 0 0 7px; }
.terms__doc ul li:last-child { margin-bottom: 0; }
.terms__doc p.terms__doc-note { margin: 22px 0 0; color: var(--text-2); }

/* ------------------------- saved cards ---------------------------------- */
.paycards {
  padding: 16px 18px; margin: 0 0 18px;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
}
.paycards__hint { margin: -4px 0 10px; font-size: 13px; color: var(--muted); }
.paycards__list { display: flex; flex-direction: column; gap: 10px; }
.paycards__row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 56px; text-align: left;
  font: inherit; color: inherit; cursor: pointer;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.paycards__row:hover { border-color: var(--line-2); }
.paycards__row:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.paycards__row--default { border-color: var(--brand); cursor: default; }
.paycards__list--busy .paycards__row { opacity: 0.55; pointer-events: none; }
.paycards__error { margin-top: 10px; text-align: left; }
.paycards__ic {
  width: 36px; height: 36px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  color: var(--brand); background: var(--soft-bg);
}
.paycards__tx { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.paycards__tx b { font-size: 14px; font-weight: 600; color: var(--text); }
.paycards__tx span { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.paycards__default {
  margin-left: auto; flex: none;
  font-size: 11.5px; font-weight: 600; padding: 4px 10px;
  border-radius: 999px; color: var(--chip-text); background: var(--chip-bg);
}
.paycards__empty { font-size: 13.5px; line-height: 1.55; color: var(--muted); margin: 0; }
.paycards__add { margin-top: 12px; }
.paycards__form { margin-top: 12px; }
.paycards__form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

/* ----------------------------- decision -------------------------------- */
.decide { display: flex; flex-direction: column; gap: 16px; }

.decide__check {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 15px 17px;
  font-size: 16.5px; line-height: 1.55; color: var(--text);
  font-weight: 600;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  cursor: pointer; user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.decide__amount {
  font-weight: 800;
  color: var(--chip-text);
  background: transparent;
  white-space: nowrap;
}
.decide__check:hover { border-color: var(--brand); }
.decide__check:has(input:checked) {
  border-color: var(--brand);
  background: var(--chip-bg);
}
.decide__check input {
  width: 20px; height: 20px; margin: 1px 0 0; flex: none;
  accent-color: var(--brand); cursor: pointer;
}
.decide__check:has(input:focus-visible) {
  outline: 2px solid var(--brand); outline-offset: 2px;
}

.decide__name { display: flex; flex-direction: column; gap: 7px; }
.decide__label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.decide__name input {
  font: inherit; font-size: 15px; color: var(--text);
  padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--card-2); border: 1px solid var(--line-2);
  outline: none; transition: border-color 0.15s ease;
}
.decide__name input:focus { border-color: var(--brand); }
.decide__name input::placeholder { color: var(--muted); opacity: 0.7; }

.decide__actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

.btn {
  font: inherit; font-size: 15px; font-weight: 600;
  padding: 12px 24px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: all 0.15s ease;
}
.btn:disabled { opacity: 0.45; cursor: default; }
.btn--primary { color: #fff; background: var(--brand); }
/* Unmistakably "off": grey pill + muted text until the consent box is
   checked, so it never reads as a broken blue button. */
.btn--primary:disabled {
  opacity: 1; cursor: not-allowed;
  color: var(--muted); background: var(--soft-bg);
  border-color: var(--line-2); box-shadow: none;
}
.btn--primary:not(:disabled):hover { background: var(--brand-strong); }
.btn--primary:not(:disabled):active { transform: translateY(1px); }
.btn--ghost { color: var(--text-2); background: var(--soft-bg); border-color: var(--line); }
.btn--ghost:hover { color: var(--text); border-color: var(--line-2); }
.btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.btn .btn__spin {
  display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 7px;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

.decide__error { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--red); text-align: right; }

/* ----------------------------- footer ----------------------------------- */
.foot {
  flex: none; position: relative; z-index: 1;
  display: flex; align-items: center; gap: 9px; justify-content: center; flex-wrap: wrap;
  padding: 26px 22px;
}
.foot__by { font-size: 13px; color: var(--muted); }
.brand--foot { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.brand--foot .brand__word { font-size: 15px; }

@media (max-width: 520px) {
  .decide__actions .btn { flex: 1; }
  .terms__doc { max-height: 40vh; }

  /* Keep "Confirm & Continue" pinned to the viewport bottom while the
     client scrolls the four cards; .terms padding is 22px at this width.
     .decide is flattened so the bar's sticky range is the whole tall card,
     not the short consent block. */
  .decide { display: contents; }
  .decide__check { margin-bottom: 16px; }
  .decide__error { margin-top: 12px; }
  .decide__actions {
    position: sticky; bottom: 0; z-index: 20;
    margin: 0 -22px -22px;
    padding: 12px 22px calc(14px + env(safe-area-inset-bottom));
    background: var(--card);
    border-top: 1px solid var(--line);
    border-radius: 0 0 calc(var(--r-card) - 1px) calc(var(--r-card) - 1px);
  }

  /* Bigger consent tap targets for thumbs (the whole row is the label). */
  .decide__check { padding: 17px; }
  .decide__check input { width: 22px; height: 22px; }

  /* Tighter card rows so brand + expiry don't wrap beside the chip. */
  .paycards__row { gap: 10px; padding: 10px; }
  .paycards__default { font-size: 10.5px; padding: 3px 8px; letter-spacing: 0; }
}

/* ======================= retainer signing additions ===================== */

/* Two-step progress: payment details, then sign */
.steps {
  display: flex; align-items: center; gap: 10px;
  list-style: none; margin: 0 0 16px; padding: 0;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.steps__item { display: flex; align-items: center; gap: 8px; }
.steps__num {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px;
  background: var(--soft-bg); border: 1px solid var(--line-2);
}
.steps__item--active { color: var(--text); }
.steps__item--active .steps__num { color: #fff; background: var(--brand); border-color: var(--brand); }
.steps__item--done .steps__num { color: var(--green); background: var(--green-bg); border-color: transparent; }
.steps__bar { flex: 1; max-width: 48px; height: 1px; background: var(--line-2); }
.steps__link {
  display: flex; align-items: center; gap: 8px; padding: 0;
  font: inherit; color: inherit; background: none; border: 0; cursor: pointer;
}
.steps__link:hover { color: var(--brand); text-decoration: underline; }

/* Reviewing the signed agreement from the payment step */
.linkbtn {
  display: inline-block; margin: -8px 0 18px; padding: 0;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--brand);
  background: none; border: 0; cursor: pointer; text-decoration: underline;
}
.agreement iframe { display: block; width: 100%; height: 100%; border: 0; }
.agreement__msg { height: 100%; display: grid; place-items: center; padding: 24px; text-align: center; color: #5b6475; }
.review__actions { margin-top: 16px; }
a.btn { text-decoration: none; }
/* Shorter than the signing frame so Continue stays in view on desktop. */
#stateReview .agreement { height: calc(100vh - 330px); min-height: 420px; }

.panel { padding: clamp(22px, 4vw, 34px); }
.panel__title { font-size: clamp(22px, 4vw, 28px); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
.panel__text { font-size: 14.5px; line-height: 1.55; color: var(--text-2); margin: 0 0 18px; }

/* Stripe Payment Element mount */
.stripecard { min-height: 120px; margin: 0 0 18px; }
.stripecard .agreement__loading { min-height: 120px; }

/* Payment authorization form */
.payauth__doc {
  font-size: 13.5px; line-height: 1.6; color: var(--text-2);
  padding: 14px 16px; margin: 0 0 18px; border-radius: var(--r-sm);
  background: var(--soft-bg); border: 1px solid var(--line);
}
.payauth__doc p { margin: 0 0 8px; }
.payauth__doc p:last-child { margin: 0; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin: 0 0 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field input {
  font: inherit; font-size: 15px; color: var(--text); width: 100%;
  padding: 11px 13px; border-radius: var(--r-sm);
  background: var(--card-2); border: 1px solid var(--line-2);
  outline: none; transition: border-color 0.15s ease;
}
.field input:focus { border-color: var(--brand); }
.field input::placeholder { color: var(--muted); opacity: 0.7; }
.field input[aria-invalid="true"] { border-color: var(--red); }
.field__brand { float: right; font-weight: 700; color: var(--text-2); }
.fields__legend {
  grid-column: 1 / -1; margin: 6px 0 -2px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.processor { font-size: 12.5px; color: var(--muted); margin: -6px 0 18px; }

/* Consents, below the authorization text */
.consents { display: flex; flex-direction: column; gap: 10px; margin: 0 0 20px; }
.consents .decide__check { font-size: 14px; font-weight: 500; line-height: 1.5; padding: 13px 15px; }
.consents .decide__check a { color: var(--brand); font-weight: 600; }
.processor b { color: var(--text-2); }

/* DocuSign Focused View mount point: it fills whatever height it is given */
/* The sign step gets a wider page than the forms, so the document is readable. */
.layout--wide, body.is-wide .nav__inner { max-width: 1180px; }

.signhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.signhead .panel__text { margin-bottom: 16px; }
.signhead__full { flex: none; display: inline-flex; align-items: center; gap: 7px; margin-top: 4px; }

.agreement {
  height: calc(100vh - 150px); min-height: 560px; max-height: 1100px;
  border-radius: var(--r-sm); overflow: hidden;
  border: 1px solid var(--line); background: #fff;
}
.agreement__loading { height: 100%; display: grid; place-items: center; }
.agreement__hint { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }

/* Full screen: the same frame, moved to cover the window (no re-mount, so the
   client's progress in DocuSign is kept). Works on iPhone, unlike the Fullscreen API. */
.agreement-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; background: var(--card); border-bottom: 1px solid var(--line);
}
.agreement-bar__title { font-size: 14px; font-weight: 700; }
.agreement-wrap--full {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; background: var(--card);
}
.agreement-wrap--full .agreement {
  flex: 1; height: auto; min-height: 0; max-height: none; margin: 0;
  border: 0; border-radius: 0;
}
body.is-fullscreen { overflow: hidden; }
/* .layout is its own stacking layer under the sticky nav, so lift it and drop
   the chrome; otherwise the nav covers the frame and the Exit button. */
body.is-fullscreen .layout { z-index: 200; }
body.is-fullscreen .nav, body.is-fullscreen .foot { visibility: hidden; }

@media (max-width: 520px) {
  .fields { grid-template-columns: 1fr; }
  .agreement { height: calc(100vh - 120px); min-height: 0; max-height: none; margin: 0 -10px; }
  .agreement-wrap--full .agreement { margin: 0; height: auto; }
  .signhead { flex-direction: column; gap: 0; }
  .signhead__full { margin: 0 0 12px; }
  #stateSign.panel { padding: 18px 14px; }
}
