@import "abb-colors.scss";
@import "abb-mixins.scss";

.checkbox {
  padding-left: 20px;
}
.checkbox label {
  display: inline-block;
  vertical-align: middle;
  position: relative;
  padding-left: 8px;
}
.checkbox label::before {
  content: "";
  display: inline-block;
  position: absolute;
  width: 16px;
  height: 16px;
  left: 0;
  margin-left: -16px;
  border: 1px solid;
  @include alpha-attribute('border-color',rgba($abb-grey-90, 0.4), white);
  border-radius: 0px;
  @include alpha-attribute('background',rgba($abb-grey-255, 0.8), white);
  -webkit-transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
  -o-transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
  transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
}
.checkbox label::after {
  display: inline-block;
  position: absolute;
  width: 18px;
  height: 18px;
  left: 0;
  top: 0;
  margin-left: -16px;
  padding-left: 2px;
  font-size: 12px;
  color: $abb-blue-13;
}
.checkbox input[type="checkbox"],
.checkbox input[type="radio"] {
  opacity: 0;
  z-index: 1;
}
.checkbox input[type="checkbox"]:hover + label::before,
.checkbox input[type="radio"]:hover + label::before {
  @include alpha-attribute('border-color',rgba($abb-grey-90, 0.8), white);
}
.checkbox input[type="checkbox"]:checked + label::after,
.checkbox input[type="radio"]:checked + label::after {
  font-family: "FontAwesome";
  content: "\f00c";
}
.checkbox input[type="checkbox"]:indeterminate + label::after,
.checkbox input[type="radio"]:indeterminate + label::after {
  display: block;
  content: "";
  width: 6px;
  height: 6px;
  background-color: $abb-blue-13;
  margin-left: -13px;
  margin-top: 5px;
}
.checkbox input[type="checkbox"]:disabled + label,
.checkbox input[type="radio"]:disabled + label {
  opacity: 0.5;
}
.checkbox input[type="checkbox"]:disabled + label::before,
.checkbox input[type="radio"]:disabled + label::before {
  background-color: #eeeeee;
  cursor: not-allowed;
}
.checkbox.checkbox-circle label::before {
  border-radius: 50%;
}
.checkbox.checkbox-inline {
  margin-top: 0;
}

.checkbox-blue input[type="checkbox"] + label::before,
.checkbox-blue input[type="radio"] + label::before {
  @include alpha-attribute('background',rgba($abb-grey-0, 0.4), white);
  border: 1px solid;
  @include alpha-attribute('border-color',rgba($abb-blue-16, 0.4), white);
}

.checkbox-blue input[type="checkbox"]:checked + label::before,
.checkbox-blue input[type="radio"]:checked + label::before {
  @include alpha-attribute('background',rgba($abb-grey-0, 0.4), white);
  border: 1px solid;
  @include alpha-attribute('border-color',rgba($abb-blue-16, 0.4), white);
}
.checkbox-blue input[type="checkbox"]:checked + label::after,
.checkbox-blue input[type="radio"]:checked + label::after {
  color: $abb-blue-16;
}

.checkbox-blue input[type="checkbox"]:hover + label::before,
.checkbox-blue input[type="radio"]:hover + label::before {
  @include alpha-attribute('border-color',rgba($abb-grey-245, 0.8), white);
}

.checkbox-dark input[type="checkbox"] + label::before,
.checkbox-dark input[type="radio"] + label::before {
  @include alpha-attribute('background',rgba($abb-grey-0, 0.6), white);
  border: 1px solid;
  @include alpha-attribute('border-color',rgba($abb-grey-110, 0.8), white);
}

.checkbox-dark input[type="checkbox"]:checked + label::before,
.checkbox-dark input[type="radio"]:checked + label::before {
  @include alpha-attribute('background',rgba($abb-grey-0, 0.6), white);
  border: 1px solid;
  @include alpha-attribute('border-color',rgba($abb-grey-110, 0.8), white);
}
.checkbox-dark input[type="checkbox"]:checked + label::after,
.checkbox-dark input[type="radio"]:checked + label::after {
  color: $abb-blue-13;
}

.checkbox-dark input[type="checkbox"]:hover + label::before,
.checkbox-dark input[type="radio"]:hover + label::before {
  @include alpha-attribute('border-color',rgba($abb-grey-200, 0.8), white);
}

.checkbox-blue input[type="checkbox"]:indeterminate + label::before,
.checkbox-blue input[type="radio"]:indeterminate + label::before {
  background-color: #337ab7;
  border-color: #337ab7;
}

