﻿:root { --brand: #12406b; --ink: #14263d; --muted: #6b7a8f; --line: #e3e8ef; --page: #f3f5f8; --ok: #13795b; --warn: #b54708; --bad: #c0392b; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; color: var(--ink); background: var(--page); font-size: 15px; line-height: 1.5; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.top { background: #fff; border-bottom: 3px solid var(--brand); }
.top-in { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 12px; }
.logo { max-height: 44px; max-width: 220px; }
.brand-name { font-weight: 700; font-size: 18px; color: var(--brand); }
main.wrap { padding-top: 24px; padding-bottom: 24px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); padding-bottom: 28px; }
h1 { font-size: 24px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }
.viewer { width: 100%; height: 72vh; min-height: 420px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select { width: 100%; padding: 10px 12px; border: 1px solid #cfd7e2; border-radius: 8px; font: inherit; color: var(--ink); background: #fff; }
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
.code { font-size: 26px; letter-spacing: 8px; text-align: center; font-weight: 700; }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); font-size: 14px; margin-top: 14px; }
.check input { margin-top: 4px; width: 18px; height: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: #fff; color: var(--ink); border-color: #cfd7e2; }
.btn-danger { background: #fff; color: var(--bad); border-color: #f0c4be; }
.btn-block { width: 100%; margin-top: 14px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.notice { border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; }
.notice.ok { background: #e7f5ef; color: var(--ok); }
.notice.warn { background: #fdf1e7; color: var(--warn); }
.notice.bad { background: #fbeceb; color: var(--bad); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: #eef2f6; color: var(--muted); }
.badge.ok { background: #e7f5ef; color: var(--ok); }
.badge.warn { background: #fdf1e7; color: var(--warn); }
.badge.bad { background: #fbeceb; color: var(--bad); }
.signers { list-style: none; padding: 0; margin: 0; }
.signers li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.signers li:last-child { border-bottom: 0; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 8px; border-bottom: 1px solid var(--line); }
table.list td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:hover td { background: #fafbfc; }
.nav { display: flex; gap: 16px; align-items: center; font-size: 14px; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--brand); }
.key { font-family: Consolas, monospace; background: #fff8e6; border: 1px dashed #e0b44c; padding: 10px; border-radius: 8px; word-break: break-all; }
details summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.center { max-width: 460px; margin: 40px auto; }
.big-icon { font-size: 44px; line-height: 1; margin-bottom: 8px; }
/* ---- the Maks look (as the Maks client's login/splash): navy sea gradient, soft light, waves, the sails */
:root { --navy-dark: #091e38; --navy: #12406b; --sea: #2267a0; --accent: #1e73d8; }
.sails { display: block; flex: none; }
.sails-lg { width: 64px; height: 64px; }
.sails-sm { width: 30px; height: 30px; }
.sails-xs { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; color: var(--navy); opacity: .8; }
.waves { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34%; pointer-events: none; }

/* split screen: brand panel + page (start, admin login, errors) */
body.brand-page { background: #fff; }
.split { display: grid; grid-template-columns: minmax(320px, 42%) 1fr; min-height: 100vh; }
.brand-panel { position: relative; overflow: hidden; color: #fff; padding: 56px 56px 40px; display: flex; flex-direction: column; justify-content: space-between;
    background: radial-gradient(ellipse 80% 60% at 10% 5%, rgba(255,255,255,.17), rgba(255,255,255,0) 70%), linear-gradient(150deg, var(--navy-dark) 0%, var(--navy) 55%, var(--sea) 100%); }
.brand-inner { position: relative; z-index: 1; max-width: 420px; }
.brand-mark { display: flex; align-items: center; gap: 18px; }
.brand-word { font-size: 46px; font-weight: 700; letter-spacing: .02em; line-height: 1; }
.brand-sub { font-size: 20px; font-weight: 600; opacity: .86; margin-top: 4px; }
.brand-tag { font-size: 16px; opacity: .72; margin: 28px 0 22px; line-height: 1.45; }
.brand-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.brand-points li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; opacity: .92; }
.brand-points span { flex: none; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.14); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.brand-foot { position: relative; z-index: 1; font-size: 12.5px; opacity: .6; }
.split-main { display: flex; align-items: center; justify-content: center; padding: 48px 32px; background: #fff; }
.split-content { width: 100%; max-width: 440px; }
.split-title { font-size: 30px; margin: 0 0 8px; letter-spacing: -.01em; }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.lead { font-size: 15.5px; margin: 0 0 24px; }
.split-foot { margin-top: 28px; font-size: 13.5px; }
.split-foot a { color: var(--muted); text-decoration: none; }
.split-foot a:hover { color: var(--accent); }
.brand-page .btn-primary { background: var(--accent); }
.brand-page input:focus { outline-color: color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.login-form .btn-big { margin-top: 22px; }
.steps { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 16px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; font-size: 14.5px; }
.steps .muted { font-size: 13.5px; }
.step-no { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #e8f1fc; color: var(--accent); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.notice.info { background: #eef4fb; color: var(--navy); }
@media (max-width: 820px) {
    .split { grid-template-columns: 1fr; }
    .brand-panel { padding: 28px 24px 56px; }
    .brand-word { font-size: 34px; }
    .brand-points, .brand-foot { display: none; }
    .brand-tag { margin: 14px 0 0; }
    .split-main { padding: 28px 20px; align-items: flex-start; }
}

/* admin: the navy band */
body.portal .band { position: relative; overflow: hidden; color: #fff;
    background: radial-gradient(ellipse 60% 140% at 5% 0%, rgba(255,255,255,.16), rgba(255,255,255,0) 70%), linear-gradient(150deg, var(--navy-dark) 0%, var(--navy) 55%, var(--sea) 100%); }
body.portal .band .waves { height: 60%; }
.band-in { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; flex-wrap: wrap; }
.band-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.band-word { font-size: 22px; font-weight: 700; letter-spacing: .03em; }
.band-sub { font-size: 16px; opacity: .85; }
.band-pill { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: rgba(255,255,255,.16); padding: 3px 9px; border-radius: 99px; }
body.portal .nav a { color: rgba(255,255,255,.82); padding: 6px 10px; border-radius: 8px; }
body.portal .nav a:hover { color: #fff; background: rgba(255,255,255,.1); }
body.portal .nav a.active { color: #fff; background: rgba(255,255,255,.16); }
.nav-user { color: rgba(255,255,255,.6); font-size: 13px; }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.btn-ghost:hover { background: rgba(255,255,255,.2); }
body.portal .btn-primary { background: var(--accent); }
body.portal h1 { font-size: 26px; }
.powered { display: inline-flex; align-items: center; gap: 6px; }
/* admin: the log */
.log-top { grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); }
.facts { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-word; }
.files { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.files li { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; }
.files li a:first-child { flex: 1; text-transform: capitalize; }
.files li.on { background: color-mix(in srgb, var(--brand) 10%, #fff); font-weight: 600; }
.log-filter select { width: auto; }
.seg { display: inline-flex; background: #eef1f5; border-radius: 8px; padding: 3px; gap: 2px; }
.seg label { margin: 0; padding: 6px 12px; border-radius: 6px; font-size: 13.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg label.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(9,30,56,.12); }
.seg input { display: none; }
table.log td { font-size: 13.5px; }
table.log .msg { word-break: break-word; }
tr.lvl-warn td { background: #fffaf3; }
tr.lvl-bad td { background: #fdf4f3; }
.mono-s { font-family: Consolas, monospace; font-size: 12.5px; white-space: nowrap; }
.logpre { white-space: pre-wrap; word-break: break-word; font: 12px/1.5 Consolas, monospace; background: #f6f8fb; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; max-height: 420px; overflow: auto; margin: 6px 0 0; }
.t-warn { color: var(--warn); font-weight: 600; }
.t-bad { color: var(--bad); font-weight: 600; }
@media (max-width: 820px) { .log-top { grid-template-columns: 1fr; } }

main a:not(.btn) { color: var(--brand); text-decoration: none; }
main a:not(.btn):hover { text-decoration: underline; }
table.list td a { color: var(--ink); font-weight: 600; }
table.list td a:hover { color: var(--brand); text-decoration: none; }

/* ---- the signer's page: the document on the left, a side panel on the right */
body.signing main.wrap { max-width: none; padding: 16px; }
body.signing .top-in { max-width: none; padding: 0 20px; }
body.signing .foot { max-width: none; padding: 0 16px 16px; }
.test-banner { margin-bottom: 12px; }
.sign-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: stretch; height: calc(100vh - 150px); min-height: 560px; }
.doc-pane { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.doc-pane .viewer { width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 0; display: block; }
.side { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; overflow: auto; }
.side-title { font-size: 20px; margin: 2px 0 10px; line-height: 1.3; }
.side-msg { white-space: pre-line; font-size: 14px; background: var(--page); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; }
.side-h { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 6px; }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center-text { text-align: center; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; }
.avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { flex: none; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: #eef2f6; color: var(--muted); }
.pill.turn { background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); }
.pill.turn::before { content: "● "; font-size: 9px; vertical-align: 1px; }
.pill.ok { background: #e7f5ef; color: var(--ok); }
.pill.bad { background: #fbeceb; color: var(--bad); }
.small-links { font-size: 13px; gap: 14px; }
.small-links a { color: var(--brand); text-decoration: none; }
.small-links a:hover { text-decoration: underline; }
.side-bottom { text-align: center; }
.btn-big { width: 100%; padding: 14px 18px; font-size: 16px; }
.link-btn { background: none; border: 0; padding: 6px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.side-bottom .link-btn { margin: 10px 0 6px; }
@media (max-width: 900px) {
    .sign-layout { grid-template-columns: 1fr; height: auto; }
    .doc-pane { height: 70vh; }
}

/* ---- dialogs */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; background: rgba(20, 38, 61, .45); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal.open { display: flex; }
.modal-box { position: relative; background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; padding: 24px; box-shadow: 0 20px 60px rgba(9, 30, 56, .3); }
.modal-box h2 { font-size: 19px; margin: 0 0 14px; padding-right: 30px; }
.modal-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 8px; }
.modal-x:hover { background: var(--page); }
.modal[data-step="1"] .step-2, .modal[data-step="2"] .step-1 { display: none; }
.tabs { display: flex; gap: 4px; background: #eef1f5; border-radius: 10px; padding: 4px; margin-bottom: 12px; }
.tab { flex: 0 0 auto; border: 0; background: none; padding: 7px 16px; border-radius: 7px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(9, 30, 56, .12); }
.pad { position: relative; height: 190px; border: 1.5px dashed #d5dce6; border-radius: 12px; background: #fff; touch-action: none; }
.pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; border-radius: 12px; }
.pad.typing canvas { cursor: default; }
.pad-hint { position: absolute; left: 0; right: 0; top: 42%; text-align: center; color: #9aa6b6; pointer-events: none; }
.pad.has-ink .pad-hint { display: none; }
.pad-x { position: absolute; left: 26px; bottom: 34px; color: #9aa6b6; pointer-events: none; }
.pad-line { position: absolute; left: 24px; right: 24px; bottom: 34px; border-bottom: 1px solid #cfd7e2; pointer-events: none; }
.pad.shake { animation: shake .4s; border-color: var(--bad); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.pad-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.pad-foot .link-btn { color: var(--brand); font-size: 13px; }
.sig-preview { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 6px; background: #fafbfc; }
.sig-preview img { max-height: 70px; max-width: 100%; }
.sig-preview span { font-size: 12px; color: var(--muted); border-top: 1px solid #cfd7e2; padding-top: 2px; min-width: 60%; text-align: center; }
.step2-links { display: flex; justify-content: space-between; margin-top: 10px; }
.step2-links .link-btn { color: var(--brand); font-size: 13px; }
.mono { font-family: Consolas, monospace; font-size: 18px; letter-spacing: 3px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
