/*noinspection CssUnresolvedCustomProperty*/
.multistep-form {
  --track-thickness: 4px;
  --track-color: #efefef;
  --track-progress-color: var(--e-global-color-primary, #be0d3e);

  --step-color: var(--e-global-color-el_c_white, #fff);
  --step-hover-color: var(--e-global-color-primary, #be0d3e);

  --step-text-color: var(--e-global-color-primary, #be0d3e);
  --step-text-hover-color: var(--e-global-color-el_c_white, #fff);

  --progress-padding-inline: 60px;

  max-width: 600px;
  margin-inline: auto;

  & .multistep-form__progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    margin-inline: auto;
    position: relative;

    & .progress-step {
      display: flex;
      flex-flow: column nowrap;
      align-items: center;
      row-gap: 1rem;
      flex-grow: 0;
      flex-shrink: 1;
      max-width: 130px;
      word-wrap: break-word;
      hyphens: auto;
      transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;

      &.active{
        & .progress-step-count{
          color: var(--step-text-hover-color);
          background-color: var(--step-hover-color);
          transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
        }
      }

      & .progress-step-count {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 69px;
        height: 69px;
        border: 1px solid var(--step-hover-color);
        border-radius: 100%;
        color: var(--step-text-color);
        background-color: var(--step-color);
        font-size: 1.875rem;
        line-height: 1;
        font-weight: 500;
      }

      & .progress-step-title{
        font-size: 1.125rem;
        line-height: 1.25rem;
        font-weight: 500;
        color: #474747;
        text-align: center;
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
        width: 100%;
      }
    }
  }

  & .multistep-form__progress-track {
    position: absolute;
    top: 32px;
    left: 0;
    right: 0;
    height: var(--track-thickness);
    background-color: var(--track-color);
    margin-inline: auto;
    width: calc(100% - 140px);
    z-index: -1;
    & .multistep-form__progress-thumb{
      height: 100%;
      width: 0;
      background-color: var(--track-progress-color, #be0d3e);
      transition: width 0.3s ease-in-out;
    }
  }

  &.initial {
    & .multistep-form__steps {
      & .form-step:first-of-type {
        display: flex;
        flex-flow: column nowrap;
      }
    }
  }

  & .multistep-form__content {
    padding: 75px 92px 75px 132px;
    background-image: url("../images/steping-form-background.png");
    background-repeat: no-repeat;
    background-position: top left;
    background-size: cover;
  }

  & .multistep-form__steps {
    max-width: 456px;
    margin-inline: auto;
    margin-bottom: 2rem;
    & .form-step:not(.active) {
      display: none;
    }

    & .form-step {
      &.has-error {
        & .wpcf7-not-valid-tip {
          display: block;
        }
        & .form-step-validation {
          display: flex;
          align-items: center;
          column-gap: 1rem;
          flex-wrap: nowrap;
          margin-bottom: 1rem;
        }
      }

      & .form-step-validation {
        display: none;
        font-size: 0.8125rem;
        color: #dc3232;
        line-height: 1.25;
        & svg {
          color: inherit;
          fill: currentColor;
          width: 40px;
          height: 40px;
        }
      }

      & .wpcf7-not-valid-tip {
        font-size: 0.8125rem;
      }

      & label {
        color: #474747b3;
        display: block;
        font-size: 0.9375rem;
        margin-bottom: 1rem;
        font-weight: 400;
        line-height: 1.2;
      }

      & .wpcf7-form-control-wrap {
        display: block;
        height: 100%;
        line-height: 1.5;
      }

      & input[type],
      & select {
        margin-bottom: 0;
        border: 1px solid #a8aab3;
        border-radius: 5px;
        background-color: #fff;
        font-size: inherit;
        line-height: 1.125rem;
        font-weight: inherit;
        &:placeholder-shown,
        &:-ms-input-placeholder {
          color: inherit;
        }
        &:focus,
        &:focus-visible {
          color: #000;
          outline: 1px solid #000;
          border: 1px solid #000;
        }
      }

      & .t_and_c_text {
        font-size: 0.875rem;
        line-height: 1rem;
        font-weight: 400;
        display: block;
        & a {
          text-decoration: underline;
        }
      }

      & .form-content{
        font-size: 12px;
        line-height: 16px;
        color: #474747b3;
        display: block;
      }
    }
  }

  & .multistep-form__buttons {
    display: flex;
    justify-content: center;
    flex-flow: row nowrap;
    align-items: center;
    column-gap: 1rem;
    max-width: 80%;
    margin-inline: auto;
    & [data-action=prev] {
      transform: scaleX(-1);
      & span {
        transform: scaleX(-1);
      }
    }
    & button:disabled{
      opacity: 0.5;
      pointer-events: none;
    }
  }
}
@media (max-width: 992px) {
  .multistep-form .multistep-form__content{
    padding: 50px 52px 50px 92px;
  }
}

@media (max-width: 576px){
  .multistep-form .multistep-form__content{
    background-image: unset;
    background-color: #f7f7f7;
    background-position: unset;
    background-repeat: unset;
    background-size: unset;
    padding: 30px 20px;
  }

  .multistep-form .multistep-form__progress-steps{
    margin-bottom: 3rem;
  }

  .multistep-form .multistep-form__progress-steps .progress-step{
    max-width: 88px;
    width: 88px;
  }

  .multistep-form .multistep-form__progress-track{
    top: 15px;
    width: 100%;
  }

  .multistep-form .multistep-form__progress-steps .progress-step:first-child{
    align-items: flex-start;
  }

  .multistep-form .multistep-form__progress-steps .progress-step:nth-last-child(2){
    align-items: flex-end;
  }

  .multistep-form .multistep-form__progress-steps .progress-step .progress-step-count{
    width: 34px;
    height: 34px;
    font-size: 1.25rem;
  }

  .multistep-form .multistep-form__progress-steps .progress-step:not(.active) .progress-step-title{
    display: none;
  }

  .multistep-form .multistep-form__progress-steps .progress-step .progress-step-title{
    font-size: 1rem;
    line-height: 1.25rem;
    position: absolute;
    top: calc(100% + 1rem);
  }
}
