/* ------------------------------------------------ */
/* ############### 3.5 Custom Forms ############### */
/* ------------------------------------------------ */

/* Checkbox */
.ckbox {
  font-weight: normal;
  position: relative;
  display: block;
  line-height: 18px;

  span {
    padding-left: 6px;

    &:empty { float: left; }

    &:before,
    &:after {
      line-height: 18px;
      position: absolute;
    }

    &:before {
      content: '';
      width: $ckbox-size;
      height: $ckbox-size;
      background-color: #fff;
      border: 1px solid $gray-500;
      top: 1px;
      left: 0;
    }

    &:after {
      top: 1px;
      left: 0;
      width: $ckbox-size;
      height: $ckbox-size;
      content: '\f00c';
      font-family: 'FontAwesome';
      font-size: 9px;
      text-align: center;
      color: #fff;
      background-color: $brand-primary;
      line-height: 17px;
      display: none;
    }
  }

  input[type='checkbox'] {
    opacity: 0;
    margin: 0 5px 0 0;

    &:checked {
      + span:after { display: block; }
    }

    &[disabled] {
      + span,
      + span:before,
      + span:after {
        opacity: .75;
      }
    }
  }
}

.ckbox-inline { display: inline-block; }


/* Radio Box */
.rdiobox {
  font-weight: normal;
  position: relative;
  display: block;
  line-height: 18px;

  span {
    padding-left: 6px;

    &:before,
    &:after {
      line-height: 18px;
      position: absolute;
    }

    &:before {
      content: '';
      width: $rdiobox-size;
      height: $rdiobox-size;
      background-color: #fff;
      border: 1px solid $gray-500;
      border-radius: 50px;
      top: 2px;
      left: 0;
    }

    &:after {
      content: '';
      width: $rdiobox-size - 10px;
      height: $rdiobox-size - 10px;
      background-color: #fff;
      border-radius: 50px;
      top: 7px;
      left: 5px;
      display: none;
    }
  }

  input[type='radio'] {
    opacity: 0;
    margin: 0 5px 0 0;

    &:checked {
      + span:before {
        border-color: transparent;
        background-color: $brand-primary;
      }
      + span:after { display: block; }
    }

    &[disabled] {
      + span,
      + span:before,
      + span:after {
        opacity: .75;
      }
    }
  }
}

.rdiobox-inline { display: inline-block; }


/* Inside input group */
.input-group-addon {
  .ckbox,
  .rdiobox {
    &,input { margin: 0; }
  }
}


/* File Browser */
.custom-file { direction: ltr; }
.custom-file-control {
  &,&::before { border-radius: 0; }
}
.custom-file-control-primary::before {
  background-color: $brand-primary;
  color: #fff;
}

.custom-file-control-inverse::before {
  background-color: $gray-800;
  color: #fff;
}
