/* Ilorb Sign - public pages (signer, verify). Same brand as the house shell: Ilorb indigo, Inter (assets/house/fonts.css). Tokens on :root; dark mode by system preference or [data-theme]. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --ink: #161a22;
  --muted: #5b6372;
  --line: #e1e4ea;
  --accent: #4338ca;
  --accent-hover: #3730a3;
  --accent-ink: #ffffff;
  --accent-soft: #eef0ff;
  --ok: #1b7348;
  --ok-soft: #e3f4ea;
  --warn: #7f5200;
  --warn-soft: #fff3d6;
  --err: #b42318;
  --err-soft: #fde8e6;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 12px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1015; --surface: #161920; --surface-2: #1d212a; --ink: #e7e9ee; --muted: #9aa2b1; --line: #2a2f3a;
    --accent: #8b87ff; --accent-hover: #a5a2ff; --accent-ink: #0e0c2b; --accent-soft: #1f1d45;
    --ok: #5cc995; --ok-soft: #13291f; --warn: #f2bd5c; --warn-soft: #2a2110; --err: #ff8a80; --err-soft: #2e1513;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1015; --surface: #161920; --surface-2: #1d212a; --ink: #e7e9ee; --muted: #9aa2b1; --line: #2a2f3a;
  --accent: #8b87ff; --accent-hover: #a5a2ff; --accent-ink: #0e0c2b; --accent-soft: #1f1d45;
  --ok: #5cc995; --ok-soft: #13291f; --warn: #f2bd5c; --warn-soft: #2a2110; --err: #ff8a80; --err-soft: #2e1513;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; }
p { margin: 0 0 .75rem; }
.mono { font-family: var(--mono); font-size: .82rem; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; white-space: nowrap; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand svg { width: 26px; height: 26px; }
.spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; }
.pill-dev { background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-err { background: var(--err-soft); color: var(--err); }
.pill-muted { background: var(--surface-2); color: var(--muted); }
.icon-btn, select.compact { height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 10px; font: inherit; font-size: .85rem; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
@media (max-width: 420px) { .topbar-inner { gap: 6px; } .topbar .btn-ghost { padding: 0 4px; } }

/* layout */
.wrap { max-width: 1200px; margin: 0 auto; padding: 20px 16px 48px; }
.narrow { max-width: 760px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }

/* forms */
label { display: block; font-size: .82rem; font-weight: 600; margin: 10px 0 4px; color: var(--ink); }
input[type=text], input[type=email], input[type=tel], input[type=password], textarea, select.field {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; min-width: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 9px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--accent); padding: 0 8px; min-height: 32px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); color: var(--muted); padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--accent-soft); color: var(--accent); }
.signer-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 8px; background: var(--surface-2); }
.signer-row .row { margin-top: 6px; }
.signer-row-head { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; font-weight: 700; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .9rem; }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.consent-links { margin: -4px 0 12px 28px; color: var(--mut, #5b6472); font-size: .82rem; }
.otp-input { font-family: var(--mono); font-size: 1.4rem; letter-spacing: .4em; text-align: center; }

/* notices */
.notice { border-radius: 10px; padding: 10px 12px; font-size: .88rem; margin: 10px 0; }
.notice-dev { background: var(--warn-soft); color: var(--warn); border: 1px dashed color-mix(in srgb, var(--warn) 55%, transparent); }
.notice-err { background: var(--err-soft); color: var(--err); }
.notice-ok { background: var(--ok-soft); color: var(--ok); }
.factor { border-top: 1px solid var(--line, #d9dce3); padding-top: 12px; margin-top: 12px; }
.factor:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.dev-code { font-family: var(--mono); font-size: 1.3rem; font-weight: 700; letter-spacing: .25em; }

/* lists */
.env-list { list-style: none; padding: 0; margin: 0; }
.env-item { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.env-item:hover, .env-item[aria-current=true] { background: var(--surface-2); border-color: var(--line); }
.env-item .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.env-item .meta { font-size: .8rem; color: var(--muted); }
.env-item > div { min-width: 0; flex: 1; }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 12px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 6px; } }
table.list { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.list th, table.list td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { color: var(--muted); font-weight: 600; font-size: .78rem; }
.table-scroll { overflow-x: auto; }
.link-box { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.link-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--surface-2); padding: 6px 8px; border-radius: 6px; font-family: var(--mono); font-size: .78rem; }

/* signer page */
.steps { display: flex; gap: 6px; margin: 4px 0 16px; padding: 0; list-style: none; }
.steps li { flex: 1; font-size: .78rem; font-weight: 600; color: var(--muted); border-top: 3px solid var(--line); padding-top: 6px; }
.steps li.active { color: var(--accent); border-color: var(--accent); }
.steps li.done { color: var(--ok); border-color: var(--ok); }
.doc-viewer { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; max-height: 70vh; overflow: auto; padding: 12px; }
.doc-viewer canvas { display: block; width: 100%; height: auto; margin: 0 auto 12px; background: #fff; box-shadow: var(--shadow); border-radius: 2px; }
.sig-preview { font-family: "Snell Roundhand", "Segoe Script", "Brush Script MT", cursive; font-size: 1.8rem; color: var(--accent); min-height: 2.6rem; border-bottom: 1px solid var(--line); padding: 4px 2px; }

/* verify */
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.result-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.result-head .big { font-size: 1.15rem; font-weight: 700; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.status-dot.ok { background: var(--ok); } .status-dot.warn { background: var(--warn); } .status-dot.err { background: var(--err); }
footer.site { text-align: center; color: var(--muted); font-size: .8rem; padding: 24px 16px; }

/* house custom select (opera-select) on the public pages: map its variables to these tokens */
:root { --osel-bg: var(--surface); --osel-line: var(--line); --osel-line-hover: var(--muted); --osel-txt: var(--ink); --osel-mut: var(--muted); --osel-acc: var(--accent); }
.topbar .osel { --osel-h: 34px; --osel-font-size: 13px; }
.company-logo { max-height: 48px; max-width: 200px; display: block; margin-bottom: 8px; }