.checkbox-primary input[type="checkbox"]:indeterminate + label::after,
.checkbox-primary input[type="radio"]:indeterminate + label::after {
  background-color: #fff;
}

.checkbox-dark input[type="checkbox"]:indeterminate + label::before,
.checkbox-dark input[type="radio"]:indeterminate + label::before {
  background-color: #d9534f;
  border-color: #d9534f;
}

.checkbox-dark input[type="checkbox"]:indeterminate + label::after,
.checkbox-dark input[type="radio"]:indeterminate + label::after {
  background-color: #fff;
}

.radio {
  padding-left: 20px;
}
.radio label {
  display: inline-block;
  vertical-align: inherit;
  position: relative;
  padding-left: 5px;
}
.radio label::before {
  content: "";
  display: inline-block;
  position: absolute;
  width: 17px;
  height: 17px;
  left: 0;
  margin-left: -20px;
  border: 1px solid;
  @include alpha-attribute('border-color',rgba($abb-grey-90, 0.4), white);
  border-radius: 50%;
  @include alpha-attribute('background',rgba($abb-grey-255, 0.8), white);
  -webkit-transition: border 0.15s ease-in-out;
  -o-transition: border 0.15s ease-in-out;
  transition: border 0.15s ease-in-out;
}
.radio label::after {
  display: inline-block;
  position: absolute;
  content: " ";
  width: 7px;
  height: 7px;
  left:5px;
  top: 5px;
  margin-left: -20px;
  border-radius: 50%;
  background-color: $abb-blue-13;
  -webkit-transform: scale(0, 0);
  -ms-transform: scale(0, 0);
  -o-transform: scale(0, 0);
  transform: scale(0, 0);
  -webkit-transition: -webkit-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
  -moz-transition: -moz-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
  -o-transition: -o-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
  transition: transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
}
.radio input[type="radio"] {
  opacity: 0;
  z-index: 1;
}
.radio input[type="radio"]:hover + label::before {
  @include alpha-attribute('border-color',rgba($abb-grey-90, 0.8), white);
}
.radio input[type="radio"]:checked + label::after {
  -webkit-transform: scale(1, 1);
  -ms-transform: scale(1, 1);
  -o-transform: scale(1, 1);
  transform: scale(1, 1);
}
.radio input[type="radio"]:disabled + label {
  opacity: 0.5;
}
.radio input[type="radio"]:disabled + label::before {
  cursor: not-allowed;
}
.radio.radio-inline {
  margin-top: 0;
}

.radio-blue input[type="radio"] + label::after {
  background-color: $abb-blue-16;
}
.radio-blue input[type="radio"] + label::before {
  @include alpha-attribute('background',rgba($abb-grey-0, 0.4), white);
  border: 1px solid;
  @include alpha-attribute('border-color',rgba($abb-blue-16, 0.4), white);
}
.radio-blue input[type="radio"]:checked + label::before {
  @include alpha-attribute('background',rgba($abb-grey-0, 0.4), white);
  border: 1px solid;
  @include alpha-attribute('border-color',rgba($abb-blue-16, 0.4), white);
}
.radio-blue input[type="radio"]:checked + label::after {
  background-color: $abb-blue-16;
}

.radio-blue input[type="radio"]:hover + label::before {
  @include alpha-attribute('border-color',rgba($abb-grey-245, 0.8), white);
}

.radio-dark input[type="radio"] + label::after {
  background-color: $abb-blue-16;
}
.radio-dark input[type="radio"] + label::before {
  @include alpha-attribute('background',rgba($abb-grey-0, 0.6), white);
  border: 1px solid;
  @include alpha-attribute('border-color',rgba($abb-grey-110, 0.8), white);
}
.radio-dark input[type="radio"]:checked + label::before {
  @include alpha-attribute('background',rgba($abb-grey-0, 0.6), white);
  border: 1px solid;
  @include alpha-attribute('border-color',rgba($abb-grey-110, 0.8), white);
}
.radio-dark input[type="radio"]:checked + label::after {
  background-color: $abb-blue-13;
}

.radio-dark input[type="radio"]:hover + label::before {
  @include alpha-attribute('border-color',rgba($abb-grey-200, 0.8), white);
}

input[type="checkbox"].styled:checked + label:after,
input[type="radio"].styled:checked + label:after {
  font-family: 'FontAwesome';
  content: "\f00c";
}
input[type="checkbox"] .styled:checked + label::before,
input[type="radio"] .styled:checked + label::before {
  color: #fff;
}
input[type="checkbox"] .styled:checked + label::after,
input[type="radio"] .styled:checked + label::after {
  color: #fff;
}
