.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";
  display: inline-flex;
  position: relative;
  cursor: pointer;
  user-select: none;
}

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

/* Box. */
.input + .label:before {
  content: "";
  margin-right: 10px;
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--palette-common-white);
  border: 1px solid var(--palette-text-primary);
  border-radius: 50%;
  box-sizing: border-box;
  margin-top: 5px;
  flex-shrink: 0;
}

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

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

/* 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: "";
  background: var(--palette-text-primary);
  border-radius: 50%;
  position: absolute;
  left: 3px;
  top: 8px;
  width: 8px;
  height: 8px;
  box-sizing: border-box;
}

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