/* Cloud Guard brand tokens, taken from the Cloud Guard agreement artifact.
   Single light look by choice: these are paper documents being reviewed and signed. */
:root {
  --desk: #E6EEF5; --paper: #FFFFFF; --ink: #1F2E40; --body: #3A4A5E; --muted: #5A6472;
  --navy: #11305A; --navy-deep: #0B2342; --sky: #269AD7; --sky-deep: #1A78AE; --tint: #EEF6FB;
  --line: #C9DCEA; --gold: #C19D68; --ok: #1B7A4B; --ok-tint: #E4F4EB; --bad: #9A2B2B; --bad-tint: #FBECEC;
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--desk); color: var(--body); font: 15px/1.6 var(--font); }
a { color: var(--sky-deep); }
code { font-size: 12.5px; word-break: break-all; color: var(--navy); }
h1, h2 { color: var(--navy); font-weight: 600; line-height: 1.25; margin: 0 0 12px; text-wrap: balance; }
h1 { font-size: 26px; } h2 { font-size: 19px; }

.top { background: var(--navy-deep); color: #fff; padding: 10px 16px; box-shadow: 0 2px 10px rgba(11,35,66,.25); }
.top-in { max-width: 920px; margin: 0 auto; display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; margin-right: auto; }
.brand img { height: 36px; width: auto; }
.brand span { font-size: 17px; font-weight: 500; border-left: 1px solid rgba(255,255,255,.3); padding-left: 10px; color: #D6E4F2; }
.top nav { display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center; }
.top nav a, .link { color: #D6E4F2; text-decoration: none; font: inherit; background: none; border: 0; padding: 6px 0; cursor: pointer; }
.top nav a:hover, .link:hover { color: #fff; text-decoration: underline; }
.top form { margin: 0; }

.wrap { max-width: 920px; margin: 24px auto; padding: 0 16px; display: flex; flex-direction: column; gap: 18px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; box-shadow: 0 6px 20px rgba(11,35,66,.06); }
.card > :last-child { margin-bottom: 0; }
.card.narrow { max-width: 460px; width: 100%; margin: 24px auto; }
.card.done { border-color: var(--ok); background: var(--ok-tint); }
details.card summary { cursor: pointer; color: var(--navy); font-weight: 600; }
details.card[open] summary { margin-bottom: 14px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.head-row h1 { margin: 0; }

.hero { background: var(--navy); color: #fff; border-radius: 12px; padding: 28px 28px 24px; }
.hero h1 { color: #fff; font-weight: 500; font-size: 28px; }
.hero-sub { margin: 0; color: #B9D3E8; }
.hero-sub span { color: #8CCBEB; }
.hero-ref { margin: 8px 0 0; color: var(--gold); font-size: 13px; font-weight: 600; letter-spacing: .6px; }
.pill { display: inline-block; background: var(--gold); color: var(--navy-deep); font-weight: 600; font-size: 12px;
  letter-spacing: 1.4px; text-transform: uppercase; border-radius: 999px; padding: 6px 13px; margin: 0 0 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; font: 600 14px/1 var(--font); border: 0;
  border-radius: 10px; padding: 12px 18px; min-height: 44px; cursor: pointer; background: var(--sky); color: #fff; text-decoration: none; }
.btn:hover { background: var(--sky-deep); }
.btn.big { font-size: 16px; padding: 14px 24px; min-height: 50px; }
.btn.ghost { background: var(--paper); color: var(--navy); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--tint); }
.btn.danger { background: var(--bad); }
.btn[disabled] { opacity: .65; cursor: progress; }
.btn:focus-visible, .clear:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; }
label, .label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; color: var(--navy); font-size: 14px; margin: 0; }
input:not([type=checkbox]):not([type=hidden]) { font: 15px var(--font); color: var(--ink); padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; min-height: 44px; width: 100%; }
input[type=file] { padding: 9px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 16px; margin: 0; }
legend { color: var(--navy); font-weight: 600; padding: 0 6px; }
.check { flex-direction: row; align-items: flex-start; gap: 12px; font-weight: 400; color: var(--body); }
.check input { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--sky-deep); }
.inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

.muted { color: var(--muted); } .small { font-size: 13px; }
.err { color: var(--bad); font-weight: 500; }
.card.err, p.err:not(.msg) { background: var(--bad-tint); border: 1px solid #E8C4C4; border-radius: 10px; padding: 12px 16px; }
.msg { margin: 0; min-height: 1px; }
.warn { background: #FBF4E8; border: 1px solid #E8D6B5; border-radius: 10px; padding: 12px 16px; }

.linkbox { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
.linkbox input { flex: 1 1 320px; font-family: Consolas, monospace !important; font-size: 13px !important; }

.facts { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; color: var(--navy); min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 8px; } }

.status { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.s-awaiting_customer { background: #FBF4E8; color: #7A5A22; }
.s-awaiting_countersign { background: var(--tint); color: var(--sky-deep); }
.s-completed { background: var(--ok-tint); color: var(--ok); }
.s-voided { background: #EEE; color: #555; }

.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table.list th { text-align: left; background: var(--navy); color: #fff; font-size: 12.5px; letter-spacing: .6px; text-transform: uppercase; padding: 10px 14px; }
table.list td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:nth-child(even) td { background: var(--tint); }

.pages { display: flex; flex-direction: column; gap: 18px; }
.pdfpage { margin: 0; }
.pdfpage img { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(11,35,66,.10); border-radius: 4px; }
.pdfpage figcaption { text-align: center; color: var(--muted); font-size: 13px; margin-top: 6px; }

.pad-wrap { position: relative; aspect-ratio: 3 / 1; width: 100%; max-width: 640px; border: 1.5px dashed var(--sky); border-radius: 8px; background: var(--tint); }
.pad { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; display: block; }
.hint { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; color: var(--sky-deep); font-size: 14px; font-weight: 500; text-align: center; padding: 0 12px; }
.clear { position: absolute; right: 8px; top: 8px; font: 500 13px/1 var(--font); background: var(--paper); color: var(--navy); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; min-height: 34px; }
.sigview { max-width: 420px; aspect-ratio: 3 / 1; border-bottom: 1.5px solid var(--navy); margin-bottom: 14px; }
.sigview img { width: 100%; height: 100%; object-fit: contain; }
[hidden] { display: none !important; }

.foot { max-width: 920px; margin: 8px auto 40px; padding: 0 16px; text-align: center; color: var(--muted); font-size: 13px; }
@media (max-width: 560px) { .card { padding: 18px 16px; } .hero { padding: 22px 18px; } .hero h1 { font-size: 23px; } }

/* Email confirmation step */
.okmsg { background: var(--ok-tint); color: var(--ok); border: 1px solid #BFE3CD; border-radius: 10px; padding: 12px 16px; font-weight: 500; }
.codeform label { flex: 0 1 180px; }
.codeform input { font: 600 20px/1 Consolas, monospace !important; letter-spacing: 4px; text-align: center; }
.codeform .btn { align-self: flex-end; }
.link-dark { background: none; border: 0; padding: 6px 0; color: var(--sky-deep); font: inherit; text-decoration: underline; cursor: pointer; }
.fixed { font-weight: 500; color: var(--ink); padding: 11px 0; min-height: 44px; overflow-wrap: anywhere; }
.card.narrow-left { max-width: 560px; }
.card h2 + form { margin-top: 0; }
