/* Modal pattern — used by the invite-owner modal on profile pages and
   the invite-user / new-member modals on the admin homepage. Reorg
   doesn't have either of these surfaces; this file is main-specific. */

.ns-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
}
.ns-modal-backdrop.is-open { display: flex; }
.ns-modal {
  width: min(440px, 92vw);
  background: var(--ns-bg-card, #161616);
  border: 1px solid var(--ns-border, #242424);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
  font-family: var(--ns-font-sans, "Epilogue", -apple-system, BlinkMacSystemFont, sans-serif);
  color: var(--ns-text, #e8e6e3);
  position: relative;
}
.ns-modal h3 {
  margin: 0 0 1rem;
  font-family: var(--ns-font-serif, "Fraunces", Georgia, serif);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--ns-text, #e8e6e3);
}
.ns-modal label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ns-text-muted, #8a8a8a);
  margin: 0.5rem 0 0.35rem;
}
.ns-modal input[type=email],
.ns-modal input[type=text],
.ns-modal input[type=url] {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--ns-bg, #0a0a0a);
  color: var(--ns-text, #e8e6e3);
  border: 1px solid var(--ns-border, #242424);
  border-radius: 8px;
  transition: border-color 120ms ease;
}
.ns-modal input[type=email]:focus,
.ns-modal input[type=text]:focus,
.ns-modal input[type=url]:focus {
  outline: none;
  border-color: var(--ns-text-muted, #8a8a8a);
}
.ns-modal__segmented {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--ns-bg, #0a0a0a);
  border: 1px solid var(--ns-border, #242424);
  border-radius: 8px;
}
.ns-modal__segmented input { position: absolute; opacity: 0; pointer-events: none; }
.ns-modal__segmented label {
  flex: 1;
  margin: 0;
  padding: 0.4rem 0.75rem;
  text-align: center;
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ns-text-muted, #8a8a8a);
  border-radius: 6px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.ns-modal__segmented label:hover { color: var(--ns-text, #e8e6e3); }
.ns-modal__segmented input:checked + label {
  background: var(--ns-text, #e8e6e3);
  color: var(--ns-bg, #0a0a0a);
  font-weight: 600;
}
.ns-modal__segmented input:focus-visible + label {
  outline: 1px solid var(--ns-text-muted, #8a8a8a);
  outline-offset: 1px;
}
.ns-modal__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--ns-text-muted, #8a8a8a);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.ns-modal__close:hover {
  background: var(--ns-bg-elevated, #1f1f1f);
  color: var(--ns-text, #e8e6e3);
}
.ns-modal__msg a {
  color: var(--ns-accent, #8b9dda);
  word-break: break-all;
  text-decoration: underline;
}
.ns-modal__msg a:hover { text-decoration: none; }
.ns-modal__row { display: flex; gap: 0.6rem; }
.ns-modal__col { flex: 1; min-width: 0; }
.ns-modal__copy-row { display: flex; gap: 0.45rem; align-items: stretch; }
.ns-modal__copy-row input { flex: 1; font-size: 0.8rem; word-break: break-all; }
.ns-modal__copy-row button {
  padding: 0 0.85rem;
  background: var(--ns-text, #e8e6e3);
  color: var(--ns-bg, #0a0a0a);
  border: 0; border-radius: 8px;
  font-family: inherit; font-size: 0.8rem; font-weight: 600;
  cursor: pointer;
}
.ns-modal__actions {
  display: flex; gap: 0.5rem; justify-content: flex-end;
  margin-top: 1.25rem;
}
.ns-modal__actions button {
  padding: 0.55rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--ns-border, #242424);
  background: var(--ns-bg-card, #161616);
  color: var(--ns-text, #e8e6e3);
}
.ns-modal__actions button.is-primary {
  background: var(--ns-text, #e8e6e3);
  color: var(--ns-bg, #0a0a0a);
  border: 0; font-weight: 600;
}
.ns-modal__actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.ns-modal__msg { margin-top: 0.6rem; font-size: 0.85rem; min-height: 1.1em; }
.ns-modal__msg.is-error { color: #ff8080; }
.ns-modal__msg.is-success { color: var(--ns-accent, #8b9dda); }
