First off you’re not horrible at math. You were accelerated and you hit a point where things did not go smoothly. Sometimes as math becomes more abstract, the acceleration can really be a detriment just based on personal brain development. There have been numerous studies about how a year or two can make a huge difference in understanding. I hope you’re making sure to get any additional support you may need and going into your math classes WITHOUT a preconceived notion that you will not do well. A B and a C in precal is a bump.
I do think you need to really take a step back and NOT apply to any school ED if you do not want to go there. Find a school that you’re excited to attend - and if that’s close wonderful! Stanford is a lottery school, so find schools nearly that are more assured. Best of luck to you!