<?php
/**
 * Ready-made Basic Forms templates.
 *
 * @package BasicForms
 */

namespace BasicForms;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class FormTemplates {

	/**
	 * @return array<string, array{label: string, icon: string, description: string}>
	 */
	public static function getCategories(): array {
		$categories = [
			'contact' => [
				'label'       => __( 'Contact', 'wppowersuite-lite' ),
				'icon'        => 'dashicons-email',
				'description' => __( 'General contact and inquiry forms.', 'wppowersuite-lite' ),
			],
			'lead'    => [
				'label'       => __( 'Lead Generation', 'wppowersuite-lite' ),
				'icon'        => 'dashicons-megaphone',
				'description' => __( 'Capture leads, quotes, and sign-ups.', 'wppowersuite-lite' ),
			],
			'support' => [
				'label'       => __( 'Support', 'wppowersuite-lite' ),
				'icon'        => 'dashicons-sos',
				'description' => __( 'Help desk, feedback, and bug reports.', 'wppowersuite-lite' ),
			],
			'events'  => [
				'label'       => __( 'Events', 'wppowersuite-lite' ),
				'icon'        => 'dashicons-calendar-alt',
				'description' => __( 'RSVPs, registrations, and volunteers.', 'wppowersuite-lite' ),
			],
			'hr'      => [
				'label'       => __( 'HR & Careers', 'wppowersuite-lite' ),
				'icon'        => 'dashicons-id',
				'description' => __( 'Applications and internal feedback.', 'wppowersuite-lite' ),
			],
			'business' => [
				'label'       => __( 'Business', 'wppowersuite-lite' ),
				'icon'        => 'dashicons-store',
				'description' => __( 'Product and wholesale inquiries.', 'wppowersuite-lite' ),
			],
		];

		/**
		 * @param array<string, array{label: string, icon: string, description: string}> $categories
		 */
		return apply_filters( 'wpps_basic_forms_template_categories', $categories );
	}

	/**
	 * @return list<array<string, mixed>>
	 */
	public static function getAll(): array {
		/**
		 * @param list<array<string, mixed>> $templates
		 */
		return apply_filters( 'wpps_basic_forms_templates', self::builtInTemplates() );
	}

	/**
	 * @return array<string, mixed>|null
	 */
	public static function getById( string $id ): ?array {
		$id = sanitize_key( $id );
		foreach ( self::getAll() as $template ) {
			if ( isset( $template['id'] ) && sanitize_key( (string) $template['id'] ) === $id ) {
				return $template;
			}
		}
		return null;
	}

	/**
	 * @return array<string, list<array<string, mixed>>>
	 */
	public static function getGroupedByCategory(): array {
		$grouped  = [];
		$fallback = 'contact';
		foreach ( self::getCategories() as $slug => $_meta ) {
			$grouped[ $slug ] = [];
		}
		foreach ( self::getAll() as $template ) {
			$cat = isset( $template['category'] ) ? sanitize_key( (string) $template['category'] ) : $fallback;
			if ( ! isset( $grouped[ $cat ] ) ) {
				$grouped[ $cat ] = [];
			}
			$grouped[ $cat ][] = $template;
		}
		return $grouped;
	}

	/**
	 * @param array<string, mixed> $overrides
	 * @return array<string, mixed>
	 */
	private static function field( int $id, string $type, string $label, array $overrides = [] ): array {
		$slug = sanitize_title( $label );
		if ( $slug === '' ) {
			$slug = 'field';
		}

		return array_merge(
			[
				'id'          => $id,
				'type'        => $type,
				'label'       => $label,
				'placeholder' => '',
				'description' => '',
				'options'     => '',
				'required'    => false,
				'field_id'    => $slug . '_' . $id,
				'help'        => '',
				'width'       => '',
			],
			$overrides
		);
	}

	/**
	 * @param list<array<string, mixed>> $fields
	 * @return list<array<string, mixed>>
	 */
	private static function settings( string $subject, string $success, string $submit = '' ): array {
		$out = [
			'subject'          => $subject,
			'success_message'  => $success,
			'captcha_provider' => 'simple',
		];
		if ( $submit !== '' ) {
			$out['submit_button_text'] = $submit;
		}
		return $out;
	}

