.form-row {
  @include make-row;
  margin-bottom: 20px;

  &__label {
    @include make-col-ready;
    @include heading-5;
    display: block;
    margin-bottom: 10px;

    &_required {
      @include required-star;
    }
  }

  &__field {
    @include make-col-ready;
  }

  &__info,
  &__error {
    @include make-col-ready;
    @include additional-text;
  }

  &__info {
    margin-bottom: 8px;
    margin-top: -8px;
  }

  &__error {
    color: $red;
    margin-top: 8px;
  }

  &_validation-error {
    .tbx,
    .ddn > select {
      @include field-error;
    }

    .rbn ins {
      @include field-error;
    }
  }

  .icon-info {
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);

    @include media-breakpoint-down(md) {
      right: 20px;
    }
  }

  &--clear-input {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    position: relative;
    width: 100%;

    .form-row__field {
      padding: 0;

      .tbx {
        padding-right: 16px;
        overflow: hidden;
        text-overflow: ellipsis;
        -webkit-box-orient: vertical;
        display: -webkit-box;

        &:not(:placeholder-shown) {
          padding-right: 40px;
        }
      }

      .btn--clear {
        display: none;
        border: 0;
        height: auto;
        line-height: 0;
        padding: 0 7px;
        margin: 0 10px;
        position: absolute;
        right: 1px;
        top: 50%;
        transform: translateY(-50%);
        background: transparent;

        &:hover,
        &:focus,
        &:not(:disabled):active {
          background: transparent;
          border: 0;
          color: $blue-transparent3;
        }
      }
    }
  }
}

.form-bg {
  .form-row_btn {
    .form-row__col-btn {
      position: relative;
      width: 100%;
      min-height: 1px;
      padding-right: 15px;
      padding-left: 15px;
    }
  }
}

@include media-breakpoint-down(sm) {
  .form-row__col-btn {
    flex: 0 0 100%;
    max-width: 100%;
    padding-right: 5px;
    padding-left: 5px;
  }

  .form-row {
    padding-right: 15px;
    padding-left: 15px;
  }
}

@include media-breakpoint-up(md) {
  .form-bg {
    .form-row_btn {
      .form-row__col-btn {
        margin-left: 8.33333%;
        flex: 0 0 25%;
        max-width: 25%;
      }
    }
  }
}

@include media-breakpoint-only(md) {
  .form-bg {
    .form-row_btn {
      .form-row__col-btn {
        margin-left: 8%;
        flex: 0 0 25%;
        max-width: 25%;
      }
    }
  }
}

.form-row__action {
  position: relative;
  margin-top: 30px;
  margin-bottom: 0;
  padding-top: 30px;

  &::before {
    content: '';
    background: $gray;
    position: absolute;
    top: 0;
    left: 15px;
    right: 15px;
    height: 1px;
  }

  &.no-border {
    margin-top: 10px;
    padding-top: 10px;

    &::before {
      content: none;
    }
  }

  .form-row__col-btn {
    @include make-col-ready;

    @include media-breakpoint-only(md) {
      @include make-col(4);
    }

    @include media-breakpoint-up(lg) {
      @include make-col(6);
    }
  }
}

.warning-required {
  @include required-star;
  @include additional-text;
  margin: 20px 0 30px;
  font-weight: 500;
}

.tbx {
  @include inputfield;

  &_small {
    height: 34px;
  }

  &_quantity {
    padding-right: 0;
    padding-left: 0;
    width: 40px;
    text-align: center;
  }

  &_textarea {
    height: auto;
    resize: none;
  }

  &--number {
    -moz-appearance: textfield;

    &::-webkit-outer-spin-button,
    &::-webkit-inner-spin-button {
      -webkit-appearance: none;
    }
  }
}

.ddn {
  @include dropdown;

  &_small {
    select {
      @include dropdown-small;
    }
  }
}

.rbn {
  @include radiobutton;
}

.chb {
  @include checkbox;

  &-new {
    @include checkbox-new;
  }

  &-inactive {
    pointer-events: none;

    .label {
      display: flex;
      flex-direction: column;
      line-height: 1;
      color: $gray-border;

      .inactive-message {
        font-size: .75rem;
      }
    }
  }

  &-round {
    @include checkbox-round;
  }
}

.file-loader {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0;

  &__button {
    margin-right: 10px;
    padding: 8px 16px;

    & svg {
      margin-right: 18px;
      margin-left: 3px;
    }
  }

  &__label {
    font-size: 1rem;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }

  &__input {
    display: none;
  }

  &__error {
    display: none;
    margin-top: 5px;
    font-size: 14px;
    line-height: 1.5;
    color: #cf000f;
  }

  &--error {
    .file-loader__button {
      border-color: $red;
    }

    & + .file-loader__error {
      display: block;
    }
  }
}

.form-wrapper, //todo: delete .form-bg after forms refactoring
.form-bg {
  background: $gray-bg;
  padding: 40px 15px;
}
