Cursor prompt

Build Multi-Step Form Wizard

Multi-step wizard with per-step validation, progress indicator, back/next navigation, and sessionStorage persistence.

Build a multi-step form wizard for {{project_name}}.

## Purpose: {{form_purpose}}
## Steps: {{steps}}

### Architecture
Single-page wizard — no browser navigation between steps.
State in React Hook Form with per-step zod schemas.
Progress persisted to sessionStorage (survives page refresh).

### Step Configuration
```typescript
const STEPS = [
  { id: 'personal', title: 'Personal Info', schema: personalSchema },
  { id: 'company', title: 'Company', schema: companySchema },
  { id: 'review', title: 'Review & Submit', schema: null },
];
```

### Navigation Rules
- **Next**: Validate current step fields only → advance if valid
- **Back**: Always allow — never validate going backward
- **Direct navigation**: Allow clicking completed steps to go back

### Validation
- Zod schema per step — validate only current step on Next
- Show field-level errors inline, not in toasts
- First invalid field receives focus automatically

### State Management
- useFormContext shares form state across all step components
- Auto-save to sessionStorage on every field change
- Restore from sessionStorage on mount

### Progress Indicator
- Completed steps: checkmark icon
- Current step: active/highlighted
- Future steps: muted/locked appearance
- Accessible: aria-current="step" on active step

### Review Step
Summary of all entered data with edit links. Final submit button disabled while submitting.

### On Success
Clear sessionStorage, redirect to confirmation page with brief summary.

### Output
WizardProvider, step components, progress indicator, and form submission handler.

Fill in: {{project_name}}, {{form_purpose}}, {{steps}}. In Loopy you fill these in a form and copy the finished prompt in one click.