// =============================================================================
// Checkbox — Toggle input with label
// =============================================================================

@use '../variables' as *;
@use '../mixins' as *;

.checkbox {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.625rem;
  cursor: pointer;
  user-select: none;

  &--disabled {
    cursor: not-allowed;
    opacity: 0.6;
  }
}

.checkbox__box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: $radius-sm;
  border: 2px solid $neutral-300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  margin-top: 1px;
  @include transition-fast(color, background-color, border-color);

  .dark & {
    background: $neutral-900;
    border-color: $neutral-600;
  }

  &:hover {
    border-color: $primary-400;
  }
}

.checkbox__box--checked {
  background: $primary-500;
  border-color: $primary-500;
  color: #fff;

  .dark & {
    background: $primary-500;
    border-color: $primary-500;
  }
}

.checkbox__box--error {
  border-color: $error-500;
}

.checkbox__icon {
  width: 14px;
  height: 14px;
}

.checkbox__label {
  font-size: $font-size-sm;
  color: rgb(var(--color-text-primary));
}
