/* agreement.css — the Operator Agreement, as a piece of paper (2026-09-24).

   Owner: "the agreement should be in a white page not with tgm background, it
   needs to be formal."

   Right, and not only on aesthetic grounds. The rest of TOP is a dark console
   because somebody is working in it. A contract is not a screen somebody is
   working in; it is a document they are going to read once, carefully, and
   then be bound by. Green-on-black with a grid behind it reads as software.
   Black on white with real margins reads as a contract, which is what it is.

   EVERYTHING IS SCOPED UNDER .legal-doc so the same stylesheet can be the
   whole page at /agreement and a white sheet sitting inside the dark operator
   dashboard, with no rule leaking either way.

   It prints. Somebody will want this on paper in front of a lawyer, and a
   contract you cannot print is a contract you cannot take advice on. */

.legal-doc {
  --ink:        #17222b;
  --ink-soft:   #4a5a66;
  --rule:       #d8dee3;
  --paper:      #ffffff;
  --accent:     #0d2d4a;

  background: var(--paper);
  color: var(--ink);
  font-family: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  text-align: left;
  padding: clamp(24px, 5vw, 64px);
  border-radius: 6px;
  box-sizing: border-box;
}

.legal-doc * { box-sizing: border-box; }

.legal-doc .doc-head { border-bottom: 2px solid var(--accent); padding-bottom: 18px; margin-bottom: 26px; }
.legal-doc .doc-title {
  font-family: 'Syne', Georgia, serif; font-weight: 800;
  font-size: clamp(22px, 4.4vw, 32px); line-height: 1.15;
  letter-spacing: -0.5px; color: var(--accent); margin: 0 0 10px;
}
.legal-doc .eff {
  font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 16px;
}
.legal-doc .intro {
  font-size: 14.5px; color: var(--ink-soft);
  border-left: 3px solid var(--rule); padding-left: 14px; margin: 0;
}

.legal-doc h2 {
  font-family: 'Syne', Georgia, serif; font-weight: 700;
  font-size: clamp(16px, 3vw, 19px); color: var(--accent);
  margin: 34px 0 12px; padding-top: 16px; border-top: 1px solid var(--rule);
  letter-spacing: -0.2px;
}
.legal-doc h2 .n {
  display: inline-block; min-width: 2.4em;
  font-family: 'DM Mono', ui-monospace, monospace; font-size: 13px;
  font-weight: 500; color: var(--ink-soft);
}
.legal-doc h3 {
  font-family: 'Syne', Georgia, serif; font-weight: 700; font-size: 15px;
  color: var(--accent); margin: 22px 0 8px;
}

.legal-doc p  { margin: 0 0 12px; }
.legal-doc ul { margin: 0 0 14px; padding-left: 20px; }
.legal-doc li { margin-bottom: 8px; }
.legal-doc li::marker { color: var(--ink-soft); }
.legal-doc b, .legal-doc strong { color: var(--ink); font-weight: 600; }
.legal-doc a { color: var(--accent); }

.legal-doc table.of {
  width: 100%; border-collapse: collapse; margin: 10px 0 18px; font-size: 14px;
}
.legal-doc table.of th, .legal-doc table.of td {
  border: 1px solid var(--rule); padding: 8px 11px; text-align: left; vertical-align: top;
}
.legal-doc table.of th {
  background: #f4f6f8; font-weight: 600; font-size: 12px;
  letter-spacing: 1px; text-transform: uppercase; color: var(--ink-soft);
}
.legal-doc .blank { color: var(--ink-soft); }

/* ── the signature block, which is part of the document ─────────────────── */