	/**
	 * @return list<array<string, mixed>>
	 */
	private static function builtInTemplates(): array {
		$site = get_bloginfo( 'name' );

		return [
			[
				'id'          => 'contact-simple',
				'name'        => __( 'Simple Contact', 'wppowersuite-lite' ),
				'description' => __( 'Name, email, and message — ideal for a basic contact page.', 'wppowersuite-lite' ),
				'category'    => 'contact',
				'icon'        => 'dashicons-email-alt',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wppowersuite-lite' ), [ 'required' => true, 'placeholder' => __( 'Your name', 'wppowersuite-lite' ), 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wppowersuite-lite' ), [ 'required' => true, 'placeholder' => __( 'you@example.com', 'wppowersuite-lite' ), 'width' => 'half' ] ),
					self::field( 2, 'textarea', __( 'Message', 'wppowersuite-lite' ), [ 'required' => true, 'rows' => '5', 'placeholder' => __( 'How can we help?', 'wppowersuite-lite' ) ] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'New contact message from %s', 'wppowersuite-lite' ), $site ),
					__( 'Thank you! We received your message and will reply soon.', 'wppowersuite-lite' ),
					__( 'Send Message', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'contact-detailed',
				'name'        => __( 'Detailed Contact', 'wppowersuite-lite' ),
				'description' => __( 'Contact form with phone and a subject dropdown.', 'wppowersuite-lite' ),
				'category'    => 'contact',
				'icon'        => 'dashicons-forms',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'phone', __( 'Phone', 'wppowersuite-lite' ), [ 'width' => 'half' ] ),
					self::field( 3, 'select', __( 'Subject', 'wppowersuite-lite' ), [
						'required'    => true,
						'width'       => 'half',
						'options'     => __( "General inquiry\nSales\nSupport\nPartnership", 'wppowersuite-lite' ),
						'empty_label' => __( 'Choose a subject', 'wppowersuite-lite' ),
					] ),
					self::field( 4, 'textarea', __( 'Message', 'wppowersuite-lite' ), [ 'required' => true, 'rows' => '5' ] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Contact form submission from %s', 'wppowersuite-lite' ), $site ),
					__( 'Thanks for reaching out. We will get back to you shortly.', 'wppowersuite-lite' ),
					__( 'Submit', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'contact-company',
				'name'        => __( 'Business Contact', 'wppowersuite-lite' ),
				'description' => __( 'Collect company details alongside contact info.', 'wppowersuite-lite' ),
				'category'    => 'contact',
				'icon'        => 'dashicons-building',
				'fields'      => [
					self::field( 0, 'text', __( 'Full Name', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'text', __( 'Company', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'email', __( 'Work Email', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 3, 'phone', __( 'Phone', 'wppowersuite-lite' ), [ 'width' => 'half' ] ),
					self::field( 4, 'textarea', __( 'How can we help?', 'wppowersuite-lite' ), [ 'required' => true, 'rows' => '4' ] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Business inquiry from %s', 'wppowersuite-lite' ), $site ),
					__( 'Thank you! A team member will contact you soon.', 'wppowersuite-lite' ),
					__( 'Send Inquiry', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'contact-appointment',
				'name'        => __( 'Appointment Request', 'wppowersuite-lite' ),
				'description' => __( 'Let visitors request a call or meeting time.', 'wppowersuite-lite' ),
				'category'    => 'contact',
				'icon'        => 'dashicons-clock',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'phone', __( 'Phone', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 3, 'date', __( 'Preferred Date', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 4, 'time', __( 'Preferred Time', 'wppowersuite-lite' ), [ 'width' => 'half' ] ),
					self::field( 5, 'textarea', __( 'Notes', 'wppowersuite-lite' ), [ 'rows' => '3', 'placeholder' => __( 'Anything we should know?', 'wppowersuite-lite' ) ] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Appointment request from %s', 'wppowersuite-lite' ), $site ),
					__( 'Thanks! We will confirm your appointment by email.', 'wppowersuite-lite' ),
					__( 'Request Appointment', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'newsletter-signup',
				'name'        => __( 'Newsletter Signup', 'wppowersuite-lite' ),
				'description' => __( 'Minimal email list signup form.', 'wppowersuite-lite' ),
				'category'    => 'lead',
				'icon'        => 'dashicons-email',
				'fields'      => [
					self::field( 0, 'html', '', [
						'content' => '<p>' . esc_html__( 'Subscribe for updates, tips, and news.', 'wppowersuite-lite' ) . '</p>',
					] ),
					self::field( 1, 'text', __( 'First Name', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'email', __( 'Email', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Newsletter signup on %s', 'wppowersuite-lite' ), $site ),
					__( 'You are subscribed. Welcome aboard!', 'wppowersuite-lite' ),
					__( 'Subscribe', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'quote-request',
				'name'        => __( 'Quote Request', 'wppowersuite-lite' ),
				'description' => __( 'Capture project details for a custom quote.', 'wppowersuite-lite' ),
				'category'    => 'lead',
				'icon'        => 'dashicons-calculator',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'text', __( 'Company', 'wppowersuite-lite' ), [ 'width' => 'half' ] ),
					self::field( 3, 'select', __( 'Service Needed', 'wppowersuite-lite' ), [
						'required'    => true,
						'width'       => 'half',
						'options'     => __( "Web design\nDevelopment\nMarketing\nConsulting\nOther", 'wppowersuite-lite' ),
						'empty_label' => __( 'Select a service', 'wppowersuite-lite' ),
					] ),
					self::field( 4, 'select', __( 'Budget Range', 'wppowersuite-lite' ), [
						'options'     => __( "Under $1,000\n$1,000 – $5,000\n$5,000 – $10,000\n$10,000+", 'wppowersuite-lite' ),
						'empty_label' => __( 'Select budget', 'wppowersuite-lite' ),
					] ),
					self::field( 5, 'textarea', __( 'Project Details', 'wppowersuite-lite' ), [ 'required' => true, 'rows' => '5' ] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Quote request from %s', 'wppowersuite-lite' ), $site ),
					__( 'Thank you! We will send your quote within 1–2 business days.', 'wppowersuite-lite' ),
					__( 'Request Quote', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'demo-request',
				'name'        => __( 'Demo Request', 'wppowersuite-lite' ),
				'description' => __( 'Schedule a product demo with your sales team.', 'wppowersuite-lite' ),
				'category'    => 'lead',
				'icon'        => 'dashicons-desktop',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Work Email', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'text', __( 'Company', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 3, 'phone', __( 'Phone', 'wppowersuite-lite' ), [ 'width' => 'half' ] ),
					self::field( 4, 'date', __( 'Preferred Demo Date', 'wppowersuite-lite' ), [ 'width' => 'half' ] ),
					self::field( 5, 'textarea', __( 'What would you like to see?', 'wppowersuite-lite' ), [ 'rows' => '4' ] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Demo request from %s', 'wppowersuite-lite' ), $site ),
					__( 'Thanks! Our team will confirm your demo shortly.', 'wppowersuite-lite' ),
					__( 'Book Demo', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'callback-request',
				'name'        => __( 'Callback Request', 'wppowersuite-lite' ),
				'description' => __( 'Quick form for phone callback requests.', 'wppowersuite-lite' ),
				'category'    => 'lead',
				'icon'        => 'dashicons-phone',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'phone', __( 'Phone Number', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'select', __( 'Best Time to Call', 'wppowersuite-lite' ), [
						'required'    => true,
						'options'     => __( "Morning\nAfternoon\nEvening", 'wppowersuite-lite' ),
						'empty_label' => __( 'Select a time', 'wppowersuite-lite' ),
					] ),
					self::field( 3, 'text', __( 'Topic', 'wppowersuite-lite' ), [ 'placeholder' => __( 'Brief reason for your call', 'wppowersuite-lite' ) ] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Callback request from %s', 'wppowersuite-lite' ), $site ),
					__( 'Got it! We will call you at the time you selected.', 'wppowersuite-lite' ),
					__( 'Request Callback', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'support-ticket',
				'name'        => __( 'Support Ticket', 'wppowersuite-lite' ),
				'description' => __( 'Structured help desk submission form.', 'wppowersuite-lite' ),
				'category'    => 'support',
				'icon'        => 'dashicons-tickets-alt',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'select', __( 'Priority', 'wppowersuite-lite' ), [
						'required'    => true,
						'width'       => 'half',
						'options'     => __( "Low\nNormal\nHigh\nUrgent", 'wppowersuite-lite' ),
						'empty_label' => __( 'Select priority', 'wppowersuite-lite' ),
					] ),
					self::field( 3, 'text', __( 'Subject', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 4, 'textarea', __( 'Describe the issue', 'wppowersuite-lite' ), [ 'required' => true, 'rows' => '6' ] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Support ticket from %s', 'wppowersuite-lite' ), $site ),
					__( 'Your support ticket was submitted. We will respond by email.', 'wppowersuite-lite' ),
					__( 'Submit Ticket', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'bug-report',
				'name'        => __( 'Bug Report', 'wppowersuite-lite' ),
				'description' => __( 'Collect reproduction steps and optional screenshots.', 'wppowersuite-lite' ),
				'category'    => 'support',
				'icon'        => 'dashicons-warning',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'url', __( 'Page URL', 'wppowersuite-lite' ), [ 'required' => true, 'placeholder' => 'https://' ] ),
					self::field( 3, 'text', __( 'Browser / Device', 'wppowersuite-lite' ), [ 'placeholder' => __( 'e.g. Chrome on Windows', 'wppowersuite-lite' ) ] ),
					self::field( 4, 'textarea', __( 'Steps to Reproduce', 'wppowersuite-lite' ), [ 'required' => true, 'rows' => '5' ] ),
					self::field( 5, 'file', __( 'Screenshot', 'wppowersuite-lite' ), [ 'file_types' => 'image/*', 'max_size' => '5' ] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Bug report from %s', 'wppowersuite-lite' ), $site ),
					__( 'Thank you for the report. Our team will investigate.', 'wppowersuite-lite' ),
					__( 'Report Bug', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'feature-request',
				'name'        => __( 'Feature Request', 'wppowersuite-lite' ),
				'description' => __( 'Let users suggest new product features.', 'wppowersuite-lite' ),
				'category'    => 'support',
				'icon'        => 'dashicons-lightbulb',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'text', __( 'Feature Title', 'wppowersuite-lite' ), [ 'required' => true ] ),
					self::field( 3, 'select', __( 'Importance', 'wppowersuite-lite' ), [
						'options'     => __( "Nice to have\nImportant\nCritical", 'wppowersuite-lite' ),
						'empty_label' => __( 'How important is this?', 'wppowersuite-lite' ),
					] ),
					self::field( 4, 'textarea', __( 'Feature Description', 'wppowersuite-lite' ), [ 'required' => true, 'rows' => '5' ] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Feature request from %s', 'wppowersuite-lite' ), $site ),
					__( 'Thanks for your suggestion! We review every request.', 'wppowersuite-lite' ),
					__( 'Submit Idea', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'customer-feedback',
				'name'        => __( 'Customer Feedback', 'wppowersuite-lite' ),
				'description' => __( 'Short satisfaction survey with rating.', 'wppowersuite-lite' ),
				'category'    => 'support',
				'icon'        => 'dashicons-star-filled',
				'fields'      => [
					self::field( 0, 'radio', __( 'Overall Rating', 'wppowersuite-lite' ), [
						'required' => true,
						'options'  => __( "Excellent\nGood\nAverage\nPoor", 'wppowersuite-lite' ),
					] ),
					self::field( 1, 'text', __( 'Name', 'wppowersuite-lite' ), [ 'width' => 'half' ] ),
					self::field( 2, 'email', __( 'Email', 'wppowersuite-lite' ), [ 'width' => 'half' ] ),
					self::field( 3, 'textarea', __( 'Your Feedback', 'wppowersuite-lite' ), [ 'required' => true, 'rows' => '4' ] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Customer feedback from %s', 'wppowersuite-lite' ), $site ),
					__( 'Thank you for your feedback!', 'wppowersuite-lite' ),
					__( 'Send Feedback', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'event-rsvp',
				'name'        => __( 'Event RSVP', 'wppowersuite-lite' ),
				'description' => __( 'Confirm attendance and guest count.', 'wppowersuite-lite' ),
				'category'    => 'events',
				'icon'        => 'dashicons-calendar',
				'fields'      => [
					self::field( 0, 'text', __( 'Full Name', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'number', __( 'Number of Guests', 'wppowersuite-lite' ), [ 'required' => true, 'min' => '1', 'max' => '10', 'default_value' => '1', 'width' => 'half' ] ),
					self::field( 3, 'select', __( 'Dietary Requirements', 'wppowersuite-lite' ), [
						'width'       => 'half',
						'options'     => __( "None\nVegetarian\nVegan\nGluten-free\nOther", 'wppowersuite-lite' ),
						'empty_label' => __( 'Select if applicable', 'wppowersuite-lite' ),
					] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Event RSVP from %s', 'wppowersuite-lite' ), $site ),
					__( 'Your RSVP is confirmed. See you at the event!', 'wppowersuite-lite' ),
					__( 'RSVP', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'event-registration',
				'name'        => __( 'Event Registration', 'wppowersuite-lite' ),
				'description' => __( 'Register attendees with ticket type selection.', 'wppowersuite-lite' ),
				'category'    => 'events',
				'icon'        => 'dashicons-tickets',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'phone', __( 'Phone', 'wppowersuite-lite' ), [ 'width' => 'half' ] ),
					self::field( 3, 'select', __( 'Ticket Type', 'wppowersuite-lite' ), [
						'required'    => true,
						'width'       => 'half',
						'options'     => __( "General Admission\nVIP\nStudent", 'wppowersuite-lite' ),
						'empty_label' => __( 'Choose ticket', 'wppowersuite-lite' ),
					] ),
					self::field( 4, 'text', __( 'Company / Organization', 'wppowersuite-lite' ) ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Event registration from %s', 'wppowersuite-lite' ), $site ),
					__( 'Registration complete! Check your email for details.', 'wppowersuite-lite' ),
					__( 'Register', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'workshop-signup',
				'name'        => __( 'Workshop Signup', 'wppowersuite-lite' ),
				'description' => __( 'Sign up for a workshop with experience level.', 'wppowersuite-lite' ),
				'category'    => 'events',
				'icon'        => 'dashicons-welcome-learn-more',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'select', __( 'Workshop', 'wppowersuite-lite' ), [
						'required'    => true,
						'options'     => __( "Intro Session\nIntermediate Session\nAdvanced Session", 'wppowersuite-lite' ),
						'empty_label' => __( 'Choose workshop', 'wppowersuite-lite' ),
					] ),
					self::field( 3, 'select', __( 'Experience Level', 'wppowersuite-lite' ), [
						'required'    => true,
						'options'     => __( "Beginner\nIntermediate\nAdvanced", 'wppowersuite-lite' ),
						'empty_label' => __( 'Your level', 'wppowersuite-lite' ),
					] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Workshop signup from %s', 'wppowersuite-lite' ), $site ),
					__( 'You are signed up! We will send workshop details by email.', 'wppowersuite-lite' ),
					__( 'Sign Up', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'volunteer-signup',
				'name'        => __( 'Volunteer Signup', 'wppowersuite-lite' ),
				'description' => __( 'Recruit volunteers with availability and skills.', 'wppowersuite-lite' ),
				'category'    => 'events',
				'icon'        => 'dashicons-groups',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'phone', __( 'Phone', 'wppowersuite-lite' ), [ 'width' => 'half' ] ),
					self::field( 3, 'select', __( 'Availability', 'wppowersuite-lite' ), [
						'required'    => true,
						'width'       => 'half',
						'options'     => __( "Weekdays\nWeekends\nBoth\nFlexible", 'wppowersuite-lite' ),
						'empty_label' => __( 'When can you help?', 'wppowersuite-lite' ),
					] ),
					self::field( 4, 'textarea', __( 'Skills & Interests', 'wppowersuite-lite' ), [ 'rows' => '4', 'placeholder' => __( 'Tell us how you would like to contribute', 'wppowersuite-lite' ) ] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Volunteer signup from %s', 'wppowersuite-lite' ), $site ),
					__( 'Thank you for volunteering! We will be in touch.', 'wppowersuite-lite' ),
					__( 'Volunteer', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'job-application',
				'name'        => __( 'Job Application', 'wppowersuite-lite' ),
				'description' => __( 'Accept applications with resume upload.', 'wppowersuite-lite' ),
				'category'    => 'hr',
				'icon'        => 'dashicons-portfolio',
				'fields'      => [
					self::field( 0, 'text', __( 'Full Name', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'phone', __( 'Phone', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 3, 'text', __( 'Position Applying For', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 4, 'file', __( 'Resume', 'wppowersuite-lite' ), [ 'required' => true, 'file_types' => '.pdf,.doc,.docx', 'max_size' => '5' ] ),
					self::field( 5, 'textarea', __( 'Cover Letter', 'wppowersuite-lite' ), [ 'rows' => '5' ] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Job application from %s', 'wppowersuite-lite' ), $site ),
					__( 'Your application was received. We will review it and contact you if there is a fit.', 'wppowersuite-lite' ),
					__( 'Apply', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'employee-feedback',
				'name'        => __( 'Employee Feedback', 'wppowersuite-lite' ),
				'description' => __( 'Internal feedback form with department selection.', 'wppowersuite-lite' ),
				'category'    => 'hr',
				'icon'        => 'dashicons-businessman',
				'fields'      => [
					self::field( 0, 'select', __( 'Department', 'wppowersuite-lite' ), [
						'required'    => true,
						'options'     => __( "Sales\nMarketing\nSupport\nOperations\nOther", 'wppowersuite-lite' ),
						'empty_label' => __( 'Select department', 'wppowersuite-lite' ),
					] ),
					self::field( 1, 'text', __( 'Name (optional)', 'wppowersuite-lite' ), [ 'width' => 'half' ] ),
					self::field( 2, 'email', __( 'Email (optional)', 'wppowersuite-lite' ), [ 'width' => 'half' ] ),
					self::field( 3, 'textarea', __( 'Your Feedback', 'wppowersuite-lite' ), [ 'required' => true, 'rows' => '5' ] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Employee feedback on %s', 'wppowersuite-lite' ), $site ),
					__( 'Thank you for your honest feedback.', 'wppowersuite-lite' ),
					__( 'Submit Feedback', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'product-inquiry',
				'name'        => __( 'Product Inquiry', 'wppowersuite-lite' ),
				'description' => __( 'Let customers ask about products and quantities.', 'wppowersuite-lite' ),
				'category'    => 'business',
				'icon'        => 'dashicons-cart',
				'fields'      => [
					self::field( 0, 'text', __( 'Name', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 1, 'email', __( 'Email', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'select', __( 'Product', 'wppowersuite-lite' ), [
						'required'    => true,
						'options'     => __( "Product A\nProduct B\nProduct C\nCustom order", 'wppowersuite-lite' ),
						'empty_label' => __( 'Select product', 'wppowersuite-lite' ),
					] ),
					self::field( 3, 'number', __( 'Quantity', 'wppowersuite-lite' ), [ 'min' => '1', 'default_value' => '1', 'width' => 'half' ] ),
					self::field( 4, 'textarea', __( 'Message', 'wppowersuite-lite' ), [ 'rows' => '4' ] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Product inquiry from %s', 'wppowersuite-lite' ), $site ),
					__( 'Thanks! We will reply with product details and pricing.', 'wppowersuite-lite' ),
					__( 'Send Inquiry', 'wppowersuite-lite' )
				),
			],
			[
				'id'          => 'wholesale-inquiry',
				'name'        => __( 'Wholesale Inquiry', 'wppowersuite-lite' ),
				'description' => __( 'B2B wholesale and partnership inquiries.', 'wppowersuite-lite' ),
				'category'    => 'business',
				'icon'        => 'dashicons-networking',
				'fields'      => [
					self::field( 0, 'text', __( 'Business Name', 'wppowersuite-lite' ), [ 'required' => true ] ),
					self::field( 1, 'text', __( 'Contact Name', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 2, 'email', __( 'Business Email', 'wppowersuite-lite' ), [ 'required' => true, 'width' => 'half' ] ),
					self::field( 3, 'phone', __( 'Phone', 'wppowersuite-lite' ), [ 'width' => 'half' ] ),
					self::field( 4, 'url', __( 'Website', 'wppowersuite-lite' ), [ 'width' => 'half', 'placeholder' => 'https://' ] ),
					self::field( 5, 'textarea', __( 'Tell us about your business', 'wppowersuite-lite' ), [ 'required' => true, 'rows' => '5' ] ),
				],
				'settings'    => self::settings(
					/* translators: %s: string value. */
					sprintf( __( 'Wholesale inquiry from %s', 'wppowersuite-lite' ), $site ),
					__( 'Thank you! Our wholesale team will contact you soon.', 'wppowersuite-lite' ),
					__( 'Submit Inquiry', 'wppowersuite-lite' )
				),
			],
		];
	}
}

