<?php
if ( ! defined( 'ABSPATH' ) ) exit;

/**
 * Form save logic
 */

$current_page = isset( $_POST['step'] ) ? intval( wp_unslash( $_POST['step'] ) ) : 0;
if ( isset( $_POST['step_prev'] ) ) {
	$current_page = isset( $_POST['step_prev'] ) ? intval( wp_unslash( $_POST['step_prev'] ) ) : 1;
}
if ( $current_page > 0 && get_option( '_wpcb_setup_run' ) ) {
	$current_page = 0;
}

if ( isset( $_POST['finish'] ) || isset( $_POST['skip'] ) ) {
	update_option('_wpcb_setup_run', '1');
	wp_safe_redirect( admin_url( 'edit.php?post_type=wpcb_configuration&page=welcome' ) );
	die();
}

$key_map = array(
	'wpcb_configuration_visual_type' => '',
	'wpcb_show_loader_indicator' => 1,
	'wpcb_show_values_inline' => 1,
	'wpcb_load_default_options' => 1,
	'wpcb_allow_uncheck_options' => 1,
	'wpcb_enable_option_notes' => 1,
	'wpcb_enable_option_descriptions' => 1,
	'wpcb_collapse_attribute_on_value' => 1,
	'wpcb_url_option_disable_click' => 1,
	'wpcb_url_option_new_tab' => 1,
	'wpcb_panel_view_type' => '',
	'wpcb_border_style' => '',
	'wpcb_default_summary_position' => '',
	'wpcb_default_note_position' => '',
	'wpcb_default_description_button_position' => '',
	'wpcb_default_description_button_type' => '',
	'wpcb_template_link_color' => array( 
		'wpcb_template_link_hover_color',
		'wpcb_option_hover_border_color',
		'wpcb_option_active_border_color',
		'wpcb_button_background_color',
		'wpcb_button_border_color',
		'wpcb_button_hover_background_color',
		'wpcb_button_hover_border_color',
		'wpcb_button_alt_text_color',
		'wpcb_button_alt_hover_text_color',
	),
	'wpcb_template_border_color' => array(
		'wpcb_option_border_color',
	),
	'wpcb_primary_color' => array(
		'wpcb_gallery_color',
		'wpcb_option_background_color',
		'wpcb_option_hover_background_color',
		'wpcb_button_text_color',
		'wpcb_button_hover_text_color',
	),
	'wpcb_accent_color' => array(
		'wpcb_option_active_background_color',
		'wpcb_button_alt_background_color',
		'wpcb_button_alt_border_color',
		'wpcb_button_alt_hover_background_color',
		'wpcb_button_alt_hover_border_color',
	),
	'wpcb_template_title_color' => array(
		'wpcb_option_text_color',
		'wpcb_option_hover_text_color',
		'wpcb_option_active_text_color'
	),
	'wpcb_template_color' => '',
	'wpcb_title_font_family' => array(
		'wpcb_text_font_family',
		'wpcb_note_font_family',
		'wpcb_button_font_family'
	),
	'wpcb_title_font_weight' => array(
		'wpcb_text_font_weight',
		'wpcb_note_font_weight',
		'wpcb_button_font_weight'
	),
	'wpcb_title_font_size' => array(),
	'wpcb_text_font_size' => array(
		'wpcb_note_font_size',
		'wpcb_button_font_size'
	),
	'wpcb_button_loop_cart_text' => array(
		'wpcb_button_open_popup_text',
		'wpcb_button_personalize_text'
	),
	'wpcb_button_cart_text' => '',
	'wpcb_button_quote_text' => '',
	'wpcb_button_email_text' => '',
	'wpcb_button_capture_text' => '',
	'wpcb_button_reset_text' => '',
	'wpcb_price_total_text' => '',
	'wpcb_price_subtotal_text' => '',
	'wpcb_price_option_total_text' => '',
	'wpcb_price_product_total_text' => '',
	'wpcb_price_currency_symbol' => '',
	'wpcb_price_thousand_sep' => '',
	'wpcb_price_decimal_sep' => '',
	'wpcb_price_decimal_number' => '',
	'wpcb_price_currency_pos' => '',
	'wpcb_free_price_label' => '',
	'wpcb_extra_price_plus_prefix' => 1,
	'wpcb_exclude_product_base_prices' => 1,
	'wpcb_show_price_option_difference' => 1,
	'wpcb_show_single_price_total' => 1,
	'wpcb_base_unit_price_on_min_value' => 1
);

