.input-group-btn, .input-group-addon {
  @extend .input-group-append;
}

.form-control-static {
  @extend .form-control-plaintext;
  background-color: $input-disabled-bg;
  @if $enable-rounded {
    // Manually use the if/else instead of the mixin to account for iOS override
    border-radius: $input-border-radius;
  } @else {
    // Otherwise undo the iOS default
    border-radius: 0;
  }
  padding: $input-padding-y $input-padding-x;
  overflow: auto;
}

.input-sm {
  @extend .form-control-sm;
}

.input-lg {
  @extend .form-control-lg;
}

//
.control-label, .form-label {
  color: $gray-800;
  font-weight: $font-weight-semibold;
}

// Custom input file type
.btn-file-input input[type=file] {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  padding: 0;
  height: 100%;
  cursor: pointer;
  opacity: 0;
  filter: alpha(opacity=0);
}

// Input group
//
.input-group-icon {
  @extend .input-group-text;
}
.form-control {
  &:disabled,
  &[readonly] {
    border-color: $gray-300;
  }
}
// Widget
//
.form-widget {
  > div > .form-fields {
    margin-bottom: 0;
  }

  > div:not(:first-child) {
    margin-top: 0;
  }
}
.modal .form-fields {
  margin-left: -#{$modal-inner-padding};
  margin-right: -#{$modal-inner-padding};
}
.form-fields {
  --bs-gutter-x: 1.45rem;
  --bs-gutter-y: 0;
  display: flex;
  flex-wrap: wrap;
  padding: calc(var(--bs-gutter-x) * 1.2) calc(var(--bs-gutter-x) * 0.3);

  > * {
    padding-right: calc(var(--bs-gutter-x) * .5);
    padding-left: calc(var(--bs-gutter-x) * .5);
    margin-top: var(--bs-gutter-y);
  }

  > .span-left,
  > .span-right {
    flex: 0 0 auto;
    width: 100%;

    &.flex-width {
      width: 25%;
    }
  }

  > .flex-width {
    width: auto;
  }

  > .flex-width .row > div {
    width: 100%;
  }

  > .span-full {
    width: 100%;
  }

  @include media-breakpoint-up(sm) {
    > .span-left,
    > .span-right {
      flex: 0 0 auto;
      width: 50%;
    }
  }
}
.hidden-field {
  margin: 0;
}
// Tabs
//
.form-nav {
  padding-top: 10px;
  padding-left: 20px;
  padding-right: 20px;

  &.nav-tabs {
    background-color: $gray-300;

    .nav-item {
    }

    .nav-link {
      border-width: 4px 2px 0;
      border-color: transparent;
      color: $body-color;
      padding: $form-nav-link-padding-y $form-nav-link-padding-x;
      font-weight: 500;
    }

    .nav-link:hover,
    .nav-link:focus {
      border-color: transparent;
    }

    .nav-link.active {
      border-width: 4px 2px 0;
      border-style: solid;
      border-color: $gray-300;
      background-color: $gray-200;
    }
  }
}
@include media-breakpoint-down(sm) {
  .form-widget .tab-heading {
    background-color: $gray-300;
    width: 100%;
    overflow-x: auto;
    display: block;
  }
  .form-nav {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: nowrap;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;

    &.nav-tabs {
      .nav-link {
        white-space: nowrap
      }
    }
  }
}
// Field Section
.field-section {
  .section-title {
    color: $text-muted;
    margin-top: 15px;
    margin-bottom: 0;
  }
}
.field-custom-container {
  padding-top: $input-padding-y;
  padding-bottom: $input-padding-y;
  height: add($input-height-inner, 0.25rem);
}
// Control label
.help-block {
  @extend .form-text;
  color: $gray-600;
  margin: 0;

  &.before-field {
    margin-bottom: 10px;
  }
}
