<!-- FACTOR Plugin Setup - Simple QR Code & Web Setup -->
<div id="settings_plugin_factor_mqtt" class="factor-mqtt-setup">
  <!-- Language Selector -->
  <div class="language-selector">
    <div class="btn-group" id="fm-lang-selector">
      <button type="button" class="btn btn-mini" data-lang="en" title="English">
        🇺🇸 EN
      </button>
      <button type="button" class="btn btn-mini" data-lang="ko" title="한국어">
        🇰🇷 KO
      </button>
    </div>
  </div>

  <!-- Main Setup Container -->
  <div class="setup-container">
    <!-- Header -->
    <div class="setup-header">
      <h2 data-i18n="setup.title">FACTOR Device Setup</h2>
      <p class="text-muted" data-i18n="setup.description">
        Click the button below to complete device setup on the FACTOR web dashboard.
      </p>
    </div>

    <!-- Setup URL Section -->
    <div class="url-section">
      <div id="fm-url-loading" class="url-loading">
        <i class="icon-spinner icon-spin"></i>
        <span data-i18n="setup.url.loading">Loading setup URL...</span>
      </div>
      <div id="fm-url-display" style="display: none;">
        <div class="url-info">
          <label data-i18n="setup.instanceId">Device ID:</label>
          <code id="fm-instance-id-text"></code>
        </div>
        <div class="url-info">
          <label data-i18n="setup.setupUrl">Setup URL:</label>
          <code id="fm-setup-url-text"></code>
        </div>
      </div>
    </div>

    <!-- Action Buttons -->
    <div class="action-buttons">
      <a id="fm-open-setup" href="#" target="_blank" class="btn btn-primary btn-large">
        <i class="icon-external-link"></i>
        <span data-i18n="setup.button.openWeb">Open Setup Page</span>
      </a>

      <button id="fm-refresh-qr" class="btn btn-small">
        <i class="icon-refresh"></i>
        <span data-i18n="setup.button.refresh">Refresh Setup URL</span>
      </button>
    </div>

    <!-- Help Section -->
    <div class="help-section">
      <h4 data-i18n="setup.help.title">How to Setup</h4>
      <ol>
        <li data-i18n="setup.help.step1">Click "Open Setup Page" button to start setup</li>
        <li data-i18n="setup.help.step2">Login to your FACTOR account on the web page</li>
        <li data-i18n="setup.help.step3">Complete the device registration and configuration</li>
        <li data-i18n="setup.help.step4">Return here to verify the connection status</li>
      </ol>
    </div>
  </div>
</div>
