(CNN) In the summer of 2013, Aimee Stephens sent her employer a letter explaining she was about to change her life. She was a transgender woman, and she intended to start dressing as such at work.

She never expected then that she was about to enter into a yearslong legal dispute, one that might soon become a litmus test for lesbian, gay and transgender rights before the next US Supreme Court.

Stephens had spent months drafting the message to management at R&G and G&R Harris Funeral Homes, a family-owned business in the Detroit area, she says. She was 52 years old at the time, and she had spent her entire life fighting the knowledge she was a transgender woman, to the point that she had considered ending her life.

Now that she was coming out at work, she hoped her nearly six years of positive performance reviews, which had earned her regular raises, would count in her favor.

But her boss, a devout Christian, told her the situation was "not going to work out," according to court documents. Thomas Rost offered her a severance package when she was fired, but she declined to accept it.

She filed a complaint with the Equal Employment Opportunity Commission, which sued the funeral home. The agency accused the funeral home of firing Stephens for being transgender and for her refusal to conform to sex-based stereotypes.

A district court agreed with the funeral home that the federal workplace discrimination law known as Title VII did not protect transgender people. But it found that the funeral home did discriminate against Stephens for her refusal to conform to its "preferences, expectations, or stereotypes" for women. The EEOC appealed.

The 6th Circuit Court of Appeals ruled in favor of Stephens and the EEOC in March. The funeral home's lawyers accused the court of exceeding its authority by expanding the definition of sex in a way that threatens to "shift" what it means to be a man or a woman.

In July, lawyers representing the funeral home asked the Supreme Court to take up the case to determine if transgender individuals are protected under Title VII's sex-based provisions. If the court takes up the case, it could have broader implications for the definition of sex-based discrimination. And it could impact case law that precludes firing anyone -- gay, straight or cisgender -- for not adhering to sex-based stereotypes.

"The stakes don't get much higher than being able to keep your job," said Harper Jean Tobin, director of policy for the National Center for Transgender Equality. "Harris Funeral Homes is a stark example of the job discrimination that so many transgender people face."

Advocates say it's one of the most important current civil rights issues for the transgender community, along with similar considerations in education and health care . And they say it has been settled by years of case law. In the past two decades, numerous federal courts have ruled that federal sex discrimination laws apply to transgender and gender-nonconforming people, including Title VII, the Title IX education law, and Section 1557 of the Affordable Care Act.

But lawyers from the Alliance Defending Freedom, the conservative Christian nonprofit representing the funeral home, say it's far from settled.

"No court or federal agency has the authority to rewrite a federal statute. That power belongs solely to Congress. Replacing 'sex' with 'gender identity,' as the 6th Circuit and the EEOC have done, is a dramatic change," senior counsel Jim Campbell said in a statement.

"What it means to be male or female shifts from a biological reality based in anatomy and physiology to a subjective perception. Far-reaching consequences accompany such a transformation."

'Like a punch in the gut'

The case is one of several that could go before the high court raising the question of whether sex includes gender identity for the purpose of Title VII. The question is coming up more often as the transgender community grows more visible, especially in the workplace.

"The most common context in which you see some kind of discrimination is in the workplace," University of Texas professor law and CNN legal analyst Stephen Vladeck said. "This is the context in which there are the most claims that would rise or fall on whether gender identity is equivalent to sex."

Donna Stephens, left, with Aimee Stephens, who has suffered health problems in recent years.

Now 57, Stephens began working in a funeral home in her 20s, preparing bodies for viewing, helping present the deceased in their best light. It was a way for her to bring a measure of comfort to people in their times of greatest need, she said.

She moved to Michigan nearly 20 years ago to be with her wife, and returned to the funeral home industry. She joined Harris Funeral Homes as an apprentice in October 2007 and served as a funeral director/embalmer from April 2008 until her termination in August 2013.

She enjoyed her work, but she struggled with her identity, she says. One day in November 2012, she went out to the backyard of her Redford home with a loaded gun.

"I couldn't see myself going backward or forward," she said. "I buried it as deep as I could for my whole life, but it doesn't stay buried."

Then, she realized she loved herself and her life too much to give up, and went back inside the house, she says.

Her wife, Donna Stephens, says she had noticed a change over time in her spouse. She thought it was depression, or worse, an affair. "When she came out and she told me, it was honestly sort of a relief," she said. "But it was very upsetting to find out the truth of what could have happened."

Stephens had started seeing a counselor who recommended she write the letter for her workplace. She began working on it in early 2013, and hand-delivered it to her co-workers and boss on July 21, 2013.

"I always knew there was a chance they would go off the deep end, but I was really hoping they would be more tolerant of my decision," she said. "Losing my job was like a punch in the gut."

Donna Stephens took on extra jobs after her wife was fired.

Stephens' health began to decline due to kidney failure and she could no longer work. Money became tight and Donna Stephens had to take on extra jobs while she grappled with her spouse's transition. They sold their van, their camper and a piano to make ends meet. A close call with death in fall 2017 renewed her resolve to speak publicly about the case in between appointments with doctors and dialysis sessions.

She's still determined to see her case through. "What they did to me was wrong, and I won't be the last," Aimee Stephens said. "It's important that we treat one another as we would want to be treated. Religious freedom doesn't give you the right to override other people's freedoms."

The case background

In her complaint to the EEOC, Stephens alleged that management said it terminated her because the public would not accept her transition, according to court documents. In a deposition, Rost testified that he fired Stephens because she "was no longer to represent himself as a man" and "wanted to dress as a woman," the court documents said.

