:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #5b6573;
  --paper: #fffaf2;
  --panel: #f4f7f2;
  --line: #cbd5c0;
  --accent: #146c63;
  --accent-strong: #0d514b;
  --danger: #9a3412;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #e9edf0;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 18px;
}

.document,
.signature-panel {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(31, 41, 51, 0.12);
}

.document {
  padding: 28px;
}

.signature-panel {
  background: var(--panel);
  padding: 22px;
  align-self: start;
  position: sticky;
  top: 18px;
}

.document-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin: 26px 0 8px;
  font-size: 18px;
}

p {
  line-height: 1.55;
}

.pdf-link,
.primary,
.ghost {
  border: 0;
  border-radius: 6px;
  min-height: 42px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.pdf-link {
  flex: 0 0 auto;
  color: #fff;
  background: var(--ink);
  padding: 12px 14px;
  text-decoration: none;
}

form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

input[name="signerName"] {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
  background: #fff;
}

.consent {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  line-height: 1.45;
  color: var(--muted);
}

.consent input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.pad-wrap {
  display: grid;
  gap: 9px;
}

.pad-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

canvas {
  width: 100%;
  aspect-ratio: 19 / 7;
  display: block;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fff;
  touch-action: none;
}

.ghost {
  padding: 0 12px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
}

.primary {
  width: 100%;
  color: #fff;
  background: var(--accent);
  padding: 0 18px;
}

.primary:disabled {
  cursor: not-allowed;
  background: #7c8b88;
}

.status {
  min-height: 24px;
  margin: 0;
  color: var(--accent-strong);
  font-weight: 700;
}

.status.error {
  color: var(--danger);
}

.status a {
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 820px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .signature-panel {
    position: static;
  }

  .document-head {
    display: grid;
  }
}
