@import '../core/variables.less';

.xm-checkbox {
  cursor: pointer;
  font-size: 12px;
  display: inline-block;
  &:hover {
    .xm-checkbox-inner {
      border-color: @primaryDark;
    }
  }
  .xm-checkbox-input {
    white-space: nowrap;
    cursor: pointer;
    outline: none;
    display: inline-block;
    line-height: 1;
    position: relative;
    vertical-align: text-bottom;
  }
  input {
    position: absolute;
    left: 0;
    z-index: 1;
    cursor: pointer;
    opacity: 0;
    top: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
  }
  .xm-checkbox-inner {
    position: relative;
    top: 0;
    left: 0;
    display: block;
    width: 14px;
    height: 14px;
    border: 1px solid #d9d9d9;
    border-radius: 2px;
    background-color: #fff;
    transition: all .3s;
    margin-left: 5px;
    &:after {
      transform: rotate(45deg) scale(0);
      position: absolute;
      left: 4px;
      top: 1px;
      display: table;
      width: 5px;
      height: 8px;
      border: 2px solid #fff;
      border-top: 0;
      border-left: 0;
      content: ' ';
      transition: all .1s cubic-bezier(.71, -.46, .88, .6);
    }
  }
  .xm-checkbox-text {
    margin-left: 5px;
  }
}

.xm-checkbox-checked {
  .xm-checkbox-inner {
    background-color: @primaryDark;
    border-color: @primaryDark;
  }
  .xm-checkbox-inner:after {
    transform: rotate(45deg) scale(1);
    position: absolute;
    left: 4px;
    top: 1px;
    display: table;
    width: 5px;
    height: 8px;
    border: 2px solid #fff;
    border-top: 0;
    border-left: 0;
    content: ' ';
    transition: all .2s ease-out .1s;
  }
}