/* ─── TermsGate — new-user terms + privacy acceptance ─────────────────────────
   Full-screen blocking overlay. Shown only to users whose terms_accepted_at
   IS NULL (accounts created after the migration). Existing users are
   backfilled (grandfathered) and never see this screen.

   z-index: 200 — above OnboardingFlow (z 100) and bottom-nav. */

.tg-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--kith-bg-grad, var(--kith-bg));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(28px, env(safe-area-inset-top, 28px)) 20px
           max(28px, env(safe-area-inset-bottom, 28px)) 20px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.tg-card {
  width: 100%;
  max-width: 380px;
  background: var(--kith-surface);
  border: 1px solid var(--kith-border);
  border-radius: 16px;
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Wordmark ── */
.tg-wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tg-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #F6DD9A, var(--kith-gold, #D1A026) 62%, #B68E2C);
  flex-shrink: 0;
}

.tg-name {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--kith-text);
}

/* ── Heading + body ── */
.tg-heading {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--kith-text);
}

.tg-body {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--kith-text-muted);
}

/* ── Document links ── */
.tg-doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tg-doc-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--kith-surface-2, var(--kith-bg));
  border: 1px solid var(--kith-border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--kith-text);
  text-decoration: none;
  transition: border-color 120ms ease, background 120ms ease;
}

.tg-doc-link:hover,
.tg-doc-link:focus-visible {
  border-color: var(--kith-green);
  background: var(--kith-accent-soft, var(--kith-surface-2));
}

.tg-doc-icon {
  flex-shrink: 0;
  color: var(--kith-green);
}

.tg-ext-icon {
  flex-shrink: 0;
  margin-left: auto;
  color: var(--kith-text-dim);
}

/* ── Checkbox row ── */
.tg-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  /* Remove default label margin */
  margin: 0;
}

.tg-check-box-wrap {
  position: relative;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px; /* optical alignment with first line of text */
}

.tg-checkbox {
  /* Hide the native checkbox; .tg-check-custom is the visual */
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.tg-check-custom {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  border: 1.5px solid var(--kith-border);
  background: var(--kith-surface);
  transition: border-color 120ms ease, background 120ms ease;
  pointer-events: none;
}

/* Checked state */
.tg-checkbox:checked + .tg-check-custom {
  background: var(--kith-green);
  border-color: var(--kith-green);
}

.tg-checkbox:checked + .tg-check-custom::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.tg-checkbox:focus-visible + .tg-check-custom {
  outline: 2px solid var(--kith-green);
  outline-offset: 2px;
}

.tg-check-label {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--kith-text);
  user-select: none;
}

/* ── Continue button ── */
.tg-btn {
  width: 100%;
  padding: 13px 20px;
  background: var(--kith-green);
  color: #fff;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms ease, opacity 120ms ease;
}

.tg-btn:hover:not(:disabled) {
  background: var(--kith-accent-ink, #14341F);
}

.tg-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
