I've been looking for the same styling technique for a while. From a UI/UX standpoint - simplifying search forms to a single element makes a lot of sense in certain situations.
Consider the example below:

When you approach it from a development standpoint the knee-jerk is to decide to style the form itself instead of the input elements. A transparent input[type=text] to the left, and a transparent .PNG submit button to the right and you've got a sharp looking search field.
As you've discovered though, you give up the CSS style capabilities associated with :focus because the input field isn't the one controlling the background / color etc - the form element is instead.
The form:focus selector would be a perfect way to handle that. Unfortunately, we've got to wait to CSS4 for that (thanks to matt3141 for the tid-bit).
In the meantime, you have a few options available
Option 1 - Forgo the Clickable Submit Button
I usually try and avoid this if possible, but you have the option to forgo the submit button altogether. Style the text field as you intended, and use a background image with the position limited to the left or of the field right. When the user types in their query, and presses enter, you can still fire a GET action. The example image above uses this technique.
Example: http://designdisease.com/
Pros: Easiest to set up.
Drawbacks: Users who still click search buttons might be confused.
Option 2 - Use an Alternate Element to Style the Background
Your next option is to take advantage of the sibling selector and content tags as o.v. has so generously explained in his/her previous answer. This in effects adds a new element and styles it to act as a new background for a specified area when the :focus effect is applied to an input field.
Example: http://jsfiddle.net/ovfiddle/PEK7h/2/
Pros: Extendable to larger forms with multiple fields more easily.
Drawbacks: The intensive selectors may not degrade as gracefully as we'd like.
Option 3 - Use Absolute Positioning to Stack the Elements
In situations where the text field will encompass the full width of the form, you can use a the position:absolute; attribute to simply load the submit button over top of the input element, and then a few css tweaks on the button to remove the background / border - giving the same effect as our example image above, but with added benefit of making it clickable.
Step One: Give the form a position - relative/absolute/fixed.
Step Two: Give the text field a width of 100%.
Step Three: Give the button an absolute position, and right position of 0.
I've updated o.v.'s fiddle to incorporate the new technique:
Example: http://jsfiddle.net/PEK7h/17/
Pro's: Degrades gracefully, gives us what we want in most single input field cases.
Drawbacks: Not as easily extendable to large forms like o.v.'s fix is.
--
As you can see, each option has its own drawbacks - but if you know about them ahead of you can usually lessen their impact. Hope this helps!