Olá! bom dia. Before further discussions, it is somehow necessary to clarify how the verb "to realize" is defined. In English, "to realize" generally means "to understand" or "to recognize", but it may also mean "to make something real or concerte", as seen in the WordReference online dictionary:
However, in major Romance languages, their corresponding term for the verb "to realize" has mostly the meaning "to make something real or concerte", for instance:
"réaliser" (français), "realizar" (español and português), and "realizzare" (italiano)
Therefore, if the above meaning were exactly what you would like to say, then naturally the expressions given from the other respondent are perfect and adoptable. However, if you want to express the principal English meaning of the verb "to realize [sth./that]", then you possibly need to use another term, and this would be "dar-se conta [de algo/que]".
So, by taking the pluperfect subjunctive mood, we are able to express "although I had not realised it, ..." as,
"embora (eu) não me tivesse dado conta de isso, ..."
(N.B.: Native speakers, please kindly rectify any mistakes in above.)
P.S. In other major Romance languages, the verb "to realize [sth./that]" would be,
"se rendre compte [de qch./que]" (français),
"darse cuenta [de algo/que]" (español), and
"darsi conto [di qc./che]" (italiano)