Please Read — Important information to help you make the most of Wedzo Please Read — Important information to help you make the most of Wedzo

Supplier Onboarding

<link href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,400&family=Montserrat:wght@400;500;600&display=swap" rel="stylesheet">
<style>
  .wsf-wrap * { box-sizing: border-box; }
  .wsf-wrap {
    --cream: #F9F5F2; --gold: #C9A87A; --gold-dark: #8B6914;
    --green: #4a5240; --green-light: #5c6650; --brown: #1a1410; --brown-light: #6b5f57;
    max-width: 800px; margin: 0 auto; padding: 60px 24px 100px;
    font-family: 'Montserrat', sans-serif; color: var(--brown); background: var(--cream);
  }
  .wsf-wrap header { text-align: center; margin-bottom: 20px; }
  .wsf-eyebrow { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 11px; letter-spacing: 5px; text-transform: uppercase; color: var(--gold-dark); font-weight: 500; margin-bottom: 18px; }
  .wsf-eyebrow::before, .wsf-eyebrow::after { content: ''; width: 44px; height: 1px; background: var(--gold-dark); opacity: .6; }
  .wsf-wrap h1 { font-family: 'Cormorant Garamond', serif; font-weight: 300; font-size: clamp(32px, 5vw, 46px); margin: 0 0 14px; }
  .wsf-wrap h1 em { font-style: italic; color: var(--gold); font-weight: 300; }
  .wsf-intro { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 18px; color: var(--brown-light); max-width: 600px; margin: 0 auto 40px; }

  .wsf-accordion { background: #fff; border: 1px solid rgba(139,105,20,0.18); border-radius: 10px; margin-bottom: 18px; overflow: hidden; }
  .wsf-service-block.wsf-accordion { border: 2px solid var(--gold); background: #fffdfb; }
  .wsf-acc-header { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; cursor: pointer; user-select: none; }
  .wsf-acc-header-left { display: flex; align-items: center; gap: 12px; }
  .wsf-acc-num {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--cream);
    border: 1px solid var(--gold); color: var(--gold-dark); font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
  }
  .wsf-accordion.open .wsf-acc-num { background: var(--green); border-color: var(--green); color: #fff; }
  .wsf-acc-header h2 { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 22px; margin: 0; color: var(--brown); }
  .wsf-acc-chevron { color: var(--gold-dark); font-size: 18px; transition: transform .2s ease; }
  .wsf-accordion.open .wsf-acc-chevron { transform: rotate(180deg); }
  .wsf-acc-desc { font-size: 13px; color: var(--brown-light); padding: 0 26px 18px; margin: -8px 0 0; line-height: 1.5; }
  .wsf-acc-body { display: none; padding: 0 26px 28px; }
  .wsf-accordion.open .wsf-acc-body { display: block; }

  .wsf-wrap label { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: 0.3px; color: var(--brown); margin-bottom: 6px; margin-top: 16px; }
  .wsf-wrap label:first-of-type { margin-top: 0; }
  .wsf-hint { font-size: 11.5px; color: var(--brown-light); font-weight: 400; margin-top: -3px; margin-bottom: 6px; font-style: italic; }
  .wsf-wrap input[type=text], .wsf-wrap input[type=email], .wsf-wrap input[type=tel], .wsf-wrap textarea, .wsf-wrap select {
    width: 100%; padding: 11px 13px; border: 1px solid rgba(139,105,20,0.3); border-radius: 6px;
    background: var(--cream); font-family: 'Montserrat', sans-serif; font-size: 14px; color: var(--brown); outline: none;
  }
  .wsf-wrap input:focus, .wsf-wrap textarea:focus, .wsf-wrap select:focus { border-color: var(--gold-dark); }
  .wsf-wrap textarea { resize: vertical; min-height: 70px; }
  .wsf-wrap input[type=file] { width: 100%; font-size: 13px; color: var(--brown-light); padding: 10px; background: var(--cream); border: 1px dashed rgba(139,105,20,0.4); border-radius: 6px; }
  .wsf-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  @media (max-width: 640px) { .wsf-row2 { grid-template-columns: 1fr; } }
  .wsf-subblock { border-top: 1px dashed rgba(139,105,20,0.3); padding-top: 18px; margin-top: 18px; }
  .wsf-subblock:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
  .wsf-subblock-title { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 17px; color: var(--gold-dark); margin-bottom: 4px; }
  .wsf-add-btn {
    display: inline-block; margin-top: 14px; margin-right: 8px; background: var(--cream); border: 1px solid var(--green); color: var(--green);
    font-family: 'Montserrat', sans-serif; font-size: 12.5px; font-weight: 600; letter-spacing: 0.3px;
    padding: 9px 16px; border-radius: 20px; cursor: pointer; transition: background .2s ease, color .2s ease;
  }
  .wsf-add-btn:hover { background: var(--green); color: #fff; }
  .wsf-continue-btn { background: var(--green); color: #fff; border-color: var(--green); }
  .wsf-continue-btn:hover { background: var(--green-light); }
  .wsf-checkbox-toggle { display: flex; align-items: center; gap: 10px; background: var(--cream); border: 1px solid rgba(139,105,20,0.3); border-radius: 8px; padding: 14px 16px; margin-bottom: 6px; }
  .wsf-checkbox-toggle input { width: auto; margin: 0; }
  .wsf-checkbox-toggle span { font-size: 13.5px; font-weight: 600; color: var(--brown); }
  .wsf-conditional { display: none; margin-top: 18px; }
  .wsf-conditional.show { display: block; }
  .wsf-badge-group { margin-bottom: 22px; }
  .wsf-badge-group-title { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 16px; color: var(--green); margin-bottom: 10px; }
  .wsf-badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
  .wsf-badge-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--brown); }
  .wsf-badge-check input { width: auto; margin-top: 3px; }
  .wsf-badge-check.disabled { opacity: 0.4; }
  .wsf-badge-counter { display: inline-block; background: var(--green); color: #fff; font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 20px; margin-bottom: 16px; }
  .wsf-submit-wrap { text-align: center; margin-top: 30px; }
  .wsf-wrap button.wsf-submit {
    background: var(--green); color: #fff; border: none; border-radius: 30px; padding: 16px 42px;
    font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 600; letter-spacing: 1px;
    text-transform: uppercase; cursor: pointer; transition: background .2s ease;
  }
  .wsf-wrap button.wsf-submit:hover { background: var(--green-light); }
  .wsf-note-box { background: var(--cream); border-left: 3px solid var(--gold); padding: 12px 16px; font-size: 12.5px; color: var(--brown-light); border-radius: 0 6px 6px 0; margin-top: 14px; line-height: 1.5; }
  .wsf-diamond { text-align: center; color: var(--gold-dark); font-size: 20px; margin: 30px 0; }

  .wsf-guide-item { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-top: 1px solid rgba(139,105,20,0.15); }
  .wsf-guide-item:first-of-type { border-top: none; padding-top: 0; }
  .wsf-guide-num { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
  .wsf-guide-text { flex: 1; }
  .wsf-guide-title { font-weight: 600; font-size: 13.5px; color: var(--brown); margin-bottom: 2px; }
  .wsf-guide-desc { font-size: 12px; color: var(--brown-light); margin-bottom: 8px; }
  .wsf-guide-example { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 13.5px; color: var(--brown-light); background: var(--cream); padding: 8px 12px; border-radius: 6px; margin-bottom: 8px; }
  .wsf-tips-box { background: var(--cream); border-radius: 8px; padding: 16px 18px; margin-top: 10px; }
  .wsf-tips-box div { font-size: 12.5px; color: var(--brown); margin-bottom: 5px; }

  .wsf-service-nav { margin-top: 22px; border-top: 1px dashed rgba(139,105,20,0.3); padding-top: 18px; }
  .wsf-radio-option { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; margin-bottom: 10px; }
  .wsf-radio-option input { width: auto; margin-top: 3px; }
</style>

<div class="wsf-wrap">
  <header>
    <div class="wsf-eyebrow">Join Wedzo</div>
    <h1>Supplier <em>Onboarding Form</em></h1>
    <p class="wsf-intro">Fill in your details step by step below — click each section to open it, and use "Continue" to move to the next one.</p>
  </header>

  <div class="wsf-note-box" id="wsfDraftBanner" style="display:none; margin-bottom:20px;">
    We've restored your saved answers from last time. <a href="#" onclick="wsfClearDraft(); return false;" style="color:var(--gold-dark); text-decoration:underline;">Clear and start over instead</a>.
  </div>
  <div class="wsf-note-box" style="margin-bottom:20px;">
    Your answers save automatically in this browser as you go, so you can close this page and come back later. <strong>Photo and audio uploads can't be saved this way</strong> — if you leave and return, you'll need to re-attach any files.
  </div>

  <form action="https://formspree.io/f/xwvgapdv" method="POST" enctype="multipart/form-data" id="wsfForm">

    <!-- CONTACT -->
    <div class="wsf-accordion open">
      <div class="wsf-acc-header" onclick="wsfToggleAccordion(this.parentElement)">
        <div class="wsf-acc-header-left"><div class="wsf-acc-num">1</div><h2>Your Contact Details</h2></div>
        <span class="wsf-acc-chevron">▾</span>
      </div>
      <p class="wsf-acc-desc">So we can reach you if we have any questions.</p>
      <div class="wsf-acc-body">
        <div class="wsf-row2">
          <div><label>Contact Name</label><input type="text" name="contact_name" required></div>
          <div><label>Contact Email</label><input type="email" name="contact_email" required></div>
        </div>
        <label>Contact Phone</label>
        <input type="tel" name="contact_phone">
        <button type="button" class="wsf-add-btn wsf-continue-btn" onclick="wsfGoToNext(this)">Continue →</button>
      </div>
    </div>

    <!-- MEET THE SUPPLIER -->
    <div class="wsf-accordion">
      <div class="wsf-acc-header" onclick="wsfToggleAccordion(this.parentElement)">
        <div class="wsf-acc-header-left"><div class="wsf-acc-num">2</div><h2>Meet the Supplier</h2></div>
        <span class="wsf-acc-chevron">▾</span>
      </div>
      <p class="wsf-acc-desc">A short bio so couples get to know the person behind the business.</p>
      <div class="wsf-acc-body">
        <div class="wsf-row2">
          <div><label>Your First Name</label><input type="text" name="meet_supplier_first_name"></div>
          <div><label>Your Location</label><div class="wsf-hint">e.g. "Leeds"</div><input type="text" name="meet_supplier_location"></div>
        </div>

        <label>Your Photo</label>
        <div class="wsf-hint">A friendly photo of you (not your work/product)</div>
        <input type="file" name="meet_supplier_photo" accept="image/*">

        <div class="wsf-hint" style="margin-top:20px; font-style:normal; font-weight:600; color:var(--green);">Use the guide below to help you write your short bio (aim for 100–150 words total).</div>

        <div class="wsf-guide-item">
          <div class="wsf-guide-num">1</div>
          <div class="wsf-guide-text">
            <div class="wsf-guide-title">Who You Are</div>
            <div class="wsf-guide-desc">Tell couples who you are and a little about you.</div>
            <div class="wsf-guide-example">e.g. "Hi, I'm Oliver, the owner and photographer behind Oliver James Photography."</div>
            <textarea name="bio_who_you_are"></textarea>
          </div>
        </div>
        <div class="wsf-guide-item">
          <div class="wsf-guide-num">2</div>
          <div class="wsf-guide-text">
            <div class="wsf-guide-title">What You Do</div>
            <div class="wsf-guide-desc">What services or products do you offer?</div>
            <div class="wsf-guide-example">e.g. "I specialise in photo booth hire for weddings and celebrations."</div>
            <textarea name="bio_what_you_do"></textarea>
          </div>
        </div>
        <div class="wsf-guide-item">
          <div class="wsf-guide-num">3</div>
          <div class="wsf-guide-text">
            <div class="wsf-guide-title">Where You're Based</div>
            <div class="wsf-guide-desc">Where are you based and where do you work?</div>
            <div class="wsf-guide-example">e.g. "Based in Harrogate, I cover weddings across Yorkshire and surrounding areas."</div>
            <textarea name="bio_where_based"></textarea>
          </div>
        </div>
        <div class="wsf-guide-item">
          <div class="wsf-guide-num">4</div>
          <div class="wsf-guide-text">
            <div class="wsf-guide-title">Your Style</div>
            <div class="wsf-guide-desc">Describe your style or what makes your service unique.</div>
            <div class="wsf-guide-example">e.g. "I love creating fun, stylish and memorable experiences your guests will talk about for years to come."</div>
            <textarea name="bio_your_style"></textarea>
          </div>
        </div>
        <div class="wsf-guide-item">
          <div class="wsf-guide-num">5</div>
          <div class="wsf-guide-text">
            <div class="wsf-guide-title">Your Experience</div>
            <div class="wsf-guide-desc">How long have you been doing what you do?</div>
            <div class="wsf-guide-example">e.g. "I've been bringing unforgettable memories to weddings for over four years."</div>
            <textarea name="bio_your_experience"></textarea>
          </div>
        </div>
        <div class="wsf-guide-item">
          <div class="wsf-guide-num">6</div>
          <div class="wsf-guide-text">
            <div class="wsf-guide-title">What Matters to You</div>
            <div class="wsf-guide-desc">What can couples expect when working with you?</div>
            <div class="wsf-guide-example">e.g. "I pride myself on being reliable, professional and easy to work with, so your day is stress-free from start to finish."</div>
            <textarea name="bio_what_matters"></textarea>
          </div>
        </div>

        <div class="wsf-tips-box">
          <div><strong>Top Tips:</strong></div>
          <div>✓ Keep it warm, friendly and easy to read</div>
          <div>✓ Write in first person (e.g. I, me, my)</div>
          <div>✓ Show your personality and passion</div>
          <div>✓ Keep it between 100–150 words in total</div>
        </div>

        <button type="button" class="wsf-add-btn wsf-continue-btn" onclick="wsfGoToNext(this)">Continue →</button>
      </div>
    </div>

    <!-- SERVICES -->
    <div id="wsfServices">
      <div class="wsf-accordion wsf-service-block" data-service="1">
        <div class="wsf-acc-header" onclick="wsfToggleAccordion(this.parentElement)">
          <div class="wsf-acc-header-left"><div class="wsf-acc-num">3</div><h2 class="wsf-service-block-title">Service 1</h2></div>
          <span class="wsf-acc-chevron">▾</span>
        </div>
        <p class="wsf-acc-desc">Tell us about ONE service you offer (e.g. Photography, Photo Booth Hire, or Sweet Cart Hire). If you offer more than one type of service, you'll get the chance to add another at the end of this section — each becomes its own separate page on Wedzo.</p>
        <div class="wsf-acc-body">

          <label>Business / Trading Name</label>
          <input type="text" name="service_1_supplier_name" required>

          <label>What category is this service?</label>
          <select name="service_1_category" class="wsf-category-select" required>
            <option value="">Select one...</option>
            <option value="Photographers">Photographer</option>
            <option value="Musicians">Musician</option>
            <option value="Celebrants">Celebrant</option>
            <option value="Dog Chaperones">Dog Chaperone</option>
            <option value="Photo Booth Hire">Photo Booth Hire</option>
            <option value="Table Decor">Table Decor / Styling</option>
            <option value="Sweet Carts">Sweet Cart Hire</option>
            <option value="Wedding Planners">Wedding Planner</option>
            <option value="Wedding Arches">Wedding Arch Hire</option>
            <option value="Flower Walls">Flower Wall Hire</option>
            <option value="Bubble Wall">Bubble Wall Hire</option>
            <option value="Bouncy Castle">Bouncy Castle Hire</option>
            <option value="Selfie Pod Hire">Selfie Pod Hire</option>
            <option value="Other">Other (not listed)</option>
          </select>
          <div class="wsf-conditional wsf-other-category-block">
            <label>Please describe your category</label>
            <input type="text" name="service_1_category_other">
          </div>

          <div class="wsf-subblock wsf-same-areas-wrap" style="display:none">
            <div class="wsf-checkbox-toggle wsf-same-areas-toggle">
              <input type="checkbox" onchange="wsfToggleSameAreas(this)">
              <span>Same service areas &amp; delivery pricing as Service 1</span>
            </div>
          </div>

          <div class="wsf-subblock wsf-areas-fields">
            <div class="wsf-subblock-title">Service Areas &amp; Delivery</div>
            <label>Areas Included in Your Price</label>
            <div class="wsf-hint">e.g. "Leeds, Harrogate, York" or "UK Wide"</div>
            <input type="text" name="service_1_areas_included">

            <label>Do you charge extra for areas outside this?</label>
            <div class="wsf-radio-option">
              <input type="radio" name="service_1_extra_area_option" value="rate" id="s1rate">
              <label for="s1rate" style="margin:0; font-weight:400;">Yes, a set rate per mile</label>
            </div>
            <input type="text" name="service_1_extra_area_rate" placeholder="e.g. 50p per mile">
            <div class="wsf-radio-option" style="margin-top:8px;">
              <input type="radio" name="service_1_extra_area_option" value="enquire" id="s1enquire">
              <label for="s1enquire" style="margin:0; font-weight:400;">No fixed rate — couples should enquire</label>
            </div>

            <div class="wsf-note-box">Please make sure your package prices below include delivery/travel to your listed areas.</div>
          </div>

          <div class="wsf-subblock">
            <div class="wsf-subblock-title">Breakage / Damage Deposit</div>
            <div class="wsf-radio-option">
              <input type="radio" name="service_1_deposit_required" value="yes" id="s1depyes">
              <label for="s1depyes" style="margin:0; font-weight:400;">Yes, I require a deposit</label>
            </div>
            <div class="wsf-radio-option">
              <input type="radio" name="service_1_deposit_required" value="no" id="s1depno">
              <label for="s1depno" style="margin:0; font-weight:400;">No deposit required</label>
            </div>
            <label>Deposit Amount (if applicable)</label>
            <input type="text" name="service_1_deposit_amount" placeholder="e.g. £50">
          </div>

          <div class="wsf-subblock">
            <div class="wsf-subblock-title">Insurance</div>
            <div class="wsf-radio-option">
              <input type="radio" name="service_1_has_insurance" value="yes" id="s1insyes">
              <label for="s1insyes" style="margin:0; font-weight:400;">Yes, I hold valid public liability insurance for this service</label>
            </div>
            <div class="wsf-radio-option">
              <input type="radio" name="service_1_has_insurance" value="no" id="s1insno">
              <label for="s1insno" style="margin:0; font-weight:400;">No, I don't currently hold insurance</label>
            </div>
            <label>Insurance Provider (optional)</label>
            <input type="text" name="service_1_insurance_provider">
          </div>

          <div class="wsf-subblock">
            <div class="wsf-subblock-title">Packages &amp; Pricing</div>
            <p class="wsf-desc" style="font-size:12.5px;color:var(--brown-light);margin-bottom:12px;">Add each package under this service, up to 6. For example, if this service is Photo Booth Hire, a package might be:<br><em>"Half Day Hire — £250 — includes props, unlimited prints, and an on-site attendant."</em></p>
            <div class="wsf-service1-packages">
              <div class="wsf-subblock wsf-package-block" data-index="1">
                <div class="wsf-subblock-title">Package 1</div>
                <label>Package Name</label><input type="text" name="service_1_package_1_name" placeholder="e.g. Half Day Hire">
                <label>Price</label><div class="wsf-hint">Please include delivery to your service areas in this price</div><input type="text" name="service_1_package_1_price" placeholder="e.g. £250">
                <label>Short Description</label><textarea name="service_1_package_1_description"></textarea>
                <label>What's Included</label><div class="wsf-hint">List one item per line</div><textarea name="service_1_package_1_items"></textarea>
              </div>
              <div class="wsf-subblock wsf-package-block" data-index="2" style="display:none">
                <div class="wsf-subblock-title">Package 2</div>
                <label>Package Name</label><input type="text" name="service_1_package_2_name">
                <label>Price</label><input type="text" name="service_1_package_2_price">
                <label>Short Description</label><textarea name="service_1_package_2_description"></textarea>
                <label>What's Included</label><div class="wsf-hint">List one item per line</div><textarea name="service_1_package_2_items"></textarea>
              </div>
              <div class="wsf-subblock wsf-package-block" data-index="3" style="display:none">
                <div class="wsf-subblock-title">Package 3</div>
                <label>Package Name</label><input type="text" name="service_1_package_3_name">
                <label>Price</label><input type="text" name="service_1_package_3_price">
                <label>Short Description</label><textarea name="service_1_package_3_description"></textarea>
                <label>What's Included</label><div class="wsf-hint">List one item per line</div><textarea name="service_1_package_3_items"></textarea>
              </div>
              <div class="wsf-subblock wsf-package-block" data-index="4" style="display:none">
                <div class="wsf-subblock-title">Package 4</div>
                <label>Package Name</label><input type="text" name="service_1_package_4_name">
                <label>Price</label><input type="text" name="service_1_package_4_price">
                <label>Short Description</label><textarea name="service_1_package_4_description"></textarea>
                <label>What's Included</label><div class="wsf-hint">List one item per line</div><textarea name="service_1_package_4_items"></textarea>
              </div>
              <div class="wsf-subblock wsf-package-block" data-index="5" style="display:none">
                <div class="wsf-subblock-title">Package 5</div>
                <label>Package Name</label><input type="text" name="service_1_package_5_name">
                <label>Price</label><input type="text" name="service_1_package_5_price">
                <label>Short Description</label><textarea name="service_1_package_5_description"></textarea>
                <label>What's Included</label><div class="wsf-hint">List one item per line</div><textarea name="service_1_package_5_items"></textarea>
              </div>
              <div class="wsf-subblock wsf-package-block" data-index="6" style="display:none">
                <div class="wsf-subblock-title">Package 6</div>
                <label>Package Name</label><input type="text" name="service_1_package_6_name">
                <label>Price</label><input type="text" name="service_1_package_6_price">
                <label>Short Description</label><textarea name="service_1_package_6_description"></textarea>
                <label>What's Included</label><div class="wsf-hint">List one item per line</div><textarea name="service_1_package_6_items"></textarea>
              </div>
            </div>
            <button type="button" class="wsf-add-btn wsf-add-package" onclick="wsfRevealNextIn(this, 'wsf-package-block')">+ Add another package</button>
            <div class="wsf-note-box">You only need to add pricing details for each package — photos are added once below and used across your whole page, not linked to any specific package.</div>
          </div>

          <div class="wsf-subblock">
            <div class="wsf-subblock-title">Photos for This Service</div>
            <p class="wsf-desc" style="font-size:12.5px;color:var(--brown-light);">These photos represent your whole page for this service — they're not tied to any single package above, they'll just showcase your work generally.</p>
            <label>Main Profile Photo</label>
            <div class="wsf-hint">One key image representing this service as a whole — this is the main photo couples will see first</div>
            <input type="file" name="service_1_profile_photo" accept="image/*">
            <label>Gallery Photos</label>
            <div class="wsf-hint">Just extra photos to showcase your work — add as many as you like, they'll all appear together on your page</div>
            <input type="file" name="service_1_gallery_photos" accept="image/*" multiple>
            <div class="wsf-note-box">If any photos, videos, or files are too large to upload here, or you run into any issues, just email them to hello@wedzo.co.uk with your business name in the subject line.</div>
          </div>

          <div class="wsf-subblock wsf-music-section" style="display:none">
            <div class="wsf-subblock-title">Music</div>
            <div class="wsf-checkbox-toggle">
              <input type="checkbox" class="wsf-music-player-toggle" name="service_1_wants_music_player" value="yes">
              <span>I'd like an audio player showcasing sample tracks</span>
            </div>
            <div class="wsf-conditional wsf-music-player-block">
              <div class="wsf-track-block" data-index="1">
                <div class="wsf-subblock-title">Track 1</div>
                <label>Song Title</label><input type="text" name="service_1_track_1_title">
                <label>Arrangement</label><input type="text" name="service_1_track_1_arrangement">
                <label>Audio File</label><input type="file" name="service_1_track_1_audio" accept="audio/*">
              </div>
              <div class="wsf-track-block" data-index="2" style="display:none">
                <div class="wsf-subblock-title">Track 2</div>
                <label>Song Title</label><input type="text" name="service_1_track_2_title">
                <label>Arrangement</label><input type="text" name="service_1_track_2_arrangement">
                <label>Audio File</label><input type="file" name="service_1_track_2_audio" accept="audio/*">
              </div>
              <div class="wsf-track-block" data-index="3" style="display:none">
                <div class="wsf-subblock-title">Track 3</div>
                <label>Song Title</label><input type="text" name="service_1_track_3_title">
                <label>Arrangement</label><input type="text" name="service_1_track_3_arrangement">
                <label>Audio File</label><input type="file" name="service_1_track_3_audio" accept="audio/*">
              </div>
              <div class="wsf-track-block" data-index="4" style="display:none">
                <div class="wsf-subblock-title">Track 4</div>
                <label>Song Title</label><input type="text" name="service_1_track_4_title">
                <label>Arrangement</label><input type="text" name="service_1_track_4_arrangement">
                <label>Audio File</label><input type="file" name="service_1_track_4_audio" accept="audio/*">
              </div>
              <div class="wsf-track-block" data-index="5" style="display:none">
                <div class="wsf-subblock-title">Track 5</div>
                <label>Song Title</label><input type="text" name="service_1_track_5_title">
                <label>Arrangement</label><input type="text" name="service_1_track_5_arrangement">
                <label>Audio File</label><input type="file" name="service_1_track_5_audio" accept="audio/*">
              </div>
              <div class="wsf-track-block" data-index="6" style="display:none">
                <div class="wsf-subblock-title">Track 6</div>
                <label>Song Title</label><input type="text" name="service_1_track_6_title">
                <label>Arrangement</label><input type="text" name="service_1_track_6_arrangement">
                <label>Audio File</label><input type="file" name="service_1_track_6_audio" accept="audio/*">
              </div>
              <button type="button" class="wsf-add-btn" onclick="wsfRevealNextScoped(this, 'wsf-track-block')">+ Add another track</button>
            </div>

            <div class="wsf-checkbox-toggle" style="margin-top:16px;">
              <input type="checkbox" class="wsf-repertoire-toggle" name="service_1_wants_repertoire" value="yes">
              <span>I'd like to show a repertoire / song list</span>
            </div>
            <div class="wsf-conditional wsf-repertoire-block">
              <div class="wsf-category-item-block" data-index="1">
                <div class="wsf-subblock-title">Category 1</div>
                <label>Category Name</label><input type="text" name="service_1_repertoire_category_1_name" placeholder="e.g. Slow Pop">
                <label>Songs</label><div class="wsf-hint">One per line: Song Title | Artist</div>
                <textarea name="service_1_repertoire_category_1_songs" placeholder="Perfect | Ed Sheeran"></textarea>
              </div>
              <div class="wsf-category-item-block" data-index="2" style="display:none">
                <div class="wsf-subblock-title">Category 2</div>
                <label>Category Name</label><input type="text" name="service_1_repertoire_category_2_name">
                <label>Songs</label><textarea name="service_1_repertoire_category_2_songs"></textarea>
              </div>
              <div class="wsf-category-item-block" data-index="3" style="display:none">
                <div class="wsf-subblock-title">Category 3</div>
                <label>Category Name</label><input type="text" name="service_1_repertoire_category_3_name">
                <label>Songs</label><textarea name="service_1_repertoire_category_3_songs"></textarea>
              </div>
              <div class="wsf-category-item-block" data-index="4" style="display:none">
                <div class="wsf-subblock-title">Category 4</div>
                <label>Category Name</label><input type="text" name="service_1_repertoire_category_4_name">
                <label>Songs</label><textarea name="service_1_repertoire_category_4_songs"></textarea>
              </div>
              <div class="wsf-category-item-block" data-index="5" style="display:none">
                <div class="wsf-subblock-title">Category 5</div>
                <label>Category Name</label><input type="text" name="service_1_repertoire_category_5_name">
                <label>Songs</label><textarea name="service_1_repertoire_category_5_songs"></textarea>
              </div>
              <div class="wsf-category-item-block" data-index="6" style="display:none">
                <div class="wsf-subblock-title">Category 6</div>
                <label>Category Name</label><input type="text" name="service_1_repertoire_category_6_name">
                <label>Songs</label><textarea name="service_1_repertoire_category_6_songs"></textarea>
              </div>
              <div class="wsf-category-item-block" data-index="7" style="display:none">
                <div class="wsf-subblock-title">Category 7</div>
                <label>Category Name</label><input type="text" name="service_1_repertoire_category_7_name">
                <label>Songs</label><textarea name="service_1_repertoire_category_7_songs"></textarea>
              </div>
              <div class="wsf-category-item-block" data-index="8" style="display:none">
                <div class="wsf-subblock-title">Category 8</div>
                <label>Category Name</label><input type="text" name="service_1_repertoire_category_8_name">
                <label>Songs</label><textarea name="service_1_repertoire_category_8_songs"></textarea>
              </div>
              <div class="wsf-category-item-block" data-index="9" style="display:none">
                <div class="wsf-subblock-title">Category 9</div>
                <label>Category Name</label><input type="text" name="service_1_repertoire_category_9_name">
                <label>Songs</label><textarea name="service_1_repertoire_category_9_songs"></textarea>
              </div>
              <div class="wsf-category-item-block" data-index="10" style="display:none">
                <div class="wsf-subblock-title">Category 10</div>
                <label>Category Name</label><input type="text" name="service_1_repertoire_category_10_name">
                <label>Songs</label><textarea name="service_1_repertoire_category_10_songs"></textarea>
              </div>
              <div class="wsf-category-item-block" data-index="11" style="display:none">
                <div class="wsf-subblock-title">Category 11</div>
                <label>Category Name</label><input type="text" name="service_1_repertoire_category_11_name">
                <label>Songs</label><textarea name="service_1_repertoire_category_11_songs"></textarea>
              </div>
              <div class="wsf-category-item-block" data-index="12" style="display:none">
                <div class="wsf-subblock-title">Category 12</div>
                <label>Category Name</label><input type="text" name="service_1_repertoire_category_12_name">
                <label>Songs</label><textarea name="service_1_repertoire_category_12_songs"></textarea>
              </div>
              <button type="button" class="wsf-add-btn" onclick="wsfRevealNextScoped(this, 'wsf-category-item-block')">+ Add another category</button>
            </div>
          </div>

          <div class="wsf-subblock">
            <div class="wsf-subblock-title">Badges for This Service</div>
            <p class="wsf-desc" style="font-size:12.5px;color:var(--brown-light);">Choose up to <strong>6 badges</strong> — options relevant to your category will appear once selected above.</p>
            <div class="wsf-badge-counter wsf-badge-counter-el">0 of 6 selected</div>

            <div class="wsf-badge-group">
              <div class="wsf-badge-group-title">General</div>
              <div class="wsf-badge-grid">
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Verified"> Verified</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Fast Response"> Fast Response</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Fully Insured"> Fully Insured</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="5-Star Rated"> 5-Star Rated</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="UK Wide Coverage"> UK Wide Coverage</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Years of Experience"> Years of Experience</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Eco-Friendly"> Eco-Friendly</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Drone Footage"> Drone Footage</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="LGBTQ+ Friendly"> LGBTQ+ Friendly</label>
              </div>
            </div>
            <div class="wsf-badge-group">
              <div class="wsf-badge-group-title">Personality &amp; Service Style</div>
              <div class="wsf-badge-grid">
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Great Guest Interaction"> Great Guest Interaction</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Captures Candid Moments"> Captures Candid Moments</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Punctual & Reliable"> Punctual &amp; Reliable</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Easy to Work With"> Easy to Work With</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Goes Above & Beyond"> Goes Above &amp; Beyond</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Attention to Detail"> Attention to Detail</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Flexible & Adaptable"> Flexible &amp; Adaptable</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Excellent Communication"> Excellent Communication</label>
              </div>
            </div>
            <div class="wsf-badge-group" data-category="Photographers" style="display:none">
              <div class="wsf-badge-group-title">Photographers</div>
              <div class="wsf-badge-grid">
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Full Day Coverage"> Full Day Coverage</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Second Shooter Available"> Second Shooter Available</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="High-Resolution Digital Files"> High-Res Digital Files</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Printed Albums Included"> Printed Albums Included</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Engagement Shoot Included"> Engagement Shoot Included</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Quick Turnaround Gallery"> Quick Turnaround Gallery</label>
              </div>
            </div>
            <div class="wsf-badge-group" data-category="Musicians" style="display:none">
              <div class="wsf-badge-group-title">Musicians</div>
              <div class="wsf-badge-grid">
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Live Ceremony Music"> Live Ceremony Music</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Reception & Party Set"> Reception &amp; Party Set</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="PA System Included"> PA System Included</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="First Dance Song Prepared"> First Dance Song Prepared</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Solo to Full Band Options"> Solo to Full Band Options</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Acoustic & Electric Sets"> Acoustic &amp; Electric Sets</label>
              </div>
            </div>
            <div class="wsf-badge-group" data-category="Celebrants" style="display:none">
              <div class="wsf-badge-group-title">Celebrants</div>
              <div class="wsf-badge-grid">
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Personalised Ceremony Script"> Personalised Ceremony Script</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Symbolic Rituals Included"> Symbolic Rituals Included</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Legally Recognised Ceremony"> Legally Recognised Ceremony</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Vow Writing Support"> Vow Writing Support</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Multi-Faith & Inclusive"> Multi-Faith &amp; Inclusive</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Rehearsal Included"> Rehearsal Included</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Weddings Officiated 10+"> Weddings Officiated 10+</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Calm & Reassuring Manner"> Calm &amp; Reassuring Manner</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Choice of Readings, Poems & Music"> Choice of Readings/Poems/Music</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Family & Friends Involved in Service"> Family &amp; Friends Involved</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Storytelling Session with the Couple"> Storytelling Session</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Keepsake Ceremony Script"> Keepsake Ceremony Script</label>
              </div>
            </div>
            <div class="wsf-badge-group" data-category="Dog Chaperones" style="display:none">
              <div class="wsf-badge-group-title">Dog Chaperones</div>
              <div class="wsf-badge-grid">
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="K9 First Aid Trained"> K9 First Aid Trained</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="CPD Certified"> CPD Certified</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Personalised Care Plans"> Personalised Care Plans</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Collection & Transport"> Collection &amp; Transport</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Ring Bearer Support"> Ring Bearer Support</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Fully Insured (Dog Handling)"> Fully Insured (Dog Handling)</label>
              </div>
            </div>
            <div class="wsf-badge-group" data-category="Photo Booth Hire" style="display:none">
              <div class="wsf-badge-group-title">Photo Booth Hire</div>
              <div class="wsf-badge-grid">
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Instant Prints"> Instant Prints</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Unlimited Sessions"> Unlimited Sessions</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Props Included"> Props Included</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Custom Backdrops"> Custom Backdrops</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Guest Book Included"> Guest Book Included</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="On-Site Attendant"> On-Site Attendant</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="GIFs & Boomerangs"> GIFs &amp; Boomerangs</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Studio Lighting"> Studio Lighting</label>
              </div>
            </div>
            <div class="wsf-badge-group" data-category="Table Decor" style="display:none">
              <div class="wsf-badge-group-title">Table Decor</div>
              <div class="wsf-badge-grid">
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Bespoke Table Styling"> Bespoke Table Styling</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Linen & Chair Covers"> Linen &amp; Chair Covers</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Fresh Floral Arrangements"> Fresh Floral Arrangements</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Setup & Breakdown Included"> Setup &amp; Breakdown Included</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Colour Palette Matching"> Colour Palette Matching</label>
                <label class="wsf-badge-check"><input type="checkbox" name="service_1_badges[]" value="Rustic to Luxe Styles"> Rustic to Luxe Styles</label>
              </div>
            </div>
            <label>Anything else you'd like highlighted?</label>
            <textarea name="service_1_badges_other"></textarea>
          </div>

          <div class="wsf-subblock">
            <div class="wsf-subblock-title">Extra Info / Terms for This Service</div>
            <p class="wsf-desc" style="font-size:12.5px;color:var(--brown-light);">Optional — e.g. cancellation policy, or anything specific to this service beyond Wedzo's standard supplier terms.</p>
            <textarea name="service_1_extra_terms"></textarea>
          </div>

          <div class="wsf-service-nav">
            <p class="wsf-desc" style="font-size:12.5px;color:var(--brown-light);margin-bottom:10px;">Do you offer another type of service, like Photo Booth Hire or Sweet Cart Hire, alongside this one?</p>
            <button type="button" class="wsf-add-btn" onclick="wsfAddService()">+ Yes, add another service</button>
            <button type="button" class="wsf-add-btn wsf-continue-btn" onclick="wsfGoToNext(this)">No, continue →</button>
          </div>

        </div>
      </div>
    </div>

    <!-- FINAL NOTES -->
    <div class="wsf-accordion">
      <div class="wsf-acc-header" onclick="wsfToggleAccordion(this.parentElement)">
        <div class="wsf-acc-header-left"><div class="wsf-acc-num">4</div><h2>Anything Else?</h2></div>
        <span class="wsf-acc-chevron">▾</span>
      </div>
      <p class="wsf-acc-desc">Any other information you'd like us to know before your page(s) go live.</p>
      <div class="wsf-acc-body">
        <textarea name="additional_notes" style="min-height:100px;"></textarea>
        <div class="wsf-note-box">Having trouble uploading anything, or have extra media to send? Just email it to hello@wedzo.co.uk along with your business name.</div>

        <div class="wsf-diamond">✦</div>
        <div class="wsf-submit-wrap">
          <button type="submit" class="wsf-submit">Submit My Details</button>
        </div>
      </div>
    </div>

  </form>
</div>

<script>
// ---- Accordion core: only one section open at a time ----
function wsfToggleAccordion(container) {
  document.querySelectorAll('.wsf-accordion').forEach(function(acc) {
    if (acc !== container) acc.classList.remove('open');
  });
  container.classList.toggle('open');
  if (container.classList.contains('open')) {
    setTimeout(function() { container.scrollIntoView({ behavior: 'smooth', block: 'start' }); }, 50);
  }
}
function wsfGoToNext(btn) {
  const current = btn.closest('.wsf-accordion');
  const all = Array.from(document.querySelectorAll('.wsf-accordion'));
  const idx = all.indexOf(current);
  if (idx > -1 && idx < all.length - 1) {
    const next = all[idx + 1];
    current.classList.remove('open');
    next.classList.add('open');
    setTimeout(function() { next.scrollIntoView({ behavior: 'smooth', block: 'start' }); }, 50);
  }
}

// ---- Reveal next hidden block scoped within the current service block (packages) ----
function wsfRevealNextIn(btn, className) {
  const container = btn.closest('.wsf-service-block');
  const blocks = container.querySelectorAll('.' + className);
  for (const block of blocks) {
    if (block.style.display === 'none') { block.style.display = 'block'; break; }
  }
}
// Reveal next hidden block within the closest conditional wrapper (tracks / repertoire categories)
function wsfRevealNextScoped(btn, className) {
  const container = btn.closest('.wsf-conditional');
  const blocks = container.querySelectorAll('.' + className);
  for (const block of blocks) {
    if (block.style.display === 'none') { block.style.display = 'block'; break; }
  }
}

// ---- Initialise behaviour for one service block ----
function wsfInitServiceBlock(block) {
  const categorySelect = block.querySelector('.wsf-category-select');
  const musicSection = block.querySelector('.wsf-music-section');
  const otherCategoryBlock = block.querySelector('.wsf-other-category-block');
  const badgeGroups = block.querySelectorAll('.wsf-badge-group[data-category]');

  categorySelect.addEventListener('change', function() {
    const val = this.value;
    musicSection.style.display = (val === 'Musicians') ? 'block' : 'none';
    otherCategoryBlock.classList.toggle('show', val === 'Other');
    badgeGroups.forEach(function(group) {
      group.style.display = (group.getAttribute('data-category') === val) ? 'block' : 'none';
    });
  });

  const musicPlayerToggle = block.querySelector('.wsf-music-player-toggle');
  const musicPlayerBlock = block.querySelector('.wsf-music-player-block');
  musicPlayerToggle.addEventListener('change', function() {
    musicPlayerBlock.classList.toggle('show', this.checked);
  });

  const repertoireToggle = block.querySelector('.wsf-repertoire-toggle');
  const repertoireBlock = block.querySelector('.wsf-repertoire-block');
  repertoireToggle.addEventListener('change', function() {
    repertoireBlock.classList.toggle('show', this.checked);
  });

  const badgeCheckboxes = block.querySelectorAll('input[name$="_badges[]"]');
  const counterEl = block.querySelector('.wsf-badge-counter-el');
  const maxBadges = 6;
  function updateBadgeState() {
    const checkedCount = block.querySelectorAll('input[name$="_badges[]"]:checked').length;
    counterEl.textContent = checkedCount + ' of ' + maxBadges + ' selected';
    badgeCheckboxes.forEach(function(cb) {
      if (!cb.checked) {
        cb.disabled = checkedCount >= maxBadges;
        cb.closest('.wsf-badge-check').classList.toggle('disabled', checkedCount >= maxBadges);
      }
    });
  }
  badgeCheckboxes.forEach(function(cb) { cb.addEventListener('change', updateBadgeState); });
}
document.querySelectorAll('.wsf-service-block').forEach(wsfInitServiceBlock);

// ---- Add another service (clone Service 1 as a template) ----
let wsfServiceCount = 1;
const wsfMaxServices = 4;
function wsfAddService() {
  if (wsfServiceCount >= wsfMaxServices) {
    alert('You can add up to ' + wsfMaxServices + ' services here. Need more? Just email us at hello@wedzo.co.uk.');
    return;
  }
  wsfServiceCount++;
  const template = document.querySelector('.wsf-service-block[data-service="1"]');
  const clone = template.cloneNode(true);
  clone.setAttribute('data-service', wsfServiceCount);
  clone.classList.remove('open');
  clone.querySelector('.wsf-service-block-title').textContent = 'Service ' + wsfServiceCount;
  clone.querySelector('.wsf-acc-num').textContent = '3';

  clone.querySelectorAll('[name^="service_1_"]').forEach(function(field) {
    field.name = field.name.replace('service_1_', 'service_' + wsfServiceCount + '_');
  });
  clone.querySelectorAll('[id^="s1"]').forEach(function(el) {
    el.id = el.id.replace('s1', 's' + wsfServiceCount);
  });
  clone.querySelectorAll('label[for^="s1"]').forEach(function(lbl) {
    lbl.setAttribute('for', lbl.getAttribute('for').replace('s1', 's' + wsfServiceCount));
  });

  clone.querySelectorAll('input[type=text], input[type=file], textarea').forEach(function(f) { f.value = ''; });
  clone.querySelectorAll('input[type=checkbox], input[type=radio]').forEach(function(f) { f.checked = false; f.disabled = false; });
  clone.querySelectorAll('.wsf-badge-check').forEach(function(f) { f.classList.remove('disabled'); });
  clone.querySelector('.wsf-badge-counter-el').textContent = '0 of 6 selected';
  clone.querySelector('.wsf-music-section').style.display = 'none';
  clone.querySelector('.wsf-other-category-block').classList.remove('show');
  clone.querySelectorAll('.wsf-conditional').forEach(function(c) { c.classList.remove('show'); });
  clone.querySelectorAll('.wsf-badge-group[data-category]').forEach(function(g) { g.style.display = 'none'; });
  clone.querySelectorAll('.wsf-package-block, .wsf-track-block, .wsf-category-item-block').forEach(function(b) {
    b.style.display = (b.getAttribute('data-index') === '1') ? 'block' : 'none';
  });
  clone.querySelector('.wsf-same-areas-wrap').style.display = 'block';

  document.getElementById('wsfServices').appendChild(clone);
  wsfInitServiceBlock(clone);

  document.querySelectorAll('.wsf-accordion').forEach(function(acc) { acc.classList.remove('open'); });
  clone.classList.add('open');
  setTimeout(function() { clone.scrollIntoView({ behavior: 'smooth', block: 'start' }); }, 50);
}

function wsfToggleSameAreas(checkbox) {
  const block = checkbox.closest('.wsf-service-block');
  const fields = block.querySelectorAll('input[name*="_areas_included"], input[name*="_extra_area_rate"], input[name*="_extra_area_option"]');
  fields.forEach(function(f) {
    f.disabled = checkbox.checked;
    f.style.opacity = checkbox.checked ? '0.4' : '1';
  });
}

// ---- Autosave & restore (text fields only — files can't be persisted this way) ----
const WSF_DRAFT_KEY = 'wedzoSupplierOnboardingDraft_v1';
const wsfForm = document.getElementById('wsfForm');

function wsfSerializeForm() {
  const data = {};
  const elements = wsfForm.querySelectorAll('input, textarea, select');
  elements.forEach(function(el) {
    if (el.type === 'file') return;
    if (!el.name) return;
    if (el.type === 'checkbox') {
      if (el.name.endsWith('[]')) {
        if (!data[el.name]) data[el.name] = [];
        if (el.checked) data[el.name].push(el.value);
      } else {
        data[el.name] = el.checked;
      }
    } else if (el.type === 'radio') {
      if (el.checked) data[el.name] = el.value;
    } else {
      data[el.name] = el.value;
    }
  });
  data.__serviceCount = wsfServiceCount;
  return data;
}

let wsfSaveTimeout;
function wsfSaveDraft() {
  clearTimeout(wsfSaveTimeout);
  wsfSaveTimeout = setTimeout(function() {
    try {
      localStorage.setItem(WSF_DRAFT_KEY, JSON.stringify(wsfSerializeForm()));
    } catch (e) { /* storage unavailable — fail silently */ }
  }, 400);
}
wsfForm.addEventListener('input', wsfSaveDraft);
wsfForm.addEventListener('change', wsfSaveDraft);

function wsfClearDraft() {
  localStorage.removeItem(WSF_DRAFT_KEY);
  location.reload();
}

function wsfRestoreDraft() {
  let saved;
  try {
    const raw = localStorage.getItem(WSF_DRAFT_KEY);
    if (!raw) return;
    saved = JSON.parse(raw);
  } catch (e) { return; }

  const targetCount = saved.__serviceCount || 1;
  while (wsfServiceCount < targetCount) { wsfAddService(); }

  Object.keys(saved).forEach(function(name) {
    if (name === '__serviceCount') return;
    const value = saved[name];
    if (name.endsWith('[]') && Array.isArray(value)) {
      const checkboxes = wsfForm.querySelectorAll('input[name="' + name + '"]');
      checkboxes.forEach(function(cb) {
        if (value.indexOf(cb.value) > -1) {
          cb.checked = true;
          cb.dispatchEvent(new Event('change'));
        }
      });
    } else {
      const els = wsfForm.querySelectorAll('[name="' + name + '"]');
      els.forEach(function(el) {
        if (el.type === 'checkbox') {
          el.checked = !!value;
          el.dispatchEvent(new Event('change'));
        } else if (el.type === 'radio') {
          if (el.value === value) { el.checked = true; el.dispatchEvent(new Event('change')); }
        } else {
          el.value = value;
        }
      });
    }
  });

  // Make sure any populated progressive blocks (packages/tracks/categories) are visible
  document.querySelectorAll('.wsf-package-block, .wsf-track-block, .wsf-category-item-block').forEach(function(block) {
    const hasValue = Array.from(block.querySelectorAll('input[type=text], textarea')).some(function(f) { return f.value.trim() !== ''; });
    if (hasValue) block.style.display = 'block';
  });

  document.getElementById('wsfDraftBanner').style.display = 'block';
}

document.addEventListener('DOMContentLoaded', wsfRestoreDraft);

wsfForm.addEventListener('submit', function() {
  localStorage.removeItem(WSF_DRAFT_KEY);
});
</script>