Four years ago, the Supreme Court legalized same-sex marriage across the United States, and many Americans believed the fight for LGBTQ equality was finally won.

But that ruling did not address all the ways LGBTQ people experience discrimination in their everyday lives. Same-sex partners can now legally marry, but in a majority of states you can still be fired for being gay.

On Tuesday the Supreme Court will hear three cases on whether it is legal to fire workers because of their sexual orientation or gender identity. Experts say they set the stage for a landmark civil rights ruling that will serve as the true test of where the nation stands on LGBTQ rights.

Supreme Court:Divided over gay, transgender job bias

'Shocking' numbers:Half of LGBTQ adults live in states where no laws ban job discrimination

Opinion:My partner was fired for being gay. The Supreme Court can't set a pro-bigotry precedent.

"This is a watershed moment that is at the level of significance of the marriage cases, but it's flying under the radar," said Ineke Mushovic, executive director at the Movement Advancement Project, a think tank that maintains a database on laws affecting LGBTQ people. "It's a question about how we as America are going to treat LGBT people."

Glossary:LGBTQ definitions every good ally should know

Advocates say in the past two decades, the nation has come a long way on LGBTQ visibility and acceptance, but many Americans don't understand how legally vulnerable the population remains. When two women get engaged on Bachelor in Paradise, a transgender teen in Tennessee is crowned homecoming royalty and Mayor Pete Buttigieg and his husband campaign for president, it can create the perception that LGBTQ people are treated equally under the law and widely embraced in public life.

Almost half of Americans believe federal law protects LGBTQ people from discrimination on the basis of sexual orientation, according to a Reuters/Ipsos poll released in June.

But the reality is the LGBTQ community continues to face discrimination.

About half of LGBTQ people in the U.S. live in a state where they legally can be fired, nixed for a promotion, refused training or harassed at their jobs – all because of their gender identity and sexual orientation.

Only 21 states, D.C. and two territories have laws on the books explicitly banning bias in the workplace based on sexual orientation and gender identity.

One quarter of LGBTQ people reported experiencing discrimination based on sexual orientation or gender identity, according to a 2018 report from the Movement Advancement Project.

Supreme Court:Rules for baker who refused to create same-sex couple's wedding cake

At Pride events this year, it was clear even many LGBTQ people didn't know their rights.

"It would either be people coming up to the booth to say, 'You are kidding me that LGBTQ people are not covered' – and this would be LGBTQ people – or it was, 'I know we're not covered because I was fired from my job' or 'My cousin was kicked out of her house,' " said Robin Maril, associate legal director at the Human Rights Campaign.

The three cases before the court involve allegations of workplace discrimination, though experts say a ruling against LGBTQ plaintiffs could open the door for opponents of gay rights to discriminate pervasively in other areas, including education, housing, credit and health care.

The justices will hear three challenges from New York, Michigan and Georgia involving workers who claim they were fired because they were gay or transgender:

A New York skydiving instructor, Donald Zarda, said he was fired because he was gay. He has died, but his sister and his life partner continue to press the case.

A Georgia county government employee, Gerald Bostock, alleged he was fired from his job as a child welfare services coordinator because he is gay.

A Michigan transgender woman, Aimee Stephens, said she was fired from the funeral home where she worked for six years as Anthony Stephens because of her transition from male to female.

Experiences like these are widespread across much of the U.S., activists say.

A.J. Celento, who lives in Nashville with his husband, Josh Corey, said he was let go from his job at a local restaurant when management learned he was married to a man.

The couple lost their health insurance, their income and the apartment they had just been given the keys to. The experience was financially and emotionally devastating, Celento said.

"We just don't trust people anymore," he said. "Josh and I shop together, we make dinner together, we go out together. We intentionally stay out of the community. It would be nice to have a group of friends, but we really don't. When someone takes away your home, your food, your money, takes away your ability to work, you become fearful and isolated."

Tennessee lacks non-discrimination laws for LGBTQ people in employment, housing, public accommodations, credit and lending. And the state explicitly bans cities and counties from passing non-discrimination laws of their own.

"If the Supreme Court says it's legal to discriminate against LGBT people, that's a huge step back for who we are as a nation, what values we have, how we think about how we treat people at work," Mushovic said. "If the Supreme Court rules LGBT people are protected in the workplace, it's an affirmation of the values the majority of Americans already hold."

More:Gay rights battle against employment discrimination extends beyond the grave, and to the Supreme Court

More:Ex-funeral home worker’s case going to Supreme Court, raising question whether 1964 law covers gender identity

More than 90% of Americans believe gays and lesbians should have equal rights in terms of job opportunities, according to a 2019 Gallup poll. More than half believe new civil rights laws are needed to reduce discrimination against lesbian, gay, bisexual or transgender people.

The Justice Department under President Donald Trump has come down on the side of the companies who fired the plaintiffs, contending that federal civil rights laws do not protect workers based on sexual orientation or gender identity.

“The sole question here is whether, as a matter of law, Title VII reaches sexual orientation discrimination," read an amicus brief submitted by the Department of Justice in the case of Zarda v. Altitude Express. "It does not."

Activists say this language makes many LGBTQ people feel excluded by a government that is meant to represent them.

"If the court rules the wrong way, it communicates to LGBTQ people that they are strangers to the law, that they are not worth protecting, that they're alone," Maril said.

Regardless of what the justices decide, advocates say passage of the Equality Act, which would amend civil rights laws to include explicit protections for sexual orientation and gender identity, is essential. They will continue to push for it whether or not the court rules in their favor.

The Democratic-controlled House passed the act this year, but it faces stiff opposition in the Republican-controlled Senate.

"We are absolutely not done," Maril said. "We were not done in 2015 and we will not be done in 2020."

You may also be interested in: