jQuery(document).ready( function( $ ) {
	var formId =gf_stla_material_localize_current_form.formId;


	wp.customize( 'gf_stla_form_id_'+formId+'[text-fields][background-color]', function( value ) {
		// set background color to transparent on inputs
		value.bind( function( to ) {
				$( '#gform_wrapper_'+formId+'.gform_wrapper .gform_body .gform_fields .gfield input[type=text]' ).css( 'background', 'transparent' );
				$( '#gform_wrapper_'+formId+'.gform_wrapper .gform_body .gform_fields .gfield input[type=email]' ).css( 'background', 'transparent' );
				$( '#gform_wrapper_'+formId+'.gform_wrapper .gform_body .gform_fields .gfield input[type=tel]' ).css( 'background', 'transparent' );
				$( '#gform_wrapper_'+formId+'.gform_wrapper .gform_body .gform_fields .gfield input[type=password]' ).css( 'background', 'transparent' );
				$( '#gform_wrapper_'+formId+'.gform_wrapper .gform_body .gform_fields .gfield input[type=url]' ).css( 'background', 'transparent' );

				 // set background color on parent
				 $( '#gform_wrapper_'+formId+'.gform_wrapper .gform_body .gform_fields .mdc-text-field' ).css( 'background', to );
			 } );
	  } );


	  wp.customize( 'gf_stla_form_id_'+formId+'[dropdown-fields][background-color]', function( value ) {
		value.bind( function( to ) {
				$( '#gform_wrapper_'+formId+'.gform_wrapper .gform_body .gform_fields .gfield select' ).css( 'background', 'transparent' );

				// set background color on parent
				$( '#gform_wrapper_'+formId+'.gform_wrapper .gform_body .gform_fields .mdc-select' ).css( 'background', to );

			 } );
	  } );
} );