
/* ###### 5.7 Parsley ###### */

input.parsley-error,
textarea.parsley-error {
  @extend .is-invalid;

  &:focus { box-shadow: none !important; }
}

input.parsley-success,
textarea.parsley-success {
  @extend .is-valid;
  &:focus { box-shadow: none !important; }
}

.parsley-checkbox {
  &.parsley-error {
    display: inline-block;
    padding: 10px;
    border: 1px solid $danger;
  }

  &.parsley-success {
    display: inline-block;
    padding: 10px;
    border: 1px solid $success;
  }
}

.parsley-select {
  &.parsley-error {
    @extend .has-danger;
  }

  &.parsley-success {
    @extend .has-success;
  }
}


.parsley-errors-list {
  color: $danger;
  list-style: none;
  font-size: 12px;
  padding: 0;
  margin-bottom: 0;

  li { margin: 5px 0 0; }
}

/***** CUSTOM STYLED ERROR MESSAGE *****/
.parsley-style-1 {
  .parsley-input {
    &.parsley-error {
      .form-control {
        background-color: lighten($danger, 45%);
        border-color: $danger;
        border-bottom-width: 0;
        @include border-bottom-radius(0);
      }
    }

    &.parsley-success {
      .form-control { border-color: $success; }
    }
  }

  .parsley-checkbox {
    &.parsley-error {
      border: 1px solid $danger;
      background-color: lighten($danger, 45%);
      @include border-top-radius(2px);
    }
  }

  .parsley-select {
    &.parsley-error {
      .select2-container--default .select2-selection--single {
        background-color: lighten($danger, 45%);
        @include border-bottom-radius(0);
      }
    }
  }

  .parsley-errors-list.filled {
    background-color: $danger;
    color: #fff;
    padding: 7px 10px;
    @include border-bottom-radius(2px);

    li:first-child { margin-top: 0; }
  }
}
