.root {
}

.input {
  cursor: pointer;
  position: absolute; /* take it out of document flow */
  opacity: 0; /* hide it */
}

.label {
  composes: bodyCopy from "coral-ui/shared/typography.css";
  position: relative;
  display: inline-block;
  cursor: pointer;
  user-select: none;
  padding-left: 25px;
}

.labelSpan {
  padding-bottom: 1px;
}

.labelLight {
  color: var(--palette-text-light);
}

/* Box. */
.input + .label:before {
  content: "";
  position: absolute;
  left: 0px;
  top: 4px;
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--palette-common-white);
  border: 1px solid var(--palette-text-primary);
  box-sizing: border-box;
}

/* Box focus */
.label.focus:before {
  @mixin outline;
}

/* Box checked */
.input:checked + .label:before {
  background: var(--palette-primary-main);
  border: 1px solid var(--palette-primary-main);
}

/* Disabled state label. */
.input:disabled + .label {
  cursor: auto;
  opacity: 0.6;
}

/* Disabled box. */
.input:disabled + .label:before {
  box-shadow: none;
  border: 1px solid var(--palette-grey-main);
  background: var(--palette-grey-lightest);
}

/* Checkmark. Could be replaced with an image */
.input:checked + .label:after {
  content: "";
  position: absolute;
  left: 2px;
  top: 10px;
  color: var(--palette-text-light);
  background: currentColor;
  width: 2px;
  height: 2px;
  box-shadow: 2px 0 0 currentColor, 4px 0 0 currentColor,
    4px -2px 0 currentColor, 4px -4px 0 currentColor, 4px -6px 0 currentColor,
    4px -8px 0 currentColor;
  transform: rotate(45deg);
  box-sizing: border-box;
}

.input:checked:disabled + .label:after {
  color: var(--palette-text-primary);
}
