# Authentication Login Form
# Interactive login for provisioning system
# Location: .typedialog/provisioning/auth-login.toml

description = "Interactive authentication login"
display_mode = "complete"
locales_path = ""
name = "Authentication Login"

# ============================================================================
# LOGIN CREDENTIALS
# ============================================================================

[[elements]]
border_bottom = true
border_top = true
name = "login_header"
title = "🔐 Authentication Login"
type = "section_header"

[[elements]]
help = "Enter your username"
name = "username"
nickel_path = ["auth", "username"]
placeholder = "username"
prompt = "Username"
required = true
type = "text"
validation_pattern = "^[a-zA-Z0-9_-]+$"

[[elements]]
help = "Enter your password"
name = "password"
nickel_path = ["auth", "password"]
placeholder = "password"
prompt = "Password"
required = true
type = "password"

# ============================================================================
# MULTI-FACTOR AUTHENTICATION
# ============================================================================

[[elements]]
border_bottom = true
border_top = true
name = "mfa_header"
title = "🔒 Multi-Factor Authentication"
type = "section_header"

[[elements]]
help = "Do you have MFA enabled for this account?"
name = "has_mfa"
nickel_path = ["auth", "has_mfa"]
prompt = "MFA enabled?"
required = false
type = "confirm"
default = false

[[elements]]
help = "Enter your MFA code (6 digits)"
name = "mfa_code"
nickel_path = ["auth", "mfa_code"]
placeholder = "123456"
prompt = "MFA Code"
required = false
type = "text"
validation_pattern = "^[0-9]{6}$"
when = "has_mfa == true"

# ============================================================================
# CONFIRMATION
# ============================================================================

[[elements]]
border_bottom = true
border_top = true
name = "confirm_header"
title = "✅ Confirmation"
type = "section_header"

[[elements]]
help = "Confirm login with the provided credentials"
name = "confirm_login"
nickel_path = ["auth", "confirm_login"]
prompt = "Proceed with login?"
required = false
type = "confirm"
default = true
