/* PrimeSign Cloud: shared look for the firm app, the admin console and sign-in.
   Navy bar, Onest, white panels, blue primary buttons, yellow call to action.
   Notices are plain tinted boxes: never a coloured line down one side. */
@font-face {
  font-family: Onest;
  src: url('/sign/assets/Onest-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Onest;
  src: url('/sign/assets/Onest-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --navy: #000d40;
  --blue: #0645b9;
  --blue-hover: #00399f;
  --azure: #1985c8;
  --yellow: #ffde59;
  --yellow-hover: #f5d23f;
  --paper: #f5f8fc;
  --ink: #172344;
  --ink-body: #3a4566;
  --muted: #5a6480;
  --line: #dfe5ef;
  --rule: #d7e0ee;
  --green: #18704e;
  --red: #a6444b;
  --shadow: 0 6px 22px #000d4006;
  --font: Onest, 'Segoe UI', Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  overflow-wrap: anywhere;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; color: var(--navy); }
h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 14px; font-weight: 700; }
p { color: var(--muted); }
a { color: var(--blue); }
strong { font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
button svg { pointer-events: none; }
:focus-visible { outline: 3px solid var(--azure); outline-offset: 3px; }
svg.icon {
  width: 18px; height: 18px; flex-shrink: 0;
  stroke: currentColor; fill: none; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -9999px; z-index: 100; padding: 14px; background: var(--yellow); color: var(--navy); }
.skip:focus { left: 12px; top: 12px; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.stack { display: grid; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.space-top { margin-top: 18px; }
.space-bottom { margin-bottom: 18px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }

/* ---- Header ---- */
.ps-header { background: var(--navy); color: #fff; }
.ps-header-in {
  max-width: 1280px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 10px 22px; flex-wrap: wrap; min-height: 68px;
}
.ps-wordmark {
  color: #fff; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -0.02em;
  display: inline-flex; align-items: center; gap: 8px;
}
.ps-wordmark .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); }
.ps-context { display: grid; line-height: 1.25; min-width: 0; }
.ps-context small { font-size: 11px; color: #cdd6ee; text-transform: uppercase; letter-spacing: 0.1em; }
.ps-context strong { font-size: 14px; color: #fff; }
.ps-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.ps-nav a {
  color: #cdd6ee; text-decoration: none; font-size: 14px; font-weight: 700;
  padding: 8px 12px; border-radius: 99px;
}
.ps-nav a:hover { color: #fff; background: #ffffff14; }
.ps-nav a[aria-current="page"] { color: var(--navy); background: #fff; }
.ps-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ps-avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow); color: var(--navy); font-size: 12px; font-weight: 700;
}
.ps-user-name { font-size: 13px; color: #fff; display: grid; line-height: 1.2; }
.ps-user-name small { color: #cdd6ee; font-size: 11px; }
.ps-signout {
  border: 1px solid #ffffff40; background: transparent; color: #fff;
  border-radius: 6px; padding: 6px 12px; font-size: 13px; font-weight: 700;
}
.ps-signout:hover { background: #ffffff14; }
.ps-banner { background: #fff3db; color: #7a4d0f; font-size: 13px; padding: 10px 24px; text-align: center; }

/* ---- Page frame ---- */
main { max-width: 1280px; margin: 0 auto; padding: 32px 24px 56px; outline: none; }
main:focus, main:focus-visible { outline: none; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 24px; margin-bottom: 24px; flex-wrap: wrap; }
.page-heading > div:first-child { min-width: 0; flex: 1 1 320px; }
.page-heading p { margin-top: 8px; font-size: 14px; }
.eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--blue); margin-bottom: 8px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--muted); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--navy); font-size: 13px; font-weight: 700; line-height: 1.3;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #f0f5fc; border-color: #bbcae0; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-hover); }
.btn.yellow { background: var(--yellow); border-color: var(--yellow); color: var(--navy); }
.btn.yellow:hover { background: var(--yellow-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--red); border-color: #eccacc; }
.btn.danger:hover { background: #fcf3f4; }
.btn.sm { min-height: 32px; padding: 6px 11px; font-size: 12px; }
.btn-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.icon-btn {
  width: 34px; height: 34px; padding: 6px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; background: transparent; border-radius: 6px; color: var(--muted);
}
.icon-btn:hover { background: #edf2fa; color: var(--blue); }

/* ---- Form controls ---- */
label.control { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: #4f5d75; }
.control input, .control select, .control textarea, input.input, select.input, textarea.input {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid #cfd8e6; border-radius: 6px;
  background: #fff; color: var(--ink); font-size: 14px; font-weight: 400;
}
.control textarea, textarea.input { min-height: 90px; resize: vertical; line-height: 1.6; }
.control input:focus, .control select:focus, .control textarea:focus, .input:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px #0645b92e;
}
.control input:disabled, .control select:disabled { background: #f3f5f9; color: var(--muted); }
.control-note { font-size: 12px; color: var(--muted); font-weight: 400; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--ink); cursor: pointer; }
.check input { accent-color: var(--blue); margin: 3px 0 0; width: 16px; height: 16px; flex-shrink: 0; }
.check small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---- Panels, notices, badges ---- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); overflow: hidden; }
.panel-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-body { padding: 22px; }
.notice { background: #fff6e0; color: #7a5518; border-radius: 8px; padding: 12px 15px; font-size: 13px; line-height: 1.6; }
.notice.info { background: #edf3fc; color: #3f5a80; }
.notice.success { background: #e9f5ef; color: #22664a; }
.notice.error { background: #fbecee; color: #8f2f37; }
.notice h2 { font-size: 15px; color: inherit; margin-bottom: 4px; }
.notice p { color: inherit; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 700; background: #ecf1f8; color: #4d5c78; white-space: nowrap;
}
.badge.sent, .badge.active, .badge.pending { background: #eaf1ff; color: #2356a9; }
.badge.completed, .badge.ok { background: #e8f5ee; color: var(--green); }
.badge.draft, .badge.staff { background: #eef0f5; color: #5a6480; }
.badge.voided, .badge.declined, .badge.suspended, .badge.bad { background: #fcecee; color: var(--red); }
.badge.seal_failed, .badge.expired, .badge.attention { background: #fff3db; color: #8a5714; }
.badge.sealing { background: #f1eafe; color: #6a49a5; }
.badge.owner { background: var(--navy); color: #fff; }
.badge.outline { background: transparent; border: 1px solid var(--line); }

/* ---- Tables ---- */
.table-wrap { background: #fff; border: 1px solid var(--rule); border-radius: 8px; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
/* :where keeps these easy to override in each screen's own table layouts. */
:where(table.data) th {
  text-align: left; padding: 12px 16px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--blue); border-bottom: 1px solid var(--rule); white-space: nowrap;
}
table.data { overflow-wrap: normal; }
:where(table.data) td { padding: 13px 16px; border-bottom: 1px solid #eef2f8; vertical-align: middle; color: var(--ink-body); }
table.data tr:last-child > td { border-bottom: 0; }
table.data .sub { display: block; font-size: 12px; color: var(--muted); }

/* ---- Dialog and toast ---- */
dialog {
  border: 1px solid #e0e7f1; border-radius: 11px; width: 560px; max-width: calc(100vw - 32px);
  max-height: 88vh; overflow: auto; padding: 0; color: var(--ink); box-shadow: 0 30px 100px #000d4033;
}
dialog::backdrop { background: #07173b80; }
.modal-header { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.modal-body { padding: 22px; }
.modal-body p { font-size: 14px; line-height: 1.65; }
.modal-body .control { margin-bottom: 14px; }
.modal-footer { border-top: 1px solid var(--line); padding: 14px 22px; display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; background: #fafcfe; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 50;
  max-width: calc(100% - 32px); padding: 13px 20px; border-radius: 8px;
  background: var(--navy); color: #fff; font-size: 13px; box-shadow: 0 6px 30px #000d402b;
  pointer-events: none;
}
.toast.error { background: #9f303b; }

@media (max-width: 700px) {
  .ps-header-in { padding: 10px 16px; gap: 8px 12px; min-height: 0; }
  .ps-nav { order: 3; width: 100%; }
  .ps-nav a { padding: 6px 10px; font-size: 13px; }
  .ps-user-name { display: none; }
  .ps-context small { display: none; }
  main { padding: 22px 16px 40px; }
  h1 { font-size: 24px; }
  .panel-head, .panel-body { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .ps-banner { padding: 10px 16px; }
}
