.c-checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  user-select: none;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: var(--leading-snug);
}

.c-checkbox.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.c-checkbox__input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.c-checkbox__visual {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-bg-raised);
  flex-shrink: 0;
  color: var(--color-text-on-accent);
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.c-checkbox__visual svg {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

.c-checkbox__input:checked + .c-checkbox__visual {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.c-checkbox__input:checked + .c-checkbox__visual svg {
  opacity: 1;
  transform: scale(1);
}

.c-checkbox__input:indeterminate + .c-checkbox__visual {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.c-checkbox__input:indeterminate + .c-checkbox__visual::before {
  content: '';
  display: block;
  width: 10px;
  height: 2px;
  background: var(--color-text-on-accent);
  border-radius: 1px;
}

.c-checkbox__input:focus-visible + .c-checkbox__visual {
  outline: none;
  box-shadow: var(--shadow-glow-accent);
}
