Context. Magnetic fields are invoked to launch, drive, and shape jets in both low- and high-mass protostars, but observational data on the spatial scales required to assess their role in the protostellar mass-loss process is still scarce. Aims: The Turner-Welch (TW) object in the W3(OH) high-mass star-forming complex drives a synchrotron jet, which is quite exceptional for a high-mass protostar, and is associated with a strongly polarized H2O maser source, W3(H2O), making it an optimal target to investigate the role of magnetic fields on the innermost scales of protostellar disk-jet systems. Methods: We report full polarimetric VLBA observations of H2O masers towards W3(H2O). Their linearly polarized emission provides clues on the orientation of the local magnetic field (on the plane of the sky), while the measurement of the Zeeman splitting provides its strength (along the line-of-sight). The linear scales probed by H2O masers are tens to hundreds of AU (at the W3(H2O) distance, 2 kpc), inaccessible to other star-formation tracers. Results: We identified a total of 148 individual maser features and we measured their physical properties. Out of 148, we measured linear polarization in 34 features, with a fractional percentage varying in the range 0.9-42%, making W3(H2O) the highest-polarized H2O maser source observed with VLBI known in the Galaxy. The H2O masers trace a bipolar, biconical outflow at the center of the synchrotron jet. Although on scales of a few thousand AU the magnetic field inferred from the masers is on average orientated along the flow axis, on smaller scales (10s to 100s of AU), we have revealed a misalignment between the magnetic field and the velocity vectors, which arises from the compression of the field component along the shock front. We also detected circularly polarized emission toward ten maser features, with a fractional percentage varying in the range 0.2-1.6%. In the gas shocked by the synchrotron jet, we estimate a total field strength in the range 100-300 mG (at densities of 109 cm-3). We conclude that fields of this order of magnitude are expected if the observed polarized water masers emerge behind magnetically supported shocks which, propagating in the W3(H2O) hot core (with an initial density of order of 107 cm-3), compress and enhance the field component perpendicular to the shock velocity (with an initial field strength of a few mG). We constrain the magnetic field strength in the pre-shock circumstellar gas (which is dominated by the component parallel to the flow motion) to at least 10-20 mG (at densities of 107 cm-3), consistent with previous estimates from a synchrotron jet model and dust polarization measurements. Conclusions: In W3(H2O), the magnetic field would evolve from having a dominant component parallel to the outflow velocity in the pre-shock gas, with field strengths of the order of a few tens of mG, to being mainly dominated by the perpendicular component of order of a few hundred of mG in the post-shock gas where the H2O masers are excited. The general implication is that in the undisturbed (I.e., not-shocked) circumstellar gas, the flow velocities would follow closely the magnetic field lines, while in the shocked gas the magnetic field would be reconfigured to be parallel to the shock front. |