.hero-form {
  --hero-form-bg: #{$topic-green};

  &.hero-form--secondary {
    --hero-form-bg: #{$secondary-color};
  }

  &.hero-form--primary {
    --hero-form-bg: #{$primary-color};
  }

  &.hero-form--orange {
    --hero-form-bg: #{$topic-orange};
  }

  &.hero-form--yellow {
    --hero-form-bg: #{$topic-yellow};
  }

  &.hero-form--green {
    --hero-form-bg: #{$topic-green};
  }

  margin: 0 auto 75px;

  @include sm {
    margin: 0 0 50px;
  }

  &__container {
    position: relative;
    max-width: $max-width;
    padding: 0 $gutter 64px;
    margin: 0 auto;

    @include sm {
      padding: 0;
    }

    &::before {
      content: '';
      display: block;
      position: absolute;
      right: 0;
      top: 75px;
      width: 600px;
      height: 600px;
      background-color: var(--hero-form-bg);

      @include mdx {
        width: 660px;
      }

      @include sm {
        display: none;
      }
    }
  }

  &__wrapper {
    @include sm {
      background-color: var(--hero-form-bg);
      padding-bottom: 16px;
    }
  }

  &__bg {
    position: relative;
    z-index: 1;
    width: 100%;
    max-height: 600px;

    @include sm {
      width: 100%;
    }

    img {
      position: absolute;
      display: block;
      width: 100%;
      height: 100%;
      top: 0;
      left: 0;
      object-fit: cover;
    }

    &::before {
      content: '';
      display: block;
      padding-top: 54%;

      @include sm {
        padding-top: 61%;
      }
    }

    &::after {
      content: '';
      position: absolute;
      display: block;
      width: 100%;
      height: 100%;
      top: 0;
      left: 0;
      background-color: rgba(0,0,0,0.4);
    }
  }

  &__content-inner {
    @include mdx {
      margin-bottom: 90px;
    }

    @include sm {
      margin-bottom: 0;
    }
  }

  &__inner {
    position: relative;

    &::before {
      content: '';
      display: block;
      position: absolute;
      left: -$gutter;
      top: 0;
      width: calc(100% / 12 * 7);
      height: 90%;
      background-color: var(--hero-form-bg);

      @include sm {
        display: none;
      }
    }
  }

  &__form-box-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    @include mdx {
      flex-direction: column-reverse;
      align-items: center;
    }

    @include sm {
      padding: 0 $gutter-mobile;
    }
  }

  &__form-box-content {
    margin-left: calc(100% / 12);
    max-width: calc(100% / 12 * 6);
    padding-right: 80px;
    margin-top: 80px;

    @include lg {
      max-width: calc(100% / 12 * 5);
      padding-right: 50px;
    }

    @include mdx {
      max-width: calc(100% / 12 * 8);
      padding-right: 0;
      margin: 10px auto 0;
    }

    @include sm {
      margin: 40px auto 0;
      max-width: 100%;
      padding: 0 $gutter-mobile;
    }

    &.hero-form--desktop {
      display: block;

      @include mdx {
        display: none;
      }
    }

    &.hero-form--mobile {
      display: none;

      @include mdx {
        display: block;
      }
    }

    h2 {
      font-size: 3.8rem;
      line-height: 4.1rem;
      font-weight: 700;
      margin: 0 0 2.4rem;

      @include sm {
        font-size: 2.6rem;
        line-height: 3rem;
      }
    }

    .rich-content,
    .rich-content-system {
      > *:first-child {
        margin-top: 0;
      }
      > *:last-child {
        margin-bottom: 0;
      }
    }
  }

  &__form-box {
    width: 100%;
    max-width: 500px;
    min-height: 550px;
    margin-top: -465px;
    position: relative;
    z-index: 1;

    &::before {
      content: "";
      pointer-events: none;
      display: block;
      background-color: var(--hero-form-bg);
      width: calc(100% + 100px);
      height: calc(100% - 510px);
      position: absolute;
      right: -24px;
      bottom: -24px;
      z-index: -1;

      @include mdx {
        height: calc(100% - 100px);
        width: calc(100% + 160px);
      }

      @include sm {
        display: none;
      }
    }

    @include mdx {
      margin-top: -90px;
      align-self: flex-end;
    }

    @include sm {
      align-self: center;
      margin: 0;
      min-height: auto;

      .js-form-open & {
        border-radius: 16px;
      }
    }

    &-wrapper {
      background-color: $white;
      padding: 20px 64px 30px;
      min-height: 500px;
      transition: all 250ms ease-out;

      @include sm {
        align-self: center;
        margin: 0;
        width: auto;
        min-height: auto;
        padding: 0;
        border-radius: 46px;

        .js-form-open & {
          border-radius: 16px;
        }
      }

      & > div {
        max-width: 350px;
        margin: auto;
      }
    }
  }

  &__form-title {
    position: relative;
    font-size: 2.6rem;
    line-height: 3rem;
    font-weight: 700;
    color: $primary-color;
    display: none;

    .hero-form--registration-closed & {
      pointer-events: none;
    }

    @include sm {
      display: block;
      font-size: 2.1rem;
      line-height: 2.9rem;
      padding: 24px 40px 24px 22px;

      &::after {
        content: '';
        position: absolute;
        right: 22px;
        top: 50%;
        margin-top: -10px;
        display: block;
        height: 13px;
        width: 13px;
        border-bottom: 2px solid $primary-color;
        border-right: 2px solid $primary-color;
        border-radius: 1px;
        transform: rotate(45deg);

        .hero-form--registration-closed & {
          display: none;
        }
      }
    }
  }

  &__content {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    width: calc(100% / 12 * 5);
    margin-left: calc(100% / 12);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: $white;

    @include mdx {
      width: calc(100% / 12 * 9);
      margin-left: calc(100% / 12);
    }

    @include sm {
      position: relative;
      width: 100%;
      margin-left: 0;
      padding: 32px $gutter-mobile;
    }

    h1 {
      color: $white;
      font-size: 4.8rem;
      line-height: 5.2rem;
      font-weight: 700;
      margin: 0;

      @include sm {
        font-size: 3.8rem;
        line-height: 4.5rem;
      }
    }

    p {
      margin: 16px 0 0;
      font-size: 2.1rem;

      @include sm {
        font-size: 1.8rem;
        margin: 16px 0 0;
      }
    }
  }

  &__form {
    padding-top: 16px;
    transition: all 250ms ease-out;

    & > div {
      transition: opacity 250ms ease-out;
    }

    @include sm-up {
      height: auto !important;
    }

    @include sm {
      padding: 0;
      overflow: hidden;
      height: 0;

      & > div {
        opacity: 0;
        padding: 0 10px 16px;

        .js-form-open & {
          opacity: 1;
          transition-delay: 150ms;
        }
      }
    }
  }

  &__event-detail {
    margin-top: 32px;
  }

  &__event-label {
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 2rem;
    font-family: var(--font-heading);;
  }

  &__event-info {
    display: flex;
    font-size: 1.8rem;
    line-height: 2.5rem;
    margin-top: 16px;
    align-items: center;
  }

  &__event-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    margin-right: 16px;

    svg {
      max-width: 100%;
      max-height: 100%;
    }

    path {
      fill: $white;
    }
  }

  &__time-separator {
    white-space: nowrap;

    &::after {
      content: "";
      display: inline-block;
      width: 3px;
      height: 3px;
      border-radius: 50%;
      background: white;
      margin: 0px 11px 5px 11px;
    }

    &:last-child::after {
      display: none;
    }
  }

  &__registration-closed {
    display: block;
    text-align: center;
    margin-top: 200px;
    font-weight: 600;
    font-size: 2rem;

    @include sm {
      margin-top: 0;
      font-size: 1.8rem;
    }
  }
}
