Because they depend on kako and describe the actions that were explained or demonstrated. After kako, Croatian often uses the infinitive to express English how to... So:
It is the direct object, so it is in the accusative case. But dokument is a masculine inanimate noun, and for many masculine inanimate nouns, the accusative singular looks the same as the nominative singular. So:
That is why the form does not visibly change.
Because priložiti takes the thing being attached in the accusative and the thing it is attached to in the dative. So:
So priložiti ga e-mailu literally means attach it to the email. The noun e-mail is a borrowed word, but it still declines like other Croatian nouns, and e-mailu is its dative singular form.