.elementor-2790 .elementor-element.elementor-element-2256bac0{--display:flex;}.elementor-2790 .elementor-element.elementor-element-74fe6b6{--display:flex;}.elementor-2790 .elementor-element.elementor-element-74fe6b6.e-con{--flex-grow:0;--flex-shrink:0;}:root{--page-title-display:none;}@media(min-width:768px){.elementor-2790 .elementor-element.elementor-element-74fe6b6{--width:98.892%;}}/* Start custom CSS for html, class: .elementor-element-76c8e18 */<!-- ========== STAR LOCAL TEST V2 COMPLET ========== -->
<div class="starlocal-box">
  <h3>⭐ StarLocal Test V2</h3>
  <p class="sl-sub">
    Évaluez votre présence locale en 30 secondes et découvrez l'offre la plus adaptée à votre métier.
  </p>
  
  <!-- PROFESSION -->
  <label for="profession">Quelle est votre profession ?</label>
  <select id="profession">
    <option value="">-- Sélectionner --</option>
    <option value="avocat">⚖️ Avocat / Juriste</option>
    <option value="notaire">📋 Notaire</option>
    <option value="medecin">🏥 Médecin / Dentiste</option>
    <option value="artisan">🔧 Artisan (Électricien, Plombier, etc.)</option>
    <option value="commerce">🛍️ Commerce / Boutique</option>
    <option value="restaurant">🍽️ Restaurant / Café</option>
    <option value="salon">💇 Salon de beauté / Coiffure</option>
    <option value="coaching">📊 Coach / Consultant</option>
    <option value="autre">🏢 Autre profession locale</option>
  </select>
  <p class="sl-help">Nous adaptons nos recommandations à votre métier.</p>
  
  <!-- AVIS -->
  <label for="avis">Nombre d'avis Google sur votre fiche</label>
  <select id="avis">
    <option value="">-- Sélectionner --</option>
    <option value="0-15">0 à 15</option>
    <option value="15-30">15 à 30</option>
    <option value="30-45">30 à 45</option>
    <option value="45-60">45 à 60</option>
    <option value="60+">60+</option>
  </select>
  <p class="sl-help">Les avis clients sont un signal clé de visibilité sur Google Maps.</p>
  
  <!-- NOTE -->
  <label for="note">Note moyenne Google</label>
  <select id="note">
    <option value="">-- Sélectionner --</option>
    <option value="3-4">3,0 – 4,0</option>
    <option value="4-4.5">4,0 – 4,5</option>
    <option value="4.5-5">4,5 – 5,0</option>
  </select>
  <p class="sl-help">Une bonne note augmente votre crédibilité et vos conversions.</p>
  
  <!-- EMAIL -->
  <div class="cta-email-wrap">
    <label for="email">Recevoir le détail du score ✉️</label>
    <input type="email" id="email" placeholder="votre@email.com" required>
  </div>
  
  <!-- BOUTON -->
  <button id="sl-submit">🚀 Voir mon score</button>
  
  <!-- RÉSULTAT -->
  <p id="sl-result" class="sl-result" style="display:none;"></p>
</div>

<!-- ========== CSS COMPLET ========== -->
<style>
:root {
  --violet-principal: #63188E;
  --violet-clair: #A678D1;
  --violet-accent: #7E3DCC;
  --bg-dark: #0f1013;
  --bg-card: #181a1f;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-focus: rgba(99, 24, 142, 0.7);
  --text-white: #ffffff;
  --text-gray: rgba(255, 255, 255, 0.9);
  --text-light: rgba(255, 255, 255, 0.85);
  --text-muted: rgba(255, 255, 255, 0.7);
  --shadow-lg: 0 14px 50px rgba(0, 0, 0, 0.35);
  --shadow-focus: 0 0 10px rgba(99, 24, 142, 0.4);
}

.starlocal-box {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1d24 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 32px 28px 36px;
  max-width: 460px;
  margin: 0 auto;
  color: var(--text-white);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  animation: slideUp 0.5s ease-out;
}

.starlocal-box:hover {
  border-color: rgba(99, 24, 142, 0.3);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.starlocal-box h3 {
  font-size: 1.6em;
  font-weight: 700;
  color: var(--text-white);
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.starlocal-box h3::before {
  content: '';
  width: 12px;
  height: 12px;
  background: var(--violet-principal);
  border-radius: 50%;
  flex-shrink: 0;
}

.sl-sub {
  font-size: 0.98rem;
  color: var(--text-light);
  line-height: 1.6;
  margin: 12px 0 24px 0;
  font-weight: 400;
}

.starlocal-box label {
  display: block;
  margin-top: 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-gray);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.starlocal-box label:first-of-type {
  margin-top: 0;
}

.sl-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
  line-height: 1.5;
}

.starlocal-box select,
.starlocal-box input[type="email"] {
  width: 100%;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 13px 14px;
  color: var(--text-white);
  margin-top: 10px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.3s ease;
  appearance: none;
}

.starlocal-box select {
  background-image: 
    linear-gradient(45deg, transparent 50%, var(--violet-principal) 50%),
    linear-gradient(135deg, var(--violet-principal) 50%, transparent 50%);
  background-position: 
    calc(100% - 15px) calc(1em + 2px),
    calc(100% - 10px) calc(1em + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.starlocal-box select:focus,
.starlocal-box input:focus {
  outline: none;
  border-color: var(--border-focus);
  background-color: rgba(99, 24, 142, 0.05);
  box-shadow: var(--shadow-focus), inset 0 0 0 1px var(--violet-accent);
}

.starlocal-box select:hover:not(:focus),
.starlocal-box input:hover:not(:focus) {
  border-color: rgba(99, 24, 142, 0.4);
}

.cta-email-wrap {
  margin-top: 22px;
}

.cta-email-wrap label {
  display: flex;
  align-items: center;
  gap: 6px;
}

#sl-submit {
  margin-top: 24px;
  width: 100%;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--violet-principal) 0%, var(--violet-accent) 100%);
  color: var(--text-white);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 0;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(99, 24, 142, 0.3);
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

#sl-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

#sl-submit:hover::before {
  left: 100%;
}

#sl-submit:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(99, 24, 142, 0.4);
}

#sl-submit:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 24, 142, 0.3);
}

#sl-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.sl-result {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.sl-result.success { color: #4ade80; }
.sl-result.error { color: #ef4444; }

@media (max-width: 640px) {
  .starlocal-box {
    padding: 24px 20px 28px;
    border-radius: 20px;
    max-width: 100%;
    margin: 0 12px;
  }
  .starlocal-box h3 { font-size: 1.3em; }
  .sl-sub { font-size: 0.9rem; }
  .starlocal-box label { font-size: 0.8rem; margin-top: 16px; }
  .starlocal-box select, .starlocal-box input[type="email"] { 
    padding: 12px 12px; 
    font-size: 16px; 
    border-radius: 10px; 
  }
  #sl-submit { padding: 12px 0; font-size: 0.95rem; margin-top: 20px; }
  .cta-email-wrap { margin-top: 18px; }
}

@media (max-width: 480px) {
  .starlocal-box { padding: 20px 16px 24px; }
  .starlocal-box h3 { font-size: 1.2em; }
  .sl-sub { font-size: 0.85rem; margin: 10px 0 16px 0; }
  .starlocal-box label { font-size: 0.75rem; margin-top: 14px; }
  .sl-help { font-size: 0.75rem; }
}

.starlocal-box select:focus-visible,
.starlocal-box input:focus-visible,
#sl-submit:focus-visible {
  outline: 2px solid var(--violet-principal);
  outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  .starlocal-box {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1d24 100%);
  }
}
</style>

