
/**
 * http://www.google.com/design/spec/components/switches.html#switches-checkbox
 */

.Checkbox {
  /* for absolute positioned .Checkbox-focus div */
  position: relative;
  height: 48px;
  display: flex;
  align-items: center;
}

.Checkbox-input {
  position: absolute;
  opacity: 0;
  z-index: -1;
}

.Checkbox-icon {
  padding: 10px;
  line-height: 0;
  outline: 0;
  fill: rgba(0, 0, 0, 0.54);

  @include medium {
    padding: 5px;
  }
}

.Checkbox-label {
  color: rgba(0, 0, 0, 0.54);
}



/**
 * checked
 */
.Checkbox-input:checked ~ .Checkbox-icon,
.Checkbox-input:checked ~ .Checkbox-label {
  color: $blue-dark;
  fill: $blue-dark;
}



/**
 * disabled
 */
.Checkbox-input:disabled ~ .Checkbox-icon,
.Checkbox-input:disabled ~ .Checkbox-label {
  fill: rgba(0, 0, 0, 0.26);
  color: rgba(0, 0, 0, 0.26);
}



/**
 * focus
 */
.Checkbox-focus {
  position: absolute;
  /* 48px - 18px = 30px / 2 = 15px */
  top: 15px;
  left: 8px;
  /* use the same width as svg path element for checkbox icon */
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: none;
}

.Checkbox-input:checked:focus ~ .Checkbox-focus {
  box-shadow: 0 0 0 8px rgba($blue-dark, 0.12);
  background-color: rgba($blue-dark, 0.12);
  display: block;
}

.Checkbox-input:not(:checked):focus ~ .Checkbox-focus {
  box-shadow: 0 0 0 8px rgba(0, 0, 0, 0.12);
  background-color: rgba(0, 0, 0, 0.12);
  display: block;
}
