When copyright arises
Under article 1046 of the Civil Code, copyright arises from the fact that the author created the work. Registration and other formalities are not required. The person named as the author on the original or on a copy of the work is treated as the author until the contrary is proved. So put your name on the work and keep a copy that carries a fixed date.
What is protected
Under article 1041 of the Civil Code, copyright applies to the form of expression of the work. Article 1042 names literary works, works of design, computer programs, photographic works and musical works. Ideas, principles, methods and concepts as such are not protected.
After an infringement
Under article 1040 of the Civil Code, exclusive rights are protected by the methods in article 11: an order to stop the infringing acts, compensation for losses, and compensation for moral harm. You may also demand seizure of the material objects used to infringe the right or created by the infringement, and publication of the fact of the infringement. Send a written demand first. If you cannot reach an agreement, apply to the court. Unlawful use of a work also brings a fine and confiscation of the counterfeit copies under article 177¹ of the Code on Administrative Liability.
How to keep evidence
Keep a document that confirms the date the work was created: email, a version history, or notarial certification. In a dispute the date of creation is important evidence.