BALTIMORE — The temperature was a brisk 40 degrees, the wind was a good 13 mph, and the rain only let up for a few minutes during pregame warmups Sunday at M&T Bank Stadium.

It was not the most ideal conditions for a passing attack in the 49ers' 20-17 loss to the Ravens.

Quarterback Jimmy Garoppolo still completed 15 of his 21 attempts for 165 yards and one touchdown, good for a 110.2 passer rating. His fumble, which happened halfway through the first quarter and led to a Ravens touchdown, might have been his biggest mistake of the game.

“Just [have to] cover the ball up, especially in these conditions,” Garoppolo said. “I kind of thought I had it locked up. He punched it out and made a good play.”

After the 49ers suffered just their second loss of the season, Garoppolo is adamant that the team's mentality still is in a good spot.

“We are going to face adversity at some time,” Garoppolo said. “I think guys responded well today. Just whether we have a turnover or a bad play, a penalty. Just how we respond to that and how we move on. I thought we did a good job of that today. Obviously room for improvement, but a step in the right direction.”

The 49ers came very close to handing the Ravens their third loss of the season, but as coach Kyle Shanahan has said in the past, it can be good to have things to focus on and fix before the team’s next game.

“We need to make more plays in crucial situations,” Garoppolo said. “That’s what separates a lot of these games. Just a couple of plays here and there. We always have things to work on, whether we won or lost this game. I think it would be the same.

"I just like the mindset that our guys have. This one hurts, but we’ll bounce back from it.”

The 49ers were effective in the run game, and Garoppolo couldn’t have been more proud of the entire offense for productively executing the scheme. Raheem Mostert had the best game of career, carrying the ball 19 times for 146 yards and one touchdown.

[RELATED: Shanahan explains decision to pass on fourth-and-1]

The 49ers' offense averaged 6.4 yards per play, 6 per each rush and 7.5 for each completion. If nothing else, the fact that the 49ers had that chance to come away with a win in Baltimore is proof they can match up with any team in the NFL.

“It was a good challenge today,” Garoppolo said. “They are a good team, Baltimore. They definitely are. It’s just we have room for improvement. Plenty of things we could do better, but whoever it is, wherever it’s at, we’re going to line it up.”