/* stylelint-disable */

// Input group CSS generate from Bootstrap 4
.input-group-prepend,
.input-group-append {
  display: flex;

  .btn {
    position: relative;
    z-index: 2;

    &:focus {
      z-index: 3;
    }
  }

  .btn + .btn,
  .btn + .input-group-text,
  .input-group-text + .input-group-text,
  .input-group-text + .btn {
    margin-left: calc(-1 * var(--bs-border-width));
  }
}

.input-group-prepend {
  margin-right: calc(-1 * var(--bs-border-width));
}

.input-group-append {
  margin-left: calc(-1 * var(--bs-border-width));
}

.input-group {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;

  > .form-control,
  > .form-control-plaintext,
  > .custom-select,
  > .custom-file {
    position: relative;
    flex: 1 1 auto;
    margin-bottom: 0;
    width: 1%;
    min-width: 0;

    + .form-control,
    + .custom-select,
    + .custom-file {
      margin-left: calc(-1 * var(--bs-border-width));
    }
  }

  > .form-control:focus,
  > .custom-select:focus,
  > .custom-file .custom-file-input:focus ~ .custom-file-label {
    z-index: 3;
  }

  > .custom-file .custom-file-input:focus {
    z-index: 4;
  }

  > .form-control,
  > .custom-select {
    &:not(:first-child) {
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
    }
  }

  > .custom-file {
    display: flex;
    align-items: center;

    &:not(:last-child) .custom-file-label,
    &:not(:last-child) .custom-file-label::after {
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }

    &:not(:first-child) .custom-file-label {
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
    }
  }

  &:not(.has-validation) {
    > .form-control:not(:last-child),
    > .custom-select:not(:last-child),
    > .custom-file:not(:last-child) .custom-file-label,
    > .custom-file:not(:last-child) .custom-file-label::after {
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }
  }

  &.has-validation {
    > .form-control:nth-last-child(n + 3),
    > .custom-select:nth-last-child(n + 3),
    > .custom-file:nth-last-child(n + 3) .custom-file-label,
    > .custom-file:nth-last-child(n + 3) .custom-file-label::after {
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }
  }
}

.input-group > .input-group-prepend > .btn,
.input-group > .input-group-prepend > .input-group-text,
.input-group:not(.has-validation) > .input-group-append:not(:last-child) > .btn,
.input-group:not(.has-validation) > .input-group-append:not(:last-child) > .input-group-text,
.input-group.has-validation > .input-group-append:nth-last-child(n + 3) > .btn,
.input-group.has-validation > .input-group-append:nth-last-child(n + 3) > .input-group-text,
.input-group > .input-group-append:last-child > .btn:not(:last-child):not(.dropdown-toggle),
.input-group > .input-group-append:last-child > .input-group-text:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group > .input-group-append > .btn,
.input-group > .input-group-append > .input-group-text,
.input-group > .input-group-prepend:not(:first-child) > .btn,
.input-group > .input-group-prepend:not(:first-child) > .input-group-text,
.input-group > .input-group-prepend:first-child > .btn:not(:first-child),
.input-group > .input-group-prepend:first-child > .input-group-text:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* stylelint-enable */
