description = "Form with sections that appear/disappear based on selections"
name = "Dynamic Section Management"

# Main header (always visible)
[[elements]]
align = "center"
border_bottom = true
border_top = true
name = "main_header"
title = "✨ Dynamic Form with Conditional Sections"
type = "header"

# Instructions (always visible)
[[elements]]
content = "Select your preferences below. Additional sections will appear based on your choices."
margin_left = 2
name = "instructions"
type = "section"

# Account type selection
[[elements]]
name = "account_type"
options = [
  { value = "Personal", label = "Personal - Individual use" },
  { value = "Business", label = "Business - Small to medium teams" },
  { value = "Enterprise", label = "Enterprise - Large organizations" },
]
prompt = "What type of account do you need?"
required = true
type = "select"

# Business section (only if account_type == Business)
[[elements]]
border_top = true
name = "business_section_header"
title = "🏢 Business Information"
type = "section"
when = "account_type == Business"

[[elements]]
name = "company_name"
prompt = "Company Name"
required = true
type = "text"
when = "account_type == Business"

[[elements]]
name = "company_size"
options = [
  { value = "1-10", label = "1-10 - Startup" },
  { value = "11-50", label = "11-50 - Small business" },
  { value = "51-200", label = "51-200 - Growth stage" },
  { value = "200+", label = "200+ - Enterprise scale" },
]
prompt = "Company Size"
type = "select"
when = "account_type == Business"

# Enterprise section (only if account_type == Enterprise)
[[elements]]
border_top = true
name = "enterprise_section_header"
title = "🏛️ Enterprise Setup"
type = "section"
when = "account_type == Enterprise"

[[elements]]
content = "⚠️ Enterprise accounts require additional verification and support setup."
name = "enterprise_warning"
type = "section"
when = "account_type == Enterprise"

[[elements]]
name = "enterprise_contact"
prompt = "Enterprise Account Manager Email"
required = true
type = "text"
when = "account_type == Enterprise"

# Infrastructure selection (visible for Business & Enterprise)
[[elements]]
border_top = true
name = "infrastructure_header"
title = "🔧 Infrastructure Preferences"
type = "section"
when = "account_type == Business"

[[elements]]
border_top = true
name = "infrastructure_header_enterprise"
title = "🔧 Infrastructure Preferences"
type = "section"
when = "account_type == Enterprise"

[[elements]]
name = "hosting_preference"
options = [
  { value = "Cloud", label = "☁️ Cloud - AWS/Azure/GCP" },
  { value = "On-Premise", label = "🏢 On-Premise - Your data center" },
  { value = "Hybrid", label = "🔀 Hybrid - Mix of both" },
]
prompt = "Preferred Hosting"
type = "select"
when = "account_type == Business"

[[elements]]
name = "hosting_preference_enterprise"
options = [
  { value = "Cloud", label = "☁️ Cloud - AWS/Azure/GCP" },
  { value = "On-Premise", label = "🏢 On-Premise - Your data center" },
  { value = "Hybrid", label = "🔀 Hybrid - Mix of both" },
  { value = "Multi-Cloud", label = "🌐 Multi-Cloud - Multiple providers" },
]
prompt = "Preferred Hosting"
type = "select"
when = "account_type == Enterprise"

# Support level selection
[[elements]]
border_top = true
margin_left = 0
name = "support_header"
title = "💬 Support Options"
type = "section"

[[elements]]
name = "support_level"
options = [
  { value = "Community", label = "👥 Community - Free community support" },
  { value = "Basic", label = "🛠️ Basic - Email support" },
  { value = "Premium", label = "⭐ Premium - 24/7 phone & email" },
  { value = "Enterprise", label = "🏛️ Enterprise - Dedicated team" },
]
prompt = "Support Level"
required = true
type = "select"

# Premium support details (only if support_level == Premium)
[[elements]]
border_top = true
content = "✓ 24/7 Phone Support\n✓ Dedicated Account Manager\n✓ Priority Queue\n✓ SLA Guarantees"
name = "premium_support_info"
title = "⭐ Premium Support Includes"
type = "section"
when = "support_level == Premium"

# Enterprise support details (only if support_level == Enterprise)
[[elements]]
border_top = true
content = "✓ 24/7 Dedicated Support Line\n✓ Dedicated Technical Team\n✓ Custom SLA\n✓ Onsite Support Available"
name = "enterprise_support_info"
title = "⭐⭐ Enterprise Support Includes"
type = "section"
when = "support_level == Enterprise"

[[elements]]
name = "support_email"
prompt = "Support Contact Email"
required = true
type = "text"
when = "support_level == Premium"

[[elements]]
name = "support_email_enterprise"
prompt = "Support Contact Email"
required = true
type = "text"
when = "support_level == Enterprise"

# Final section
[[elements]]
align = "center"
border_bottom = true
border_top = true
content = "Review your selections above and click submit to create your account."
name = "final_section"
title = "✅ Ready to Complete"
type = "section"

[[elements]]
name = "agree_terms"
prompt = "I agree to the terms and conditions"
required = true
type = "confirm"
