The Spanish subjunctive mood (el subjuntivo) is a grammatical mood—not a tense—used to express doubt, wishes, emotions, uncertainty, or hypothetical situations.
Compound tenses are formed using the auxiliary verb haber + past participle.
Used for current or future doubts, wishes, and commands. Espero que hables español. (I hope you speak Spanish.)
Used for past doubts, polite requests, or hypothetical if clauses. Quería que hablaras más. (I wanted you to speak more.)
Combines the present subjunctive of haber with a past participle to talk about a past action connected to the present. Dudo que hayas hablado con él. (I doubt you have spoken with him.)
Combines the imperfect subjunctive of haber with a past participle for past hypothetical outcomes. Ojalá hubiera hablado antes. (I wish I had spoken sooner.)