/*
 * PGP Contracts: the shared look.
 *
 * Tokens from @pgp/ui v0.2 (the PlayBook brand data): Pam Golding Green
 * #144733, Montserrat, red for errors and counts only. Two values differ from
 * @pgp/ui on purpose: its muted grey #7d7d7d fails WCAG AA for small text on
 * white (4.1:1), so muted text here is #5f5f5f (6.4:1), and the page ground is
 * a warm off-white so white cards read as cards.
 *
 * The design these pages follow is the "PGP Contracts experience design"
 * canvas. Staff pages use .topbar; client pages use .band.
 *
 * Montserrat (SIL Open Font License 1.1, see Montserrat-OFL.txt) is served
 * from here, not from Google: a client opening a signing link should not have
 * their address handed to a third party for the sake of a typeface.
 */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/assets/montserrat-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/assets/montserrat-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --g: #144733; --g-dk: #0f3727; --tint: #e7efea; --tint2: #f2f6f3;
  --ink: #1b2420; --body: #454545; --muted: #5f5f5f; --faint: #8c8c8c;
  --line: #e1ded6; --line2: #cbc7bc; --ground: #f4f3ee; --alt: #faf9f5;
  --red: #ba0d2e; --red-ink: #9a0b26; --red-bg: #fbe9ed;
  --amber: #7a4b00; --amber-bg: #fbf0d8; --amber-line: #eacb8a;
  --law: #6b1f33; --law-bg: #f6eaee;
  --sans: Montserrat, "Segoe UI", system-ui, -apple-system, sans-serif;
  --doc: Arial, Helvetica, sans-serif;
  --radius: 6px; --radius-card: 8px;
  --ring: 0 0 0 2px #fff, 0 0 0 4px var(--g);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.55 var(--sans); color: var(--body); background: var(--ground); }
h1, h2, h3 { color: var(--ink); line-height: 1.3; }
a { color: var(--g); }
a:hover { color: var(--g-dk); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }

