The chief military architect of restoring democracy to Brazil has resigned and been replaced by a civilian with a reputation as a hard-liner, a change seen here as clouding hopes for continued political liberalization.

Often called the most powerful man in Brazilian politics, the replaced chief of staff, Gen. Golbery do Couto e Silva, has steadily steered Brazil away from harsh military rule during the last seven years. Golbery orchestrated the policy of abertura, or democratic opening, that is being implemented by President Joao Baptista Figueiredo, who has bolstered civil liberties and scheduled wide-ranging elections for next year.

Taking over Golbery's job last Thursday was Joao Leitao de Abreu, who occupied the same post under the man regarded as the most repressive president of the last 17 years of military rule, Gen. Emilio Garrastazu Medici. Many opponents of the Medici regime were censored, tortured or exiled.

Political observers do not predict a return to this harsh era under Leitao, but they foresee a freezing of the recently more relaxed political climate. In his long inauguration speech last week, Leitao never used the world abertura. Instead, he warned that "the days of plenty are over."

"I prefer injustice to disorder," Leitao, 68, a former Supreme Court justice, told reporters.

"The elections will be held, but Leitao is the tough guy called in to win them," said Riordan Roett, director of The School of Advanced International Studies' Center of Brazilian Studies in Washington. Roett was here for meetings with political and economic leaders.

Golbery, 70, long the government's gray eminence, avoided press interviews and preferred to keep his political deals behind closed doors.

The minister's secretive style rankled Brazil's outspoken opposition, who nicknamed him "the wizard" and "the witch doctor." Brazil's largest selling newsweekly described him as "one of the most detested men in the country."

Following his sudden resignation Aug. 6, however, opposition politicians suddenly noted that Golbery's tenure, uninterrupted since 1974, coincided with a period of steady liberalization.

Overnight, Golbery became "the great strategist of the abertura" as civilian politicians nervously sized up the authoritarian credentials of his successor.

Officially, Golbery resigned for health reasons. But he had been under fire from the right since May, when he pressed for a complete investigation of suspected military involvement in a bomb explosion at a folk concert. In the incident, one military intelligence officer was killed and another wounded when a bomb they were apparently carrying exploded in their car.

Evidence overwhelmingly indicated that the soldiers were planning to bomb the concert, which had communist sponsorship. But the military blamed an extinct leftist guerrilla group and shelved the probe.

Golbery also lost a clash with Planning Minister Antonio Delfim Netto over Delfim's restrictive and highly unpopular economic policies.

One newspaper columnist painted a picture of two trains hurtling toward each other on the same track. One was labeled the abertura and the other Delfim's economic program. By all reports, the collision took place quietly in Brasilia and Golbery was the casualty.

Golbery reportedly had mapped a populist strategy for the 1982 elections to revive the weak government party by subsidizing food prices, giving pay raises to all civil servants, delaying a proposed 25 percent increase in social security taxes, cutting back on the costly nuclear program and boosting the economy by lowering interest rates.

Faced with an inflation rate of 120 percent a year, the government has pushed up interest rates -- and pushed Brazil into a recession. Industrial production has dropped, about 222,000 workers have been laid off in Sao Paulo, and a national association of supermarket owners reported that food sales are down 10 percent this year.

"Patronage politics can only be done in a period of economic expansion," said Alexandre de Barros, a Brazilian political scientist who closely follows the Brazilian military. "Instead, the government has called in a qualified jurist to write electoral reforms so they cannot lose important states."

De Barros said some of the electoral restrictions under consideration are: outlawing coalitions of the five opposition parties, restricting election advertising, setting residency requirements that would exclude returned exiles and opening corruption cases against candidates.

In February the military used one such maneuver against Brazil's most popular labor leader, Luis Ignacio da Silva. Da Silva was convicted of leading an illegal strike, making him ineligible to run for elected office.

Golbery's fall from power seems to mean the end of his political career. He has been long regarded as the intellectual father of the Brazilian military revolution that began with the overthrow of civilian government in 1964.

In the 1950s he helped found the Superior War College, an influential military think tank where he developed a doctrine of national security, summarized in the motto "security and development," which was subsequently emulated by military governments throughout Latin America. The ideology maintains that military forces should combat "internal subversion" with fervor while pressing development.

Golbery participated in the 1964 military coup against the left-leaning civilian government of Joao Goulart. With the military in power, Golbery created the National Information Service, a hybrid intelligence service and security police.

In 1967, he published "Geopolitics of Brazil," spelling out a view of Brazil's "manifest destiny" in the South Atlantic region. Widely read in Argentine military circles, the book was denounced there as an example of "Brazilian imperialism." That same year, as the military revolution moved sharply to the right, Golbery left the government to work for the Dow Chemical Corp., returning to public life in 1974.