/* views-nda.css — first-login NDA gate (js/views/nda-gate.js).
   Full-screen signing ceremony rendered before the app when me.nda_pending.
   House style via tokens.css; must not overflow at 390px. */

.nda-gate {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(12px, 4vw, 40px);
  background: var(--bg-0);
  box-sizing: border-box;
}

.nda-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 720px;
  padding: clamp(16px, 3vw, 28px);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  font-family: var(--font-ui);
  color: var(--text-1);
}

/* ── header ─────────────────────────────────────────────────────────────── */
.nda-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
}
.nda-titles { min-width: 0; flex: 1 1 240px; }
.nda-heading {
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 700;
  margin: 0;
  color: var(--text-1);
  word-break: break-word;
}
.nda-intro {
  font-size: 13px;
  color: var(--text-2);
  margin: 6px 0 0;
  line-height: 1.5;
}

.nda-langbar {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--bg-input);
}
.nda-lang {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 16px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nda-lang.is-active { background: var(--accent-strong); color: #fff; }
.nda-lang:not(.is-active):hover { color: var(--text-1); }
.nda-lang:focus-visible { outline: none; box-shadow: var(--ring); }

/* ── document scroller ──────────────────────────────────────────────────── */
.nda-doc {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-input);
  padding: var(--s4);
  max-height: min(46vh, 420px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.nda-doc:focus-visible { outline: none; box-shadow: var(--ring); }
.nda-doc-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--text-1);
}
.nda-doc-body {
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.nda-scrollnote {
  font-size: 12px;
  color: var(--warn);
  margin-top: -6px;
}
.nda-scrollnote.is-done { color: var(--ok); }

/* ── form ───────────────────────────────────────────────────────────────── */
.nda-form { display: flex; flex-direction: column; gap: var(--s4); }
.nda-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.nda-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .01em;
}
.nda-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-1);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 10px 12px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.nda-input:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

.nda-addr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s3);
}
.nda-field-wide { grid-column: 1 / -1; }

/* ── signature pad ──────────────────────────────────────────────────────── */
.nda-sig { display: flex; flex-direction: column; gap: 7px; }
.nda-sig-box {
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-input);
  height: 140px;
  overflow: hidden;
  touch-action: none;
}
.nda-sig-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}
.nda-sig-clear { align-self: flex-start; }

/* ── agree + accept ─────────────────────────────────────────────────────── */
.nda-agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-1);
  cursor: pointer;
  line-height: 1.45;
}
.nda-agree input[type="checkbox"] {
  width: 18px; height: 18px;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
  cursor: pointer;
}
.nda-accept { align-self: stretch; padding-top: 12px; padding-bottom: 12px; font-size: 14px; }

.nda-cfg-error {
  font-size: 13.5px;
  color: var(--danger);
  background: var(--danger-dim);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  border-radius: var(--r-md);
  padding: var(--s4);
  line-height: 1.5;
  margin: 0;
}

/* ── confirmation ───────────────────────────────────────────────────────── */
.nda-confirm { align-items: center; text-align: center; }
.nda-confirm-check {
  width: 56px; height: 56px;
  border-radius: var(--r-pill);
  background: var(--ok-dim);
  color: var(--ok);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  font-weight: 700;
}
.nda-confirm-actions {
  display: flex;
  gap: var(--s3);
  flex-wrap: wrap;
  justify-content: center;
}

/* ── narrow viewports ───────────────────────────────────────────────────── */
@media (max-width: 540px) {
  .nda-addr-grid { grid-template-columns: 1fr 1fr; }
  .nda-field-wide { grid-column: 1 / -1; }
  .nda-confirm-actions { flex-direction: column; align-items: stretch; }
}
@media (max-width: 380px) {
  .nda-addr-grid { grid-template-columns: 1fr; }
}
