.root {
}

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

.label {
  position: relative;
  display: inline-block;
  cursor: pointer;
  user-select: none;
  padding-left: calc(var(--v2-spacing-3) + 14px);
  color: var(--v2-palette-input-label);
  font-size: var(--v2-font-size-3);
  font-weight: var(--v2-font-weight-primary-regular);
  font-family: var(--v2-font-family-primary);
  line-height: var(--v2-line-height-reset);
}

.labelSpan {
  padding-bottom: 1px;
}

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

/* Box. */
.input + .label:before {
  content: "";
  position: absolute;
  left: 0px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--v2-palette-input-background);
  border: 1px solid var(--v2-palette-input-label);
  box-sizing: border-box;
}

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

/* Box checked */
.input:checked + .label:before {
  background: var(--v2-palette-primary-main);
  border: 1px solid var(--v2-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(--v2-palette-input-disabled-foreground);
  background: var(--v2-palette-input-disabled-background);
}

/* Checkmark. Could be replaced with an image */
.input:checked + .label:after {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  margin-top: -1px;
  transform: translateY(-50%);
  color: var(--v2-palette-input-background);
  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(--v2-palette-input-disabled-foreground);
}
