description = "Compose form from reusable fragment files"
name = "Modular Form with Groups & Includes"

# Include main header from fragment (paths relative to this file)
[[elements]]
includes = ["fragments/header.toml"]
name = "main_group"
order = 1
type = "group"

# Account type selection
[[elements]]
name = "account_plan"
options = [
  { value = "Personal", label = "Personal - Individual Users" },
  { value = "Premium", label = "Premium - Growing Teams" },
  { value = "Enterprise", label = "Enterprise - Large Organizations" },
]
order = 2
prompt = "Select your plan"
required = true
type = "select"

# Premium section - conditionally loaded from fragment
[[elements]]
includes = ["fragments/premium_section.toml"]
name = "premium_group"
order = 3
type = "group"
when = "account_plan == Premium"

# Enterprise section - conditionally loaded from fragment
[[elements]]
includes = ["fragments/enterprise_section.toml"]
name = "enterprise_group"
order = 4
type = "group"
when = "account_plan == Enterprise"

# Support section - always included from fragment
[[elements]]
includes = ["fragments/support_section.toml"]
name = "support_group"
order = 5
type = "group"

# Agreement section - always included from fragment
[[elements]]
includes = ["fragments/agreement_section.toml"]
name = "agreement_group"
order = 6
type = "group"
