{# Step 3: Build Context #}
<form hx-post="{{ url_for('leads.quote_step', step=3) }}"
      hx-target="#quote-step" hx-swap="innerHTML">
  <input type="hidden" name="_accumulated" value='{{ data | tojson }}'>
  <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">

  <h2 class="q-step-title">{{ t.q3_heading }}</h2>
  <p class="q-step-sub">{{ t.q3_subheading }}</p>

  <div class="q-field-group">
    <span class="q-label">{{ t.q3_context_label }}</span>
    <div class="q-pills">
      {% for val, label in [('new_standalone', t.q3_context_new), ('adding_to_club', t.q3_context_adding), ('converting_building', t.q3_context_converting), ('venue_search', t.q3_context_venue_search)] %}
      <label><input type="radio" name="build_context" value="{{ val }}" {{ 'checked' if data.get('build_context') == val }}><span class="q-pill">{{ label }}</span></label>
      {% endfor %}
    </div>
  </div>

  <div class="q-nav">
    <button type="button" class="q-btn-back"
            hx-get="{{ url_for('leads.quote_step', step=2, _accumulated=data | tojson) }}"
            hx-target="#quote-step" hx-swap="innerHTML">{{ t.q_btn_back }}</button>
    <button type="submit" class="q-btn-next">{{ t.q_btn_next }}</button>
  </div>
</form>

<div id="q-progress" hx-swap-oob="innerHTML">
  <div class="q-progress__meta">
    <span class="q-progress__label">{{ steps[step - 1].title }}</span>
    <span class="q-progress__count">{{ t.q_step_counter | tformat(step=step, total=steps|length) }}</span>
  </div>
  <div class="q-progress__track">
    <div class="q-progress__fill" style="width: {{ (step / steps|length * 100) | round }}%"></div>
  </div>
</div>
