html.has-open-modal,
html.has-open-modal body {
  overflow: hidden;
}

.site-modal {
  position: fixed;
  inset: 0;

  z-index: 1000;

  display: grid;
  place-items: center;

  padding: 24px;

  opacity: 0;
  visibility: hidden;

  pointer-events: none;

  transition:
    opacity 260ms ease,
    visibility 0s linear 260ms;
}

.site-modal.is-open {
  opacity: 1;
  visibility: visible;

  pointer-events: auto;

  transition:
    opacity 260ms ease,
    visibility 0s;
}

.site-modal__backdrop {
  position: absolute;
  inset: 0;

  background: rgba(0, 0, 0, 0.78);

  backdrop-filter: blur(8px);
}

.site-modal__dialog {
  position: relative;
  z-index: 1;

  width: min(100%, 560px);
  max-height: calc(100dvh - 48px);

  padding: 46px;

  overflow-y: auto;

  border: 1px solid var(--color-border-gold-31);

  background: var(--color-surface-card);

  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);

  opacity: 0;

  transform: translateY(20px) scale(0.985);

  transition:
    opacity 260ms ease,
    transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.site-modal.is-open .site-modal__dialog {
  opacity: 1;

  transform: translateY(0) scale(1);
}

.site-modal__close {
  position: absolute;

  top: 18px;
  right: 18px;

  width: 36px;
  height: 36px;

  padding: 0;

  border: 0;

  background: transparent;

  color: var(--color-text-primary);
}

.site-modal__close span {
  position: absolute;

  top: 50%;
  left: 50%;

  width: 20px;
  height: 1px;

  background: currentColor;
}

.site-modal__close span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}

.site-modal__close span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.site-modal__title {
  margin: 0;

  color: var(--color-text-primary);

  font-family: var(--font-heading);

  font-size: 42px;
  font-weight: 400;
  line-height: 48px;
}

.site-modal__text {
  margin: 18px 0 0;

  color: var(--color-text-muted);

  font-size: 16px;
  line-height: 24px;
}

.site-modal__form {
  margin-top: 30px;
}

/* ----------------------------------------------------------
   Лэптоп
   ---------------------------------------------------------- */

@media (max-width: 1439px) {
  .site-modal__dialog {
    padding: 42px;
  }
}

/* ----------------------------------------------------------
   Планшет
   ---------------------------------------------------------- */

@media (max-width: 1023px) {
  .site-modal__dialog {
    width: min(100%, 520px);

    padding: 38px;
  }

  .site-modal__title {
    font-size: 38px;
    line-height: 44px;
  }
}

/* ----------------------------------------------------------
   Смартфон
   ---------------------------------------------------------- */

@media (max-width: 767px) {
  .site-modal {
    padding: 16px;
  }

  .site-modal__dialog {
    max-height: calc(100dvh - 32px);

    padding: 34px 22px 26px;
  }

  .site-modal__close {
    top: 10px;
    right: 10px;
  }

  .site-modal__title {
    padding-right: 26px;

    font-size: 32px;
    line-height: 38px;
  }
}

/* ----------------------------------------------------------
   Reduced Motion
   ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .site-modal,
  .site-modal__dialog {
    transition: none;
  }
}