/* ---- staff chrome ------------------------------------------------------- */
.topbar { height: 60px; background: var(--g); display: flex; align-items: center; gap: 28px; padding: 0 24px 0 28px; }
.topbar .home { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.topbar .home img { width: 34px; height: 30px; object-fit: contain; }
.topbar .home .rule { width: 1px; height: 24px; background: rgba(255,255,255,.3); }
.topbar .home span { color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .2em; }
.topbar nav { display: flex; align-self: stretch; gap: 2px; flex: 1; }
.topbar nav a { display: flex; align-items: center; padding: 0 14px; color: rgba(255,255,255,.8); text-decoration: none; font-weight: 500; }
.topbar nav a:hover { color: #fff; }
.topbar nav a[aria-current] { color: #fff; font-weight: 600; box-shadow: inset 0 -3px 0 #fff; }
.topbar .who { display: flex; align-items: center; gap: 12px; color: #fff; font-size: 13px; }
.topbar .who .av { width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--g); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.topbar .who a { color: rgba(255,255,255,.85); font-size: 12.5px; }

.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--g); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); font-weight: 500; }

/* ---- client chrome ------------------------------------------------------- */
.band { height: 76px; background: #154734; display: flex; align-items: center; justify-content: space-between; padding: 0 16px 0 8px; }
.band img { height: 68px; width: 124px; object-fit: contain; }
.band .aside { color: rgba(255,255,255,.88); font-size: 12.5px; font-weight: 500; }

/* ---- buttons ------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px;
       border-radius: var(--radius); border: 1px solid var(--g); background: var(--g); color: #fff;
       font: 600 14px/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--g-dk); border-color: var(--g-dk); color: #fff; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line2); }
.btn.secondary:hover { border-color: var(--g); color: var(--g); background: #fff; }
.btn.ghost { background: transparent; color: var(--g); border-color: transparent; }
.btn.ghost:hover { background: var(--tint2); color: var(--g-dk); }
.btn.danger { background: #fff; color: var(--red); border-color: #e7b3bf; }
.btn.danger:hover { background: var(--red-bg); color: var(--red-ink); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn.large { min-height: 52px; font-size: 16px; }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled=true] { background: #eceae4; border-color: #eceae4; color: #6e6e6e; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--g); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ---- chips --------------------------------------------------------------- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 4px;
        background: #eeece6; color: var(--body); font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1; }
.chip.green { background: var(--tint); color: var(--g); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.red { background: var(--red-bg); color: var(--red-ink); }
.chip.law { background: var(--law-bg); color: var(--law); }
.chip svg { width: 13px; height: 13px; }

/* ---- cards --------------------------------------------------------------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px 22px; }
.card > h2, .card > h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }

/* ---- fields -------------------------------------------------------------- */
.field { display: flex; flex-direction: column; }
.field > label, .field > .label { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field .opt { font-weight: 400; color: var(--muted); }
.field .box { display: flex; align-items: center; min-height: 40px; border: 1px solid var(--line2); border-radius: var(--radius); background: #fff; }
.field .box:focus-within { border-color: var(--g); box-shadow: 0 0 0 3px var(--tint); }
.field .box input, .field .box select, .field .box textarea { flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  padding: 9px 12px; font: 14px/1.4 var(--sans); color: var(--ink); }
.field .box textarea { min-height: 76px; resize: vertical; }
.field .box select { appearance: auto; cursor: pointer; }
.field .box .fix { padding: 0 0 0 12px; color: var(--muted); }
.field .box .fix.end { padding: 0 12px 0 0; }
.field .box .tick { display: none; padding-right: 12px; color: var(--g); }
.field.done .box .tick { display: flex; }
.field.bad .box, .field.bad .box:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px #f8dde3; }
.field.locked .box { background: #f1f0eb; }
.field.locked .box .lock { display: flex; padding-right: 12px; color: var(--muted); }
.field .box .lock { display: none; }
.field .hint { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.field .err { margin: 6px 0 0; font-size: 13px; color: var(--red-ink); line-height: 1.45; display: flex; gap: 6px; }
.field .err:empty { display: none; }
.field.flash .box { box-shadow: 0 0 0 4px #fff3cd; transition: box-shadow .2s; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--g); flex-shrink: 0; }

/* ---- stepper ------------------------------------------------------------- */
.stepper { display: flex; align-items: center; gap: 10px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.stepper li .n { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line2); display: grid; place-items: center; font-size: 11px; background: #fff; }
.stepper li.done { color: var(--ink); }
.stepper li.done .n { background: var(--g); border-color: var(--g); color: #fff; }
.stepper li.now { color: var(--g); }
.stepper li.now .n { border: 2px solid var(--g); color: var(--g); }
.stepper li.join { width: 28px; height: 2px; background: var(--line); }
.stepper li.join.done { background: var(--g); }

/* ---- dialogs ------------------------------------------------------------- */
dialog { border: 0; border-radius: 10px; padding: 0; width: min(620px, 94vw); box-shadow: 0 24px 60px rgba(0,0,0,.28); color: var(--body); }
dialog::backdrop { background: rgba(20,30,25,.45); }
dialog .dhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 26px 6px; }
dialog .dhead h2 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
dialog .dbody { padding: 14px 26px 20px; display: flex; flex-direction: column; gap: 16px; }
dialog .dfoot { display: flex; justify-content: flex-end; gap: 10px; align-items: center; padding: 16px 26px; border-top: 1px solid var(--line); background: var(--alt); border-radius: 0 0 10px 10px; }
.iconbtn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.iconbtn:hover { background: var(--tint2); color: var(--ink); }

/* ---- notices ------------------------------------------------------------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; font-size: 13.5px; line-height: 1.5; }
.notice.good { background: var(--tint2); color: var(--ink); }
.notice.bad { background: var(--red-bg); color: #7c0a21; }
.notice.warn { background: var(--amber-bg); color: var(--amber); }
.notice svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.linkbtn:disabled { color: var(--muted); text-decoration: none; cursor: default; font-weight: 500; }
