/* =========================================================
   Tixora — Reusable Terms & Conditions Modal
   Shared component used by: Sign Up, Organizer Event Creation,
   and anywhere else Terms & Conditions must be shown/accepted.

   Relies on the same design tokens (--color-primary, --font-heading,
   etc.) already defined in login_sign_in/style.css and dashboard/styles.css.
   Falls back to sane defaults if those variables aren't present, so this
   file is safe to drop into any page.
   ========================================================= */

.terms-modal-overlay {
  --tm-primary: var(--color-primary, #001F54);
  --tm-radius: var(--card-radius, 18px);
  --tm-border: var(--color-border, #D1D9E6);
  --tm-muted: var(--color-muted, #6B7385);
  --tm-text: var(--color-text, #1A1A2E);

  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 16, 32, 0.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
  font-family: var(--font-body, 'Inter', sans-serif);
}

.terms-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.terms-modal {
  width: 100%;
  max-width: 560px;
  max-height: 84vh;
  background: #fff;
  border-radius: var(--tm-radius);
  box-shadow: 0 24px 60px rgba(0, 31, 84, 0.25);
  display: flex;
  flex-direction: column;
  transform: translateY(18px) scale(0.98);
  opacity: 0;
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), opacity 220ms ease;
}

.terms-modal-overlay.is-open .terms-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.terms-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--tm-border);
  flex-shrink: 0;
}

.terms-modal__header h2 {
  margin: 0;
  font-family: var(--font-heading, 'Poppins', sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--tm-primary);
}

.terms-modal__close {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--tm-muted);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: background 150ms ease, color 150ms ease;
}

.terms-modal__close:hover {
  background: rgba(0, 31, 84, 0.06);
  color: var(--tm-primary);
}

.terms-modal__body {
  padding: 18px 24px;
  overflow-y: auto;
  color: var(--tm-text);
  font-size: 0.925rem;
  line-height: 1.65;
}

.terms-modal__body h3 {
  font-size: 0.95rem;
  margin: 18px 0 6px;
  color: var(--tm-primary);
}

.terms-modal__body h3:first-child {
  margin-top: 0;
}

.terms-modal__body p {
  margin: 0 0 10px;
  color: var(--tm-muted);
}

.terms-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--tm-border);
  flex-shrink: 0;
}

.terms-modal__btn {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid var(--tm-border);
  background: #fff;
  color: var(--tm-text);
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.terms-modal__btn:hover {
  background: rgba(0, 31, 84, 0.04);
}

.terms-modal__btn--confirm {
  border: none;
  background: var(--tm-primary);
  color: #fff;
}

.terms-modal__btn--confirm:hover {
  background: var(--color-primary-soft, #0A2E6E);
}

.terms-modal__btn--confirm:active,
.terms-modal__btn:active {
  transform: scale(0.97);
}

@media (max-width: 480px) {
  .terms-modal {
    max-height: 90vh;
  }
  .terms-modal__header,
  .terms-modal__body,
  .terms-modal__footer {
    padding-left: 16px;
    padding-right: 16px;
  }
}
