description = "Web-optimized registration form with account setup and preferences"
locale = "en-US"
name = "User Registration"

# Account Credentials Section
[[items]]
name = "account_section"
order = 1
title = "Create Your Account"
type = "section_header"

[[fields]]
group = "account"
name = "username"
order = 2
placeholder = "Choose a unique username"
prompt = "Username"
required = true
type = "text"

[[fields]]
group = "account"
name = "email"
order = 3
placeholder = "your.email@example.com"
prompt = "Email Address"
required = true
type = "text"

[[fields]]
group = "account"
name = "password"
order = 4
prompt = "Password"
required = true
type = "password"

[[fields]]
group = "account"
name = "confirm_password"
order = 5
prompt = "Confirm Password"
required = true
type = "password"

# Profile Information Section
[[items]]
name = "profile_section"
order = 10
title = "Profile Information"
type = "section_header"

[[fields]]
group = "profile"
name = "first_name"
order = 11
placeholder = "Jane"
prompt = "First Name"
required = true
type = "text"

[[fields]]
group = "profile"
name = "last_name"
order = 12
placeholder = "Smith"
prompt = "Last Name"
required = true
type = "text"

[[fields]]
group = "profile"
name = "display_name"
order = 13
placeholder = "How you'll appear to other users"
prompt = "Display Name (optional)"
type = "text"

[[fields]]
group = "profile"
max_date = "2006-12-31"
min_date = "1950-01-01"
name = "birth_date"
order = 14
prompt = "Date of Birth"
type = "date"
week_start = "Sun"

[[fields]]
file_extension = "md"
group = "profile"
name = "bio"
order = 15
prompt = "About Me"
type = "editor"

# Account Settings Section
[[items]]
name = "settings_section"
order = 20
title = "Account Settings"
type = "section_header"

[[fields]]
default = "Personal"
group = "settings"
name = "account_type"
options = [
  { value = "Personal", label = "👤 Personal - Individual use" },
  { value = "Business", label = "💼 Business - Small team" },
  { value = "Organization", label = "🏢 Organization - Large team" },
]
order = 21
prompt = "Account Type"
required = true
type = "select"

[[fields]]
default = "Free"
group = "settings"
name = "subscription_plan"
options = [
  { value = "Free", label = "🆓 Free - Essential features" },
  { value = "Pro", label = "⭐ Pro - Advanced features" },
  { value = "Enterprise", label = "🏛️ Enterprise - Full suite" },
]
order = 22
prompt = "Subscription Plan"
required = true
type = "select"

# Conditional fields for Business/Organization accounts
[[fields]]
group = "settings"
name = "company_name"
order = 23
placeholder = "Your Organization"
prompt = "Company Name"
required = true
type = "text"
when = "account_type != Personal"

[[fields]]
group = "settings"
name = "company_url"
order = 24
placeholder = "https://example.com"
prompt = "Company Website"
type = "text"
when = "account_type != Personal"

# Premium features (conditional on subscription)
[[fields]]
default = "false"
group = "settings"
name = "api_access"
order = 25
prompt = "Enable API Access?"
type = "confirm"
when = "subscription_plan != Free"

[[fields]]
custom_type = "i32"
default = "1"
group = "settings"
name = "team_members_count"
order = 26
prompt = "How many team members?"
type = "custom"
when = "subscription_plan == Enterprise"

# Preferences Section
[[items]]
name = "preferences_section"
order = 30
title = "Communication Preferences"
type = "section_header"

[[fields]]
default = "true"
group = "preferences"
name = "notifications_email"
order = 31
prompt = "Send me email notifications?"
type = "confirm"

[[fields]]
default = "false"
group = "preferences"
name = "marketing_emails"
order = 32
prompt = "Subscribe to marketing emails and updates?"
type = "confirm"

[[fields]]
default = "Daily Digest"
group = "preferences"
name = "notification_frequency"
options = [
  { value = "Immediate", label = "⚡ Immediate" },
  { value = "Daily Digest", label = "📅 Daily Digest" },
  { value = "Weekly Summary", label = "📊 Weekly Summary" },
  { value = "Monthly Summary", label = "📈 Monthly Summary" },
  { value = "Never", label = "🚫 Never" },
]
order = 33
prompt = "Email notification frequency"
type = "select"
when = "notifications_email == true"

[[fields]]
group = "preferences"
name = "interests"
options = [
  { value = "Product Updates", label = "🚀 Product Updates" },
  { value = "Security Alerts", label = "🔒 Security Alerts" },
  { value = "Performance Tips", label = "⚡ Performance Tips" },
  { value = "Community News", label = "👥 Community News" },
  { value = "Educational Content", label = "📚 Educational Content" },
  { value = "Exclusive Offers", label = "🎁 Exclusive Offers" },
]
order = 34
page_size = 4
prompt = "Topics you're interested in:"
type = "multiselect"

# Privacy & Legal Section
[[items]]
name = "legal_section"
order = 40
title = "Privacy & Legal"
type = "section_header"

[[fields]]
group = "legal"
name = "terms_accepted"
order = 41
prompt = "I agree to the Terms of Service"
required = true
type = "confirm"

[[fields]]
group = "legal"
name = "privacy_policy_accepted"
order = 42
prompt = "I have read and accept the Privacy Policy"
required = true
type = "confirm"

[[fields]]
group = "legal"
name = "data_processing"
order = 43
prompt = "I consent to data processing as described"
required = true
type = "confirm"

# Optional secondary contact
[[fields]]
default = "false"
group = "legal"
name = "enable_secondary_contact"
order = 44
prompt = "Add secondary contact information?"
type = "confirm"

[[fields]]
group = "legal"
name = "secondary_email"
order = 45
placeholder = "alternative@example.com"
prompt = "Secondary Email Address"
type = "text"
when = "enable_secondary_contact == true"

[[fields]]
group = "legal"
name = "recovery_phone"
order = 46
placeholder = "+1-555-0123"
prompt = "Recovery Phone Number"
type = "text"
when = "enable_secondary_contact == true"
