﻿from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField, SelectField, BooleanField
from wtforms.validators import DataRequired, Email, Length

class LeadCaptureForm(FlaskForm):
    """Pre-launch lead capture form - direct to Slack, no database"""

    email = StringField('Email Address',
                       validators=[DataRequired(), Email(), Length(max=120)])

    # Segmentation checkboxes
    is_beta_tester = BooleanField('I\'m interested in testing the site early (beta access)')
    wants_updates = BooleanField('I just want updates when you launch', default=True)

    # Three core questions
    company_size = SelectField('Company Size',
                              choices=[
                                  ('', 'Select company size...'),
                                  ('1-5', '1-5 employees'),
                                  ('6-20', '6-20 employees'),
                                  ('21-50', '21-50 employees'),
                                  ('50+', '50+ employees')
                              ],
                              validators=[DataRequired()])

    biggest_challenge = TextAreaField('What\'s your biggest challenge with contractor management?',
                                     validators=[DataRequired(), Length(min=10, max=500)])

    construction_focus = SelectField('Construction Focus',
                                   choices=[
                                       ('', 'Select your focus...'),
                                       ('Residential', 'Residential'),
                                       ('Commercial', 'Commercial'),
                                       ('Civil', 'Civil'),
                                       ('Industrial', 'Industrial'),
                                       ('Mixed', 'Mixed/Multiple')
                                   ],
                                   validators=[DataRequired()])
