Accurate and efficient 3D controlled-source electromagnetic (CSEM) forward modeling is crucial for deciphering CSEM responses in complex geological contexts and for assessing the efficacy of survey designs. It also serves as the foundation for 3D inversion, a critical technique for interpreting CSEM data. We present a novel hp-adaptive finite element method for 3D CSEM forward modeling. This method enhances the traditional h-adaptive approach, which only refines the mesh while keeping the polynomial degree of the basis functions constant, by enabling simultaneous refining mesh and increasing polynomial degree of basis functions. High-order elements yield superior approximations when the solution exhibits sufficient smoothness, while mesh refinement enhances accuracy in regions with less smooth solutions. The adaptive refinement process is guided by a goal-oriented error estimator that relies on the residual of the governing equation and the continuity of electromagnetic fields. The hp-adaptive strategy, which determines whether to refine elements or increase their polynomial degree, is based on the refinement levels of the elements. Constraints are applied to hanging nodes, introduced during the refinement process, to ensure the continuity of the finite element space. We validate the accuracy, efficiency, and convergence of the hp-adaptive method through tests on two layered models. Further simulations on a topographic model and a realistic model corroborate its effectiveness. Our findings indicate that the hp-adaptive method outperforms the traditional h-adaptive method in terms of accuracy, convergence rate and computational cost, making it a promising technique for 3D CSEM forward modeling.