“Cannot modify header information” means I can’t use wp_redirect

As Milo stated, you can’t send header information after PHP has begun sending request response body.

Redirects belong in a function hooked into wp_loaded to ensure they run before the request body is generated.

You need something like the following in your functions.php file:

function hook_wp_loaded_require_login() {
    $uri = ( isset( $_SERVER['REQUEST_URI'] ) )
        ? $_SERVER['REQUEST_URI']
        : null;

    if (
        $uri &&
        $uri !== '/login/' &&
        $uri !== '/policy-agreement/' &&
        ! is_user_logged_in()
    ) {
        $url = get_site_url() . "/login/";
        wp_redirect($url);
        exit;
    }
}
add_action( 'wp_loaded', 'hook_wp_loaded_require_login' );

Note: If you use this approach, users will never see your You must be logged in to see the team details. error message and you’ll also need to follow up on that policy_agreement_redirect() call…