/* ——— Legal modals (Privacy / Terms) ——— */
.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.legal-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.legal-modal[hidden] {
  display: none !important;
}

.legal-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
}

.legal-modal__panel {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(84dvh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--white);
  color: var(--black);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.legal-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid #ecece8;
  flex-shrink: 0;
}

.legal-modal__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.legal-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1.5px solid #d8d8d4;
  border-radius: 999px;
  background: transparent;
  color: var(--black);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.legal-modal__close:hover {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

.legal-modal__close-x {
  position: relative;
  width: 12px;
  height: 12px;
}

.legal-modal__close-x::before,
.legal-modal__close-x::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1.5px;
  background: currentColor;
}

.legal-modal__close-x::before {
  transform: rotate(45deg);
}

.legal-modal__close-x::after {
  transform: rotate(-45deg);
}

.legal-modal__body {
  padding: 1.25rem 1.35rem 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.legal-modal__body p {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #2a2a2a;
}

.legal-modal__body h3 {
  margin: 1.25rem 0 0.55rem;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--black);
}

.legal-modal__body h3:first-of-type {
  margin-top: 1rem;
}

.legal-modal__body ul {
  margin: 0 0 0.85rem;
  padding-left: 1.15rem;
}

.legal-modal__body li {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #2a2a2a;
}

.legal-modal__body li:last-child {
  margin-bottom: 0;
}

.legal-modal__body a {
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-modal__body p:last-child {
  margin-bottom: 0;
}

body.legal-open {
  overflow: hidden;
}