<!-- ========== JAVASCRIPT COMPLET ========== -->
<script>
const professionConfig = {
  avocat: {
    name: 'Avocat / Juriste',
    priorities: ['credibilité', 'avis', 'annuaires'],
    thresholds: { tier1: { avis: 8, note: 3.8 }, tier2: { avis: 15, note: 4.2 }, tier3: { avis: 25, note: 4.5 } }
  },
  notaire: {
    name: 'Notaire',
    priorities: ['credibilité', 'avis', 'confiance'],
    thresholds: { tier1: { avis: 5, note: 3.9 }, tier2: { avis: 12, note: 4.3 }, tier3: { avis: 20, note: 4.6 } }
  },
  medecin: {
    name: 'Médecin / Dentiste',
    priorities: ['doctolib', 'avis', 'horaires'],
    thresholds: { tier1: { avis: 10, note: 3.9 }, tier2: { avis: 20, note: 4.3 }, tier3: { avis: 35, note: 4.7 } }
  },
  artisan: {
    name: 'Artisan',
    priorities: ['photos', 'google_posts', 'avis'],
    thresholds: { tier1: { avis: 12, note: 3.8 }, tier2: { avis: 25, note: 4.2 }, tier3: { avis: 40, note: 4.5 } }
  },
  commerce: {
    name: 'Commerce / Boutique',
    priorities: ['photos', 'avis', 'google_posts'],
    thresholds: { tier1: { avis: 15, note: 3.7 }, tier2: { avis: 30, note: 4.1 }, tier3: { avis: 50, note: 4.6 } }
  },
  restaurant: {
    name: 'Restaurant / Café',
    priorities: ['photos', 'horaires', 'avis'],
    thresholds: { tier1: { avis: 20, note: 3.8 }, tier2: { avis: 40, note: 4.2 }, tier3: { avis: 60, note: 4.5 } }
  },
  salon: {
    name: 'Salon de beauté / Coiffure',
    priorities: ['photos', 'google_posts', 'avis'],
    thresholds: { tier1: { avis: 15, note: 3.8 }, tier2: { avis: 30, note: 4.1 }, tier3: { avis: 50, note: 4.6 } }
  },
  coaching: {
    name: 'Coach / Consultant',
    priorities: ['credibilité', 'avis', 'pages_locales'],
    thresholds: { tier1: { avis: 5, note: 4.0 }, tier2: { avis: 15, note: 4.4 }, tier3: { avis: 30, note: 4.7 } }
  },
  autre: {
    name: 'Autre profession',
    priorities: ['fiche', 'avis', 'annuaires'],
    thresholds: { tier1: { avis: 10, note: 3.8 }, tier2: { avis: 20, note: 4.2 }, tier3: { avis: 35, note: 4.6 } }
  }
};

document.getElementById('sl-submit').addEventListener('click', function(e){
  e.preventDefault();
  
  const profession = document.getElementById('profession').value;
  const avis = document.getElementById('avis').value;
  const note = document.getElementById('note').value;
  const email = document.getElementById('email').value.trim();
  
  if(!profession) {
    alert("Sélectionnez votre profession pour continuer 🔐");
    return;
  }
  if(!avis || !note){
    alert("Remplissez tous les champs pour continuer 🔐");
    return;
  }
  if(!email){
    alert("Ajoutez votre email pour recevoir le détail du score 🔐");
    return;
  }
  
  const tier = determineTierByProfession(profession, avis, note);
  const resultsURL = `/star-local-results/?tier=${tier}&profession=${profession}`;
  
  sendToBrevo(email, tier, profession);
  
  const res = document.getElementById('sl-result');
  res.style.display = 'block';
  res.innerText = "Analyse en cours… orientation vers la solution la plus adaptée.";
  
  setTimeout(() => {
    window.location.href = resultsURL;
  }, 1200);
});

function determineTierByProfession(profession, avis, note) {
  const config = professionConfig[profession] || professionConfig.autre;
  const avisNum = parseFloat(avis.split('-')[0]);
  const noteNum = parseFloat(note.split('-')[0]);
  
  if (avisNum <= config.thresholds.tier1.avis || noteNum <= config.thresholds.tier1.note) {
    return 'tier-1';
  }
  else if (avisNum <= config.thresholds.tier2.avis || noteNum <= config.thresholds.tier2.note) {
    return 'tier-2';
  }
  else if (avisNum >= config.thresholds.tier3.avis && noteNum >= config.thresholds.tier3.note) {
    return 'tier-3';
  }
  
  return 'tier-2';
}

function sendToBrevo(email, tier, profession) {
  const config = professionConfig[profession];
  
  fetch('/wp-json/brevo/v1/optin', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      email: email,
      tier: tier,
      profession: profession,
      profession_name: config.name,
      source: 'star-local-test-v2'
    })
  }).catch(err => console.log('Brevo opt-in envoyé'));
}
</script>/* End custom CSS */