/* Styled to match the EaseSignature app (sign.easesignature.com). */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url(fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url(fonts/inter-latin-700-normal.woff2) format("woff2"); }
:root {
  --ink: #2559ff; --ink-2: #1a45d6; --ink-soft: #eaf0ff;
  --paper: #f6f8fe; --surface: #ffffff; --line: #e1e8f5; --line-2: #cdd7ec;
  --text: #0f1b3d; --muted: #5b6785; --navy: #0e1b3b;
  --amber-soft: #fff4de; --green: #129a5b; --green-soft: #e1f6ec; --red: #c8372d; --red-soft: #fdeceb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 27, 61, .04), 0 6px 20px rgba(37, 89, 255, .05);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); color: var(--text); background: var(--paper); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--ink-2); }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.02em; }
.eyebrow { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* buttons & inputs */
.btn { font: inherit; font-weight: 600; font-size: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, transform .05s; }
.btn:hover { background: #eef3ff; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 2px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 1px 2px rgba(37, 89, 255, .35); }
.btn.primary:hover { background: var(--ink-2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(37, 89, 255, .08); }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn.sm, .btn.small { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; padding: 10px 14px; }
.btn[disabled], .btn:disabled { opacity: .5; cursor: not-allowed; }
input[type=text], input[type=password], input[type=search], input:not([type]), select { font: inherit; width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--text); }
label { display: block; margin: 0 0 14px; font-size: 13px; font-weight: 600; color: #3b4559; }
label input, label select { margin-top: 5px; font-weight: 400; }
label.lbl { margin: 0 0 5px; }
label.check { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; }
label.check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.field-row { margin-bottom: 14px; }
.err { background: var(--red-soft); color: #9b2a21; border-radius: 8px; padding: 9px 12px; font-size: 14px; margin-bottom: 12px; }
.err:empty { display: none; }
.error { color: var(--red); font-size: 14px; }
.error:empty { display: none; }

/* badges */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; padding: 2px 9px; border-radius: 99px; background: #eef0f4; color: #596175; }
.chip.ok { background: var(--green-soft); color: #11754f; }
.chip.warn { background: var(--amber-soft); color: #9a6200; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #c3cad8; margin-right: 8px; flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

/* auth */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px; background: radial-gradient(1100px 520px at 50% -12%, #dfe8ff 0, transparent 70%), var(--paper); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.login-card { width: 100%; max-width: 410px; padding: 30px; }
.login-card h1 { font-size: 30px; letter-spacing: -.03em; margin: 6px 0 4px; }
.login-card > .muted { margin: 0 0 18px; }
.brand { font-weight: 700; font-size: 19px; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 10px; letter-spacing: -.03em; }
.auth .brand { font-size: 24px; margin-bottom: 18px; }
.logo { border-radius: 8px; }

/* shell */
.topbar { height: 64px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.topbar .brand { margin-right: 12px; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 7px 13px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14.5px; transition: background .15s, color .15s; white-space: nowrap; }
.nav a:hover { background: var(--ink-soft); color: var(--text); }
.nav a.active { color: var(--ink); background: var(--ink-soft); font-weight: 600; }
.search { max-width: 260px; }
.with-side { display: grid; grid-template-columns: 280px minmax(0, 1fr); align-items: start; }
.side { padding: 26px 8px 40px 18px; position: sticky; top: 64px; max-height: calc(100vh - 64px); overflow-y: auto; }
.side-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 0 4px; }
.side-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.client-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.client-list a { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.client-list a:hover { background: rgba(37, 89, 255, .07); }
.client-list a.active { background: var(--ink-soft); color: var(--ink-2); font-weight: 650; }
.client-list .cname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 500; }
.folder { color: var(--muted); flex: none; }
.client-list a.active .folder { color: var(--ink); }
.page { padding: 30px 32px 80px 28px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 30px; letter-spacing: -.03em; margin-right: auto; }
.page-head .muted { align-self: center; }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }

/* tables */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; background: #fbfcff; }
tbody tr:hover { background: #f8faff; }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn + .btn { margin-left: 6px; }
.devname { display: flex; align-items: center; font-weight: 650; }
.sub { color: var(--muted); font-size: 12.5px; font-family: var(--mono); margin: 2px 0 0 17px; }
pre.cmd { background: var(--paper); border: 1px solid var(--line); padding: 10px 12px; border-radius: 8px; white-space: pre-wrap; word-break: break-all; margin: 6px 0 14px; }
ol.steps { padding-left: 20px; margin: 8px 0 12px; }
ol.steps li { margin: 7px 0; }

/* modal */
.dlg { border: 0; border-radius: 14px; background: #fff; color: var(--text); padding: 0; width: min(540px, calc(100vw - 32px)); box-shadow: 0 24px 80px rgba(10, 20, 40, .35); }
.dlg::backdrop { background: rgba(18, 28, 46, .45); }
.dlg form { padding: 22px; }
.dlg h3 { font-size: 20px; margin: 0 0 12px; }
.dlg .btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; align-items: center; }
.dlg p { margin: 8px 0; }

/* remote session viewer */
.viewer { position: fixed; inset: 0; background: #0b1226; display: flex; flex-direction: column; z-index: 50; }
.vbar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--navy); color: #fff; }
.vbar .btn:not(.solid) { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: #fff; }
.vbar .btn:not(.solid):hover { background: rgba(255, 255, 255, .16); }
.vbar select { width: auto; padding: 4px 8px; }
.vmuted { color: #a9b4cf; font-size: 13.5px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff5a4f; box-shadow: 0 0 0 3px rgba(255, 90, 79, .3); }
.vstage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.vstage.actual { overflow: auto; align-items: flex-start; justify-content: flex-start; }
#vCanvas { max-width: 100%; max-height: 100%; outline: none; background: #000; }
.vstage.actual #vCanvas { max-width: none; max-height: none; }
.voverlay { position: absolute; color: #e7ecf8; font-size: 16px; text-align: center; padding: 20px; }

@media (max-width: 820px) {
  .topbar { padding: 0 14px; gap: 8px; overflow-x: auto; }
  .topbar .brand { font-size: 0; margin-right: 0; }
  .search, .hide-sm { display: none; }
  .with-side { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; padding: 16px 16px 0; }
  .page { padding: 20px 16px 60px; }
  .page-head h2 { font-size: 24px; }
}
.page-head .ph { margin-right: auto; }
.page-head .ph h2 { margin: 0; }