The funeral home had a dress code for public-facing employees: suits and ties for men, skirts and business jackets for women. For Rost, who believes the Bible teaches that "sex is immutable," acquiescing to Stephens' proposal would have violated the funeral home's dress code, according to his petition. And Rost was concerned that female employees would have to share the restroom with Stephens, his lawyers claim.

A photo of Aimee Stephens before her transition with her wife Donna Stephens.

Rost's arguments center on the definition of sex as "a biological reality based in anatomy and physiology," not a "subjective perception evidenced by what people profess they feel." It's a position Alliance Defending Freedom lawyers have held in legal disputes across the country, where the group represents school districts, parent groups and individuals in fights against policies that let transgender individuals use facilities based on their gender identity.

Rost believed "he 'would be violating God's commands' if a male representative of Harris Homes presented himself as a woman while representing the company," his petition says.

What Brett Kavanaugh could mean for the case

Sixteen states filed a brief on August 23 supporting the funeral home, urging the Supreme Court to "restore the balance of power in our federal system." The attorneys general of 13 states and the governors of three others signed, saying states should be the ones to "legislate and experiment in this policy arena."

When Congress enacted Title VII in 1964, according to the brief, "sex" and "gender identity" had different meanings, and Congress has treated them as separate concepts ever since. Several federal statutes include "sex" and "gender identity" as separate traits, but not Title VII.

"Congress clearly knows there is a distinction between sex and gender identity. It has used both terms at the same time (indicating they are not interchangeable), and it has thus far declined to add gender identity to Title VII," the brief says.

"Unless and until Congress affirmatively acts, our Constitution leaves to the states the authority to determine which protections, or not, should flow to individuals based on gender identity. The 6th Circuit ignored this fact and essentially rewrote federal law, engaging in policy experimentation."

It's not clear if the Supreme Court will take the case. But Lambda Legal Staff Attorney Sasha Buchert and other civil rights advocates say they are deeply concerned about the potential outcome, especially if nominee Brett Kavanaugh is on the bench. The court of appeals judge served as associate counsel and then senior associate counsel to the president from 2001 to 2003. While awaiting confirmation for nearly three years, he became assistant and staff secretary to Bush.

What they know about his record on the D.C. Circuit Court of Appeals suggests he won't be friendly to workers or to the LGBT community, Tobin said. What's more alarming is what they don't know about his time in President George W. Bush's White House, during which the administration fought same-sex marriage, she said. The Senate Judiciary Committee released a portion of documents related to his work in the early 2000s, but none from his time as staff secretary from 2003 to 2006. Tobin and others say the release sheds virtually no new light on his legal thinking or positions on issues.

"What we do know is troubling enough, but the fact that there is such a concerted effort to keep us from seeing his whole record makes you wonder what they don't want us to see," Tobin said.

Under President Obama, the EEOC and the Department of Justice took the position that gender identity and transgender status were protected under federal sex discrimination laws. After President Trump took office, "We knew that the administration's position about protections for transgender people was less secure than the previous one," said Stephens' ACLU lawyer, John Knight.

The DOJ has not filed a brief in the funeral home case.

What's at stake

In March, the 6th Circuit held that the funeral home discriminated against Stephens based on her sex. It also found that the funeral home was not entitled to a religious freedom defense.

In its ruling, the panel cited the 1989 Supreme Court decision in Price Waterhouse v. Hopkins. The landmark case involved a female employee who sued after she was passed over for a promotion for being "macho" and told that she should walk, talk and dress "more femininely." The court held that a woman could sue for sex discrimination "even though she was not discriminated against for being a woman per se, but instead for failing to be womanly enough," the 6th Circuit said.

Aimee Stephens has a meal at the Redford Grill & Bar in Redford, Michigan.

The funeral home's lawyers claimed its sex-specific dress code applied to everyone, not just Stephens. But the 6th Circuit said the question was whether the funeral home could terminate Stephens because she refused to conform to its "notion of her sex," not whether she intended to comply with the dress code.

"Title VII's reference to 'sex' encompasses both the biological differences between men and women, and gender discrimination, that is, discrimination based on a failure to conform to stereotypical gender norms," the 6th Circuit said. "Discrimination on the basis of transgender and transitioning status is necessarily discrimination on the basis of sex."

In addition to Title VII's scope, Rost's lawyers have also asked the court to consider whether employers are prohibited from applying sex-specific policies "according to their employees' sex rather than their gender identity."

Fearing the worst

Advocates say the question could have dramatic implications not only for transgender individuals but for anyone who fails to meet an employer's expectations for how a man or women should appear or behave.

"Being transgender is the very essence of not conforming to gender stereotypes," Buchert said.

"The initial impact is obvious, that it would be extremely harmful for transgender people in the workplace because the holding would specifically focus on gender identity. But it's likely the court could hold broader and define sex discrimination in a myopic and narrow way that would carve out all protections for LGBT workers that have been in place for decades."

Stephens is also wary of the case going to the high court after winning at the court of appeals. The issues at stake are matters of life and death for the transgender community, and she wants people to hear her story, she says. Like others, though, she fears an adverse outcome.

"The 6th Circuit was a great decision on behalf of transgender people and their rights. The court made it clear that you can't use religious beliefs to discriminate against people, and it made clear that we have rights under federal law," she said.

"But what if the court strikes it down? That's a day I can't imagine."

Correction: A previous version of this story inaccurately described the Equal Employment Opportunity Commission as "the Department of Labor's enforcement agency." It has been updated.