The book I'm thinking of has the protagonist as a female in her teens who is exceptional at fighting and enjoys it. She lives underground in a society that believes the above ground is toxic and unsafe for habitation. Before I continue, I'm not thinking of The City of Ember — I enjoyed that series but it's not the one I'm thinking of. The town she lives with, as there are multiple underground, finds a boy, who I'll say is the second protagonist, in the underground who claims to have come from above ground. They later find a blind boy while hunting for food underground and he says the monsters are now attacking the towns and killing them off. After the town disbelieves it they are sent to the blind boy's town to investigate, and find it is true. They end up escaping to above ground and find a group of men who basically enslave women to reproduce and kill for what they need.
After a sequence of events the leader follows them and they find the second protagonist's old lover — or at least, she loves him, but not the other way around — in a bunker. Later the leader of the bandits joins them while they shelter in an abandoned house for the winter; the leader apparently also has a sense of love for the girl, as does the second protagonist, although he's not so sure about it. They end up living in a town where they have a biblical belief about what men and women should or should not do as a society. Typically women do the crafting with clothes and whatnot while men do the heavy lifting and work, women are also not supposed to fight. They end up banishing her claiming her behavior towards fighting is what's bringing divine punishment to them, aka the goblin raids and she puts together an army of humans to fight the army of goblins eventually.