.legal-doc .card, .legal-doc .sigblock {
  border: 1px solid var(--rule); border-radius: 4px;
  padding: clamp(16px, 3vw, 24px); margin: 26px 0;
  background: #fbfcfd;
}
.legal-doc .sig { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
@media (max-width: 620px) { .legal-doc .sig { grid-template-columns: 1fr; } }
.legal-doc .sig p { font-size: 14px; line-height: 2; }

/* A real signature line: a rule with a label under it, the way a contract
   does it, rather than a row of underscores that wraps on a phone. */
.legal-doc .sigline { margin-bottom: 16px; }
.legal-doc .sigline .rule {
  border-bottom: 1px solid var(--ink); min-height: 30px;
  display: flex; align-items: flex-end; padding-bottom: 3px;
}
.legal-doc .sigline .lbl {
  font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--ink-soft); margin-top: 5px;
}
.legal-doc .sigline .val {
  font-size: 15px; color: var(--ink);
}
.legal-doc .sigline .val.hand {
  font-family: 'Syne', Georgia, serif; font-size: 19px; font-style: italic;
}
.legal-doc .sigline img { max-height: 58px; max-width: 100%; display: block; }

/* The tap target. Deliberately the size of a signature line rather than a
   button: what it does is put a signature on that line. */
.legal-doc .sigpad-open {
  width: 100%; min-height: 62px; cursor: pointer;
  border: 1.5px dashed #9fb0bd; border-radius: 4px; background: #fff;
  color: var(--ink-soft); font-family: inherit; font-size: 13.5px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.legal-doc .sigpad-open:hover { border-color: var(--accent); color: var(--accent); }
.legal-doc .sigpad-open.signed { border-style: solid; border-color: var(--accent); padding: 6px; }

.legal-doc input[type=text] {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--ink);
  padding: 9px 11px; border: 1px solid #b9c4cc; border-radius: 4px; background: #fff;
}
.legal-doc input[type=text]:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.legal-doc .accept {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; color: var(--ink); margin: 18px 0 14px; cursor: pointer;
}
.legal-doc .accept input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; }
.legal-doc .doc-btn {
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 12px;
  letter-spacing: 1.6px; text-transform: uppercase; cursor: pointer;
  background: var(--accent); color: #fff; border: none; border-radius: 4px;
  padding: 13px 22px;
}
.legal-doc .doc-btn:disabled { opacity: .45; cursor: not-allowed; }
.legal-doc .doc-btn.ghost { background: #fff; color: var(--accent); border: 1px solid #b9c4cc; }
.legal-doc .doc-out { margin-top: 12px; font-size: 13.5px; color: var(--ink-soft); }
.legal-doc .doc-out.bad { color: #a3241b; }
.legal-doc .doc-note { font-size: 12.5px; color: var(--ink-soft); margin-top: 10px; }

/* ── the signing surface ─────────────────────────────────────────────────
   A full overlay rather than a small canvas wedged into the page. A
   signature drawn in a 150px box with a finger looks like a scribble, and
   somebody signing a contract should not be fighting the layout. */
.sigpad-back {
  position: fixed; inset: 0; z-index: 9999; display: none;
  background: rgba(10,18,24,.72); padding: 16px;
  align-items: center; justify-content: center;
}
.sigpad-back.open { display: flex; }
.sigpad-sheet {
  background: #fff; border-radius: 8px; width: 100%; max-width: 620px;
  padding: 18px; color: #17222b;
  font-family: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}
.sigpad-sheet h4 {
  font-family: 'Syne', Georgia, serif; font-size: 17px; margin: 0 0 4px; color: #0d2d4a;
}
.sigpad-sheet .sub { font-size: 13px; color: #4a5a66; margin: 0 0 14px; }
.sigpad-wrap { position: relative; border: 1.5px solid #b9c4cc; border-radius: 4px; background: #fff; }
.sigpad-wrap canvas { width: 100%; height: 190px; display: block; touch-action: none; cursor: crosshair; }
.sigpad-wrap .ph {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  text-align: center; color: #b3bfc8; font-size: 14px; pointer-events: none;
}
.sigpad-wrap .base {
  position: absolute; left: 22px; right: 22px; bottom: 44px;
  border-bottom: 1px solid #dfe5ea; pointer-events: none;
}
.sigpad-row { display: flex; gap: 10px; margin-top: 14px; }
.sigpad-row button { flex: 1; }

@media print {
  body { background: #fff !important; }
  nav, footer, .sigpad-back, .doc-btn, .back-link { display: none !important; }
  .legal-doc { padding: 0; border-radius: 0; box-shadow: none; }
  .legal-doc h2 { break-after: avoid; }
  .legal-doc .sigblock { break-inside: avoid; }
}
