The Taliban made an audacious attack early Monday on Afghanistan’s capital city, upending recent assurances of military progress.