html.modal-active {
  overflow-y: hidden;
}

.modal-backdrop {
  z-index: $z-above-all;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: $black-800;
  transition: opacity calc($transition-speed * 2) $transition-easing;
  opacity: 0;
  pointer-events: none;

  html.modal-active & {
    opacity: 1;
    pointer-events: all;
  }
}

.modal {
  position: relative;
  background-color: $white;
  overflow: visible;
  display: flex;
  justify-content: center;
  margin: 4rem auto 0;
  height: auto;
  max-width: 80vw;
  max-height: calc(100% - 16rem);

  @include media-min($large) {
    margin-top: 8rem;
    max-width: 800px;
  }

  &__close {
    z-index: 1;
    position: absolute;
    top: -10px;
    right: -40px;
    cursor: pointer;
    background: transparent;
    color: #fff;
    border: none;
    padding: 0;
    width: 3.2rem;
    height: 3.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    svg {
      width: 1rem;
      height: 1rem;
    }
  }

  &-form {
    width: 80%;
    max-width: 60rem;
    border-radius: 1rem;
  }

  &__content-container {
    position: relative;
    width: 100%;
    overflow-y: scroll;
  }

  &__loading-container,
  &__content {
    padding: 4rem 3.2rem;

    @include media-min($large) {
      padding: 6rem 4rem;
    }
  }

  &__loading-container {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity $transition-speed $transition-easing;
  }

  &.is-loading {
    .modal__loading-container {
      opacity: 1;
      pointer-events: all;
    }

    .modal__content {
      opacity: 0;
      pointer-events: none;
    }
  }
}

/**
 * Video Modal
 */
.modal {
  &__video-embed {
    width: 100%;
  }
  &-video {
    background-color: transparent;
    height: auto;

    @include media-max($small) {
      margin-top: 8rem;
    }

    .modal__content {
      padding: 0;
    }
  }
}
