@charset 'UTF-8';

.form-control {
  width: auto;
  height: auto;
  max-width: 100%;
  padding: 0.8em;
  border-width: $input-border-size;
  box-shadow: none;

  &.full-width {
    width: 100%;
  }

  &:-webkit-autofill,
  &:-webkit-autofill:hover,
  &:-webkit-autofill:focus,
  &:-webkit-autofill:active {
    box-shadow: 0 0 0 1000px $input-bg inset;
  }

  &:focus {
    box-shadow: none;
    outline: none;
    background: $input-bg-focus;
    border-color: $input-border-focus;
  }
}

&.form-small {
  padding: 0.4em;
}

.form-group {
  margin-top: 20px;

  label {
    margin-left: 0;
    margin-bottom: 0.3em;
    font-size: ceil($font-size-h6);
    transition: opacity 0.25s ease-in-out;

    &:first-letter { text-transform: capitalize; }

    &.label-hidden { opacity: 0; }
  }

  .input-error-desc {
    padding-top: 0.5em;
    font-size: ceil($font-size-h6);
    font-weight: 700;
    color: $brand-danger;
  }

  .help-block { font-size: ceil($font-size-h6); }

  &.error {
    .form-control {
      border-color: $brand-danger;
    }
  }

  &.readonly {
    .form-control {
      background: $input-bg-disabled;
      border-color: $input-border-disabled;
      color: $input-color-placeholder;
    }
  }
}

.form-inline {
  display: flex;
  flex-direction: column;

  @media screen and (min-width: $screen-xs-min) {
    flex-direction: row;
  }

  .form-group {
    margin: 10px 5px;

    @media screen and (min-width: $screen-md-min) {
      margin: 20px 0 15px;
    }
  }
}
