.bp-from {
  width: 100%;

  &.bp-from__compact {
    .bp-form-group {
      position: relative;
      display: flex;
      width: 100%;
      flex-wrap: wrap;
      margin-bottom: 5px;
      box-shadow: none;
      outline: none;

      &:last-child {
        margin-bottom: 20px;
      }
    }
  }

  &.bp-form-tools {
    display: flex;
    flex-wrap: nowrap;

    .bp-form-tools__item {
      margin-left: 15px;

      .bp-form-control {
        max-width: 300px;
      }
    }
  }

  &.bp-from__tools {
    //margin: 0 auto;
    //max-width: 300px;
    display: flex;
    flex-wrap: nowrap;

    .bp-form-group {
      margin-bottom: 0;

      .bp-form-control {
        padding: 4px 7px;
      }
    }
  }

  .bp-form-group {
    position: relative;
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    margin-bottom: 20px;
    box-shadow: none;
    outline: none;

    &.bp-form-group_svg {
      .bp-form-group__inner {
        position: relative;
      }

      svg.icon,
      .svg-icon {
        width: 24px;
        height: 24px;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        display: block;
        cursor: pointer;
        pointer-events: auto;
        opacity: 0.6;
        transition: opacity ease-in-out 0.2s;

        &:hover {
          opacity: 1;
        }
      }
    }

    &.bp-form-check {
      justify-content: center;
    }

    &.bp-form-jc-start {
      justify-content: flex-start;
    }

    .bp-form-group__link {
      //flex-basis: 100%;
      text-align: center;
      color: $gray2;
      font-size: 18px;
      font-weight: 400;
      text-decoration: none;

      &:hover {
        text-decoration: underline;
      }
    }

    .bp-form-group__inner {
      position: relative;
      width: 100%;
      align-items: flex-end;

      &.bp-form-group__inner-search {
        .bp-form-control {
          padding: 25px 55px;
        }
      }

      &.bp-form-group__inline {
        width: 100%;
        display: flex;
        //flex-wrap: wrap;
        align-items: flex-end;
        justify-content: flex-start;

        .bp-form-control {
          flex-basis: 100%;
        }

        &.bp-form-group__list {
          flex-wrap: nowrap;
          gap: 20px;

          .select2 {
            flex-basis: 30%;
          }

          .bp-form-control {
            flex-basis: 70%;
          }
        }

        &.bp-form-group__phone {
          direction: ltr;
        }
      }

      .bp-form-error {
        color: red;
      }

      label {
        display: inline-block;
        width: 100%;
      }

      &:last-child {
        margin-right: 0;
      }

      .bp-form-control__inline-btn {
        position: absolute;
        right: 5px;
        top: 50%;
        transform: translateY(-50%);

        &.bp-select2 {
          max-height: 1px;
        }
      }
    }

    .bp-form-group__label {
      width: 100%;
      margin-bottom: 0.5rem;
      @include font-size-block(18px, inherit, 400);

      &.text-smaller {
        @include font-size-block(14px, inherit, 400);
      }
    }

    .bp-text-error {
      display: block;
      color: red;
      font-size: 13px;
      margin-top: 5px;
    }

    .bp-form-inner-group {
    }

    label {
      color: $gray;
      @include font-size-block(18px, inherit, 400);

      &.text-smaller {
        @include font-size-block(14px, inherit, 400);
      }
    }

    .bp-form-control {
      position: relative;
      width: 100%;
      padding: 15px 20px;
      border: 1px solid #707070;
      background-color: #ffffff;

      color: #000;
      font-size: 18px;
      font-weight: 300;

      &.bp-form-control_email {
        + svg.icon {
          display: none;
        }

        &:disabled {
          + svg.icon {
            display: block;
          }
        }
      }

      &::placeholder {
        color: #000;
        font-size: 18px;
        font-weight: 300;
      }
    }

    textarea {
      &.bp-form-control {
        height: auto;
      }
    }

    input {
      &[type="submit"] {
        width: 100%;
      }

      &.bp-form-check-input {
        &[type="checkbox"] {
          display: none;
        }

        + label {
          position: relative;
          color: #000;
          font-size: 18px;
          font-weight: 300;

          &::before {
            content: "";
            display: inline-block;
            position: relative;
            vertical-align: middle;
            width: 15px;
            height: 15px;
            border: 1px solid #000;
            box-sizing: border-box;
            margin-right: 10px;
            -webkit-transition: all 0.2s;
            transition: all 0.2s;
            //opacity: 0.6;
            top: -2px;
            color: #000000;
            font-size: 18px;
            font-weight: 300;
          }
        }

        &:checked {
          + label {
            &.text-smaller {
              &:after {
                content: "";
                left: 8px;
                top: 6px;
                width: 4px;
                height: 6px;
              }
            }

            &::before {
              opacity: 1;
            }

            &:after {
              content: "";
              display: inline-block;
              position: absolute;
              left: 6px;
              top: 6px;
              width: 4px;
              height: 8px;
              border: solid #000;
              border-width: 0 2px 2px 0;
              transform: rotate(45deg);
            }
          }
        }
      }

      &.bp-form-radio-input {
        &[type="radio"] {
          display: none;
        }

        + label {
          position: relative;

          &::before {
            content: "";
            display: inline-block;
            position: relative;
            vertical-align: middle;
            height: 20px;
            width: 20px;
            border: 2px solid #000;
            box-sizing: border-box;
            margin-right: 10px;
            -webkit-transition: all 0.2s;
            transition: all 0.2s;
            border-radius: 50%;
            opacity: 0.6;
            top: -2px;
          }
        }

        &:checked {
          + label {
            &.text-smaller {
              &:after {
                content: "";
                left: 8px;
                top: 6px;
                width: 4px;
                height: 6px;
              }
            }

            &::before {
              opacity: 1;
            }

            &:after {
              content: "";
              display: inline-block;
              position: absolute;
              left: 8px;
              top: 8px;
              width: 4px;
              height: 8px;
              border: solid #000;
              border-width: 0 2px 2px 0;
              transform: rotate(45deg);
            }
          }
        }
      }

      &.bp-form-file-input {
        &[type="file"] {
          display: none;
        }

        + label {
          cursor: pointer;
          width: auto;
          padding: 0 20px;
          border-radius: 30px 30px;
          background-color: $lGray;
          opacity: 1;
          @include font-size-block(16px, 38px, 400);
          color: #fff;
        }
      }
    }

    .bp-form-file__label {
      color: $lGray;
      @include font-size-block(18px, inherit, 400);
      margin-bottom: 5px;

      &[data-label] {
        //margin-bottom: 35px;
      }

      &:after {
        content: attr(data-label);
        display: block;
        width: auto;
        padding-bottom: 15px;
        @include font-size-block(12px, inherit, 400);
        color: $lGray;
        opacity: 0.7;
      }
    }

    &.bp-btn-loader {
      position: relative;

      &::after {
        content: "";
        display: inline-block;
        border-radius: 50%;
        animation: spin 2s linear infinite;
        position: absolute;
        right: 5%;

        width: 20px;
        height: 20px;
        top: 10%;
        border: 4px solid var(--main-bg-color, #003f91);
        border-top: 4px solid hsla(0, 0%, 100%, 0);
      }
    }
  }
}

.bp-form-wrp-select {
  .select2-container {
    &.select2-container--default {
      height: 100%;

      .select2-selection--single {
        height: 100%;
        border: 1px solid #cccccc;
        border-radius: 5px;
        display: flex;
        align-items: center;

        .select2-selection__arrow {
          margin-left: auto;
          position: relative;
        }
      }
    }
  }
}

.bp-form-file {
  position: relative;
  display: block;
  flex-wrap: wrap;

  .bp-form-control_file,
  .bp-form-file__label {
    width: 100%;
    display: block;
  }
}

.bp-wrp-form {
  padding: 15px;
}

form[role="search"] {
  .bp-form-group {
    height: 60px;

    input {
      &[type="text"] {
        padding-left: 65px;
        //color: $lGray;
        //border: 1px solid $lGray;
        background-color: transparent;

        &::after {
          content: "";
          position: absolute;
          display: inline-block;
          background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='21' viewBox='0 0 21 21'%3E%3Cpath d='M796.228,313.882l-.921.93-.4-.4a7.934,7.934,0,1,0-.5.5l.4.4-.832.864L799.769,322h.147A2.147,2.147,0,0,0,802,319.818v-.147Zm-7.219,2.424a7.3,7.3,0,1,1,7.3-7.3A7.3,7.3,0,0,1,789.009,316.305Zm11.048,4.911-5.07-5.07,1.258-1.259,5.07,5.07A1.409,1.409,0,0,1,800.057,321.217Z' transform='translate(-781 -301)'/%3E%3C/svg%3E");
          left: 0;
          margin: auto 0;
          top: 0;
          bottom: 0;
          padding-right: 20px;
          padding-left: 20px;
          width: 25px;
          height: 25px;
        }
      }

      &[type="submit"] {
        height: 100%;
        width: 100%;
      }
    }
  }
}

/*.select2-container--default {
    .select2-selection--single {
        .select2-selection__clear {

        }
    }
}*/

.select2-container--default {
  .select2-selection--single {
    .select2-selection__clear {
      position: absolute;
      right: 35px;
    }
  }

  &.bp-custom-select {
    &.select2-container--open {
      .select2-selection--single {
        .select2-selection__arrow {
          b {
            border-color: transparent transparent #5a5a5a;
            border-width: 0 4px 5px;
          }
        }
      }
    }

    .select2-selection--single {
      position: relative;
      height: auto;
      border: 1px solid #a6a8aa;
      background-color: #ffffff;
      border-radius: 0;
      max-height: 55px;

      .select2-selection__rendered {
        padding: 15px 8px 15px 23px;
        color: #000;
        font-size: 18px;
        font-weight: 300;
      }

      .select2-selection__arrow {
        height: 26px;
        right: 18px;
        left: initial;
        bottom: initial;
        width: 20px;
        @include item-v-center();

        b {
          border-color: #5a5a5a transparent transparent transparent;
          border-style: solid;
          border-width: 5px 4px 0;
          height: 0;
          left: 50%;
          margin-left: 12px;
          margin-top: -2px;
          position: absolute;
          top: 50%;
          width: 0;
        }
      }
    }

    .select2-dropdown {
      border-radius: 0;
    }
  }
}

.bp-compact-form {
  &::before {
    content: "";
    display: inline-block;
    width: 100%;
    position: absolute;
  }
}

@media (max-width: 576px) {
  .bp-from {
    .bp-form-group {
      //margin-bottom: 12px;

      .bp-form-control {
        padding: 12px 15px;
      }

      .bp-form-group__inner {
        &.bp-form-group__inline {
          &.bp-form-group__list {
            gap: 8px;
            flex-wrap: wrap;

            .select2,
            .bp-form-control {
              flex-basis: 100%;
            }
          }
        }
      }
    }
  }

  .select2-container--default {
    &.bp-custom-select {
      .select2-selection--single {
        .select2-selection__rendered {
          padding: 12px 8px 12px 18px;
          line-height: 22px;
        }
      }
    }
  }
}