if ( isset( $_POST['step'] ) ) {
	$check_keys = array();
	if ( 2 == intval( $_POST['step'] ) ) {
		$check_keys = array(
			'wpcb_show_loader_indicator' => 1,
		);
	}
	elseif ( 3 == intval( $_POST['step'] ) ) {
		$check_keys = array(
			'wpcb_show_values_inline' => 1,
			'wpcb_load_default_options' => 1,
			'wpcb_allow_uncheck_options' => 1,
			'wpcb_enable_option_notes' => 1,
			'wpcb_enable_option_descriptions' => 1,
			'wpcb_collapse_attribute_on_value' => 1,
			'wpcb_url_option_disable_click' => 1,
			'wpcb_url_option_new_tab' => 1
		);
	}
	elseif ( 6 == intval( $_POST['step'] ) ) {
		$check_keys = array(
			'wpcb_extra_price_plus_prefix' => 1,
			'wpcb_exclude_product_base_prices' => 1,
			'wpcb_show_price_option_difference' => 1,
			'wpcb_show_single_price_total' => 1,
			'wpcb_base_unit_price_on_min_value' => 1
		);
	}

	foreach ( $_POST as $key => $value ) {
		if ( ! array_key_exists( $key, $key_map ) ) {
			continue;
		}

		$result = $key_map[$key];
		if ( 1 === $result ) {
			// Boolean value and set (because posted)
			update_option( '_' . $key, 'yes' );
		} else if ( '' !== $value ) {
			update_option( '_' . $key, $value );

			if ( is_array( $result ) ) {
				foreach ( $result as $subkey ) {
					update_option( '_' . $subkey, $value );
				} 
			}
		}
	}

	if ( count( $check_keys ) > 0 ) {
		foreach ( $check_keys as $key => $val ) {
			if ( ! array_key_exists( $key, $_POST ) ) {
				update_option( '_' . $key, '' );
			}
		}
	}
}
?>
<div class="wpcb-page-setup">
	<div class="wpcb-page-container">

		<?php if ( 0 == $current_page ) : ?>
		
			<div class="wpcb-page-header">
				<div class="wpcb-page-logo">
					<img src="<?php echo esc_url( WPCB_BASE_URL ); ?>admin/img/wcb-logo-alt.png" height="91" width="170" alt="WCB">
				</div>

				<div class="wpcb-page-intro">
					<h1><?php esc_attr_e( 'Thank you for choosing WP Configurator Builder', 'wcb-configurator-builder' ); ?></h1>

					<?php if ( ! get_option( '_wpcb_setup_run' ) ) : ?>

						<p><?php esc_attr_e( 'Run the setup wizard to personalize your initial product configuration settings.', 'wcb-configurator-builder' ); ?><br><?php esc_attr_e( 'You can later always update this in the WCB Settings page.', 'wcb-configurator-builder' ); ?></p>
						<form method="post" action="<?php echo admin_url('edit.php?post_type=wpcb_configuration&page=setup'); ?>">
							<button type="submit" name="step" value="1" class="wpcb-button wpcb-button-large"><?php esc_attr_e( 'Run setup wizard', 'wcb-configurator-builder' ); ?></button>
							<div style="margin: 16px 0 0">
								<button type="submit" name="skip" value="yes" class="wpcb-button-link"><?php esc_attr_e( 'Go to dashboard', 'wcb-configurator-builder' ); ?></button>
							</div>
						</form>

					<?php else : ?>

						<p><?php esc_attr_e( 'Looks like you have run the setup wizard already.', 'wcb-configurator-builder' ); ?><br><?php esc_attr_e( 'Please head over to the WCB Settings page to customize your settings.', 'wcb-configurator-builder' ); ?></p>

						<?php if ( current_user_can( 'manage_options' ) ) : ?>

							<a href="<?php echo esc_url( admin_url( 'edit.php?post_type=wpcb_configuration&page=wpcb-settings' ) ); ?>" class="wpcb-button"><?php esc_attr_e( 'View settings', 'wcb-configurator-builder' ); ?></a>

						<?php endif; ?>

					<?php endif; ?>
				</div>
			</div>

		<?php else : ?>

			<div class="wpcb-page-header">
				<div class="wpcb-page-logo">
					<img src="<?php echo esc_url( WPCB_BASE_URL ); ?>admin/img/wcb-logo-alt.png" height="91" width="170" alt="WCB">
				</div>
			</div>

			<div class="wpcb-page-form-wrapper">
				<div class="wpcb-page-form-nav">
					<?php
					$steps = array(
						1 => __( 'General', 'wcb-configurator-builder' ),
						2 => __( 'Configuration', 'wcb-configurator-builder' ),
						3 => __( 'Appearance', 'wcb-configurator-builder' ),
						4 => __( 'Labels', 'wcb-configurator-builder' ),
						5 => __( 'Pricing', 'wcb-configurator-builder' ),
						6 => __( 'Extras', 'wcb-configurator-builder' ),
					);
					foreach ( $steps as $step_id => $step_label ) {
						$active = $step_id == $current_page ? ' active' : '';
						echo '<strong class="wpcb-page-form-nav-title' . esc_attr( $active ) . '">' . esc_attr( $step_id ) . '. <span>' . esc_attr( $step_label ) . '</span></strong>';
					}
					?>
				</div>

				<form id="form-step-1" class="wpcb-page-form<?php echo $current_page == 1 ? ' active' : ''; ?>" method="post" action="<?php echo esc_url( admin_url('edit.php?post_type=wpcb_configuration&page=setup' ) ); ?>">
					<div class="wpcb-page-form-content">
						<div class="wpcb-page-form-row">
							<strong><?php esc_attr_e( 'Gallery', 'wcb-configurator-builder' ); ?></strong>
							<div class="wpcb-page-form-field wpcb-page-form-field--image">
								<label for="wpcb_configuration_visual_2d">
									<input type="radio" id="wpcb_configuration_visual_2d" name="wpcb_configuration_visual_type" value="image"<?php echo wpcb_get_option('wpcb_configuration_visual_type') == 'image' ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<img src="<?php echo esc_url( WPCB_BASE_URL ); ?>/admin/img/image.png" alt="2D" height="302">
										<p><?php esc_attr_e( 'Images', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Build visual configurations using regular images', 'wcb-configurator-builder' ); ?></small>
									</div>
								</label>
								<label for="wpcb_configuration_visual_3d">
									<input type="radio" id="wpcb_configuration_visual_3d" name="wpcb_configuration_visual_type" value="model"<?php echo wpcb_get_option('wpcb_configuration_visual_type') == 'model' ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<img src="<?php echo esc_url( WPCB_BASE_URL ); ?>/admin/img/model.png" alt="3D" height="302">
										<p><?php esc_attr_e( '3D models', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Build visual configurations using 3D models', 'wcb-configurator-builder' ); ?></small>
									</div>
								</label>
							</div>
						</div>

						<div class="wpcb-page-form-row">
							<strong><?php esc_attr_e( 'Loader', 'wcb-configurator-builder' ); ?></strong>
							<div class="wpcb-page-form-field">

								<label for="wpcb_show_loader_indicator">
									<input type="checkbox" id="wpcb_show_loader_indicator" name="wpcb_show_loader_indicator" value="yes"<?php echo wpcb_get_option('wpcb_show_loader_indicator') ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<p><?php esc_attr_e( 'Show loader', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Show gallery loading indicator on option change', 'wcb-configurator-builder' ); ?></small>
									</div>
								</label>

							</div>
						</div>

						<div class="wpcb-page-form-row">
							<strong><?php esc_attr_e( 'Descriptions', 'wcb-configurator-builder' ); ?></strong>
							<div class="wpcb-page-form-field wpcb-page-form-field--image">
								<label for="wpcb_panel_view_type_panel">
									<input type="radio" id="wpcb_panel_view_type_panel" name="wpcb_panel_view_type" value="panel"<?php echo wpcb_get_option('wpcb_panel_view_type') == 'panel' ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<img src="<?php echo esc_url( WPCB_BASE_URL ); ?>/admin/img/panel.png" alt="Panel" height="302">
										<p><?php esc_attr_e( 'Panel', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Show descriptions in side panels', 'wcb-configurator-builder' ); ?></small>
									</div>
								</label>
								<label for="wpcb_panel_view_type_popup">
									<input type="radio" id="wpcb_panel_view_type_popup" name="wpcb_panel_view_type" value="popup"<?php echo wpcb_get_option('wpcb_panel_view_type') == 'popup' ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<img src="<?php echo esc_url( WPCB_BASE_URL ); ?>/admin/img/popup.png" alt="Popup" height="302">
										<p><?php esc_attr_e( 'Popup', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Show descriptions in centered popups', 'wcb-configurator-builder' ); ?></small>
									</div>
								</label>
							</div>
						</div>

						<div class="wpcb-page-form-actions">
							<span></span>
							<button type="submit" name="step" value="2" class="wpcb-button"><?php echo esc_attr( $steps['2'] ); ?> ></button>
						</div>
					</div>
				</form>

				<form id="form-step-2" class="wpcb-page-form<?php echo $current_page == 2 ? ' active' : ''; ?>" method="post" action="<?php echo esc_url( admin_url('edit.php?post_type=wpcb_configuration&page=setup') ); ?>">
					<div class="wpcb-page-form-content">

						<div class="wpcb-page-form-row">
							<strong><?php esc_attr_e( 'Options', 'wcb-configurator-builder' ); ?></strong>
							<div class="wpcb-page-form-field">

								<label for="wpcb_show_values_inline">
									<input type="checkbox" id="wpcb_show_values_inline" name="wpcb_show_values_inline" value="yes"<?php echo wpcb_get_option('wpcb_show_values_inline') ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<p><?php esc_attr_e( 'Show values after label', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Show selected option values inline after attribute label', 'wcb-configurator-builder' ); ?></small>
									</div>
								</label>

								<label for="wpcb_load_default_options">
									<input type="checkbox" id="wpcb_load_default_options" name="wpcb_load_default_options" value="yes"<?php echo wpcb_get_option('wpcb_load_default_options') ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<p><?php esc_attr_e( 'Check options', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Make first available options active on load', 'wcb-configurator-builder' ); ?></small>
									</div>
								</label>

								<label for="wpcb_allow_uncheck_options">
									<input type="checkbox" id="wpcb_allow_uncheck_options" name="wpcb_allow_uncheck_options" value="yes"<?php echo wpcb_get_option('wpcb_allow_uncheck_options') ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<p><?php esc_attr_e( 'Allow uncheck options', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Allow customers to uncheck optional form options', 'wcb-configurator-builder' ); ?></small>
									</div>
								</label>

								<label for="wpcb_collapse_attribute_on_value">
									<input type="checkbox" id="wpcb_collapse_attribute_on_value" name="wpcb_collapse_attribute_on_value" value="yes"<?php echo wpcb_get_option('wpcb_collapse_attribute_on_value') ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<p><?php esc_attr_e( 'Close collapsible attributes on value select', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Closes the current attribute automatically on attribute value select.', 'wcb-configurator-builder' ); ?></small>
									</div>
								</label>

								<label for="wpcb_enable_option_notes">
									<input type="checkbox" id="wpcb_enable_option_notes" name="wpcb_enable_option_notes" value="yes"<?php echo wpcb_get_option('wpcb_enable_option_notes') ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<p><?php esc_attr_e( 'Show option notes', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Enable notes to include short additional discriptions', 'wcb-configurator-builder' ); ?></small>
									</div>
								</label>

								<label for="wpcb_enable_option_descriptions">
									<input type="checkbox" id="wpcb_enable_option_descriptions" name="wpcb_enable_option_descriptions" value="yes"<?php echo wpcb_get_option('wpcb_enable_option_descriptions') ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<p><?php esc_attr_e( 'Show option descriptions', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Enable descriptions to include a detailed description for each choice option', 'wcb-configurator-builder' ); ?></small>
									</div>
								</label>

								<label for="wpcb_url_option_disable_click">
									<input type="checkbox" id="wpcb_url_option_disable_click" name="wpcb_url_option_disable_click" value="yes"<?php echo wpcb_get_option('wpcb_url_option_disable_click') ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<p><?php esc_attr_e( 'Disable click for URL options', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Removes the default click handler for URL options so you can handle the link your own way', 'wcb-configurator-builder' ); ?></small>
									</div>
								</label>
								
								<label for="wpcb_url_option_new_tab">
									<input type="checkbox" id="wpcb_url_option_new_tab" name="wpcb_url_option_new_tab" value="yes"<?php echo wpcb_get_option('wpcb_url_option_new_tab') ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<p><?php esc_attr_e( 'Open in new tab', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Open URL options in a new tab.', 'wcb-configurator-builder' ); ?></small>
									</div>
								</label>

							</div>
						</div>

						<div class="wpcb-page-form-row">
							<strong><?php esc_attr_e( 'Description positions', 'wcb-configurator-builder' ); ?></strong>
							<div class="wpcb-page-form-field wpcb-page-form-field--input">

								<div class="wpcb-page-form-input">
									<label for="wpcb_default_summary_position"><p><?php esc_attr_e( 'Default options summary position', 'wcb-configurator-builder' ); ?></p></label>
									<select name="wpcb_default_summary_position" id="wpcb_default_summary_position">
										<option value="below"<?php echo wpcb_get_option('wpcb_default_summary_position') == 'below' ? ' selected' : ''; ?>><?php esc_attr_e( 'Show below options', 'wcb-configurator-builder' ); ?></option>
										<option value="above"<?php echo wpcb_get_option('wpcb_default_summary_position') == 'above' ? ' selected' : ''; ?>><?php esc_attr_e( 'Show above options', 'wcb-configurator-builder' ); ?></option>
									</select>
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_default_note_position"><p><?php esc_attr_e( 'Default short description position', 'wcb-configurator-builder' ); ?></p></label>
									<select name="wpcb_default_note_position" id="wpcb_default_note_position">
										<option value="below"<?php echo wpcb_get_option('wpcb_default_note_position') == 'below' ? ' selected' : ''; ?>><?php esc_attr_e( 'Show below options', 'wcb-configurator-builder' ); ?></option>
										<option value="above"<?php echo wpcb_get_option('wpcb_default_note_position') == 'above' ? ' selected' : ''; ?>><?php esc_attr_e( 'Show above options', 'wcb-configurator-builder' ); ?></option>
									</select>
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_default_description_button_position"><p><?php esc_attr_e( 'Default description button position', 'wcb-configurator-builder' ); ?></p></label>
									<select name="wpcb_default_description_button_position" id="wpcb_default_description_button_position">
										<option value="above"<?php echo wpcb_get_option('wpcb_default_description_button_position') == 'above' ? ' selected' : ''; ?>><?php esc_attr_e( 'Show above options', 'wcb-configurator-builder' ); ?></option>
										<option value="below"<?php echo wpcb_get_option('wpcb_default_description_button_position') == 'below' ? ' selected' : ''; ?>><?php esc_attr_e( 'Show below options', 'wcb-configurator-builder' ); ?></option>
									</select>
								</div>
								
								<div class="wpcb-page-form-input">
									<label for="wpcb_default_description_button_type"><p><?php esc_attr_e( 'Default description button type', 'wcb-configurator-builder' ); ?></p></label>
									<select name="wpcb_default_description_button_type" id="wpcb_default_description_button_type">
										<option value="icon"<?php echo wpcb_get_option('wpcb_default_description_button_type') == 'icon' ? ' selected' : ''; ?>><?php esc_attr_e( 'Icon', 'wcb-configurator-builder' ); ?></option>
										<option value="text"<?php echo wpcb_get_option('wpcb_default_description_button_type') == 'text' ? ' selected' : ''; ?>><?php esc_attr_e( 'Text', 'wcb-configurator-builder' ); ?></option>
										<option value="text_icon"<?php echo wpcb_get_option('wpcb_default_description_button_type') == 'text_icon' ? ' selected' : ''; ?>><?php esc_attr_e( 'Text icon', 'wcb-configurator-builder' ); ?></option>
										<option value="button"<?php echo wpcb_get_option('wpcb_default_description_button_type') == 'button' ? ' selected' : ''; ?>><?php esc_attr_e( 'Button', 'wcb-configurator-builder' ); ?></option>
										<option value="button_icon"<?php echo wpcb_get_option('wpcb_default_description_button_type') == 'button_icon' ? ' selected' : ''; ?>><?php esc_attr_e( 'Button icon', 'wcb-configurator-builder' ); ?></option>
									</select>
								</div>
							</div>
						</div>

						<div class="wpcb-page-form-actions">
							<button type="submit" name="step_prev" value="1" class="wpcb-button-outline">< <?php echo esc_attr( $steps['1'] ); ?></button>
							<button type="submit" name="step" value="3" class="wpcb-button"><?php echo esc_attr( $steps['3'] ); ?> ></button>
						</div>
					</div>
				</form>

				<form id="form-step-3" class="wpcb-page-form<?php echo $current_page == 3 ? ' active' : ''; ?>" method="post" action="<?php echo esc_url( admin_url('edit.php?post_type=wpcb_configuration&page=setup' ) ); ?>">
					<div class="wpcb-page-form-content">

						<div class="wpcb-page-form-row">
							<strong><?php esc_attr_e( 'Template colors', 'wcb-configurator-builder' ); ?></strong>
							<div class="wpcb-page-form-field wpcb-page-form-field--input">

								<div class="wpcb-page-form-input wpcb-page-form-input--color">
									<label for="wpcb_template_link_color"><p><?php esc_attr_e( 'Primary color', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_template_link_color" name="wpcb_template_link_color" value="<?php echo wpcb_get_option('wpcb_template_link_color') ? esc_attr( wpcb_get_option('wpcb_template_link_color' ) ) : '#1456A5'; ?>">
									<small><?php esc_attr_e( 'Main color for buttons, links and options', 'wcb-configurator-builder' ); ?></small>
								</div>

								<div class="wpcb-page-form-input wpcb-page-form-input--color">
									<label for="wpcb_template_border_color"><p><?php esc_attr_e( 'Border color', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_template_border_color" name="wpcb_template_border_color" value="<?php echo wpcb_get_option('wpcb_template_border_color') ? esc_attr( wpcb_get_option('wpcb_template_border_color' ) ) : '#cccccc'; ?>">
									<small><?php esc_attr_e( 'Border colors for options and inputs', 'wcb-configurator-builder' ); ?></small>
								</div>

								<div class="wpcb-page-form-input wpcb-page-form-input--color">
									<label for="wpcb_primary_color"><p><?php esc_attr_e( 'Background color', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_primary_color" name="wpcb_primary_color" value="<?php echo wpcb_get_option('wpcb_primary_color') ? esc_attr( wpcb_get_option('wpcb_primary_color' ) ) : '#ffffff'; ?>">
									<small><?php esc_attr_e( 'Main configuration background color', 'wcb-configurator-builder' ); ?></small>
								</div>

								<div class="wpcb-page-form-input wpcb-page-form-input--color">
									<label for="wpcb_accent_color"><p><?php esc_attr_e( 'Accent color', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_accent_color" name="wpcb_accent_color" value="<?php echo wpcb_get_option('wpcb_accent_color') ? esc_attr( wpcb_get_option('wpcb_accent_color' ) ) : '#F4F5F7'; ?>">
									<small><?php esc_attr_e( 'Accent color to complement the background color', 'wcb-configurator-builder' ); ?></small>
								</div>

							</div>
						</div>

						<div class="wpcb-page-form-row">
							<strong><?php esc_attr_e( 'Text colors', 'wcb-configurator-builder' ); ?></strong>
							<div class="wpcb-page-form-field wpcb-page-form-field--input">

								<div class="wpcb-page-form-input wpcb-page-form-input--color">
									<label for="wpcb_template_title_color"><p><?php esc_attr_e( 'Title color', 'wcb-configurator-builder' ); ?></p></label> 
									<input type="text" id="wpcb_template_title_color" name="wpcb_template_title_color" value="<?php echo wpcb_get_option('wpcb_template_title_color') ? esc_attr( wpcb_get_option('wpcb_template_title_color' ) ) : '#000000'; ?>">
								</div>

								<div class="wpcb-page-form-input wpcb-page-form-input--color">
									<label for="wpcb_template_color"><p><?php esc_attr_e( 'Text color', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_template_color" name="wpcb_template_color" value="<?php echo wpcb_get_option('wpcb_template_color') ? esc_attr( wpcb_get_option('wpcb_template_color') ) : '#333333'; ?>">
								</div>

							</div>
						</div>

						<div class="wpcb-page-form-row">
							<strong><?php esc_attr_e( 'Fonts', 'wcb-configurator-builder' ); ?></strong>
							<div class="wpcb-page-form-field wpcb-page-form-field--input">

								<div class="wpcb-page-form-input">
									<label for="wpcb_title_font_family"><p><?php esc_attr_e( 'Font family', 'wcb-configurator-builder' ); ?></p></label> 
									<input type="text" id="wpcb_title_font_family" name="wpcb_title_font_family" value="<?php echo wpcb_get_option('wpcb_title_font_family') ? esc_attr( wpcb_get_option('wpcb_title_font_family') ) : ''; ?>">
									<small><?php esc_attr_e( 'Enter full font family: "Open Sans", sans-serif', 'wcb-configurator-builder' ); ?></small>
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_title_font_weight"><p><?php esc_attr_e( 'Font weight', 'wcb-configurator-builder' ); ?></p></label> 
									<input type="text" id="wpcb_title_font_weight" name="wpcb_title_font_weight" value="<?php echo wpcb_get_option('wpcb_title_font_weight') ? esc_attr( wpcb_get_option('wpcb_title_font_weight') ) :  ''; ?>">
									<small><?php esc_attr_e( 'Enter CSS unit (700 or bold)', 'wcb-configurator-builder' ); ?></small>
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_title_font_size"><p><?php esc_attr_e( 'Title font size', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_title_font_size" name="wpcb_title_font_size" value="<?php echo wpcb_get_option('wpcb_title_font_size') ? esc_attr( wpcb_get_option('wpcb_title_font_size') ) :  ''; ?>">
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_text_font_size"><p><?php esc_attr_e( 'Text font size', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_text_font_size" name="wpcb_text_font_size" value="<?php echo wpcb_get_option('wpcb_text_font_size') ? esc_attr( wpcb_get_option('wpcb_text_font_size') ) : ''; ?>">
								</div>
							</div>
						</div>

						<div class="wpcb-page-form-row">
							<strong><?php esc_attr_e( 'Borders', 'wcb-configurator-builder' ); ?></strong>
							<div class="wpcb-page-form-field wpcb-page-form-field--image">
								<label for="wpcb_border_style_round">
									<input type="radio" id="wpcb_border_style_round" name="wpcb_border_style" value="rounded"<?php echo wpcb_get_option('wpcb_border_style') == 'rounded' ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<img src="<?php echo esc_url( WPCB_BASE_URL ); ?>/admin/img/border-round.png" alt="Rounded" height="302">
									</div>
								</label>
								<label for="wpcb_border_style_square">
									<input type="radio" id="wpcb_border_style_square" name="wpcb_border_style" value="square"<?php echo wpcb_get_option('wpcb_border_style') == 'square' ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<img src="<?php echo esc_url( WPCB_BASE_URL ); ?>/admin/img/border-square.png" alt="Square" height="302">
									</div>
								</label>
								<label for="wpcb_border_style_pill">
									<input type="radio" id="wpcb_border_style_pill" name="wpcb_border_style" value="pill"<?php echo wpcb_get_option('wpcb_border_style') == 'pill' ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<img src="<?php echo esc_url( WPCB_BASE_URL ); ?>/admin/img/border-pill.png" alt="Pill" height="302">
									</div>
								</label>
							</div>
						</div>

						<div class="wpcb-page-form-actions">
							<button type="submit" name="step_prev" value="2" class="wpcb-button-outline">< <?php echo esc_attr( $steps['2'] ); ?></button>
							<button type="submit" name="step" value="4" class="wpcb-button"><?php echo esc_attr( $steps['4'] ); ?> ></button>
						</div>
					</div>
				</form>

				<form id="form-step-4" class="wpcb-page-form<?php echo $current_page == 4 ? ' active' : ''; ?>" method="post" action="<?php echo esc_url( admin_url('edit.php?post_type=wpcb_configuration&page=setup' ) ); ?>">
					<div class="wpcb-page-form-content">

						<div class="wpcb-page-form-row">
							<strong><?php esc_attr_e( 'Button labels', 'wcb-configurator-builder' ); ?></strong>
							<div class="wpcb-page-form-field wpcb-page-form-field--input">
								<div class="wpcb-page-form-input">
									<label for="wpcb_button_loop_cart_text"><p><?php esc_attr_e( 'Configure button label', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_button_loop_cart_text" name="wpcb_button_loop_cart_text" value="" placeholder="<?php echo wpcb_get_option('wpcb_button_loop_cart_text') ? esc_attr( wpcb_get_option('wpcb_button_loop_cart_text') ) : __( 'Configure', 'wcb-configurator-builder' ); ?>">
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_button_cart_text"><p><?php esc_attr_e( 'Add to cart button label', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_button_cart_text" name="wpcb_button_cart_text" value="" placeholder="<?php echo wpcb_get_option('wpcb_button_cart_text') ? esc_attr( wpcb_get_option('wpcb_button_cart_text') ) : __( 'Add to cart', 'wcb-configurator-builder' ); ?>">
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_button_quote_text"><p><?php esc_attr_e( 'Request a quote button label', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_button_quote_text" name="wpcb_button_quote_text" value="" placeholder="<?php echo wpcb_get_option('wpcb_button_quote_text') ? esc_attr( wpcb_get_option('wpcb_button_quote_text') ) : __( 'Request a quote', 'wcb-configurator-builder' ); ?>">
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_button_email_text"><p><?php esc_attr_e( 'Email button label', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_button_email_text" name="wpcb_button_email_text" value="" placeholder="<?php echo wpcb_get_option('wpcb_button_email_text') ? esc_attr( wpcb_get_option('wpcb_button_email_text') ) : __( 'Send an email', 'wcb-configurator-builder' ); ?>">
								</div>
							</div>
						</div>

						<div class="wpcb-page-form-row">
							<strong><?php esc_attr_e( 'Gallery labels', 'wcb-configurator-builder' ); ?></strong>
							<div class="wpcb-page-form-field wpcb-page-form-field--input">
								<div class="wpcb-page-form-input">
									<label for="wpcb_button_capture_text"><p><?php esc_attr_e( 'Capture image button label', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_button_capture_text" name="wpcb_button_capture_text" value="" placeholder="<?php echo wpcb_get_option('wpcb_button_capture_text') ? esc_attr( wpcb_get_option('wpcb_button_capture_text') ) : __( 'Capture image', 'wcb-configurator-builder' ); ?>">
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_button_reset_text"><p><?php esc_attr_e( 'Reset button label', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_button_reset_text" name="wpcb_button_reset_text" value="" placeholder="<?php echo wpcb_get_option('wpcb_button_reset_text') ? esc_attr( wpcb_get_option('wpcb_button_reset_text') ) : __( 'Reset configuration', 'wcb-configurator-builder' ); ?>">
								</div>
							</div>
						</div>

						<div class="wpcb-page-form-row">
							<strong><?php esc_attr_e( 'Price labels', 'wcb-configurator-builder' ); ?></strong>
							<div class="wpcb-page-form-field wpcb-page-form-field--input">
								<div class="wpcb-page-form-input">
									<label for="wpcb_price_summary_text"><p><?php esc_attr_e( 'Price total prefix', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_price_summary_text" name="wpcb_price_summary_text" value="" placeholder="<?php echo wpcb_get_option('wpcb_button_loop_cart_text') ? esc_attr( wpcb_get_option('wpcb_button_loop_cart_text') ) : ''; ?>">
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_price_total_text"><p><?php esc_attr_e( 'Total price label', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_price_total_text" name="wpcb_price_total_text" value="" placeholder="<?php echo wpcb_get_option('wpcb_price_total_text') ? esc_attr( wpcb_get_option('wpcb_price_total_text') ) : __( 'Total price', 'wcb-configurator-builder' ); ?>">
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_price_subtotal_text"><p><?php esc_attr_e( 'Subtotal price label', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_price_subtotal_text" name="wpcb_price_subtotal_text" value="" placeholder="<?php echo wpcb_get_option('wpcb_price_subtotal_text') ? esc_attr( wpcb_get_option('wpcb_price_subtotal_text') ) : __( 'Subtotal price', 'wcb-configurator-builder' ); ?>">
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_price_option_total_text"><p><?php esc_attr_e( 'Option price label', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_price_option_total_text" name="wpcb_price_option_total_text" value="" placeholder="<?php echo wpcb_get_option('wpcb_price_option_total_text') ? esc_attr( wpcb_get_option('wpcb_price_option_total_text') ) : __( 'Option price', 'wcb-configurator-builder' ); ?>">
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_price_tax_total_text"><p><?php esc_attr_e( 'VAT price label', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_price_tax_total_text" name="wpcb_price_tax_total_text" value="" placeholder="<?php echo wpcb_get_option('wpcb_price_tax_total_text') ? esc_attr( wpcb_get_option('wpcb_price_tax_total_text') ) : __( 'VAT', 'wcb-configurator-builder' ); ?>">
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_price_product_total_text"><p><?php esc_attr_e( 'Product price label', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_price_product_total_text" name="wpcb_price_product_total_text" value="" placeholder="<?php echo wpcb_get_option('wpcb_price_product_total_text') ? esc_attr( wpcb_get_option('wpcb_price_product_total_text') ) : __( 'Product price', 'wcb-configurator-builder' ); ?>">
								</div>
							</div>
						</div>

						<div class="wpcb-page-form-actions">
							<button type="submit" name="step_prev" value="3" class="wpcb-button-outline">< <?php echo esc_attr( $steps['3'] ); ?></button>
							<button type="submit" name="step" value="5" class="wpcb-button"><?php echo esc_attr( $steps['5'] ); ?> ></button>
						</div>
					</div>
				</form>

				<form id="form-step-5" class="wpcb-page-form<?php echo $current_page == 5 ? ' active' : ''; ?>" method="post" action="<?php echo esc_url( admin_url('edit.php?post_type=wpcb_configuration&page=setup' ) ); ?>">
					<div class="wpcb-page-form-content">

						<div class="wpcb-page-form-row">
							<strong><?php esc_attr_e( 'Price format', 'wcb-configurator-builder' ); ?></strong>
							<div class="wpcb-page-form-field wpcb-page-form-field--input">
								<div class="wpcb-page-form-input">
									<label for="wpcb_price_currency_symbol"><p><?php esc_attr_e( 'Currency symbol', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_price_currency_symbol" name="wpcb_price_currency_symbol" value="" placeholder="<?php echo wpcb_get_option('wpcb_price_currency_symbol') ? esc_attr( wpcb_get_option('wpcb_price_currency_symbol') ) : ''; ?>">
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_price_thousand_sep"><p><?php esc_attr_e( 'Thousand separator', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_price_thousand_sep" name="wpcb_price_thousand_sep" value="" placeholder="<?php echo wpcb_get_option('wpcb_price_thousand_sep') ? esc_attr( wpcb_get_option('wpcb_price_thousand_sep') ) : ','; ?>">
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_price_decimal_sep"><p><?php esc_attr_e( 'Decimal separator', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_price_decimal_sep" name="wpcb_price_decimal_sep" value="" placeholder="<?php echo wpcb_get_option('wpcb_price_decimal_sep') ? esc_attr( wpcb_get_option('wpcb_price_decimal_sep') ) : '.'; ?>">
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_price_decimal_number"><p><?php esc_attr_e( 'Number of decimals', 'wcb-configurator-builder' ); ?></p></label>
									<input type="number" id="wpcb_price_decimal_number" name="wpcb_price_decimal_number" value="" placeholder="<?php echo wpcb_get_option('wpcb_price_decimal_number') ? esc_attr( wpcb_get_option('wpcb_price_decimal_number') ) : '2'; ?>">
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_price_currency_pos"><p><?php esc_attr_e( 'Symbol position', 'wcb-configurator-builder' ); ?></p></label>
									<select name="wpcb_price_currency_pos" id="wpcb_price_currency_pos">
										<option value="left_space"<?php echo 'left_space' == wpcb_get_option('wpcb_price_currency_pos') ? ' selected': ''; ?>><?php esc_attr_e( 'Left with a space', 'wcb-configurator-builder' ); ?></option>
										<option value="left"<?php echo 'left' == wpcb_get_option('wpcb_price_currency_pos') ? ' selected': ''; ?>><?php esc_attr_e( 'Left', 'wcb-configurator-builder' ); ?></option>
										<option value="right_space"<?php echo 'right_space' == wpcb_get_option('wpcb_price_currency_pos') ? ' selected': ''; ?>><?php esc_attr_e( 'Right with a space', 'wcb-configurator-builder' ); ?></option>
										<option value="right"<?php echo 'right' == wpcb_get_option('wpcb_price_currency_pos') ? ' selected': ''; ?>><?php esc_attr_e( 'Right', 'wcb-configurator-builder' ); ?></option>
									</select>
								</div>

								<div class="wpcb-page-form-input">
									<label for="wpcb_free_price_label"><p><?php esc_attr_e( 'Free price label', 'wcb-configurator-builder' ); ?></p></label>
									<input type="text" id="wpcb_free_price_label" name="wpcb_free_price_label" value="" placeholder="<?php echo wpcb_get_option('wpcb_free_price_label') ? esc_attr( wpcb_get_option('wpcb_free_price_label') ) : ''; ?>">
									<small><?php esc_attr_e( 'Optionally indicate free options with a label (e.g. Included)', 'wcb-configurator-builder' ); ?></small>
								</div>
							</div>
						</div>

						<div class="wpcb-page-form-row">
							<strong><?php esc_attr_e( 'Price options', 'wcb-configurator-builder' ); ?></strong>
							<div class="wpcb-page-form-field">
								
								<label for="wpcb_extra_price_plus_prefix">
									<input type="checkbox" id="wpcb_extra_price_plus_prefix" name="wpcb_extra_price_plus_prefix" value="yes"<?php echo wpcb_get_option('wpcb_extra_price_plus_prefix') ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<p><?php esc_attr_e( 'Mark additional costs', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Display plus sign for additional costs', 'wcb-configurator-builder' ); ?></small>
									</div>
								</label>

								<label for="wpcb_exclude_product_base_prices">
									<input type="checkbox" id="wpcb_exclude_product_base_prices" name="wpcb_exclude_product_base_prices" value="yes"<?php echo wpcb_get_option('wpcb_exclude_product_base_prices') ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<p><?php esc_attr_e( 'Exclude base product price', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Exclude base product price in regular price calculations', 'wcb-configurator-builder' ); ?></small>
									</div>
								</label>

								<label for="wpcb_show_price_option_difference">
									<input type="checkbox" id="wpcb_show_price_option_difference" name="wpcb_show_price_option_difference" value="yes"<?php echo wpcb_get_option('wpcb_show_price_option_difference') ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<p><?php esc_attr_e( 'Only show price difference in options', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Shows difference in price options regarding other options instead of full option price', 'wcb-configurator-builder' ); ?></small>
									</div>
								</label>

								<label for="wpcb_show_single_price_total">
									<input type="checkbox" id="wpcb_show_single_price_total" name="wpcb_show_single_price_total" value="yes"<?php echo wpcb_get_option('wpcb_show_single_price_total') ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<p><?php esc_attr_e( 'Show single quantity price', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Show configuration total price based on single product quantity', 'wcb-configurator-builder' ); ?></small>
									</div>
								</label>

								<label for="wpcb_base_unit_price_on_min_value">
									<input type="checkbox" id="wpcb_base_unit_price_on_min_value" name="wpcb_base_unit_price_on_min_value" value="yes"<?php echo wpcb_get_option('wpcb_base_unit_price_on_min_value') ? ' checked' : ''; ?>>
									<div class="wpcb-page-form-option">
										<p><?php esc_attr_e( 'Base unit price on minimum allowed input value', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Charges unit price costs based on input minimum value instead of zero', 'wcb-configurator-builder' ); ?></small>
									</div>
								</label>

							</div>
						</div>

						<div class="wpcb-page-form-actions">
							<button type="submit" name="step_prev" value="4" class="wpcb-button-outline">< <?php echo esc_attr( $steps['4'] ); ?></button>
							<button type="submit" name="step" value="6" class="wpcb-button"><?php echo esc_attr( $steps['6'] ); ?> ></button>
						</div>
					</div>
				</form>

				<form id="form-step-6" class="wpcb-page-form<?php echo $current_page == 6 ? ' active' : ''; ?>" method="post" action="<?php echo esc_url( admin_url('edit.php?post_type=wpcb_configuration&page=setup' ) ); ?>">
					<div class="wpcb-page-form-content">

						<?php if ( ! wpcb_fs()->is_plan_or_trial( 'pro' ) ) : ?>

							<div class="wpcb-page-form-row">
								<strong><?php esc_attr_e( 'Do more with WCB', 'wcb-configurator-builder' ); ?></strong>

								<div class="wpcb-page-form-links">
									<div class="wpcb-page-form-link">
										<div class="wpcb-page-form-link-text">
											<p><?php esc_attr_e( 'Start 14-day free trial', 'wcb-configurator-builder' ); ?></p>
											<small><?php esc_attr_e( 'Try out all our amazing plugin functions risk-free for 14 days. No credit card required', 'wcb-configurator-builder' ); ?></small>
										</div>
										<a href="<?php echo esc_url( wpcb_fs()->get_trial_url() ); ?>" target="_blank" class="wpcb-button">
											<?php esc_attr_e( 'Start 14-day free trial', 'wcb-configurator-builder' ); ?>
										</a>
									</div>

									<div class="wpcb-page-form-link">
										<div class="wpcb-page-form-link-text">
											<p><?php esc_attr_e( 'Explore add-ons', 'wcb-configurator-builder' ); ?></p>
											<small><?php esc_attr_e( 'Check out our amazing add-ons to extend the WCB plugin capabilities', 'wcb-configurator-builder' ); ?></small>
										</div>
										<a href="https://wpconfiguratorbuilder.com/add-ons/" target="_blank" class="wpcb-button">
											<?php esc_attr_e( 'Explore add-ons', 'wcb-configurator-builder' ); ?>
										</a>
									</div>
								</div>
							</div>

						<?php endif; ?>

						<div class="wpcb-page-form-row">
							<strong><?php esc_attr_e( 'Next up', 'wcb-configurator-builder' ); ?></strong>
							<div class="wpcb-page-form-links">

								<div class="wpcb-page-form-link">
									<div class="wpcb-page-form-link-text">
										<p><?php esc_attr_e( 'Visit WCB dashboard page', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Get ready to publish your first product configuration', 'wcb-configurator-builder' ); ?></small>
									</div>
									<a href="<?php echo esc_url( admin_url( 'edit.php?post_type=wpcb_configuration&page=welcome' ) ); ?>" class="wpcb-button-outline">
										<?php esc_attr_e( 'Go to dashboard', 'wcb-configurator-builder' ); ?>
									</a>
								</div>

								<?php if ( current_user_can( 'manage_options' ) ) : ?>
										
									<div class="wpcb-page-form-link">
										<div class="wpcb-page-form-link-text">
											<p><?php esc_attr_e( 'Review plugin settings', 'wcb-configurator-builder' ); ?></p>
											<small><?php esc_attr_e( 'Customize all WCB configurator builder settings.', 'wcb-configurator-builder' ); ?></small>
										</div>
										<a href="<?php echo esc_url( admin_url( 'edit.php?post_type=wpcb_configuration&page=wpcb-settings' ) ); ?>" class="wpcb-button-outline">
											<?php esc_attr_e( 'Update settings', 'wcb-configurator-builder' ); ?>
										</a>
									</div>

								<?php endif; ?>

								<div class="wpcb-page-form-link">
									<div class="wpcb-page-form-link-text">
										<p><?php esc_attr_e( 'Import demo configuration', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Import a demo configuration to better understand how the configuration is set up.', 'wcb-configurator-builder' ); ?></small>
									</div>
									<a href="<?php echo esc_url( admin_url( 'edit.php?post_type=wpcb_configuration&method=import_demo' ) ); ?>" class="wpcb-button-outline">
										<?php esc_attr_e( 'Run import', 'wcb-configurator-builder' ); ?>
									</a>
								</div>

								<div class="wpcb-page-form-link">
									<div class="wpcb-page-form-link-text">
										<p><?php esc_attr_e( 'Read documentation', 'wcb-configurator-builder' ); ?></p>
										<small><?php esc_attr_e( 'Check out our extensive documentation guides', 'wcb-configurator-builder' ); ?></small>
									</div>
									<a href="https://wpconfiguratorbuilder.com/docs/" target="_blank" class="wpcb-button-outline">
										<?php esc_attr_e( 'Read the docs', 'wcb-configurator-builder' ); ?>
									</a>
								</div>

							</div>
						</div>

						<?php
						if ( ! get_option( '_wpcb_setup_run' ) ) {
							?>
							<div class="wpcb-page-form-actions">
								<button type="submit" name="step_prev" value="5" class="wpcb-button-outline">< <?php echo esc_attr( $steps['5'] ); ?></button>
								<button type="submit" name="finish" value="yes" class="wpcb-button"><?php esc_attr_e( 'Finish setup', 'wcb-configurator-builder' ); ?></button>
							</div>
							<?php
						}
						?>

					</div>
				</form>

				<?php 
				if ($current_page != 6): 
					?>

					<div class="wpcb-page-footer">
						<form method="post" action="<?php echo esc_url( admin_url('edit.php?post_type=wpcb_configuration&page=setup' ) ); ?>">
							<button type="submit" name="skip" value="yes" class="wpcb-button-outline"><?php esc_attr_e( 'Skip setup', 'wcb-configurator-builder' ); ?></button>
						</form>
					</div>

					<?php
				endif;
				?>

			</div>

		<?php endif; ?>

	</div>
</div>
