:root {
  --ink: #111;
  --muted: #5a5a5a;
  --line: #d5d5d5;
  --line-strong: #888;
  --accent: #0f4d3a;
  --accent-hover: #0c3d2e;
  --error-bg: #fdecea;
  --error-ink: #8a1c10;
  --bg: #ffffff;
  --bg-soft: #f7f7f5;
  --max-w: 760px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-soft);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--accent); }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.container.narrow { max-width: 560px; }
.container.wide   { max-width: 1100px; }

.masthead h1 {
  font-size: 28px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.masthead .subtitle {
  margin: 0 0 24px;
  color: var(--muted);
}

.scroll-instruction {
  background: #fff7e6;
  border: 1px solid #f0c674;
  color: #6b4500;
  padding: 10px 14px;
  border-radius: 6px;
  margin: 0 0 12px;
  font-size: 14px;
}

.nda-text {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px 28px;
  margin-bottom: 12px;
  max-height: 480px;
  overflow-y: auto;
  font-size: 14.5px;
  line-height: 1.55;
  scroll-behavior: smooth;
}
.nda-text:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.scroll-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 6px;
  margin: 0 0 20px;
  background: #fdecea;
  border: 1px solid #e7a8a0;
  color: #8a1c10;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.scroll-status.done {
  background: #e8f5ee;
  border-color: #8cc9a4;
  color: #0c3d2e;
}
.scroll-status-icon { font-weight: 700; }

.nda-text h2 {
  font-size: 16px;
  margin: 18px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nda-text h2.nda-title {
  text-align: center;
  margin-top: 0;
  font-size: 18px;
}
.nda-text p { margin: 0 0 10px; white-space: pre-line; }
.nda-text ul { margin: 0 0 12px 20px; padding: 0; }
.nda-text li { margin-bottom: 4px; }

.sign-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}
.sign-form h2 {
  margin: 0 0 18px;
  font-size: 20px;
}

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
}
.field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.field .req     { color: #b00020; font-weight: 700; }
.field .optional { color: var(--muted); font-weight: 400; font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; }

.canvas-wrap {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  background-image:
    linear-gradient(to bottom, transparent calc(100% - 32px), #eee calc(100% - 32px), #eee calc(100% - 31px), transparent calc(100% - 31px));
  overflow: hidden;
  touch-action: none;
}
#signature-canvas {
  display: block;
  width: 100%;
  height: 200px;
  cursor: crosshair;
}
.canvas-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.field.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.field.check input { margin-top: 4px; }
.field.check label { font-weight: 400; font-size: 14px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled {
  background: #bbb;
  cursor: not-allowed;
}

.btn-secondary {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
}
.btn-secondary:hover { background: var(--bg-soft); }

.btn-link {
  color: var(--accent);
  text-decoration: underline;
}

.btn-danger {
  background: #fff;
  color: #8a1c10;
  border: 1px solid #e7a8a0;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
}
.btn-danger:hover:not(:disabled) {
  background: var(--error-bg);
  border-color: #c97160;
}
.btn-danger:disabled {
  background: #f3f3f3;
  color: #999;
  border-color: #ddd;
  cursor: not-allowed;
}

.error-banner {
  background: var(--error-bg);
  color: var(--error-ink);
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 14px;
}

.legal-fine-print {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

.privacy-disclosure {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
}
.privacy-disclosure summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
}
.privacy-disclosure summary::-webkit-details-marker { display: none; }
.privacy-disclosure summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}
.privacy-disclosure[open] summary::before { content: "▾ "; }
.privacy-disclosure p { margin: 8px 0; }
.privacy-disclosure ul { margin: 4px 0 8px 18px; padding: 0; }
.privacy-disclosure li { margin-bottom: 2px; }

.confirmation.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}
.ref-id { font-size: 18px; }
.ref-id code {
  background: var(--bg-soft);
  padding: 6px 10px;
  border-radius: 4px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 15px;
}

.sig-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-size: 14px;
}
.sig-table th,
.sig-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.sig-table th {
  background: var(--bg-soft);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sig-table tr:last-child td { border-bottom: none; }

@media print {
  body { background: #fff; }
  .sign-form, .masthead { display: none; }
  .nda-text {
    max-height: none;
    overflow: visible;
    border: none;
    padding: 0;
  }
}
