.help-block {
  color: $text-muted;
}

a.btn, button.btn {
  max-width: 100%;
  white-space: normal;
}

.btn-checkbox {
    position: relative;
    display: block;
    padding-left: 24px;
    padding-right: 24px;
    white-space: normal;

    input {
        position: absolute;
        left: 10px;
    }
    &.btn-checkbox-checked {
        background-color: $gray-lighter;
    }
}

.panel-title .radio {
  margin-left: 20px;
}
.panel-title label {
  margin-bottom: 0;
  display: inline;
}

.form-control + .form-control-feedback {
  /* Fix for https://github.com/FortAwesome/Font-Awesome/issues/4313 */
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2; // Ensure icon is above input groups
  display: block;
  width: $input-height-base;
  height: $input-height-base;
  line-height: $input-height-base;
  text-align: center;
  pointer-events: none;
}

.js-copy-answers {
  margin-right: 10px;
}

.form-inline .form-control {
  max-width: 100%;
}

.form-control.is-focused {
  $color-rgba: rgba(red($input-border-focus), green($input-border-focus), blue($input-border-focus), .6);
  border-color: $input-border-focus;
  outline: 0;
  @include box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px $color-rgba);
}

.form-control.has-error {
  border-color: $state-danger-text;
  @include box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075)); // Redeclare so transitions work
  &:focus, &.is-focused {
    border-color: darken($state-danger-text, 10%);
    $shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px lighten($state-danger-text, 20%);
    @include box-shadow($shadow);
  }
}

.input-item-count-group {
  display: flex;
}
.input-item-count-group input {
  border-radius: 0;
  border-left: none;
  border-right: none;
  padding-right: 12px;
  -moz-appearance: textfield;
}
.input-item-count-group input::-webkit-outer-spin-button,
.input-item-count-group input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.input-item-count-dec[disabled],
.input-item-count-inc[disabled],
.input-item-count-dec[disabled]:hover,
.input-item-count-inc[disabled]:hover {
  box-shadow: 0px 0px 0px 1px #cccccc inset;
  background: #eee;
  opacity: 1;
}
.input-item-count-dec {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  width: 2.5em;
  z-index: 2;
}
.input-item-count-inc {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  width: 2.5em;
}
.input-group-price {
  input {
    -moz-appearance: textfield;
  }
  input::-webkit-outer-spin-button,
  input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
}

.required-legend span {
  color: $brand-primary;
  font-weight: bold;
}
.form-group.required .control-label:after {
  content: '*';
  color: $brand-primary;
}
.form-control-text {
  padding-top: 7px;
}
.addon-list {
  padding: 0;
  list-style-type: none;
}
.accordion-radio {
  display: block;
  margin: 0;
}
.panel-default>.accordion-radio>.panel-heading {
  color: #333;
  background-color: #f5f5f5;
  padding: 8px 15px;

  input[type=radio] {
    margin-top: 0;
    margin-right: 5px;
  }
}
.panel-default>.accordion-radio+.panel-collapse>.panel-body {
  border-top: 1px solid #ddd;
}

.nav-tabs {
  border-bottom: 0px solid #ddd;
}

.tab-content {
  border: 1px solid #ddd;
  border-radius: 0px 5px 5px 5px;
  padding: 5px 5px 0px 5px;
}

.splitdatetimerow {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;

  .help-block {
    width: 100%;
  }
}
.splitdatetimepart {
  width: 50%;
  display: inline-block;

  &.datepickerfield {
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
  }
  &.timepickerfield {
    border-bottom-left-radius: 0;
    border-top-left-radius: 0;
    border-left: 0;
  }
}

.photo-initial {
  margin-bottom: 5px;
}
.photo-preview {
  max-width: 550px;
  width: 100%;
  height: auto;
  margin-top: 10px;

  img {
    display: block;
    max-width: 100%;
  }
}

details {
  summary .chevron::before {
    content: $fa-var-caret-right;
  }
  &[open] .chevron::before {
    content: $fa-var-caret-down;
  }
}


@media(max-width: $screen-xs-max) {
  .nameparts-form-group {
    display: block;
    input:not(:first-child), select:not(:first-child) {
      border-top-right-radius: 0;
      border-top-left-radius: 0;
    }
    input:not(:last-child), select:not(:last-child) {
      border-bottom-right-radius: 0;
      border-bottom-left-radius: 0;
    }
  }
}
@media(min-width: $screen-sm-min) {
  .nameparts-form-group {
    display: flex;
    flex-direction: row;
    input, select {
      min-width: 5em;
      flex-basis: 0;
      flex-grow: 1;
    }
    input:not(:first-child), select:not(:first-child) {
      border-bottom-left-radius: 0;
      border-top-left-radius: 0;
    }
    input:not(:last-child), select:not(:last-child)  {
      border-bottom-right-radius: 0;
      border-top-right-radius: 0;
    }
    [data-size="1"] {
      flex-grow: 1;
      flex-shrink: 4;
    }
    [data-size="2"] {
      flex-grow: 2;
      flex-shrink: 3;
    }
    [data-size="3"] {
      flex-grow: 3;
      flex-shrink: 2;
    }
    [data-size="4"] {
      flex-grow: 4;
      flex-shrink: 1;
    }
  }
}
@media (max-width: $screen-sm-max) {
  .form-horizontal .control-label {
    text-align: left;
  }
}
