.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.legal-modal.is-open {
  display: flex;
}

.legal-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 39, 59, 0.72);
  backdrop-filter: blur(3px);
}

.legal-modal__dialog {
  position: relative;
  width: min(1100px, calc(100vw - 48px));
  height: min(88vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(24, 33, 55, 0.35);
}

.legal-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(43, 58, 92, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.98));
}

.legal-modal__title {
  margin: 0;
  color: #2b3a5c;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
}

.legal-modal__close {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: rgba(43, 58, 92, 0.08);
  color: #2b3a5c;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.legal-modal__close:hover {
  background: rgba(43, 58, 92, 0.14);
  transform: scale(1.03);
}

.legal-modal__frame {
  width: 100%;
  flex: 1;
  border: 0;
  background: #ebeff2;
}

body.legal-modal-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .legal-modal {
    padding: 12px;
  }

  .legal-modal__dialog {
    width: min(100vw - 24px, 1000px);
    height: min(92vh, 920px);
    border-radius: 20px;
  }

  .legal-modal__header {
    padding: 14px 16px;
  }

  .legal-modal__title {
    font-size: 18px;
  }

  .legal-modal__close {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}
