/* ═══════════════════════════════════════════════════════════════════════
   Terms gate — shared scroll-to-accept overlay (terms-gate.js)
   Used by the Forge Creator Terms and the Closed Alpha NDA. Link this file
   on any page that can open a gate. Moved here from forge.css when the gate
   was generalised beyond the Forge.
   ═══════════════════════════════════════════════════════════════════════ */

.terms-gate {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(5, 5, 10, 0.82);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 24px;
}
.terms-gate__panel {
  background: var(--surface-raised);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: min(760px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.terms-gate__head {
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--border-light);
}
.terms-gate__head h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
}
.terms-gate__head p { margin: 0; font-size: 0.92rem; color: var(--text-muted); }

.terms-gate__doc {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 28px;
  flex: 1 1 auto;
  min-height: 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-muted);
}
.terms-gate__doc:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.terms-gate__doc h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 28px 0 10px;
}
.terms-gate__doc h2:first-child { margin-top: 0; }
.terms-gate__doc p { margin: 0 0 14px; }
.terms-gate__doc ul { margin: 0 0 16px; padding-left: 20px; }
.terms-gate__doc li { margin-bottom: 8px; }
.terms-gate__doc strong { color: var(--text); }
.terms-gate__doc a { color: var(--gold); text-decoration: underline; }
.terms-gate__loading,
.terms-gate__error { color: var(--text-dim); font-style: italic; }

.terms-gate__foot {
  padding: 16px 28px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-card);
}
.terms-gate__hint { margin: 0; font-size: 0.85rem; color: var(--text-dim); }
.terms-gate__hint.is-ready { color: var(--accent-emerald); }
.terms-gate__actions { display: flex; gap: 10px; margin-left: auto; }
.terms-gate__actions .btn[disabled] { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 560px) {
  .terms-gate { padding: 12px; }
  .terms-gate__head,
  .terms-gate__doc,
  .terms-gate__foot { padding-left: 18px; padding-right: 18px; }
  .terms-gate__actions { width: 100%; margin-left: 0; }
  .terms-gate__actions .btn { flex: 1; }
}
