Browse Source

Ajout packs v2 + mises à jour projet

augustin.podvin 8 months ago
parent
commit
3070900628
41 changed files with 2395 additions and 519 deletions
  1. 1 1
      README.md
  2. 0 0
      config/audit-structure.json
  3. 1 1
      config/config.local.example.php
  4. 1 1
      config/config.php
  5. 298 0
      config/packs/collecte-terrain-qualite-conformite-v2.json
  6. 272 0
      config/packs/internal-requests-validations-v2.json
  7. 239 0
      config/packs/intervention-sav-maintenance-terrain-v2-compact.json
  8. 0 0
      config/packs/pack-onboarding-v1.json
  9. 25 25
      config/packs/process-generique-v2.json
  10. 35 163
      config/packs/process-generique.json
  11. 213 0
      config/packs/transformation-excel.json
  12. 20 120
      config/packs/validation-facture.json
  13. 3 3
      docs/DOC.md
  14. 9 9
      docs/MODX_INTEGRATION.md
  15. 2 2
      docs/SECURITY.md
  16. 1 1
      modx/chunks/ae_cta_unlocked.html
  17. 1 1
      modx/chunks/ae_results.html
  18. 1 1
      modx/chunks/ae_win_item.html
  19. 1 1
      modx/model/audit_express/auditrequest.class.php
  20. 1 1
      modx/model/audit_express/mysql/auditrequest.class.php
  21. 1 1
      modx/model/audit_express/mysql/auditrequest.map.inc.php
  22. 3 3
      modx/plugins/AuditExpress_Init.php
  23. 23 23
      modx/preview-chunks.html
  24. 3 3
      modx/schema/audit_express.mysql.schema.xml
  25. 1 1
      modx/setup/create_tables.sql
  26. 1 1
      modx/setup/install.php
  27. 2 2
      modx/snippets/AuditExpress_Quiz.php
  28. 2 2
      modx/snippets/AuditExpress_Results.php
  29. 2 2
      modx/snippets/AuditExpress_SelectPack.php
  30. 3 3
      modx/templates/AuditExpress_Base.html
  31. 3 3
      modx/templates/AuditExpress_Landing.html
  32. 3 3
      modx/templates/AuditExpress_Quiz.html
  33. 3 3
      modx/templates/AuditExpress_Results.html
  34. 8 1
      public/.htaccess
  35. 241 6
      public/assets/css/app.css
  36. 636 107
      public/assets/js/app.js
  37. 55 4
      public/index.php
  38. 157 18
      src/Engine.php
  39. 4 0
      src/PackRepository.php
  40. 42 3
      templates/pdf_a4.php
  41. 78 0
      test-excel-pack.ps1

+ 1 - 1
README.md

@@ -1,6 +1,6 @@
 # Audit Express Self (V1)
 
-Quiz diagnostic "contrôle technique" — 20 questions, ~7 min.  
+Quiz diagnostic "contrôle technique" - 20 questions, ~7 min.  
 Stack : HTML / CSS / JavaScript / PHP.
 
 ## Démarrage rapide

File diff suppressed because it is too large
+ 0 - 0
config/audit-structure.json


+ 1 - 1
config/config.local.example.php

@@ -9,6 +9,6 @@ declare(strict_types=1);
 return [
     'booking_url' => 'https://cal.com/augustin.podvin/decouvrir-les-opportunites-suite-a-mon-audit',
     'devis_url'   => 'mailto:contact@votredomaine.fr?subject=Demande%20de%20devis',
-    // Webhook appelé à chaque submit (score, pdf, email) — à garder secret
+    // Webhook appelé à chaque submit (score, pdf, email) - à garder secret
     'admin_notify_webhook' => 'https://hooks.zapier.com/...',  // ou Make, endpoint custom
 ];

+ 1 - 1
config/config.php

@@ -23,6 +23,6 @@ return [
     ],
     'allowed_notify_tools' => ['process-mapper'],  // Liste blanche pour notify.php
 
-    // Webhook appelé à chaque submit (score, pdf, email) — Make, Zapier ou endpoint custom
+    // Webhook appelé à chaque submit (score, pdf, email) - Make, Zapier ou endpoint custom
     'admin_notify_webhook' => 'https://hook.eu1.make.com/hwpp9vg8i8sw32wroqfb1y1923vb6plp',
 ];

+ 298 - 0
config/packs/collecte-terrain-qualite-conformite-v2.json

@@ -0,0 +1,298 @@
+{
+  "pack_id": "collecte-terrain-qualite-conformite-v2",
+  "pack_title": "Collecte terrain / qualité / conformité / audits",
+  "pack_description": "Diagnostic de maturité pour checklists, contrôles, non-conformités et traçabilité audit.",
+  "pillars": [
+    { "id": "CLARTE", "label": "Clarté", "max": 20, "raw_max": 15 },
+    { "id": "FIABILITE", "label": "Fiabilité", "max": 20, "raw_max": 20 },
+    { "id": "PREUVE", "label": "Preuve", "max": 20, "raw_max": 15 },
+    { "id": "RESILIENCE", "label": "Résilience", "max": 20, "raw_max": 15 },
+    { "id": "COUT", "label": "Coût", "max": 20, "raw_max": 15 }
+  ],
+  "questions": [
+    {
+      "id": "CTQ1",
+      "pillar_id": "CLARTE",
+      "label": "Le processus de contrôle / checklist est-il défini et compris de façon homogène par les équipes ?",
+      "type": "radio",
+      "options": [
+        { "id": "ctq1_lvl_0", "label": "Non, ou très insuffisant", "points": 0 },
+        { "id": "ctq1_lvl_2", "label": "Partiellement, de façon manuelle", "points": 2 },
+        { "id": "ctq1_lvl_4", "label": "Oui, mais encore fragile", "points": 4 },
+        { "id": "ctq1_lvl_5", "label": "Oui, de façon claire et fiable", "points": 5 },
+        { "id": "ctq1_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "CTQ2",
+      "pillar_id": "CLARTE",
+      "label": "Disposez-vous d'une version unique et à jour des checklists / formulaires, sans variantes locales non maîtrisées ?",
+      "type": "radio",
+      "options": [
+        { "id": "ctq2_lvl_0", "label": "Non, ou très insuffisant", "points": 0 },
+        { "id": "ctq2_lvl_2", "label": "Partiellement, de façon manuelle", "points": 2 },
+        { "id": "ctq2_lvl_4", "label": "Oui, mais encore fragile", "points": 4 },
+        { "id": "ctq2_lvl_5", "label": "Oui, de façon claire et fiable", "points": 5 },
+        { "id": "ctq2_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "CTQ3",
+      "pillar_id": "CLARTE",
+      "label": "Les critères de contrôle et les responsabilités (déclarer, traiter, valider) sont-ils clairement définis ?",
+      "type": "radio",
+      "options": [
+        { "id": "ctq3_lvl_0", "label": "Non, ou très insuffisant", "points": 0 },
+        { "id": "ctq3_lvl_2", "label": "Partiellement, de façon manuelle", "points": 2 },
+        { "id": "ctq3_lvl_4", "label": "Oui, mais encore fragile", "points": 4 },
+        { "id": "ctq3_lvl_5", "label": "Oui, de façon claire et fiable", "points": 5 },
+        { "id": "ctq3_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "CTQ4",
+      "pillar_id": "FIABILITE",
+      "label": "La collecte terrain se fait-elle dans un format structuré (plutôt que papier, WhatsApp, notes libres, Excel non cadré) ?",
+      "type": "radio",
+      "options": [
+        { "id": "ctq4_lvl_0", "label": "Non, ou très insuffisant", "points": 0 },
+        { "id": "ctq4_lvl_2", "label": "Partiellement, de façon manuelle", "points": 2 },
+        { "id": "ctq4_lvl_4", "label": "Oui, mais encore fragile", "points": 4 },
+        { "id": "ctq4_lvl_5", "label": "Oui, de façon claire et fiable", "points": 5 },
+        { "id": "ctq4_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "CTQ5",
+      "pillar_id": "FIABILITE",
+      "label": "Les formulaires réduisent-ils les erreurs de saisie (champs obligatoires, listes, formats, règles conditionnelles) ?",
+      "type": "radio",
+      "options": [
+        { "id": "ctq5_lvl_0", "label": "Non, ou très insuffisant", "points": 0 },
+        { "id": "ctq5_lvl_2", "label": "Partiellement, de façon manuelle", "points": 2 },
+        { "id": "ctq5_lvl_4", "label": "Oui, mais encore fragile", "points": 4 },
+        { "id": "ctq5_lvl_5", "label": "Oui, de façon claire et fiable", "points": 5 },
+        { "id": "ctq5_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "CTQ6",
+      "pillar_id": "FIABILITE",
+      "label": "Les erreurs de saisie ou oublis ayant un impact réel (retard, reprise, litige, qualité) sont-ils rares et bien maîtrisés ?",
+      "type": "radio",
+      "options": [
+        { "id": "ctq6_lvl_0", "label": "Non, ou très insuffisant", "points": 0 },
+        { "id": "ctq6_lvl_2", "label": "Partiellement, de façon manuelle", "points": 2 },
+        { "id": "ctq6_lvl_4", "label": "Oui, mais encore fragile", "points": 4 },
+        { "id": "ctq6_lvl_5", "label": "Oui, de façon claire et fiable", "points": 5 },
+        { "id": "ctq6_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "CTQ7",
+      "pillar_id": "FIABILITE",
+      "label": "La ressaisie / copier-coller entre vos contrôles et les autres outils est-elle limitée et maîtrisée ?",
+      "type": "radio",
+      "options": [
+        { "id": "ctq7_lvl_0", "label": "Non, ou très insuffisant", "points": 0 },
+        { "id": "ctq7_lvl_2", "label": "Partiellement, de façon manuelle", "points": 2 },
+        { "id": "ctq7_lvl_4", "label": "Oui, mais encore fragile", "points": 4 },
+        { "id": "ctq7_lvl_5", "label": "Oui, de façon claire et fiable", "points": 5 },
+        { "id": "ctq7_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "CTQ8",
+      "pillar_id": "PREUVE",
+      "label": "Les contrôles permettent-ils d'ajouter facilement des preuves (photos, pièces jointes, commentaires) ?",
+      "type": "radio",
+      "options": [
+        { "id": "ctq8_lvl_0", "label": "Non, ou très insuffisant", "points": 0 },
+        { "id": "ctq8_lvl_2", "label": "Partiellement, de façon manuelle", "points": 2 },
+        { "id": "ctq8_lvl_4", "label": "Oui, mais encore fragile", "points": 4 },
+        { "id": "ctq8_lvl_5", "label": "Oui, de façon claire et fiable", "points": 5 },
+        { "id": "ctq8_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "CTQ9",
+      "pillar_id": "PREUVE",
+      "label": "Pouvez-vous savoir précisément qui a saisi quoi et quand, sans ambiguïté ?",
+      "type": "radio",
+      "options": [
+        { "id": "ctq9_lvl_0", "label": "Non, ou très insuffisant", "points": 0 },
+        { "id": "ctq9_lvl_2", "label": "Partiellement, de façon manuelle", "points": 2 },
+        { "id": "ctq9_lvl_4", "label": "Oui, mais encore fragile", "points": 4 },
+        { "id": "ctq9_lvl_5", "label": "Oui, de façon claire et fiable", "points": 5 },
+        { "id": "ctq9_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "CTQ10",
+      "pillar_id": "PREUVE",
+      "label": "En cas d'audit interne / client / certification, la preuve est-elle rapide à retrouver et exploitable ?",
+      "type": "radio",
+      "options": [
+        { "id": "ctq10_lvl_0", "label": "Non, ou très insuffisant", "points": 0 },
+        { "id": "ctq10_lvl_2", "label": "Partiellement, de façon manuelle", "points": 2 },
+        { "id": "ctq10_lvl_4", "label": "Oui, mais encore fragile", "points": 4 },
+        { "id": "ctq10_lvl_5", "label": "Oui, de façon claire et fiable", "points": 5 },
+        { "id": "ctq10_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "CTQ11",
+      "pillar_id": "RESILIENCE",
+      "label": "La déclaration d'une non-conformité est-elle simple, standardisée et intégrée au flux de travail ?",
+      "type": "radio",
+      "options": [
+        { "id": "ctq11_lvl_0", "label": "Non, ou très insuffisant", "points": 0 },
+        { "id": "ctq11_lvl_2", "label": "Partiellement, de façon manuelle", "points": 2 },
+        { "id": "ctq11_lvl_4", "label": "Oui, mais encore fragile", "points": 4 },
+        { "id": "ctq11_lvl_5", "label": "Oui, de façon claire et fiable", "points": 5 },
+        { "id": "ctq11_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "CTQ12",
+      "pillar_id": "RESILIENCE",
+      "label": "Chaque non-conformité débouche-t-elle sur un plan d'actions avec responsable et échéance ?",
+      "type": "radio",
+      "options": [
+        { "id": "ctq12_lvl_0", "label": "Non, ou très insuffisant", "points": 0 },
+        { "id": "ctq12_lvl_2", "label": "Partiellement, de façon manuelle", "points": 2 },
+        { "id": "ctq12_lvl_4", "label": "Oui, mais encore fragile", "points": 4 },
+        { "id": "ctq12_lvl_5", "label": "Oui, de façon claire et fiable", "points": 5 },
+        { "id": "ctq12_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "CTQ13",
+      "pillar_id": "RESILIENCE",
+      "label": "Le suivi des statuts (ouvert, en cours, corrigé, validé) et les relances sont-ils fiables ?",
+      "type": "radio",
+      "options": [
+        { "id": "ctq13_lvl_0", "label": "Non, ou très insuffisant", "points": 0 },
+        { "id": "ctq13_lvl_2", "label": "Partiellement, de façon manuelle", "points": 2 },
+        { "id": "ctq13_lvl_4", "label": "Oui, mais encore fragile", "points": 4 },
+        { "id": "ctq13_lvl_5", "label": "Oui, de façon claire et fiable", "points": 5 },
+        { "id": "ctq13_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "CTQ14",
+      "pillar_id": "COUT",
+      "label": "Le temps passé à récupérer et consolider les contrôles terrain est-il maîtrisé ?",
+      "type": "radio",
+      "options": [
+        { "id": "ctq14_lvl_0", "label": "Non, ou très insuffisant", "points": 0 },
+        { "id": "ctq14_lvl_2", "label": "Partiellement, de façon manuelle", "points": 2 },
+        { "id": "ctq14_lvl_4", "label": "Oui, mais encore fragile", "points": 4 },
+        { "id": "ctq14_lvl_5", "label": "Oui, de façon claire et fiable", "points": 5 },
+        { "id": "ctq14_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "CTQ15",
+      "pillar_id": "COUT",
+      "label": "Le temps nécessaire pour produire les reportings et préparer les audits est-il maîtrisé ?",
+      "type": "radio",
+      "options": [
+        { "id": "ctq15_lvl_0", "label": "Non, ou très insuffisant", "points": 0 },
+        { "id": "ctq15_lvl_2", "label": "Partiellement, de façon manuelle", "points": 2 },
+        { "id": "ctq15_lvl_4", "label": "Oui, mais encore fragile", "points": 4 },
+        { "id": "ctq15_lvl_5", "label": "Oui, de façon claire et fiable", "points": 5 },
+        { "id": "ctq15_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "CTQ16",
+      "pillar_id": "COUT",
+      "label": "Avez-vous une vision exploitable des résultats (sites, anomalies, délais) pour agir rapidement ?",
+      "type": "radio",
+      "options": [
+        { "id": "ctq16_lvl_0", "label": "Non, ou très insuffisant", "points": 0 },
+        { "id": "ctq16_lvl_2", "label": "Partiellement, de façon manuelle", "points": 2 },
+        { "id": "ctq16_lvl_4", "label": "Oui, mais encore fragile", "points": 4 },
+        { "id": "ctq16_lvl_5", "label": "Oui, de façon claire et fiable", "points": 5 },
+        { "id": "ctq16_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    }
+  ],
+  "scoring": {
+    "scale": "0-5",
+    "dk_points": 1,
+    "triggers_mode": "lowest",
+    "triggers_score_max": 2,
+    "pillar_normalization": true,
+    "level_thresholds": {
+      "A": { "min": 85, "max": 100, "label": "Process gérable mais fragile" },
+      "B": { "min": 70, "max": 84, "label": "Process gérable mais fragile" },
+      "C": { "min": 50, "max": 69, "label": "Digitalisation recommandée à court terme" },
+      "D": { "min": 0, "max": 49, "label": "Digitalisation prioritaire" }
+    },
+    "anti_cheat_caps": [
+      { "trigger": { "question": "CTQ1", "condition": "score == 0" }, "pillar": "CLARTE", "cap": 12 },
+      { "trigger": { "question": "CTQ6", "condition": "score == 0" }, "pillar": "FIABILITE", "cap": 12 },
+      { "trigger": { "question": "CTQ10", "condition": "score == 0" }, "pillar": "PREUVE", "cap": 10 },
+      { "trigger": { "question": "CTQ12", "condition": "score == 0" }, "pillar": "RESILIENCE", "cap": 12 },
+      { "trigger": { "question": "CTQ15", "condition": "score == 0" }, "pillar": "COUT", "cap": 12 }
+    ]
+  },
+  "confidence": {
+    "dk_count_thresholds": {
+      "high": { "max_dk": 2, "label": "Haute confiance" },
+      "medium": { "min_dk": 3, "max_dk": 5, "label": "Confiance moyenne" },
+      "low": { "min_dk": 6, "label": "Faible confiance" }
+    }
+  },
+  "optional_questions": {
+    "sites_count": {
+      "id": "sites_count",
+      "label": "Nombre de sites concernés",
+      "type": "radio",
+      "required": false,
+      "options": [
+        { "id": "sites_1", "label": "1 site" },
+        { "id": "sites_2_5", "label": "2 à 5 sites" },
+        { "id": "sites_6_20", "label": "6 à 20 sites" },
+        { "id": "sites_20_plus", "label": "20+ sites" }
+      ]
+    },
+    "controls_per_week": {
+      "id": "controls_per_week",
+      "label": "Nombre de contrôles / semaine",
+      "type": "radio",
+      "required": false,
+      "options": [
+        { "id": "vol_faible", "label": "Moins de 10" },
+        { "id": "vol_moyen", "label": "10 à 50" },
+        { "id": "vol_eleve", "label": "50 à 200" },
+        { "id": "vol_fort", "label": "200+" }
+      ]
+    },
+    "impact_principal": {
+      "id": "impact_principal",
+      "label": "Impact principal recherché",
+      "type": "radio",
+      "required": false,
+      "options": [
+        { "id": "impact_temps", "label": "Gain de temps" },
+        { "id": "impact_erreurs", "label": "Réduction des erreurs" },
+        { "id": "impact_tracabilite", "label": "Traçabilité / audit" },
+        { "id": "impact_audit", "label": "Préparation audit / certification" }
+      ]
+    },
+    "horizon": {
+      "id": "horizon",
+      "label": "Horizon de réflexion",
+      "type": "radio",
+      "required": false,
+      "options": [
+        { "id": "horizon_0_3", "label": "0 à 3 mois" },
+        { "id": "horizon_annee", "label": "Cette année" },
+        { "id": "horizon_exploration", "label": "Exploration" }
+      ]
+    }
+  }
+}

+ 272 - 0
config/packs/internal-requests-validations-v2.json

@@ -0,0 +1,272 @@
+{
+  "pack_id": "internal-requests-validations-v2",
+  "pack_title": "Demandes internes & validations",
+  "pack_description": "16 questions pour auditer votre process de demandes internes (achats, RH, IT, juridique, marketing…) : point d'entrée, catégorisation, règles de validation, traçabilité, résilience et coût.",
+  "pillars": [
+    {"id": "CLARTE", "label": "Clarté", "max": 20, "raw_max": 20},
+    {"id": "FIABILITE", "label": "Fiabilité", "max": 20, "raw_max": 15},
+    {"id": "PREUVE", "label": "Preuve", "max": 20, "raw_max": 15},
+    {"id": "RESILIENCE", "label": "Résilience", "max": 20, "raw_max": 15},
+    {"id": "COUT", "label": "Coût", "max": 20, "raw_max": 15}
+  ],
+  "questions": [
+    {
+      "id": "IR1",
+      "pillar_id": "CLARTE",
+      "label": "Le point d'entrée des demandes internes est-il clair et partagé (portail / formulaire / canal principal) ?",
+      "type": "radio",
+      "options": [
+        {"id": "ir1_o1", "label": "Absent / très dispersé", "points": 0},
+        {"id": "ir1_o2", "label": "Partiel / informel", "points": 2},
+        {"id": "ir1_o3", "label": "Structuré mais incomplet", "points": 4},
+        {"id": "ir1_o4", "label": "Standardisé et maîtrisé", "points": 5},
+        {"id": "ir1_dk", "label": "Je ne sais pas", "points": 1},
+        {"id": "ir1_na", "label": "Non pertinent (N/A)", "points": 3}
+      ]
+    },
+    {
+      "id": "IR2",
+      "pillar_id": "CLARTE",
+      "label": "Les types de demandes (achats, RH, IT, juridique, marketing...) sont-ils clairement catégorisés ?",
+      "type": "radio",
+      "options": [
+        {"id": "ir2_o1", "label": "Absent / très dispersé", "points": 0},
+        {"id": "ir2_o2", "label": "Partiel / informel", "points": 2},
+        {"id": "ir2_o3", "label": "Structuré mais incomplet", "points": 4},
+        {"id": "ir2_o4", "label": "Standardisé et maîtrisé", "points": 5},
+        {"id": "ir2_dk", "label": "Je ne sais pas", "points": 1},
+        {"id": "ir2_na", "label": "Non pertinent (N/A)", "points": 3}
+      ]
+    },
+    {
+      "id": "IR3",
+      "pillar_id": "CLARTE",
+      "label": "Les informations requises au dépôt (champs, pièces, contexte) sont-elles standardisées ?",
+      "type": "radio",
+      "options": [
+        {"id": "ir3_o1", "label": "Absent / très dispersé", "points": 0},
+        {"id": "ir3_o2", "label": "Partiel / informel", "points": 2},
+        {"id": "ir3_o3", "label": "Structuré mais incomplet", "points": 4},
+        {"id": "ir3_o4", "label": "Standardisé et maîtrisé", "points": 5},
+        {"id": "ir3_dk", "label": "Je ne sais pas", "points": 1},
+        {"id": "ir3_na", "label": "Non pertinent (N/A)", "points": 3}
+      ]
+    },
+    {
+      "id": "IR4",
+      "pillar_id": "CLARTE",
+      "label": "Les règles de validation (qui valide quoi selon type / montant / service) sont-elles explicites ?",
+      "type": "radio",
+      "options": [
+        {"id": "ir4_o1", "label": "Absent / très dispersé", "points": 0},
+        {"id": "ir4_o2", "label": "Partiel / informel", "points": 2},
+        {"id": "ir4_o3", "label": "Structuré mais incomplet", "points": 4},
+        {"id": "ir4_o4", "label": "Standardisé et maîtrisé", "points": 5},
+        {"id": "ir4_dk", "label": "Je ne sais pas", "points": 1},
+        {"id": "ir4_na", "label": "Non pertinent (N/A)", "points": 3}
+      ]
+    },
+    {
+      "id": "IR5",
+      "pillar_id": "FIABILITE",
+      "label": "La qualité des demandes à l'entrée permet-elle un traitement fluide (peu d'allers-retours) ?",
+      "type": "radio",
+      "options": [
+        {"id": "ir5_o1", "label": "Absent / très dispersé", "points": 0},
+        {"id": "ir5_o2", "label": "Partiel / informel", "points": 2},
+        {"id": "ir5_o3", "label": "Structuré mais incomplet", "points": 4},
+        {"id": "ir5_o4", "label": "Standardisé et maîtrisé", "points": 5},
+        {"id": "ir5_dk", "label": "Je ne sais pas", "points": 1},
+        {"id": "ir5_na", "label": "Non pertinent (N/A)", "points": 3}
+      ]
+    },
+    {
+      "id": "IR6",
+      "pillar_id": "FIABILITE",
+      "label": "La circulation des données entre outils limite-t-elle la ressaisie / copier-coller ?",
+      "type": "radio",
+      "options": [
+        {"id": "ir6_o1", "label": "Absent / très dispersé", "points": 0},
+        {"id": "ir6_o2", "label": "Partiel / informel", "points": 2},
+        {"id": "ir6_o3", "label": "Structuré mais incomplet", "points": 4},
+        {"id": "ir6_o4", "label": "Standardisé et maîtrisé", "points": 5},
+        {"id": "ir6_dk", "label": "Je ne sais pas", "points": 1},
+        {"id": "ir6_na", "label": "Non pertinent (N/A)", "points": 3}
+      ]
+    },
+    {
+      "id": "IR7",
+      "pillar_id": "FIABILITE",
+      "label": "Les délais de traitement sont-ils suivis et tenus de manière prévisible (SLA / retards) ?",
+      "type": "radio",
+      "options": [
+        {"id": "ir7_o1", "label": "Absent / très dispersé", "points": 0},
+        {"id": "ir7_o2", "label": "Partiel / informel", "points": 2},
+        {"id": "ir7_o3", "label": "Structuré mais incomplet", "points": 4},
+        {"id": "ir7_o4", "label": "Standardisé et maîtrisé", "points": 5},
+        {"id": "ir7_dk", "label": "Je ne sais pas", "points": 1},
+        {"id": "ir7_na", "label": "Non pertinent (N/A)", "points": 3}
+      ]
+    },
+    {
+      "id": "IR8",
+      "pillar_id": "PREUVE",
+      "label": "La traçabilité d'une demande (qui a demandé quoi, quand, statut) est-elle facile à reconstituer ?",
+      "type": "radio",
+      "options": [
+        {"id": "ir8_o1", "label": "Absent / très dispersé", "points": 0},
+        {"id": "ir8_o2", "label": "Partiel / informel", "points": 2},
+        {"id": "ir8_o3", "label": "Structuré mais incomplet", "points": 4},
+        {"id": "ir8_o4", "label": "Standardisé et maîtrisé", "points": 5},
+        {"id": "ir8_dk", "label": "Je ne sais pas", "points": 1},
+        {"id": "ir8_na", "label": "Non pertinent (N/A)", "points": 3}
+      ]
+    },
+    {
+      "id": "IR9",
+      "pillar_id": "PREUVE",
+      "label": "Pouvez-vous prouver qui a validé / refusé / modifié une demande, et quand ?",
+      "type": "radio",
+      "options": [
+        {"id": "ir9_o1", "label": "Absent / très dispersé", "points": 0},
+        {"id": "ir9_o2", "label": "Partiel / informel", "points": 2},
+        {"id": "ir9_o3", "label": "Structuré mais incomplet", "points": 4},
+        {"id": "ir9_o4", "label": "Standardisé et maîtrisé", "points": 5},
+        {"id": "ir9_dk", "label": "Je ne sais pas", "points": 1},
+        {"id": "ir9_na", "label": "Non pertinent (N/A)", "points": 3}
+      ]
+    },
+    {
+      "id": "IR10",
+      "pillar_id": "PREUVE",
+      "label": "Les pièces jointes, commentaires et justificatifs sont-ils centralisés avec la demande ?",
+      "type": "radio",
+      "options": [
+        {"id": "ir10_o1", "label": "Absent / très dispersé", "points": 0},
+        {"id": "ir10_o2", "label": "Partiel / informel", "points": 2},
+        {"id": "ir10_o3", "label": "Structuré mais incomplet", "points": 4},
+        {"id": "ir10_o4", "label": "Standardisé et maîtrisé", "points": 5},
+        {"id": "ir10_dk", "label": "Je ne sais pas", "points": 1},
+        {"id": "ir10_na", "label": "Non pertinent (N/A)", "points": 3}
+      ]
+    },
+    {
+      "id": "IR11",
+      "pillar_id": "RESILIENCE",
+      "label": "Le process dépend-il peu de personnes clés (connaissance tacite) ?",
+      "type": "radio",
+      "options": [
+        {"id": "ir11_o1", "label": "Absent / très dispersé", "points": 0},
+        {"id": "ir11_o2", "label": "Partiel / informel", "points": 2},
+        {"id": "ir11_o3", "label": "Structuré mais incomplet", "points": 4},
+        {"id": "ir11_o4", "label": "Standardisé et maîtrisé", "points": 5},
+        {"id": "ir11_dk", "label": "Je ne sais pas", "points": 1},
+        {"id": "ir11_na", "label": "Non pertinent (N/A)", "points": 3}
+      ]
+    },
+    {
+      "id": "IR12",
+      "pillar_id": "RESILIENCE",
+      "label": "Le process continue-t-il correctement en cas d'absence, turnover ou pic d'activité ?",
+      "type": "radio",
+      "options": [
+        {"id": "ir12_o1", "label": "Absent / très dispersé", "points": 0},
+        {"id": "ir12_o2", "label": "Partiel / informel", "points": 2},
+        {"id": "ir12_o3", "label": "Structuré mais incomplet", "points": 4},
+        {"id": "ir12_o4", "label": "Standardisé et maîtrisé", "points": 5},
+        {"id": "ir12_dk", "label": "Je ne sais pas", "points": 1},
+        {"id": "ir12_na", "label": "Non pertinent (N/A)", "points": 3}
+      ]
+    },
+    {
+      "id": "IR13",
+      "pillar_id": "RESILIENCE",
+      "label": "Le process est-il harmonisé entre équipes / services / sites concernés ?",
+      "type": "radio",
+      "options": [
+        {"id": "ir13_o1", "label": "Absent / très dispersé", "points": 0},
+        {"id": "ir13_o2", "label": "Partiel / informel", "points": 2},
+        {"id": "ir13_o3", "label": "Structuré mais incomplet", "points": 4},
+        {"id": "ir13_o4", "label": "Standardisé et maîtrisé", "points": 5},
+        {"id": "ir13_dk", "label": "Je ne sais pas", "points": 1},
+        {"id": "ir13_na", "label": "Non pertinent (N/A)", "points": 3}
+      ]
+    },
+    {
+      "id": "IR14",
+      "pillar_id": "COUT",
+      "label": "Le poids administratif des relances, suivis manuels et coordinations est-il maîtrisé ?",
+      "type": "radio",
+      "options": [
+        {"id": "ir14_o1", "label": "Absent / très dispersé", "points": 0},
+        {"id": "ir14_o2", "label": "Partiel / informel", "points": 2},
+        {"id": "ir14_o3", "label": "Structuré mais incomplet", "points": 4},
+        {"id": "ir14_o4", "label": "Standardisé et maîtrisé", "points": 5},
+        {"id": "ir14_dk", "label": "Je ne sais pas", "points": 1},
+        {"id": "ir14_na", "label": "Non pertinent (N/A)", "points": 3}
+      ]
+    },
+    {
+      "id": "IR15",
+      "pillar_id": "COUT",
+      "label": "Avez-vous une visibilité simple sur les demandes en cours, bloquées, en retard ?",
+      "type": "radio",
+      "options": [
+        {"id": "ir15_o1", "label": "Absent / très dispersé", "points": 0},
+        {"id": "ir15_o2", "label": "Partiel / informel", "points": 2},
+        {"id": "ir15_o3", "label": "Structuré mais incomplet", "points": 4},
+        {"id": "ir15_o4", "label": "Standardisé et maîtrisé", "points": 5},
+        {"id": "ir15_dk", "label": "Je ne sais pas", "points": 1},
+        {"id": "ir15_na", "label": "Non pertinent (N/A)", "points": 3}
+      ]
+    },
+    {
+      "id": "IR16",
+      "pillar_id": "COUT",
+      "label": "Un socle de portail pourrait-il être réutilisé sur plusieurs types de demandes internes ?",
+      "type": "radio",
+      "options": [
+        {"id": "ir16_o1", "label": "Absent / très dispersé", "points": 0},
+        {"id": "ir16_o2", "label": "Partiel / informel", "points": 2},
+        {"id": "ir16_o3", "label": "Structuré mais incomplet", "points": 4},
+        {"id": "ir16_o4", "label": "Standardisé et maîtrisé", "points": 5},
+        {"id": "ir16_dk", "label": "Je ne sais pas", "points": 1},
+        {"id": "ir16_na", "label": "Non pertinent (N/A)", "points": 3}
+      ]
+    }
+  ],
+  "scoring": {
+    "scale": "0-5",
+    "dk_points": 1,
+    "na_points": 3,
+    "triggers_mode": "lowest",
+    "triggers_score_max": 2,
+    "pillar_normalization": true,
+    "level_thresholds": {
+      "A": {"min": 85, "max": 100, "label": "Process encore gérable, mais à cadrer"},
+      "B": {"min": 70, "max": 84, "label": "Process encore gérable, mais à cadrer"},
+      "C": {"min": 50, "max": 69, "label": "Process fragile, gains rapides possibles"},
+      "D": {"min": 0, "max": 49, "label": "Priorité forte, digitalisation recommandée"}
+    },
+    "anti_cheat_caps": {
+      "IR1": {"trigger_points": 0, "pillar_id": "CLARTE", "cap": 12},
+      "IR4": {"trigger_max": 2, "pillar_id": "CLARTE", "cap": 14},
+      "IR5": {"trigger_points": 0, "pillar_id": "FIABILITE", "cap": 12},
+      "IR9": {"trigger_points": 0, "pillar_id": "PREUVE", "cap": 10},
+      "IR11": {"trigger_points": 0, "pillar_id": "RESILIENCE", "cap": 12},
+      "IR14": {"trigger_max": 2, "pillar_id": "COUT", "cap": 12}
+    }
+  },
+  "confidence": {
+    "dk_count_thresholds": {
+      "high": {"max_dk": 2, "label": "Haute confiance"},
+      "medium": {"min_dk": 3, "max_dk": 5, "label": "Confiance moyenne"},
+      "low": {"min_dk": 6, "label": "Faible confiance"}
+    }
+  },
+  "ui_scenarios": {
+    "scenario_1": {"levels": ["A", "B"], "label": "Process encore gérable, mais à cadrer", "desc": "Optimisation ciblée"},
+    "scenario_2": {"levels": ["C"], "label": "Process fragile, gains rapides possibles", "desc": "Digitalisation ciblée recommandée"},
+    "scenario_3": {"levels": ["D"], "label": "Priorité forte, digitalisation recommandée", "desc": "Application métier prioritaire"}
+  }
+}

+ 239 - 0
config/packs/intervention-sav-maintenance-terrain-v2-compact.json

@@ -0,0 +1,239 @@
+{
+  "pack_id": "intervention-sav-maintenance-terrain-v2-compact",
+  "pack_title": "Intervention SAV / Maintenance terrain",
+  "pack_description": "16 questions pour auditer votre process d'interventions terrain : canal d'entrée, affectation, traçabilité, KPI, résilience et coût caché.",
+  "pillars": [
+    { "id": "CLARTE", "label": "Clarté du flux", "max": 20, "raw_max": 15 },
+    { "id": "FIABILITE", "label": "Fiabilité et contrôle", "max": 20, "raw_max": 15 },
+    { "id": "PREUVE", "label": "Traçabilité et preuve", "max": 20, "raw_max": 20 },
+    { "id": "RESILIENCE", "label": "Résilience et continuité", "max": 20, "raw_max": 15 },
+    { "id": "COUT", "label": "Coût caché et friction", "max": 20, "raw_max": 15 }
+  ],
+  "questions": [
+    {
+      "id": "S1",
+      "pillar_id": "CLARTE",
+      "label": "Les demandes d'intervention arrivent-elles via un point d'entrée clair et standardisé ?",
+      "type": "radio",
+      "options": [
+        { "id": "s1_low", "label": "Non, elles arrivent par plusieurs canaux non cadrés", "points": 0 },
+        { "id": "s1_mid", "label": "Canal principal défini, mais beaucoup d'exceptions", "points": 3 },
+        { "id": "s1_high", "label": "Point d'entrée majoritairement unique et standardisé", "points": 5 },
+        { "id": "s1_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "S2",
+      "pillar_id": "CLARTE",
+      "label": "Les informations demandées à l'ouverture sont-elles suffisamment cadrées ?",
+      "type": "radio",
+      "options": [
+        { "id": "s2_low", "label": "Non, infos souvent incomplètes ou variables", "points": 0 },
+        { "id": "s2_mid", "label": "Trame partielle, qualité inégale", "points": 3 },
+        { "id": "s2_high", "label": "Champs attendus clairs et globalement complets", "points": 5 },
+        { "id": "s2_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "S3",
+      "pillar_id": "CLARTE",
+      "label": "La priorité (urgence) est-elle qualifiée avec des règles partagées ?",
+      "type": "radio",
+      "options": [
+        { "id": "s3_low", "label": "Non, au ressenti selon les personnes", "points": 0 },
+        { "id": "s3_mid", "label": "Règles implicites ou incomplètes", "points": 3 },
+        { "id": "s3_high", "label": "Grille de priorité claire et utilisée", "points": 5 },
+        { "id": "s3_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "S4",
+      "pillar_id": "FIABILITE",
+      "label": "L'affectation au bon intervenant / équipe est-elle fiable ?",
+      "type": "radio",
+      "options": [
+        { "id": "s4_low", "label": "Erreurs de routage ou lenteurs fréquentes", "points": 0 },
+        { "id": "s4_mid", "label": "Globalement correcte, mais dépend de personnes clés", "points": 3 },
+        { "id": "s4_high", "label": "Règles d'affectation claires et fiables", "points": 5 },
+        { "id": "s4_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "S5",
+      "pillar_id": "FIABILITE",
+      "label": "Les demandes sont-elles traitées sans oublis / doublons / pertes ?",
+      "type": "radio",
+      "options": [
+        { "id": "s5_low", "label": "Non, cela arrive régulièrement", "points": 0 },
+        { "id": "s5_mid", "label": "Cela arrive occasionnellement", "points": 3 },
+        { "id": "s5_high", "label": "Cas rares et détectés rapidement", "points": 5 },
+        { "id": "s5_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "S6",
+      "pillar_id": "FIABILITE",
+      "label": "Les retours terrain (statut, compte rendu, infos utiles) remontent-ils correctement ?",
+      "type": "radio",
+      "options": [
+        { "id": "s6_low", "label": "Remontées aléatoires ou incomplètes", "points": 0 },
+        { "id": "s6_mid", "label": "Remontées partielles selon les personnes", "points": 3 },
+        { "id": "s6_high", "label": "Remontée structurée et régulière", "points": 5 },
+        { "id": "s6_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "S7",
+      "pillar_id": "PREUVE",
+      "label": "Pouvez-vous reconstituer facilement l'historique complet d'une intervention ?",
+      "type": "radio",
+      "options": [
+        { "id": "s7_low", "label": "Non, infos dispersées", "points": 0 },
+        { "id": "s7_mid", "label": "Partiellement, avec recherches manuelles", "points": 3 },
+        { "id": "s7_high", "label": "Oui, historique centralisé et lisible", "points": 5 },
+        { "id": "s7_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "S8",
+      "pillar_id": "PREUVE",
+      "label": "Photos, pièces jointes et commentaires sont-ils centralisés avec la demande ?",
+      "type": "radio",
+      "options": [
+        { "id": "s8_low", "label": "Non, dispersés (emails, téléphone, dossiers)", "points": 0 },
+        { "id": "s8_mid", "label": "Partiellement centralisés", "points": 3 },
+        { "id": "s8_high", "label": "Centralisés sur la demande / intervention", "points": 5 },
+        { "id": "s8_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "S9",
+      "pillar_id": "PREUVE",
+      "label": "Savez-vous qui a fait quoi et quand (traçabilité / horodatage) ?",
+      "type": "radio",
+      "options": [
+        { "id": "s9_low", "label": "Non ou très partiellement", "points": 0 },
+        { "id": "s9_mid", "label": "Oui sur certaines étapes seulement", "points": 3 },
+        { "id": "s9_high", "label": "Oui de bout en bout", "points": 5 },
+        { "id": "s9_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "S10",
+      "pillar_id": "PREUVE",
+      "label": "Disposez-vous de KPI fiables sur délais, volumes, blocages ?",
+      "type": "radio",
+      "options": [
+        { "id": "s10_low", "label": "Non, ou seulement à la main ponctuellement", "points": 0 },
+        { "id": "s10_mid", "label": "Quelques KPI, peu fiables / peu exploitables", "points": 3 },
+        { "id": "s10_high", "label": "KPI suivis et utilisés pour piloter", "points": 5 },
+        { "id": "s10_dk", "label": "Je ne sais pas", "points": 1 },
+        { "id": "s10_na", "label": "Non pertinent", "points": 3 }
+      ]
+    },
+    {
+      "id": "S11",
+      "pillar_id": "RESILIENCE",
+      "label": "Le process tient-il sans personne clé (coordinateur, expert, responsable SAV) ?",
+      "type": "radio",
+      "options": [
+        { "id": "s11_low", "label": "Non, forte dépendance", "points": 0 },
+        { "id": "s11_mid", "label": "Oui difficilement, avec ralentissements", "points": 3 },
+        { "id": "s11_high", "label": "Oui, process transmissible et robuste", "points": 5 },
+        { "id": "s11_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "S12",
+      "pillar_id": "RESILIENCE",
+      "label": "Le process tient-il en période de pic d'activité ?",
+      "type": "radio",
+      "options": [
+        { "id": "s12_low", "label": "Non, saturation et retards", "points": 0 },
+        { "id": "s12_mid", "label": "Tient partiellement avec forte tension", "points": 3 },
+        { "id": "s12_high", "label": "Priorisation et suivi restent maîtrisés", "points": 5 },
+        { "id": "s12_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "S13",
+      "pillar_id": "RESILIENCE",
+      "label": "Avez-vous des alertes / relances pour éviter les oublis et retards ?",
+      "type": "radio",
+      "options": [
+        { "id": "s13_low", "label": "Non, tout repose sur l'humain", "points": 0 },
+        { "id": "s13_mid", "label": "Relances manuelles ou automatiques partielles", "points": 3 },
+        { "id": "s13_high", "label": "Alertes / relances en place sur étapes clés", "points": 5 },
+        { "id": "s13_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "S14",
+      "pillar_id": "COUT",
+      "label": "La coordination administrative (appels, relances, suivi) prend-elle beaucoup de temps ?",
+      "type": "radio",
+      "options": [
+        { "id": "s14_low", "label": "Oui, charge très importante", "points": 0 },
+        { "id": "s14_mid", "label": "Charge notable mais supportable", "points": 3 },
+        { "id": "s14_high", "label": "Charge faible et maîtrisée", "points": 5 },
+        { "id": "s14_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "S15",
+      "pillar_id": "COUT",
+      "label": "Y a-t-il de la ressaisie / copier-coller entre outils (email, Excel, ERP, CRM, planning) ?",
+      "type": "radio",
+      "options": [
+        { "id": "s15_low", "label": "Oui, fréquente", "points": 0 },
+        { "id": "s15_mid", "label": "Oui, sur certains cas / étapes", "points": 3 },
+        { "id": "s15_high", "label": "Très peu, flux globalement fluidifiés", "points": 5 },
+        { "id": "s15_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "S16",
+      "pillar_id": "COUT",
+      "label": "Les relances clients / internes sur le statut sont-elles fréquentes ?",
+      "type": "radio",
+      "options": [
+        { "id": "s16_low", "label": "Oui, très fréquentes", "points": 0 },
+        { "id": "s16_mid", "label": "Régulières", "points": 3 },
+        { "id": "s16_high", "label": "Rares grâce à la visibilité du suivi", "points": 5 },
+        { "id": "s16_dk", "label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    }
+  ],
+  "scoring": {
+    "triggers_mode": "lowest",
+    "triggers_score_max": 3,
+    "level_thresholds": {
+      "A": { "min": 85, "max": 100, "label": "Excellente maîtrise" },
+      "B": { "min": 70, "max": 84, "label": "Solide mais perfectible" },
+      "C": { "min": 50, "max": 69, "label": "À améliorer" },
+      "D": { "min": 0, "max": 49, "label": "Risques élevés" }
+    },
+    "anti_cheat_caps": {
+      "S1": { "trigger_points": 0, "pillar_id": "CLARTE", "cap": 12 },
+      "S3": { "trigger_points": 0, "pillar_id": "CLARTE", "cap": 10 },
+      "S4": { "trigger_points": 0, "pillar_id": "FIABILITE", "cap": 12 },
+      "S5": { "trigger_points": 0, "pillar_id": "FIABILITE", "cap": 10 },
+      "S7": { "trigger_points": 0, "pillar_id": "PREUVE", "cap": 10 },
+      "S10": { "trigger_points": 0, "pillar_id": "PREUVE", "cap": 12 },
+      "S11": { "trigger_points": 0, "pillar_id": "RESILIENCE", "cap": 10 },
+      "S14": { "trigger_points": 0, "pillar_id": "COUT", "cap": 12 }
+    }
+  },
+  "confidence": {
+    "dk_count_thresholds": {
+      "high": { "max_dk": 2, "label": "Haute confiance" },
+      "medium": { "min_dk": 3, "max_dk": 5, "label": "Confiance moyenne" },
+      "low": { "min_dk": 6, "label": "Faible confiance" }
+    }
+  },
+  "ui_scenarios": {
+    "scenario_1": { "levels": ["A", "B"], "min_score": 77, "label": "Process globalement maîtrisé", "desc": "Optimisation ciblée" },
+    "scenario_2": { "levels": ["B", "C"], "max_score": 76, "min_score": 50, "label": "Process fonctionnel mais fragile", "desc": "Digitalisation ciblée recommandée" },
+    "scenario_3": { "levels": ["D"], "label": "Process critique", "desc": "Application métier prioritaire" }
+  }
+}

File diff suppressed because it is too large
+ 0 - 0
config/packs/pack-onboarding-v1.json


+ 25 - 25
config/packs/process-generique-v2.json

@@ -23,7 +23,7 @@
         { "id": "h1_1", "label": "1 à 5h",  "points": 1 },
         { "id": "h1_2", "label": "5 à 20h", "points": 2 },
         { "id": "h1_3", "label": "> 20h",   "points": 3 },
-        { "id": "h1_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h1_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -36,7 +36,7 @@
         { "id": "h2_1", "label": "Parfois",     "points": 1 },
         { "id": "h2_2", "label": "Souvent",     "points": 2 },
         { "id": "h2_3", "label": "Constamment", "points": 3 },
-        { "id": "h2_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h2_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -49,7 +49,7 @@
         { "id": "h3_1", "label": "1",     "points": 1 },
         { "id": "h3_2", "label": "2 à 3", "points": 2 },
         { "id": "h3_3", "label": "4+",    "points": 3 },
-        { "id": "h3_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h3_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -62,7 +62,7 @@
         { "id": "h4_1", "label": "Quelques fois par mois",  "points": 1 },
         { "id": "h4_2", "label": "Chaque semaine",          "points": 2 },
         { "id": "h4_3", "label": "Tous les jours",          "points": 3 },
-        { "id": "h4_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h4_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -75,7 +75,7 @@
         { "id": "h5_1", "label": "10 à 50",  "points": 1 },
         { "id": "h5_2", "label": "50 à 200", "points": 2 },
         { "id": "h5_3", "label": "> 200",    "points": 3 },
-        { "id": "h5_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h5_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -88,7 +88,7 @@
         { "id": "h6_1", "label": "1 à 3 jours", "points": 1 },
         { "id": "h6_2", "label": "3 à 10 jours","points": 2 },
         { "id": "h6_3", "label": "> 10 jours",  "points": 3 },
-        { "id": "h6_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h6_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -101,7 +101,7 @@
         { "id": "h7_1", "label": "Légère hausse",               "points": 1 },
         { "id": "h7_2", "label": "Nette hausse",                "points": 2 },
         { "id": "h7_3", "label": "Explosion / non maîtrisé",    "points": 3 },
-        { "id": "h7_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h7_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -114,7 +114,7 @@
         { "id": "h8_1", "label": "Irritant",                                 "points": 1 },
         { "id": "h8_2", "label": "Coûteux (temps, argent, client)",          "points": 2 },
         { "id": "h8_3", "label": "Critique (conformité, sécurité, gros coût)","points": 3 },
-        { "id": "h8_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h8_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -126,7 +126,7 @@
         { "id": "h9_0", "label": "Non",                "points": 0 },
         { "id": "h9_2", "label": "Oui, une fois",      "points": 2 },
         { "id": "h9_3", "label": "Oui, plusieurs fois","points": 3 },
-        { "id": "h9_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h9_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -139,7 +139,7 @@
         { "id": "h10_1", "label": "Un peu",      "points": 1 },
         { "id": "h10_2", "label": "Oui",         "points": 2 },
         { "id": "h10_3", "label": "Obligatoire", "points": 3 },
-        { "id": "h10_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h10_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -152,7 +152,7 @@
         { "id": "h11_1", "label": "Mix outil + fichiers",                      "points": 1 },
         { "id": "h11_2", "label": "Beaucoup d'Excel / PDF / mails",            "points": 2 },
         { "id": "h11_3", "label": "Surtout mails, papier, échanges informels", "points": 3 },
-        { "id": "h11_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h11_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -165,7 +165,7 @@
         { "id": "h12_1", "label": "Partiellement centralisés",  "points": 1 },
         { "id": "h12_2", "label": "Dispersés",                  "points": 2 },
         { "id": "h12_3", "label": "Introuvables ou doublonnés", "points": 3 },
-        { "id": "h12_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h12_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -178,7 +178,7 @@
         { "id": "h13_1", "label": "Moyenne",                     "points": 1 },
         { "id": "h13_2", "label": "Souvent incomplètes",         "points": 2 },
         { "id": "h13_3", "label": "Souvent faux ou contradictoires","points": 3 },
-        { "id": "h13_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h13_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -191,7 +191,7 @@
         { "id": "h14_1", "label": "2",     "points": 1 },
         { "id": "h14_2", "label": "3 à 4", "points": 2 },
         { "id": "h14_3", "label": "5+",    "points": 3 },
-        { "id": "h14_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h14_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -204,7 +204,7 @@
         { "id": "h15_1", "label": "Quelques intégrations",  "points": 1 },
         { "id": "h15_2", "label": "Quasiment rien",         "points": 2 },
         { "id": "h15_3", "label": "Rien, tout à la main",   "points": 3 },
-        { "id": "h15_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h15_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -217,7 +217,7 @@
         { "id": "h16_1", "label": "Oui mais lent",     "points": 1 },
         { "id": "h16_2", "label": "Compliqué",         "points": 2 },
         { "id": "h16_3", "label": "Quasi impossible",  "points": 3 },
-        { "id": "h16_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h16_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -230,7 +230,7 @@
         { "id": "h17_1", "label": "Standard mais avec exceptions",   "points": 1 },
         { "id": "h17_2", "label": "Très variable selon les cas",     "points": 2 },
         { "id": "h17_3", "label": "Différent à chaque fois",         "points": 3 },
-        { "id": "h17_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h17_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -243,7 +243,7 @@
         { "id": "h18_1", "label": "Connues par quelques personnes",      "points": 1 },
         { "id": "h18_2", "label": "Implicites",                          "points": 2 },
         { "id": "h18_3", "label": "Personne n'est d'accord sur les règles","points": 3 },
-        { "id": "h18_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h18_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -256,7 +256,7 @@
         { "id": "h19_1", "label": "Mensuelles",     "points": 1 },
         { "id": "h19_2", "label": "Hebdomadaires",  "points": 2 },
         { "id": "h19_3", "label": "Quotidiennes",   "points": 3 },
-        { "id": "h19_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h19_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -269,7 +269,7 @@
         { "id": "h20_1", "label": "2",  "points": 1 },
         { "id": "h20_2", "label": "3",  "points": 2 },
         { "id": "h20_3", "label": "4+", "points": 3 },
-        { "id": "h20_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h20_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -282,7 +282,7 @@
         { "id": "h21_1", "label": "2",     "points": 1 },
         { "id": "h21_2", "label": "3 - 4", "points": 2 },
         { "id": "h21_3", "label": "5+",    "points": 3 },
-        { "id": "h21_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h21_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -295,7 +295,7 @@
         { "id": "h22_1", "label": "Partiellement",            "points": 1 },
         { "id": "h22_2", "label": "Non",                      "points": 2 },
         { "id": "h22_3", "label": "Non, et source de conflits","points": 3 },
-        { "id": "h22_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h22_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -307,7 +307,7 @@
         { "id": "h23_0", "label": "Oui",          "points": 0 },
         { "id": "h23_2", "label": "Plus ou moins","points": 2 },
         { "id": "h23_3", "label": "Non",          "points": 3 },
-        { "id": "h23_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h23_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -320,7 +320,7 @@
         { "id": "h24_1", "label": "Correct", "points": 1 },
         { "id": "h24_2", "label": "Faible",  "points": 2 },
         { "id": "h24_3", "label": "Aucun",   "points": 3 },
-        { "id": "h24_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h24_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     },
     {
@@ -333,7 +333,7 @@
         { "id": "h25_1", "label": "Plutôt oui",     "points": 1 },
         { "id": "h25_2", "label": "Réticents",       "points": 2 },
         { "id": "h25_3", "label": "Très résistants", "points": 3 },
-        { "id": "h25_na","label": "Non pertinent — N/A", "points": 1 }
+        { "id": "h25_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
       ]
     }
   ],

+ 35 - 163
config/packs/process-generique.json

@@ -39,7 +39,7 @@
       "options": [
         {
           "id": "g1_0",
-          "label": "Dans la tête des personnes — rien d'écrit",
+          "label": "Dans la tête des personnes - rien d'écrit",
           "points": 0
         },
         {
@@ -59,13 +59,8 @@
         },
         {
           "id": "g1_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g1_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -78,7 +73,7 @@
       "options": [
         {
           "id": "g2_0",
-          "label": "Personne — les problèmes restent sans responsable",
+          "label": "Personne - les problèmes restent sans responsable",
           "points": 0
         },
         {
@@ -98,13 +93,8 @@
         },
         {
           "id": "g2_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g2_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -137,13 +127,8 @@
         },
         {
           "id": "g3_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g3_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -156,7 +141,7 @@
       "options": [
         {
           "id": "g4_0",
-          "label": "Chacun se débrouille — pas de règle ni de chemin défini",
+          "label": "Chacun se débrouille - pas de règle ni de chemin défini",
           "points": 0
         },
         {
@@ -176,13 +161,8 @@
         },
         {
           "id": "g4_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g4_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -195,7 +175,7 @@
       "options": [
         {
           "id": "g5_0",
-          "label": "Pas de vérification — on avance et on découvre les erreurs après",
+          "label": "Pas de vérification - on avance et on découvre les erreurs après",
           "points": 0
         },
         {
@@ -215,13 +195,8 @@
         },
         {
           "id": "g5_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g5_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -254,13 +229,8 @@
         },
         {
           "id": "g6_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g6_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -273,7 +243,7 @@
       "options": [
         {
           "id": "g7_0",
-          "label": "Tout le monde — pas de règle d'accès",
+          "label": "Tout le monde - pas de règle d'accès",
           "points": 0
         },
         {
@@ -293,13 +263,8 @@
         },
         {
           "id": "g7_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g7_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -332,13 +297,8 @@
         },
         {
           "id": "g8_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g8_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -351,7 +311,7 @@
       "options": [
         {
           "id": "g9_0",
-          "label": "Non — impossible de savoir qui a fait quoi",
+          "label": "Non - impossible de savoir qui a fait quoi",
           "points": 0
         },
         {
@@ -371,13 +331,8 @@
         },
         {
           "id": "g9_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g9_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -410,13 +365,8 @@
         },
         {
           "id": "g10_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g10_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -429,7 +379,7 @@
       "options": [
         {
           "id": "g11_0",
-          "label": "Impossible — tout est dans sa tête ou sa boîte email",
+          "label": "Impossible - tout est dans sa tête ou sa boîte email",
           "points": 0
         },
         {
@@ -444,18 +394,13 @@
         },
         {
           "id": "g11_5",
-          "label": "En moins de 15 min — process documenté et accès partagés en place",
+          "label": "En moins de 15 min - process documenté et accès partagés en place",
           "points": 5
         },
         {
           "id": "g11_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g11_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -488,13 +433,8 @@
         },
         {
           "id": "g12_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g12_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -527,13 +467,8 @@
         },
         {
           "id": "g13_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g13_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -566,13 +501,8 @@
         },
         {
           "id": "g14_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g14_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -585,7 +515,7 @@
       "options": [
         {
           "id": "g15_0",
-          "label": "Pas de mesure — on le voit quand ça dysfonctionne",
+          "label": "Pas de mesure - on le voit quand ça dysfonctionne",
           "points": 0
         },
         {
@@ -605,13 +535,8 @@
         },
         {
           "id": "g15_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g15_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -624,7 +549,7 @@
       "options": [
         {
           "id": "g16_0",
-          "label": "En urgence, sans règle ni trace — on oublie vite",
+          "label": "En urgence, sans règle ni trace - on oublie vite",
           "points": 0
         },
         {
@@ -644,13 +569,8 @@
         },
         {
           "id": "g16_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g16_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -683,13 +603,8 @@
         },
         {
           "id": "g17_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g17_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -702,33 +617,28 @@
       "options": [
         {
           "id": "g18_0",
-          "label": "Souvent — on re-saisit ou copie-colle dans 2 outils ou plus",
+          "label": "Souvent - on re-saisit ou copie-colle dans 2 outils ou plus",
           "points": 0
         },
         {
           "id": "g18_2",
-          "label": "Parfois — certaines informations sont dupliquées",
+          "label": "Parfois - certaines informations sont dupliquées",
           "points": 2
         },
         {
           "id": "g18_4",
-          "label": "Rarement — quelques cas résiduels non prioritaires",
+          "label": "Rarement - quelques cas résiduels non prioritaires",
           "points": 4
         },
         {
           "id": "g18_5",
-          "label": "Jamais — les données circulent automatiquement entre outils",
+          "label": "Jamais - les données circulent automatiquement entre outils",
           "points": 5
         },
         {
           "id": "g18_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g18_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -761,13 +671,8 @@
         },
         {
           "id": "g19_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g19_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -805,13 +710,8 @@
         },
         {
           "id": "g20_dk",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "g20_na",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     }
@@ -876,7 +776,7 @@
   },
   "cost_hidden": {
     "formula": "minutes_per_occurrence = G19_minutes + G18_minutes + G17_minutes",
-    "default_hourly_cost": 50,
+    "default_hourly_cost": 42,
     "components": {
       "G19": {
         "option_mapping": {
@@ -939,34 +839,6 @@
           "value": 150
         }
       ]
-    },
-    "hourly_cost": {
-      "id": "hourly_cost",
-      "label": "Coût horaire indicatif (optionnel)",
-      "type": "radio",
-      "required": false,
-      "options": [
-        {
-          "id": "cost_lt_35",
-          "label": "<35 €",
-          "value": 35
-        },
-        {
-          "id": "cost_35_60",
-          "label": "35-60 €",
-          "value": 50
-        },
-        {
-          "id": "cost_60_90",
-          "label": "60-90 €",
-          "value": 75
-        },
-        {
-          "id": "cost_gt_90",
-          "label": "90 €+",
-          "value": 90
-        }
-      ]
     }
   }
 }

+ 213 - 0
config/packs/transformation-excel.json

@@ -0,0 +1,213 @@
+{
+  "pack_id": "transformation-excel",
+  "pack_title": "Transformation fichier Excel",
+  "pack_description": "Évaluez si votre fichier Excel doit être transformé en application web, optimisé ou gardé tel quel. 14 questions, 5 minutes.",
+  "pillars": [
+    { "id": "COLLABORATION", "label": "Collaboration et partage", "max": 9 },
+    { "id": "FRICTION",      "label": "Friction et perte de temps", "max": 9 },
+    { "id": "COMPLEXITE",    "label": "Complexité technique", "max": 9 },
+    { "id": "MAITRISE",      "label": "Maîtrise et gouvernance", "max": 9 },
+    { "id": "RISQUE",        "label": "Risque et scalabilité", "max": 6 }
+  ],
+  "questions": [
+    {
+      "id": "X1", "pillar_id": "COLLABORATION",
+      "label": "Combien de personnes utilisent ou modifient ce fichier ?",
+      "help": "Excel tient mieux quand il est utilisé par 1 personne. Dès qu'il y a plusieurs intervenants, les problèmes de versions et de coordination arrivent.",
+      "type": "radio",
+      "options": [
+        { "id": "x1_0", "label": "1 seule personne",                "points": 0 },
+        { "id": "x1_1", "label": "2 personnes",                     "points": 1 },
+        { "id": "x1_2", "label": "3 à 5 personnes",                 "points": 2 },
+        { "id": "x1_3", "label": "6 personnes ou plus",             "points": 3 },
+        { "id": "x1_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "X2", "pillar_id": "COLLABORATION",
+      "label": "Existe-t-il plusieurs versions du même fichier (v2, final, final_v3, version_corrigée…) ?",
+      "help": "Ça montre un problème de source unique de vérité. On perd du temps à vérifier quelle version est la bonne.",
+      "type": "radio",
+      "options": [
+        { "id": "x2_0", "label": "Non, une seule version à jour",                             "points": 0 },
+        { "id": "x2_1", "label": "Parfois, 2-3 versions coexistent brièvement",               "points": 1 },
+        { "id": "x2_2", "label": "Régulièrement — final, v2, v3…",                            "points": 2 },
+        { "id": "x2_3", "label": "Constamment — on ne sait plus quelle version est la bonne", "points": 3 },
+        { "id": "x2_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "X3", "pillar_id": "FRICTION",
+      "label": "Combien de temps par semaine est perdu à saisir, copier-coller, vérifier ou corriger ce fichier ?",
+      "help": "C'est le premier levier ROI, simple à comprendre pour un décideur.",
+      "type": "radio",
+      "options": [
+        { "id": "x3_0", "label": "Moins de 30 minutes",  "points": 0 },
+        { "id": "x3_1", "label": "30 min à 2 heures",    "points": 1 },
+        { "id": "x3_2", "label": "2 à 5 heures",         "points": 2 },
+        { "id": "x3_3", "label": "Plus de 5 heures",     "points": 3 },
+        { "id": "x3_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "X4", "pillar_id": "FRICTION",
+      "label": "Est-ce que des erreurs de saisie ou d'oubli arrivent régulièrement ?",
+      "help": "Un fichier Excel peut être rapide, mais fragile. Les erreurs coûtent souvent plus cher que le temps gagné.",
+      "type": "radio",
+      "options": [
+        { "id": "x4_0", "label": "Rarement ou jamais",                                        "points": 0 },
+        { "id": "x4_1", "label": "Occasionnellement (quelques fois par mois)",                 "points": 1 },
+        { "id": "x4_2", "label": "Régulièrement (chaque semaine)",                             "points": 2 },
+        { "id": "x4_3", "label": "Fréquemment — impact clients, production, finance, qualité", "points": 3 },
+        { "id": "x4_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "X5", "pillar_id": "COMPLEXITE",
+      "label": "Le fichier sert-il à piloter un process avec des étapes, statuts ou validations ?",
+      "help": "À partir du moment où Excel devient un mini workflow (à traiter / en cours / validé / refusé), vous êtes déjà en terrain \"logiciel\".",
+      "type": "radio",
+      "options": [
+        { "id": "x5_0", "label": "Non, simple liste ou tableau de données",          "points": 0 },
+        { "id": "x5_1", "label": "Quelques statuts simples (oui/non, fait/à faire)", "points": 1 },
+        { "id": "x5_2", "label": "Oui, statuts + règles de gestion",                 "points": 2 },
+        { "id": "x5_3", "label": "Oui, workflow complet avec validations et exceptions", "points": 3 },
+        { "id": "x5_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "X6", "pillar_id": "COLLABORATION",
+      "label": "Faut-il relancer des personnes par mail ou téléphone pour faire avancer le process lié à ce fichier ?",
+      "help": "Cela révèle un manque de notifications, de responsabilités claires et de suivi.",
+      "type": "radio",
+      "options": [
+        { "id": "x6_0", "label": "Rarement ou jamais",    "points": 0 },
+        { "id": "x6_1", "label": "Parfois",               "points": 1 },
+        { "id": "x6_2", "label": "Souvent",               "points": 2 },
+        { "id": "x6_3", "label": "Constamment — on relance pour chaque action ou validation", "points": 3 },
+        { "id": "x6_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "X7", "pillar_id": "COMPLEXITE",
+      "label": "Une seule personne \"maîtrise vraiment\" le fichier ?",
+      "help": "C'est un risque de dépendance. Si cette personne est absente, le process ralentit ou bloque.",
+      "type": "radio",
+      "options": [
+        { "id": "x7_0", "label": "Non, plusieurs personnes maîtrisent le fichier",                      "points": 0 },
+        { "id": "x7_1", "label": "Une personne connaît mieux, mais d'autres se débrouillent",           "points": 1 },
+        { "id": "x7_2", "label": "Oui, une personne est indispensable pour le faire tourner",           "points": 2 },
+        { "id": "x7_3", "label": "Oui, et elle est la seule à comprendre les formules, macros ou VBA",  "points": 3 },
+        { "id": "x7_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "X8", "pillar_id": "COMPLEXITE",
+      "label": "Le fichier contient-il des formules complexes, macros, VBA ou manipulations fragiles ?",
+      "help": "Ça peut fonctionner, mais la maintenance devient risquée et peu scalable. Personne n'ose toucher certaines cellules \"par peur de casser\".",
+      "type": "radio",
+      "options": [
+        { "id": "x8_0", "label": "Non, formules simples (SOMME, SI…)",                           "points": 0 },
+        { "id": "x8_1", "label": "Quelques formules avancées (RECHERCHEV, INDEX-EQUIV…)",         "points": 1 },
+        { "id": "x8_2", "label": "Formules complexes imbriquées ou macros simples",               "points": 2 },
+        { "id": "x8_3", "label": "VBA, macros critiques — des onglets qu'on n'ose pas toucher",   "points": 3 },
+        { "id": "x8_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "X9", "pillar_id": "MAITRISE",
+      "label": "Avez-vous besoin d'un historique fiable de qui a fait quoi et quand ?",
+      "help": "Traçabilité, audit, responsabilité, conformité. Excel est limité pour ça dans un usage métier structuré.",
+      "type": "radio",
+      "options": [
+        { "id": "x9_0", "label": "Non, pas de besoin particulier",                                "points": 0 },
+        { "id": "x9_1", "label": "Ce serait un plus, mais pas critique",                          "points": 1 },
+        { "id": "x9_2", "label": "Oui, besoin réel de traçabilité (logs, historique, suivi)",      "points": 2 },
+        { "id": "x9_3", "label": "Obligatoire — audit, conformité, réglementation",               "points": 3 },
+        { "id": "x9_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "X10", "pillar_id": "MAITRISE",
+      "label": "Différents profils devraient-ils voir des informations différentes (manager, RH, opérateur, direction, client) ?",
+      "help": "Les droits d'accès et les rôles sont un sujet naturel d'application web. Partager trop d'infos ou dupliquer par profil sont deux signaux.",
+      "type": "radio",
+      "options": [
+        { "id": "x10_0", "label": "Non, tout le monde voit et utilise la même chose",           "points": 0 },
+        { "id": "x10_1", "label": "Quelques onglets cachés ou protégés, ça suffit",              "points": 1 },
+        { "id": "x10_2", "label": "Oui, on partage trop d'infos ou on duplique par profil",     "points": 2 },
+        { "id": "x10_3", "label": "Oui, besoin de vrais rôles avec droits d'accès différenciés","points": 3 },
+        { "id": "x10_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "X11", "pillar_id": "MAITRISE",
+      "label": "Ce fichier doit-il être utilisé sur plusieurs sites, par le terrain, ou à distance ?",
+      "help": "Excel devient vite pénible en mobilité, multi-sites, usage partagé. Un accès navigateur simplifie tout.",
+      "type": "radio",
+      "options": [
+        { "id": "x11_0", "label": "Non, usage bureau classique, un seul site",                 "points": 0 },
+        { "id": "x11_1", "label": "Parfois à distance (télétravail)",                           "points": 1 },
+        { "id": "x11_2", "label": "Oui, multi-sites ou usage terrain fréquent",                 "points": 2 },
+        { "id": "x11_3", "label": "Oui, accès mobile ou tablette indispensable sur le terrain", "points": 3 },
+        { "id": "x11_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "X12", "pillar_id": "FRICTION",
+      "label": "Le fichier doit-il se connecter à d'autres outils (ERP, CRM, RH, mails, formulaires, BI…) ?",
+      "help": "Le vrai sujet n'est souvent pas Excel, c'est la circulation de l'information entre systèmes.",
+      "type": "radio",
+      "options": [
+        { "id": "x12_0", "label": "Non, fichier autonome",                                     "points": 0 },
+        { "id": "x12_1", "label": "Quelques imports/exports ponctuels",                         "points": 1 },
+        { "id": "x12_2", "label": "Imports/exports réguliers entre 2-3 outils",                 "points": 2 },
+        { "id": "x12_3", "label": "Double saisie fréquente entre Excel et d'autres systèmes",   "points": 3 },
+        { "id": "x12_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "X13", "pillar_id": "RISQUE",
+      "label": "Si le volume double dans 12 mois, est-ce que ce fichier tiendra encore ?",
+      "help": "C'est la question de scalabilité. Beaucoup de fichiers \"marchent\" jusqu'au moment où ils explosent.",
+      "type": "radio",
+      "options": [
+        { "id": "x13_0", "label": "Oui, largement — le volume est stable et maîtrisé",          "points": 0 },
+        { "id": "x13_1", "label": "Probablement, avec quelques ajustements",                     "points": 1 },
+        { "id": "x13_2", "label": "Difficile — ça commence déjà à ramer ou à poser problème",    "points": 2 },
+        { "id": "x13_3", "label": "Non — le fichier est déjà à sa limite",                       "points": 3 },
+        { "id": "x13_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    },
+    {
+      "id": "X14", "pillar_id": "RISQUE",
+      "label": "Si ce fichier tombe en panne (erreur, perte, corruption, confusion de version), quel est l'impact business ?",
+      "help": "La vraie question : pas \"est-ce qu'on aime Excel\", mais \"combien ça coûte quand ça casse\".",
+      "type": "radio",
+      "options": [
+        { "id": "x14_0", "label": "Faible — on peut se débrouiller autrement",                   "points": 0 },
+        { "id": "x14_1", "label": "Gênant mais gérable en quelques heures",                      "points": 1 },
+        { "id": "x14_2", "label": "Important — retards, pertes financières, clients impactés",    "points": 2 },
+        { "id": "x14_3", "label": "Critique — CA, conformité, image client, production bloquée",  "points": 3 },
+        { "id": "x14_na","label": "Je ne sais pas / Non pertinent - N/A", "points": 1 }
+      ]
+    }
+  ],
+  "scoring": {
+    "triggers_mode": "highest",
+    "level_thresholds": {
+      "A": { "min": 75, "max": 100, "label": "Transformation prioritaire" },
+      "B": { "min": 50, "max": 74,  "label": "Étape intermédiaire recommandée" },
+      "C": { "min": 25, "max": 49,  "label": "Optimiser Excel d'abord" },
+      "D": { "min": 0,  "max": 24,  "label": "Excel suffit pour l'instant" }
+    },
+    "anti_cheat_caps": {}
+  },
+  "confidence": {
+    "dk_count_thresholds": {
+      "high":   { "max_dk": 2,  "label": "Haute confiance" },
+      "medium": { "min_dk": 3,  "max_dk": 5, "label": "Confiance moyenne" },
+      "low":    { "min_dk": 6,  "label": "Faible confiance" }
+    }
+  }
+}

+ 20 - 120
config/packs/validation-facture.json

@@ -58,13 +58,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -97,13 +92,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -136,13 +126,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -175,13 +160,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -214,13 +194,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -253,13 +228,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -292,13 +262,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -331,13 +296,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -370,13 +330,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -409,13 +364,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -448,13 +398,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -487,13 +432,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -526,13 +466,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -565,13 +500,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -604,13 +534,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -643,13 +568,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -682,13 +602,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -721,13 +636,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -760,13 +670,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     },
@@ -804,13 +709,8 @@
         },
         {
           "id": "DK",
-          "label": "Je ne sais pas",
+          "label": "Je ne sais pas / Non pertinent - N/A",
           "points": 1
-        },
-        {
-          "id": "NA",
-          "label": "Non pertinent — N/A",
-          "points": 3
         }
       ]
     }

+ 3 - 3
docs/DOC.md

@@ -1,4 +1,4 @@
-# Audit Express Self — Documentation
+# Audit Express Self - Documentation
 
 Quiz diagnostic "contrôle technique" (20 questions, ~7 min). Stack : HTML/CSS/JS + PHP.
 
@@ -9,7 +9,7 @@ Quiz diagnostic "contrôle technique" (20 questions, ~7 min). Stack : HTML/CSS/J
 ### Prérequis
 
 - **PHP 8.1+**
-- **Composer** : [getcomposer.org](https://getcomposer.org) — installer globalement ou télécharger `composer.phar` dans le projet
+- **Composer** : [getcomposer.org](https://getcomposer.org) - installer globalement ou télécharger `composer.phar` dans le projet
 
 ### Commandes
 
@@ -48,7 +48,7 @@ audit express self/
 ## 3. Configuration
 
 - **config.php** : valeurs par défaut
-- **config.local.php** : surcharges (booking_url, devis_url, webhook) — à créer à partir de `config.local.example.php`
+- **config.local.php** : surcharges (booking_url, devis_url, webhook) - à créer à partir de `config.local.example.php`
 - **config.local.php** est ignoré par Git (ne pas le commiter)
 
 ---

+ 9 - 9
docs/MODX_INTEGRATION.md

@@ -1,4 +1,4 @@
-# Intégration MODX — Audit Express Self
+# Intégration MODX - Audit Express Self
 
 Architecture complète : xPDO en BD + templates/chunks/snippets MODX.
 
@@ -17,7 +17,7 @@ MODX Resource          Template                    Snippet appelé
 /ct/pdf/               AuditExpress_Results        [[!AuditExpress_PDF]]
 ```
 
-**Objet BD** : `AuditRequest` (table `{prefix}audit_requests`) — créé dès le choix du pack, mis à jour à chaque réponse, finalisé avec le score au moment des résultats.
+**Objet BD** : `AuditRequest` (table `{prefix}audit_requests`) - créé dès le choix du pack, mis à jour à chaque réponse, finalisé avec le score au moment des résultats.
 
 ---
 
@@ -63,12 +63,12 @@ cp    public/assets/css/app.css   assets/components/audit_express/css/
 
 ## 2. Base de données
 
-**Option A — Script automatique** (recommandé) :
+**Option A - Script automatique** (recommandé) :
 ```bash
 php modx/setup/install.php
 ```
 
-**Option B — SQL manuel** :
+**Option B - SQL manuel** :
 ```sql
 -- Ouvrir modx/setup/create_tables.sql, remplacer modx_ par votre préfixe, exécuter.
 ```
@@ -85,9 +85,9 @@ Colonnes de `audit_requests` :
 | `result`        | MEDIUMTEXT (JSON)                 | Score, piliers, risques, quick wins |
 | `email`         | VARCHAR(255) nullable             | Saisi lors du déblocage |
 | `status`        | ENUM draft/completed/emailed      | État du cycle de vie |
-| `ip_hash`       | VARCHAR(64) nullable              | sha256(IP) — RGPD, pas d'IP en clair |
+| `ip_hash`       | VARCHAR(64) nullable              | sha256(IP) - RGPD, pas d'IP en clair |
 | `step`          | TINYINT                           | Index de la question en cours |
-| `created_at`    | DATETIME                          | — |
+| `created_at`    | DATETIME                          | - |
 | `updated_at`    | DATETIME                          | Mis à jour automatiquement |
 
 ---
@@ -113,7 +113,7 @@ Colonnes de `audit_requests` :
 Créer un plugin **AuditExpress_Init** avec le code de `modx/plugins/AuditExpress_Init.php`.
 
 Événements à cocher :
-- `OnMODXInit` (priorité **1** — avant tout)
+- `OnMODXInit` (priorité **1** - avant tout)
 - `OnHandleRequest`
 
 ---
@@ -233,7 +233,7 @@ AuditExpress_PDF           modx/snippets/AuditExpress_PDF.php
             [Quiz Q1]
                 ↓ POST ae_action=ae_answer (x20)
            Met à jour AuditRequest.answers + step (BD)
-                ↓ redirect (PRG) — question suivante
+                ↓ redirect (PRG) - question suivante
             [Optional]
                 ↓ POST ae_action=ae_optional
            Engine::compute() → AuditRequest.result + status=completed (BD)
@@ -258,7 +258,7 @@ La purge des données doit être exécutée régulièrement (cron ou tâche plan
 ### Cron Linux (exemple)
 
 ```cron
-# Purge RGPD — 1er jour du mois à 3h (adapter USER, PASS, BASE_MODX)
+# Purge RGPD - 1er jour du mois à 3h (adapter USER, PASS, BASE_MODX)
 0 3 1 * * mysql -u USER -pPASS BASE_MODX -e "DELETE FROM modx_audit_requests WHERE status='draft' AND created_at < DATE_SUB(NOW(), INTERVAL 7 DAY); DELETE FROM modx_audit_requests WHERE status IN ('completed','emailed') AND created_at < DATE_SUB(NOW(), INTERVAL 90 DAY);" >> /var/log/purge-audit.log 2>&1
 ```
 

+ 2 - 2
docs/SECURITY.md

@@ -1,4 +1,4 @@
-# Sécurité — Audit Express Self
+# Sécurité - Audit Express Self
 
 ## Mesures déjà en place
 
@@ -10,7 +10,7 @@
 | **Headers sécurité** | X-Frame-Options, X-Content-Type-Options, Referrer-Policy, etc. |
 | **Cookies session** | HttpOnly, SameSite=Lax, Secure (en HTTPS) |
 | **.htaccess** | Pas de listing répertoires, blocage fichiers sensibles |
-| **Document root** | `public/` — config/, src/, storage/ non accessibles en HTTP |
+| **Document root** | `public/` - config/, src/, storage/ non accessibles en HTTP |
 
 ---
 

+ 1 - 1
modx/chunks/ae_cta_unlocked.html

@@ -11,7 +11,7 @@
     </p>
 
     <div class="cta-block">
-      [[+booking_url:notempty=`<div style="display:flex;flex-direction:column;align-items:center;width:100%"><span class="cta-offert">30 min offert</span><a class="btn btn--primary btn--cta-main" href="[[+booking_url]]" target="_blank" rel="noreferrer">Découvrir les opportunités suite à mon audit — Entretien de 30 min offert avec un consultant</a></div>`]]
+      [[+booking_url:notempty=`<div style="display:flex;flex-direction:column;align-items:center;width:100%"><span class="cta-offert">30 min offert</span><a class="btn btn--primary btn--cta-main" href="[[+booking_url]]" target="_blank" rel="noreferrer">Découvrir les opportunités suite à mon audit - Entretien de 30 min offert avec un consultant</a></div>`]]
       [[+devis_url:notempty=`<a class="btn btn--outline btn--cta-secondary" href="[[+devis_url]]">Demander un devis</a>`]]
     </div>
 

+ 1 - 1
modx/chunks/ae_results.html

@@ -16,7 +16,7 @@
         <div class="scoreBig">[[+score_total]]/100</div>
         <div class="level-badge" style="margin-top:10px">
           <span class="level-dot" style="background:[[+dot_color]]"></span>
-          <span>[[+level]] — [[+level_label]]</span>
+          <span>[[+level]] - [[+level_label]]</span>
         </div>
         <div class="confidence">Confiance du diagnostic : [[+confidence]]</div>
       </div>

+ 1 - 1
modx/chunks/ae_win_item.html

@@ -3,5 +3,5 @@
 -->
 <li>
   <strong>[[+title]]</strong>
-  <div class="hint">[[+effect]] · Effort : [[+effort]]</div>
+  <div class="hint">[[+effect]] ; Effort : [[+effort]]</div>
 </li>

+ 1 - 1
modx/model/audit_express/auditrequest.class.php

@@ -1,6 +1,6 @@
 <?php
 /**
- * AuditRequest — Classe xPDO de base
+ * AuditRequest - Classe xPDO de base
  * Représente une session d'audit (quiz + résultat) en base de données.
  */
 class AuditRequest extends xPDOSimpleObject

+ 1 - 1
modx/model/audit_express/mysql/auditrequest.class.php

@@ -1,5 +1,5 @@
 <?php
 /**
- * AuditRequest — Pilote MySQL xPDO
+ * AuditRequest - Pilote MySQL xPDO
  */
 class AuditRequestMysql extends AuditRequest {}

+ 1 - 1
modx/model/audit_express/mysql/auditrequest.map.inc.php

@@ -1,6 +1,6 @@
 <?php
 /**
- * AuditRequest — Map xPDO MySQL
+ * AuditRequest - Map xPDO MySQL
  * Généré depuis schema/audit_express.mysql.schema.xml
  */
 $xpdo_meta_map['AuditRequest'] = [

+ 3 - 3
modx/plugins/AuditExpress_Init.php

@@ -3,11 +3,11 @@
  * Plugin : AuditExpress_Init
  *
  * Événements à attacher :
- *   - OnMODXInit  (priorité 1) — charge le modèle xPDO à chaque requête
- *   - OnHandleRequest             — redirige si session expirée sur pages quiz/résultats
+ *   - OnMODXInit  (priorité 1) - charge le modèle xPDO à chaque requête
+ *   - OnHandleRequest             - redirige si session expirée sur pages quiz/résultats
  *
  * Paramètre plugin :
- *   core_path  — chemin vers components/audit_express/ (facultatif, auto-détecté)
+ *   core_path  - chemin vers components/audit_express/ (facultatif, auto-détecté)
  */
 
 $corePath = $modx->getOption('ae.core_path', null,

+ 23 - 23
modx/preview-chunks.html

@@ -3,7 +3,7 @@
 <head>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width,initial-scale=1">
-  <title>Spec visuelle — Chunks & Templates · Audit Express</title>
+  <title>Spec visuelle - Chunks & Templates ; Audit Express</title>
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link rel="stylesheet" href="../public/assets/css/app.css">
@@ -189,7 +189,7 @@
   <!-- ── Toolbar sticky ── -->
   <div class="pv-toolbar">
     <div>
-      <strong>Spec visuelle — Chunks &amp; Templates</strong>
+      <strong>Spec visuelle - Chunks &amp; Templates</strong>
       <div class="pv-nav" style="margin-top:6px">
         <a href="#step-select">① Choix pack</a>
         <a href="#step-quiz">② Quiz</a>
@@ -268,9 +268,9 @@
 
 
   <!-- ════════════════════════════════════════════════════
-       ② QUIZ — 1 QUESTION
+       ② QUIZ - 1 QUESTION
   ════════════════════════════════════════════════════ -->
-  <div id="step-quiz" class="pv-step">② Quiz — une question</div>
+  <div id="step-quiz" class="pv-step">② Quiz - une question</div>
 
   <div data-tpl="AuditExpress_Quiz">
     <div class="pv-box">
@@ -300,7 +300,7 @@
               <input type="hidden" name="question_id" value="q5">
 
               <div class="qTitle">Les étapes et responsabilités du process sont-elles formalisées quelque part ?</div>
-              <p class="qHelp">Procédure écrite, workflow dans un outil, checklist partagée — tout format compte.</p>
+              <p class="qHelp">Procédure écrite, workflow dans un outil, checklist partagée - tout format compte.</p>
 
               <!-- Chaque option = ae_question_option, injectées via [[+options]] -->
               <div class="options">
@@ -315,7 +315,7 @@
                 <div data-chunk="ae_question_option">
                   <label class="opt opt--selected" for="d_q5_2">
                     <input id="d_q5_2" type="radio" name="option_id" value="q5_2" checked>
-                    <div><strong>Partiellement — quelques étapes sont formalisées</strong></div>
+                    <div><strong>Partiellement - quelques étapes sont formalisées</strong></div>
                   </label>
                 </div>
 
@@ -329,7 +329,7 @@
                 <div data-chunk="ae_question_option">
                   <label class="opt opt--na" for="d_q5_na">
                     <input id="d_q5_na" type="radio" name="option_id" value="q5_na">
-                    <div><strong>Je ne sais pas / Non pertinent</strong></div>
+                    <div><strong>Je ne sais pas / Non pertinent - N/A</strong></div>
                   </label>
                 </div>
 
@@ -357,7 +357,7 @@
 
   <div data-tpl="AuditExpress_Quiz">
     <div class="pv-box">
-      <p class="pv-caption">Ressource MODX : <code>[[!AuditExpress_Optional]]</code> — même template que le quiz</p>
+      <p class="pv-caption">Ressource MODX : <code>[[!AuditExpress_Optional]]</code> - même template que le quiz</p>
 
       <div data-chunk="ae_optional">
         <div class="grid">
@@ -431,13 +431,13 @@
 
 
   <!-- ════════════════════════════════════════════════════
-       ④ RÉSULTATS — ÉTAT NON DÉBLOQUÉ
+       ④ RÉSULTATS - ÉTAT NON DÉBLOQUÉ
   ════════════════════════════════════════════════════ -->
-  <div id="step-results" class="pv-step">④ Résultats — avant déblocage email</div>
+  <div id="step-results" class="pv-step">④ Résultats - avant déblocage email</div>
 
   <div data-tpl="AuditExpress_Results">
     <div class="pv-box">
-      <p class="pv-caption">Ressource MODX : <code>[[!AuditExpress_Results]]</code> — <strong>[[+gate_html]]</strong> = ae_unlock_gate (email non saisi)</p>
+      <p class="pv-caption">Ressource MODX : <code>[[!AuditExpress_Results]]</code> - <strong>[[+gate_html]]</strong> = ae_unlock_gate (email non saisi)</p>
 
       <div data-chunk="ae_results">
         <div class="grid">
@@ -453,7 +453,7 @@
                 <div class="scoreBig">67/100</div>
                 <div class="level-badge" style="margin-top:10px">
                   <span class="level-dot" style="background:#c07c10"></span>
-                  <span>C — Fragile</span>
+                  <span>C - Fragile</span>
                 </div>
                 <div class="confidence">Confiance du diagnostic : Élevée (2 DK)</div>
               </div>
@@ -512,7 +512,7 @@
             </div>
           </div><!-- /ae_unlock_gate -->
 
-          <!-- [[+wins_html]] = vide (non débloqué) — absent ici -->
+          <!-- [[+wins_html]] = vide (non débloqué) - absent ici -->
 
         </div>
       </div><!-- /ae_results -->
@@ -522,9 +522,9 @@
 
 
   <!-- ════════════════════════════════════════════════════
-       ⑤ PAGE COMPLÈTE — ÉTAT DÉBLOQUÉ
+       ⑤ PAGE COMPLÈTE - ÉTAT DÉBLOQUÉ
   ════════════════════════════════════════════════════ -->
-  <div id="step-full" class="pv-step">⑤ Résultats — après déblocage email (état final)</div>
+  <div id="step-full" class="pv-step">⑤ Résultats - après déblocage email (état final)</div>
 
   <div data-tpl="AuditExpress_Results">
     <div class="pv-box">
@@ -540,7 +540,7 @@
                 <div class="scoreLabel">Score global</div>
                 <div class="scoreBig">67/100</div>
                 <div class="level-badge" style="margin-top:10px">
-                  <span class="level-dot" style="background:#c07c10"></span><span>C — Fragile</span>
+                  <span class="level-dot" style="background:#c07c10"></span><span>C - Fragile</span>
                 </div>
                 <div class="confidence">Confiance du diagnostic : Élevée</div>
               </div>
@@ -580,7 +580,7 @@
               <div class="h2" style="margin-bottom:6px">Et maintenant ?</div>
               <p class="lead" style="margin-bottom:24px">Votre diagnostic révèle des opportunités concrètes. Nous pouvons vous aider à les transformer en plan d'action.</p>
               <div style="display:flex;flex-wrap:wrap;gap:10px;justify-content:center">
-                <a class="btn btn--primary" href="#">Réserver un appel découverte — 30 min</a>
+                <a class="btn btn--primary" href="#">Réserver un appel découverte - 30 min</a>
                 <a class="btn btn--outline" href="#">Demander un devis</a>
               </div>
               <hr style="border:none;border-top:1px solid var(--border);margin:24px 0">
@@ -595,11 +595,11 @@
           <div class="card">
             <div class="h2">5 quick wins prioritaires</div>
             <ol class="list">
-              <div data-chunk="ae_win_item"><li><strong>Checklist jour 1 partagée</strong><div class="hint">Réduction des oublis à l'intégration · Effort : S</div></li></div>
-              <div data-chunk="ae_win_item"><li><strong>Pré-check 48 h avant arrivée</strong><div class="hint">Accès outils prêts dès J1 · Effort : S</div></li></div>
-              <div data-chunk="ae_win_item"><li><strong>Tableau de statut unique</strong><div class="hint">Fin des relances sur l'avancement · Effort : M</div></li></div>
-              <div data-chunk="ae_win_item"><li><strong>Centraliser les documents</strong><div class="hint">Dossier toujours complet et retrouvable · Effort : S</div></li></div>
-              <div data-chunk="ae_win_item"><li><strong>Escalade simple formalisée</strong><div class="hint">Moins de blocages en cas d'absence · Effort : S</div></li></div>
+              <div data-chunk="ae_win_item"><li><strong>Checklist jour 1 partagée</strong><div class="hint">Réduction des oublis à l'intégration ; Effort : S</div></li></div>
+              <div data-chunk="ae_win_item"><li><strong>Pré-check 48 h avant arrivée</strong><div class="hint">Accès outils prêts dès J1 ; Effort : S</div></li></div>
+              <div data-chunk="ae_win_item"><li><strong>Tableau de statut unique</strong><div class="hint">Fin des relances sur l'avancement ; Effort : M</div></li></div>
+              <div data-chunk="ae_win_item"><li><strong>Centraliser les documents</strong><div class="hint">Dossier toujours complet et retrouvable ; Effort : S</div></li></div>
+              <div data-chunk="ae_win_item"><li><strong>Escalade simple formalisée</strong><div class="hint">Moins de blocages en cas d'absence ; Effort : S</div></li></div>
             </ol>
             <p class="hint" style="margin-top:8px">Le PDF contient les 5 actions avec détail effort/impact.</p>
           </div>
@@ -612,7 +612,7 @@
 
 
   <footer class="footer" style="margin-top:48px">
-    Spec visuelle chunks &amp; templates — Audit Express Self · Livinweb
+    Spec visuelle chunks &amp; templates - Audit Express Self ; Livinweb
   </footer>
 
 </div>

+ 3 - 3
modx/schema/audit_express.mysql.schema.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-    Schéma xPDO — Audit Express Self
+    Schéma xPDO - Audit Express Self
     Table : audit_requests
     Déploiement : voir modx/setup/install.php
 -->
@@ -27,9 +27,9 @@
         <field key="email"         dbtype="varchar"  precision="255"                       phptype="string"   null="true"  default="null" />
         <!-- draft → completed → emailed -->
         <field key="status"        dbtype="enum"     precision="'draft','completed','emailed'" phptype="string" null="false" default="draft" />
-        <!-- Hash de l'IP (sha256) — pas d'IP en clair, RGPD -->
+        <!-- Hash de l'IP (sha256) - pas d'IP en clair, RGPD -->
         <field key="ip_hash"       dbtype="varchar"  precision="64"                        phptype="string"   null="true"  default="null" />
-        <!-- Étape courante (index question, 0-based) — pour reprise -->
+        <!-- Étape courante (index question, 0-based) - pour reprise -->
         <field key="step"          dbtype="tinyint"  precision="3"                         phptype="integer"  null="false" default="0" />
         <field key="created_at"    dbtype="datetime"                                       phptype="datetime" null="false" />
         <field key="updated_at"    dbtype="datetime"                                       phptype="datetime" null="false" />

+ 1 - 1
modx/setup/create_tables.sql

@@ -1,4 +1,4 @@
--- Audit Express — création de table (exécuter si install.php ne peut pas tourner)
+-- Audit Express - création de table (exécuter si install.php ne peut pas tourner)
 -- Remplacer `modx_` par votre préfixe MODX réel.
 
 CREATE TABLE IF NOT EXISTS `modx_audit_requests` (

+ 1 - 1
modx/setup/install.php

@@ -1,6 +1,6 @@
 <?php
 /**
- * Script d'installation Audit Express — MODX
+ * Script d'installation Audit Express - MODX
  * ============================================
  * À exécuter UNE SEULE FOIS après le déploiement du composant.
  * Requiert que MODX soit correctement configuré (config.core.php présent).

+ 2 - 2
modx/snippets/AuditExpress_Quiz.php

@@ -1,7 +1,7 @@
 <?php
 /**
  * Snippet : AuditExpress_Quiz
- * Vue "Question N/20" — 1 question par chargement de page, PRG pattern
+ * Vue "Question N/20" - 1 question par chargement de page, PRG pattern
  *
  * Propriétés :
  *   &select_resource_id   = `4`  Ressource choix du pack
@@ -118,7 +118,7 @@ $selected = $answers[$q['id']] ?? '';
 $optionsHtml = '';
 foreach ($q['options'] as $opt) {
     $isSelected = ($selected === $opt['id']);
-    $isNa       = ($opt['id'] === 'NA' || str_ends_with(strtolower($opt['id']), '_na'));
+    $isNa       = ($opt['id'] === 'NA' || $opt['id'] === 'DK' || str_ends_with(strtolower($opt['id']), '_na') || str_ends_with(strtolower($opt['id']), '_dk'));
     $optionsHtml .= $modx->getChunk('ae_question_option', [
         'question_id' => htmlspecialchars($q['id'], ENT_QUOTES),
         'option_id'   => htmlspecialchars($opt['id'], ENT_QUOTES),

+ 2 - 2
modx/snippets/AuditExpress_Results.php

@@ -71,7 +71,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && ($_POST['ae_action'] ?? '') === 'ae
             $mailer = new \AuditExpress\LogMailer($corePath . '../storage/outbox/');
             $mailer->send(
                 $email,
-                'Votre diagnostic — Contrôle technique process',
+                'Votre diagnostic - Contrôle technique process',
                 "Bonjour,\n\nVeuillez trouver ci-joint votre synthèse PDF.\n\nBonne continuation,\nL'équipe Livinweb",
                 $pdfBytes,
                 'controle-technique-' . $packId . '.pdf'
@@ -162,7 +162,7 @@ $gateOrCtaHtml = $unlocked
 return $modx->getChunk('ae_results', [
     'pack_title'   => htmlspecialchars($r['pack_title'] ?? $auditReq->get('pack_id'), ENT_QUOTES),
     'score_total'  => $r['score_total'] ?? 0,
-    'level'        => $r['level'] ?? '—',
+    'level'        => $r['level'] ?? '-',
     'level_label'  => htmlspecialchars($r['level_label'] ?? '', ENT_QUOTES),
     'dot_color'    => $dotColor,
     'confidence'   => htmlspecialchars($r['confidence']['label'] ?? '', ENT_QUOTES),

+ 2 - 2
modx/snippets/AuditExpress_SelectPack.php

@@ -77,14 +77,14 @@ $packCatalogue = [
     [
         'id'       => 'onboarding-v1',
         'title'    => 'Onboarding collaborateur',
-        'desc'     => "Fiabilisez l'intégration de vos nouveaux collaborateurs : clarté du flux, traçabilité, continuité.",
+        'desc'     => "Clarté du flux, traçabilité, continuité — auditez votre process d'intégration.",
         'tag'      => 'Pré-configuré',
         'tagClass' => 'tag--pre',
     ],
     [
         'id'       => 'validation-facture',
         'title'    => 'Validation de facture',
-        'desc'     => 'Contrôles, séparation des tâches, preuve : évaluez la robustesse de votre circuit factures.',
+        'desc'     => 'Contrôles, séparation des tâches, preuve — évaluez votre circuit factures.',
         'tag'      => 'Pré-configuré',
         'tagClass' => 'tag--pre',
     ],

+ 3 - 3
modx/templates/AuditExpress_Base.html

@@ -3,7 +3,7 @@
 <head>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width,initial-scale=1">
-  <title>[[*pagetitle]] — Contrôle technique process · Livinweb</title>
+  <title>[[*pagetitle]] - Contrôle technique process ; Livinweb</title>
   <meta name="description" content="[[*description:default=`En 7 minutes, obtenez une note sur 100, vos risques probables et 5 actions prioritaires pour fiabiliser votre process.`]]">
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@@ -19,7 +19,7 @@
           <a href="[[~[[++ae.resource.landing]]]]" style="color:inherit;text-decoration:none">Contrôle technique process</a>
         </div>
         <div class="brand__sub">
-          Diagnostic self-serve ·
+          Diagnostic self-serve ;
           <a href="https://livinweb.fr" target="_blank" rel="noreferrer" style="color:inherit;text-decoration:none">Livinweb</a>
         </div>
       </div>
@@ -32,7 +32,7 @@
 
     <footer class="footer">
       <a href="#" id="privacyLink">Données &amp; confidentialité</a>
-      &nbsp;·&nbsp;
+      &nbsp;;&nbsp;
       <a href="https://livinweb.fr" target="_blank" rel="noreferrer">Livinweb</a>
     </footer>
 

+ 3 - 3
modx/templates/AuditExpress_Landing.html

@@ -3,7 +3,7 @@
 <head>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width,initial-scale=1">
-  <title>Contrôle technique de votre process — Livinweb</title>
+  <title>Contrôle technique de votre process - Livinweb</title>
   <meta name="description" content="En 7 minutes, obtenez une note sur 100, vos risques probables et 5 actions prioritaires pour fiabiliser votre process.">
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@@ -16,7 +16,7 @@
       <div>
         <div class="brand__logo">Contrôle technique process</div>
         <div class="brand__sub">
-          Diagnostic self-serve ·
+          Diagnostic self-serve ;
           <a href="https://livinweb.fr" target="_blank" rel="noreferrer" style="color:inherit;text-decoration:none">Livinweb</a>
         </div>
       </div>
@@ -29,7 +29,7 @@
 
     <footer class="footer">
       <a href="#" id="privacyLink">Données &amp; confidentialité</a>
-      &nbsp;·&nbsp;
+      &nbsp;;&nbsp;
       <a href="https://livinweb.fr" target="_blank" rel="noreferrer">Livinweb</a>
     </footer>
 

+ 3 - 3
modx/templates/AuditExpress_Quiz.html

@@ -3,7 +3,7 @@
 <head>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width,initial-scale=1">
-  <title>[[*pagetitle]] — Contrôle technique process</title>
+  <title>[[*pagetitle]] - Contrôle technique process</title>
   <meta name="robots" content="noindex,nofollow">
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@@ -17,7 +17,7 @@
         <div class="brand__logo">
           <a href="[[~[[++ae.resource.landing]]]]" style="color:inherit;text-decoration:none">Contrôle technique process</a>
         </div>
-        <div class="brand__sub">Diagnostic self-serve · Livinweb</div>
+        <div class="brand__sub">Diagnostic self-serve ; Livinweb</div>
       </div>
     </header>
 
@@ -27,7 +27,7 @@
 
     <footer class="footer">
       <a href="[[~[[++ae.resource.landing]]]]">Accueil</a>
-      &nbsp;·&nbsp;
+      &nbsp;;&nbsp;
       <a href="https://livinweb.fr" target="_blank" rel="noreferrer">Livinweb</a>
     </footer>
 

+ 3 - 3
modx/templates/AuditExpress_Results.html

@@ -3,7 +3,7 @@
 <head>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width,initial-scale=1">
-  <title>Vos résultats — Contrôle technique process</title>
+  <title>Vos résultats - Contrôle technique process</title>
   <meta name="robots" content="noindex,nofollow">
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@@ -17,7 +17,7 @@
         <div class="brand__logo">
           <a href="[[~[[++ae.resource.landing]]]]" style="color:inherit;text-decoration:none">Contrôle technique process</a>
         </div>
-        <div class="brand__sub">Diagnostic self-serve · Livinweb</div>
+        <div class="brand__sub">Diagnostic self-serve ; Livinweb</div>
       </div>
     </header>
 
@@ -27,7 +27,7 @@
 
     <footer class="footer">
       <a href="[[~[[++ae.resource.landing]]]]">Accueil</a>
-      &nbsp;·&nbsp;
+      &nbsp;;&nbsp;
       <a href="https://livinweb.fr" target="_blank" rel="noreferrer">Livinweb</a>
     </footer>
 

+ 8 - 1
public/.htaccess

@@ -1,4 +1,11 @@
-# Audit Express Self — Sécurité Apache (OVH)
+# Audit Express Self - Sécurité Apache (OVH)
+
+# Forcer HTTPS
+<IfModule mod_rewrite.c>
+    RewriteEngine On
+    RewriteCond %{HTTPS} off
+    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
+</IfModule>
 
 # Désactiver l'affichage du contenu des répertoires
 Options -Indexes

+ 241 - 6
public/assets/css/app.css

@@ -31,7 +31,7 @@ body {
 }
 
 /* ── Layout ── */
-.container { max-width: 920px; margin: 0 auto; padding: 32px 18px 52px; }
+.container { max-width: 1000px; margin: 0 auto; padding: 32px 18px 52px; }
 
 /* ── Navbar (bandeau menu) ── */
 .navbar {
@@ -174,6 +174,153 @@ body {
   }
 }
 
+/* ── Navbar breadcrumb (outil actif) ── */
+.navbar__sub {
+  font-size: 11px;
+  font-weight: 400;
+  margin-top: 1px;
+  letter-spacing: .2px;
+  color: rgba(255,255,255,.65);
+  max-width: 200px;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  min-height: 14px;
+  transition: opacity .2s;
+}
+.navbar__sub:empty { opacity: 0; }
+.navbar__sub:not(:empty) { opacity: 1; }
+
+/* ── Navbar dropdown Outils ── */
+.navbar__dropdown { position: relative; }
+.navbar__dropdown-btn {
+  color: rgba(255,255,255,.88);
+  background: transparent;
+  border: none;
+  font-family: Lato, sans-serif;
+  font-size: 14px;
+  font-weight: 500;
+  padding: 8px 12px;
+  border-radius: 6px;
+  cursor: pointer;
+  display: flex;
+  align-items: center;
+  gap: 5px;
+  transition: color .2s, background .2s;
+}
+.navbar__dropdown-btn:hover,
+.navbar__dropdown--open .navbar__dropdown-btn {
+  color: #fff;
+  background: rgba(255,255,255,.1);
+}
+.navbar__chevron {
+  font-size: 10px;
+  transition: transform .18s;
+  display: inline-block;
+  opacity: .75;
+}
+.navbar__dropdown--open .navbar__chevron { transform: rotate(180deg); }
+.navbar__dropdown-menu {
+  position: absolute;
+  top: calc(100% + 10px);
+  right: 0;
+  min-width: 240px;
+  background: #fff;
+  border: 1px solid var(--border);
+  border-radius: var(--radius);
+  box-shadow: var(--shadow-lg);
+  padding: 6px 0;
+  opacity: 0;
+  visibility: hidden;
+  transform: translateY(-6px);
+  transition: opacity .15s, transform .15s, visibility .15s;
+  z-index: 200;
+}
+.navbar__dropdown--open .navbar__dropdown-menu {
+  opacity: 1;
+  visibility: visible;
+  transform: translateY(0);
+}
+.navbar__dropdown-group {
+  padding: 7px 16px 3px;
+  font-size: 10px;
+  font-weight: 700;
+  letter-spacing: .7px;
+  text-transform: uppercase;
+  color: var(--muted);
+}
+.navbar__dropdown-item {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  padding: 9px 16px;
+  font-size: 13px;
+  color: var(--navy);
+  text-decoration: none;
+  cursor: pointer;
+  border: none;
+  background: transparent;
+  width: 100%;
+  text-align: left;
+  font-family: Lato, sans-serif;
+  font-weight: 500;
+  transition: background .12s;
+}
+.navbar__dropdown-item:hover { background: var(--bg); }
+.navbar__dropdown-item.active {
+  font-weight: 700;
+  color: var(--cyan);
+  background: #f0faff;
+}
+.navbar__dropdown-sep {
+  height: 1px;
+  background: var(--border);
+  margin: 5px 10px;
+}
+@media (max-width: 640px) {
+  .navbar__dropdown { width: 100%; }
+  .navbar__dropdown-btn {
+    width: 100%;
+    padding: 12px 16px;
+    justify-content: flex-start;
+    font-size: 15px;
+  }
+  .navbar__dropdown-menu {
+    position: static;
+    transform: none;
+    opacity: 1;
+    visibility: visible;
+    box-shadow: none;
+    border: none;
+    border-left: 2px solid rgba(255,255,255,.15);
+    border-radius: 0;
+    padding: 4px 0;
+    margin-left: 16px;
+    display: none;
+    background: transparent;
+  }
+  .navbar__dropdown--open .navbar__dropdown-menu { display: block; }
+  .navbar__dropdown-item {
+    color: rgba(255,255,255,.75);
+    font-size: 14px;
+    padding: 10px 16px;
+  }
+  .navbar__dropdown-item:hover,
+  .navbar__dropdown-item.active {
+    background: rgba(255,255,255,.08);
+    color: #fff;
+  }
+  .navbar__dropdown-group { color: rgba(255,255,255,.35); }
+  .navbar__dropdown-sep { background: rgba(255,255,255,.12); margin: 4px 0; }
+}
+
+/* ── Landing sections ── */
+.landing-section { margin-top: 24px; }
+.landing-section + .landing-section { margin-top: 28px; }
+.section-label--audit { color: var(--navy); }
+.section-label--calc  { color: #5e3b9e; }
+.section-label--conseil { color: #b85c10; }
+
 /* ── Footer ── */
 .footer {
   margin-top: 48px;
@@ -280,6 +427,7 @@ body {
 .tag--pre  { background: #eef7f2; color: #1a6b45; border-color: #a8d9bc; }
 .tag--new  { background: #f5f0fd; color: #5e3b9e; border-color: #ccb3f5; }
 .tag--v2   { background: #fff3e8; color: #b85c10; border-color: #f5c49a; }
+.tag--excel { background: #e8f0e8; color: #2a6b2a; border-color: #90c090; }
 
 /* ── Bullets ── */
 .bullets { margin: 0 0 16px; padding: 0 0 0 18px; }
@@ -340,6 +488,13 @@ body {
 .pack-card .title { font-size: 17px; font-weight: 700; color: var(--navy); margin: 8px 0 4px; }
 .pack-card .desc  { font-size: 14px; color: var(--muted); }
 .pack-card .arrow { font-size: 18px; color: var(--cyan); float: right; margin-top: 2px; }
+.pack-card--featured {
+  border-color: var(--cyan);
+  background: linear-gradient(135deg, #f8fcff 0%, var(--bg-card) 100%);
+  box-shadow: var(--shadow-lg);
+}
+.pack-card--featured:hover { border-color: var(--navy); }
+.section-label--featured { color: var(--cyan); font-size: 12px; }
 
 /* ── Quiz ── */
 .quizHead {
@@ -437,8 +592,12 @@ body {
   padding: 10px 12px; border-radius: var(--radius);
   border: 1.5px solid var(--border); background: var(--bg);
   color: var(--navy); font-family: Lato, sans-serif; font-size: 15px;
+  transition: border-color 0.2s ease, box-shadow 0.2s ease;
+}
+.field input:focus {
+  outline: none; border-color: var(--cyan);
+  box-shadow: 0 0 0 3px rgba(0, 190, 243, 0.2);
 }
-.field input:focus { outline: none; border-color: var(--cyan); }
 .check {
   display: flex; gap: 10px; align-items: flex-start;
   margin: 10px 0; font-size: 14px; color: var(--muted); line-height: 1.4;
@@ -583,8 +742,12 @@ body {
   padding: 12px 14px; border-radius: var(--radius);
   border: 1.5px solid var(--border); background: var(--bg);
   color: var(--navy); font-family: Lato, sans-serif; font-size: 15px;
+  transition: border-color 0.2s ease, box-shadow 0.2s ease;
+}
+.unlock-row input[type="email"]:focus {
+  outline: none; border-color: var(--cyan);
+  box-shadow: 0 0 0 3px rgba(0, 190, 243, 0.2);
 }
-.unlock-row input[type="email"]:focus { outline: none; border-color: var(--cyan); }
 .btn--unlock { padding: 12px 28px; font-size: 16px; box-shadow: 0 2px 12px rgba(0, 190, 243, .35); }
 
 /* ── CTAs débloqués ── */
@@ -600,6 +763,13 @@ body {
   padding: 32px 28px;
   text-align: center;
 }
+.unlocked-ctas--entering {
+  animation: unlocked-ctas-enter 0.4s ease-out;
+}
+@keyframes unlocked-ctas-enter {
+  0% { opacity: 0; transform: translateY(12px); }
+  100% { opacity: 1; transform: translateY(0); }
+}
 .unlocked-ctas .h2 { text-align: center; font-size: 22px; }
 .unlocked-ctas .lead { text-align: center; max-width: 480px; margin: 0 auto; }
 
@@ -648,9 +818,10 @@ body {
 }
 
 /* ── Tags outils ── */
-.tag--roi { background: #fffbe8; color: #8a5a00; border-color: #f0d090; }
-.tag--qwf { background: #e8faf6; color: #0a6a50; border-color: #90d8c0; }
+.tag--roi   { background: #fffbe8; color: #8a5a00; border-color: #f0d090; }
+.tag--qwf   { background: #e8faf6; color: #0a6a50; border-color: #90d8c0; }
 .tag--booking { background: #e8f4ff; color: #0a5a9e; border-color: #90c0f0; }
+.tag--excel { background: #e8f5e9; color: #1a5c28; border-color: #90c8a0; }
 
 .pack-card--link {
   display: block;
@@ -775,12 +946,31 @@ body {
 
 /* ── Dialog ── */
 .dialog { border: none; padding: 0; background: transparent; }
-.dialog::backdrop { background: rgba(23,50,88,.45); }
+.dialog[open] {
+  animation: dialog-enter 0.25s ease-out;
+}
+@keyframes dialog-enter {
+  from { opacity: 0; }
+  to { opacity: 1; }
+}
+.dialog::backdrop {
+  background: rgba(23,50,88,.45);
+  animation: dialog-backdrop-enter 0.25s ease-out;
+}
+@keyframes dialog-backdrop-enter {
+  from { opacity: 0; }
+  to { opacity: 1; }
+}
 .dialog__inner {
   width: min(560px, calc(100vw - 20px));
   border: 1.5px solid var(--border); border-radius: var(--radius);
   background: var(--bg-card); box-shadow: var(--shadow-lg);
   padding: 0;
+  animation: dialog-inner-enter 0.3s ease-out;
+}
+@keyframes dialog-inner-enter {
+  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
+  to { opacity: 1; transform: scale(1) translateY(0); }
 }
 .dialog__head {
   display: flex; justify-content: space-between; align-items: center;
@@ -788,3 +978,48 @@ body {
 }
 .dialog__head strong { font-size: 17px; font-weight: 700; color: var(--navy); }
 .dialog__body { padding: 18px 20px; }
+
+/* ── Excel → Application tool ── */
+.excel-verdict {
+  display: flex; gap: 16px; align-items: flex-start;
+  border: 2px solid; border-radius: var(--radius);
+  padding: 20px; background: var(--bg-card);
+}
+.excel-verdict__icon {
+  width: 40px; height: 40px; border-radius: 50%;
+  display: flex; align-items: center; justify-content: center;
+  font-size: 20px; font-weight: 700; color: #fff; flex-shrink: 0;
+}
+.excel-verdict__body { display: grid; gap: 6px; }
+.excel-verdict__score { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
+.excel-verdict__title { font-size: 19px; font-weight: 700; line-height: 1.2; }
+.excel-verdict__summary { font-size: 14px; color: var(--text); line-height: 1.5; }
+
+.excel-actions { display: grid; gap: 12px; margin-top: 4px; }
+.excel-action {
+  display: flex; gap: 14px; align-items: flex-start;
+  background: var(--bg); border-radius: var(--radius); padding: 14px 16px;
+}
+.excel-action__num {
+  width: 26px; height: 26px; border-radius: 50%; background: var(--cyan); color: #fff;
+  font-size: 13px; font-weight: 700; flex-shrink: 0;
+  display: flex; align-items: center; justify-content: center;
+}
+.excel-action__text { font-size: 14px; color: var(--navy); line-height: 1.5; }
+
+.qual-row { margin-bottom: 14px; }
+.qual-row__lbl { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
+.qual-chips { display: flex; flex-wrap: wrap; gap: 8px; }
+.qual-chip {
+  padding: 6px 14px; border-radius: 999px;
+  border: 1.5px solid var(--border); background: var(--bg-card);
+  font-size: 13px; color: var(--navy); cursor: pointer;
+  transition: background .15s, border-color .15s, color .15s;
+  font-family: inherit;
+}
+.qual-chip.active { background: var(--cyan); border-color: var(--cyan); color: #fff; font-weight: 700; }
+.qual-chip:hover:not(.active) { border-color: var(--cyan); color: var(--cyan); }
+
+.qual-summary { display: grid; gap: 8px; margin-top: 4px; }
+.qual-summary__row { font-size: 14px; color: var(--navy); }
+.qual-summary__lbl { font-weight: 700; }

File diff suppressed because it is too large
+ 636 - 107
public/assets/js/app.js


+ 55 - 4
public/index.php

@@ -35,7 +35,7 @@ if ($csrfToken === null) {
   <head>
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width,initial-scale=1" />
-    <title>Contrôle technique process — Diagnostic self-serve · Livinweb</title>
+    <title>Contrôle technique process - Diagnostic self-serve ; Livinweb</title>
     <meta name="description" content="Choisissez le process à diagnostiquer. Packs pré-configurés, process universel, outils complémentaires (ROI Calculator, Quick Wins Finder)." />
     <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
     <link rel="preconnect" href="https://fonts.googleapis.com" />
@@ -45,11 +45,29 @@ if ($csrfToken === null) {
   <body>
     <header class="navbar">
       <div class="navbar__inner">
-        <a href="/" class="navbar__brand">
+        <a href="/" class="navbar__brand" onclick="window._ae?.goStart(); return false;">
           <span class="navbar__logo">Contrôle technique process</span>
+          <span class="navbar__sub" id="navBreadcrumb"></span>
         </a>
         <nav class="navbar__nav">
-          <a href="/" class="navbar__link">Accueil</a>
+          <a href="/" class="navbar__link" onclick="window._ae?.goStart(); return false;">Accueil</a>
+
+          <div class="navbar__dropdown" id="toolsDropdown">
+            <button class="navbar__dropdown-btn" id="toolsDropdownBtn" type="button" aria-haspopup="true" aria-expanded="false">
+              Outils <span class="navbar__chevron">▾</span>
+            </button>
+            <div class="navbar__dropdown-menu" id="toolsDropdownMenu" role="menu">
+              <div class="navbar__dropdown-group">Audits &amp; Diagnostics</div>
+              <button class="navbar__dropdown-item" id="nav-diag"   onclick="window._ae?.goDiag()"   role="menuitem">Diagnostic process</button>
+              <button class="navbar__dropdown-item" id="nav-v2"     onclick="window._ae?.goV2()"     role="menuitem">Diagnostic d'opportunité</button>
+              <button class="navbar__dropdown-item" id="nav-excel"  onclick="window._ae?.goExcel()"  role="menuitem">Excel → Application</button>
+              <div class="navbar__dropdown-sep"></div>
+              <div class="navbar__dropdown-group">Calculateurs rapides</div>
+              <button class="navbar__dropdown-item" id="nav-roi"    onclick="window._ae?.goRoi()"    role="menuitem">ROI Calculator</button>
+              <button class="navbar__dropdown-item" id="nav-qwf"    onclick="window._ae?.goQwf()"    role="menuitem">Quick Wins Finder</button>
+            </div>
+          </div>
+
           <a href="https://livinweb.fr" target="_blank" rel="noreferrer" class="navbar__link navbar__link--logo">
             <img src="/assets/images/logo-livinweb.svg" alt="Livinweb" class="navbar__logo-img" width="100" height="22" />
           </a>
@@ -73,7 +91,7 @@ if ($csrfToken === null) {
         <div class="footer__inner">
           <div class="footer__brand">
             <strong>Contrôle technique process</strong>
-            <span>Diagnostic self-serve · <a href="https://livinweb.fr" target="_blank" rel="noreferrer" class="footer__logo-link">Livinweb</a></span>
+            <span>Diagnostic self-serve ; <a href="https://livinweb.fr" target="_blank" rel="noreferrer" class="footer__logo-link">Livinweb</a></span>
           </div>
           <div class="footer__links">
             <a href="/">Accueil</a>
@@ -111,6 +129,39 @@ if ($csrfToken === null) {
       document.getElementById('footerPrivacyLink')?.addEventListener('click', openPrivacy);
       cls?.addEventListener('click', () => dlg?.close());
       document.getElementById('navToggle')?.addEventListener('click', () => document.body.classList.toggle('nav-open'));
+
+      /* ── Dropdown Outils ── */
+      const toolsDd  = document.getElementById('toolsDropdown');
+      const toolsBtn = document.getElementById('toolsDropdownBtn');
+
+      toolsBtn?.addEventListener('click', (e) => {
+        e.stopPropagation();
+        const isOpen = toolsDd.classList.toggle('navbar__dropdown--open');
+        toolsBtn.setAttribute('aria-expanded', isOpen ? 'true' : 'false');
+      });
+
+      document.addEventListener('click', (e) => {
+        if (!toolsDd?.contains(e.target)) {
+          toolsDd?.classList.remove('navbar__dropdown--open');
+          toolsBtn?.setAttribute('aria-expanded', 'false');
+        }
+      });
+
+      /* Fermer le dropdown après sélection d'un outil */
+      document.getElementById('toolsDropdownMenu')?.addEventListener('click', () => {
+        toolsDd?.classList.remove('navbar__dropdown--open');
+        toolsBtn?.setAttribute('aria-expanded', 'false');
+        /* Fermer aussi le menu mobile */
+        document.body.classList.remove('nav-open');
+      });
+
+      /* Échap ferme le dropdown */
+      document.addEventListener('keydown', (e) => {
+        if (e.key === 'Escape') {
+          toolsDd?.classList.remove('navbar__dropdown--open');
+          toolsBtn?.setAttribute('aria-expanded', 'false');
+        }
+      });
     </script>
   </body>
 </html>

+ 157 - 18
src/Engine.php

@@ -15,6 +15,7 @@ final class Engine
                 'label' => (string) ($p['label'] ?? $p['id']),
                 'score' => 0,
                 'max' => isset($p['max']) ? (int) $p['max'] : 20,
+                'raw_max' => isset($p['raw_max']) ? (int) $p['raw_max'] : null,
             ];
         }
 
@@ -57,7 +58,7 @@ final class Engine
                 $dkCount++;
             }
 
-            $pillarId = (string) ($q['pillar_id'] ?? '');
+            $pillarId = (string) ($q['pillar_id'] ?? $q['pillar'] ?? '');
             if ($pillarId !== '' && isset($pillars[$pillarId])) {
                 $pillars[$pillarId]['score'] += $points;
             }
@@ -69,19 +70,49 @@ final class Engine
             ];
         }
 
-        // Anti-cheat caps (deterministic)
+        // Normalize pillar scores when raw_max differs from max (e.g. 3 vs 4 questions per pillar)
+        foreach ($pillars as $pid => $p) {
+            $rawMax = $p['raw_max'] ?? null;
+            if ($rawMax !== null && $rawMax > 0) {
+                $raw = (int) $p['score'];
+                $pillars[$pid]['score'] = (int) round(($raw / $rawMax) * 20);
+            }
+        }
+
+        // Anti-cheat caps (deterministic, applied on normalized score)
         $caps = (array) (($pack['scoring']['anti_cheat_caps'] ?? []) ?: []);
-        foreach ($caps as $capQuestionId => $capRule) {
-            $capQuestionId = (string) $capQuestionId;
-            if (!isset($perQuestion[$capQuestionId])) {
-                continue;
+        $capsList = array_values($caps);
+        $isArrayFormat = isset($capsList[0]) && is_array($capsList[0]) && isset($capsList[0]['trigger']);
+        foreach ($caps as $capKey => $capRule) {
+            $capQuestionId = '';
+            if ($isArrayFormat) {
+                $capQuestionId = (string) ($capRule['trigger']['question'] ?? '');
+                $cond = (string) ($capRule['trigger']['condition'] ?? '');
+                if ($capQuestionId === '' || !isset($perQuestion[$capQuestionId])) {
+                    continue;
+                }
+                $pts = (int) $perQuestion[$capQuestionId]['points'];
+                $triggered = self::triggerMatches($cond, $pts, 'lowest', 2);
+            } else {
+                $capQuestionId = (string) $capKey;
+                if (!isset($perQuestion[$capQuestionId])) {
+                    continue;
+                }
+                $pts = (int) $perQuestion[$capQuestionId]['points'];
+                $triggerPoints = isset($capRule['trigger_points']) ? (int) $capRule['trigger_points'] : null;
+                $triggerMax = isset($capRule['trigger_max']) ? (int) $capRule['trigger_max'] : null;
+                $triggered = false;
+                if ($triggerPoints !== null && $pts === $triggerPoints) {
+                    $triggered = true;
+                } elseif ($triggerMax !== null && $pts <= $triggerMax) {
+                    $triggered = true;
+                }
             }
-            $triggerPoints = (int) ($capRule['trigger_points'] ?? 0);
-            if ((int) $perQuestion[$capQuestionId]['points'] !== $triggerPoints) {
+            if (!$triggered) {
                 continue;
             }
 
-            $pillarId = (string) ($capRule['pillar_id'] ?? '');
+            $pillarId = (string) ($capRule['pillar_id'] ?? $capRule['pillar'] ?? '');
             $cap = (int) ($capRule['cap'] ?? 0);
             if ($pillarId !== '' && isset($pillars[$pillarId])) {
                 $pillars[$pillarId]['score'] = min($pillars[$pillarId]['score'], $cap);
@@ -104,7 +135,8 @@ final class Engine
         $risks = [];
         if (is_array($rulesBundle)) {
             $triggersMode = (string) ($pack['scoring']['triggers_mode'] ?? 'lowest');
-            [$quickWins, $risks] = self::selectWinsAndRisks($rulesBundle, $perQuestion, (string) ($pack['pack_id'] ?? ''), $triggersMode);
+            $triggersScoreMax = (int) ($pack['scoring']['triggers_score_max'] ?? 2);
+            [$quickWins, $risks] = self::selectWinsAndRisks($rulesBundle, $perQuestion, (string) ($pack['pack_id'] ?? ''), $triggersMode, $triggersScoreMax);
         }
 
         $costHidden = null;
@@ -118,6 +150,11 @@ final class Engine
             $v2Diagnostic = self::computeV2Diagnostic($pillars, $quickWins, $risks);
         }
 
+        $excelDiagnostic = null;
+        if ($packIdStr === 'transformation-excel') {
+            $excelDiagnostic = self::computeExcelDiagnostic($pillars, $quickWins, $risks);
+        }
+
         return [
             'pack_id' => $packIdStr,
             'score_total' => $scoreTotal,
@@ -135,6 +172,7 @@ final class Engine
             'quick_wins_top5' => array_slice($quickWins, 0, 5),
             'cost_hidden' => $costHidden,
             'v2_diagnostic' => $v2Diagnostic,
+            'excel_diagnostic' => $excelDiagnostic,
         ];
     }
 
@@ -175,17 +213,53 @@ final class Engine
         return ['level' => 'medium', 'label' => 'Confiance moyenne'];
     }
 
-    private static function selectWinsAndRisks(array $rulesBundle, array $perQuestion, string $packId = '', string $triggersMode = 'lowest'): array
+    private static function triggerMatches(string $cond, int $pts, string $triggersMode, int $triggersScoreMax): bool
+    {
+        if ($cond !== '') {
+            if (preg_match('/score\s*>=\s*(\d+)/', $cond, $m)) {
+                return $pts >= (int) $m[1];
+            }
+            if (preg_match('/score\s*<=\s*(\d+)/', $cond, $m)) {
+                return $pts <= (int) $m[1];
+            }
+            if (preg_match('/score\s*==\s*(\d+)/', $cond, $m)) {
+                return $pts === (int) $m[1];
+            }
+        }
+        return $triggersMode === 'highest' ? $pts >= 2 : $pts <= $triggersScoreMax;
+    }
+
+    private static function selectWinsAndRisks(array $rulesBundle, array $perQuestion, string $packId = '', string $triggersMode = 'lowest', int $triggersScoreMax = 2): array
     {
         $winsLib = (array) ($rulesBundle['quick_wins'] ?? []);
 
         // Choose the right risk library + rules based on pack
         $isV2     = $packId === 'process-generique-v2';
-        $isGeneric = !$isV2 && (str_starts_with($packId, 'process-generique') || str_starts_with($packId, 'process_generique'));
-        if ($isV2) {
+        $isExcel  = str_starts_with($packId, 'transformation-excel');
+        $isSav    = str_starts_with($packId, 'intervention-sav');
+        $isInternalRequests = str_starts_with($packId, 'internal-requests');
+        $isCtq    = str_starts_with($packId, 'collecte-terrain');
+        $isGeneric = !$isV2 && !$isExcel && !$isSav && !$isInternalRequests && !$isCtq && (str_starts_with($packId, 'process-generique') || str_starts_with($packId, 'process_generique'));
+        if ($isCtq) {
+            $winsLib = (array) ($rulesBundle['quick_wins_ctq'] ?? $rulesBundle['quick_wins'] ?? []);
+            $riskLib = (array) ($rulesBundle['risks_ctq'] ?? []);
+            $rules   = (array) ($rulesBundle['rules_ctq'] ?? []);
+        } elseif ($isInternalRequests) {
+            $winsLib = (array) ($rulesBundle['quick_wins_internal_requests'] ?? $rulesBundle['quick_wins'] ?? []);
+            $riskLib = (array) ($rulesBundle['risks_internal_requests'] ?? []);
+            $rules   = (array) ($rulesBundle['rules_internal_requests'] ?? []);
+        } elseif ($isV2) {
             $riskLib = (array) ($rulesBundle['risks_v2'] ?? $rulesBundle['risks_generic'] ?? []);
             $rules   = (array) ($rulesBundle['rules_v2'] ?? []);
             $triggersMode = 'highest';
+        } elseif ($isExcel) {
+            $riskLib = (array) ($rulesBundle['risks_excel'] ?? []);
+            $rules   = (array) ($rulesBundle['rules_excel'] ?? []);
+            $triggersMode = 'highest';
+        } elseif ($isSav) {
+            $winsLib = (array) ($rulesBundle['quick_wins_sav'] ?? $rulesBundle['quick_wins'] ?? []);
+            $riskLib = (array) ($rulesBundle['risks_sav'] ?? []);
+            $rules   = (array) ($rulesBundle['rules_sav'] ?? []);
         } elseif ($isGeneric) {
             $riskLib = (array) ($rulesBundle['risks_generic'] ?? $rulesBundle['risks_onboarding'] ?? []);
             $rules   = (array) ($rulesBundle['rules_generic'] ?? $rulesBundle['rules'] ?? []);
@@ -210,9 +284,9 @@ final class Engine
                 continue;
             }
             $pts = (int) $perQuestion[$qid]['points'];
-            // "lowest" (default): trigger when score <= 2 (bad on a 0-5 scale)
-            // "highest": trigger when score >= 2 (high friction on a 0-3 scale)
-            if ($triggersMode === 'highest' ? $pts < 2 : $pts > 2) {
+            $cond = (string) ($rule['trigger']['condition'] ?? '');
+            $triggered = self::triggerMatches($cond, $pts, $triggersMode, $triggersScoreMax);
+            if (!$triggered) {
                 continue;
             }
 
@@ -231,7 +305,9 @@ final class Engine
                 continue;
             }
             $pts = (int) $perQuestion[$qid]['points'];
-            if ($triggersMode === 'highest' ? $pts < 2 : $pts > 2) {
+            $cond = (string) ($rule['trigger']['condition'] ?? '');
+            $triggered = self::triggerMatches($cond, $pts, $triggersMode, $triggersScoreMax);
+            if (!$triggered) {
                 continue;
             }
 
@@ -309,7 +385,7 @@ final class Engine
 
         // Verdict basé sur le potentiel
         if ($potentiel >= 70) {
-            $verdict = ['code' => 'prioritaire', 'label' => 'Prioritaire', 'desc' => 'ROI rapide — lancer maintenant'];
+            $verdict = ['code' => 'prioritaire', 'label' => 'Prioritaire', 'desc' => 'ROI rapide - lancer maintenant'];
         } elseif ($potentiel >= 40) {
             $verdict = ['code' => 'candidat',    'label' => 'Bon candidat', 'desc' => 'À cadrer avant de lancer'];
         } else {
@@ -328,6 +404,69 @@ final class Engine
         ];
     }
 
+    private static function computeExcelDiagnostic(array $pillars, array $quickWins, array $risks): array
+    {
+        $douleurAxes     = ['COLLABORATION', 'FRICTION', 'RISQUE'];
+        $complexiteAxes  = ['COMPLEXITE', 'MAITRISE'];
+
+        $douleurRaw = 0; $douleurMax = 0;
+        $complexiteRaw = 0; $complexiteMax = 0;
+
+        foreach ($pillars as $p) {
+            $pid = (string) ($p['id'] ?? '');
+            if (in_array($pid, $douleurAxes, true)) {
+                $douleurRaw += (int) $p['score'];
+                $douleurMax += (int) $p['max'];
+            }
+            if (in_array($pid, $complexiteAxes, true)) {
+                $complexiteRaw += (int) $p['score'];
+                $complexiteMax += (int) $p['max'];
+            }
+        }
+
+        $douleur    = $douleurMax    > 0 ? (int) round(($douleurRaw    / $douleurMax)    * 100) : 0;
+        $complexite = $complexiteMax > 0 ? (int) round(($complexiteRaw / $complexiteMax) * 100) : 0;
+
+        if ($douleur >= 65) {
+            $verdict = [
+                'code'  => 'transformer',
+                'label' => 'Passer à une application web',
+                'desc'  => 'Votre fichier Excel a atteint ses limites — une application web résoudra les problèmes de fond.',
+            ];
+            $tag      = $complexite >= 60 ? 'projet_structurant' : 'application_rapide';
+            $tagLabel = $tag === 'projet_structurant'
+                ? 'Projet structurant (3-6 mois)'
+                : 'Application rapide (4-8 semaines)';
+        } elseif ($douleur >= 35) {
+            $verdict = [
+                'code'  => 'intermediaire',
+                'label' => 'Étape intermédiaire recommandée',
+                'desc'  => 'Des douleurs réelles mais gérables — standardisez et automatisez avant un vrai projet.',
+            ];
+            $tag      = 'intermediaire';
+            $tagLabel = 'Optimisation progressive (2-8 semaines)';
+        } else {
+            $verdict = [
+                'code'  => 'optimiser',
+                'label' => 'Garder et optimiser Excel',
+                'desc'  => 'Excel reste adapté — quelques améliorations ciblées suffiront.',
+            ];
+            $tag      = 'optimiser';
+            $tagLabel = 'Améliorations rapides (1-3 semaines)';
+        }
+
+        return [
+            'douleur'       => $douleur,
+            'complexite'    => $complexite,
+            'tag'           => $tag,
+            'tag_label'     => $tagLabel,
+            'verdict'       => $verdict,
+            'actions'       => array_slice($quickWins, 0, 3),
+            'quick_wins'    => array_slice($quickWins, 3, 2),
+            'risque_majeur' => count($risks) > 0 ? $risks[0] : null,
+        ];
+    }
+
     private static function computeCostHidden(array $pack, array $answers, array $optional): ?array
     {
         $cfg = (array) ($pack['cost_hidden'] ?? []);

+ 4 - 0
src/PackRepository.php

@@ -26,6 +26,10 @@ final class PackRepository
             'validation-facture'    => $this->rootDir . '/config/packs/validation-facture.json',
             'process-generique'     => $this->rootDir . '/config/packs/process-generique.json',
             'process-generique-v2'  => $this->rootDir . '/config/packs/process-generique-v2.json',
+            'transformation-excel'  => $this->rootDir . '/config/packs/transformation-excel.json',
+            'intervention-sav-maintenance-terrain-v2-compact' => $this->rootDir . '/config/packs/intervention-sav-maintenance-terrain-v2-compact.json',
+            'internal-requests-validations-v2' => $this->rootDir . '/config/packs/internal-requests-validations-v2.json',
+            'collecte-terrain-qualite-conformite-v2' => $this->rootDir . '/config/packs/collecte-terrain-qualite-conformite-v2.json',
             default => null,
         };
 

+ 42 - 3
templates/pdf_a4.php

@@ -18,6 +18,9 @@ $risks = (array) ($result['risks_top3'] ?? []);
 $wins = (array) ($result['quick_wins_top5'] ?? []);
 $cost = $result['cost_hidden'] ?? null;
 
+$xlDiag = $result['excel_diagnostic'] ?? null;
+$v2Diag = $result['v2_diagnostic'] ?? null;
+
 ?>
 <!doctype html>
 <html lang="fr">
@@ -52,19 +55,26 @@ $cost = $result['cost_hidden'] ?? null;
       .cta-desc { color: #6b7280; }
       .link { color: #2F506D; text-decoration: none; font-weight: 600; }
       .hr { border-top: 1px solid #e5e7eb; margin: 10px 0; }
+      .verdict-box { margin: 10px 0; padding: 12px 14px; border-radius: 8px; border-left: 4px solid #2F506D; background: #f8fafc; }
+      .verdict-title { font-weight: 700; font-size: 14px; color: #374151; margin-bottom: 4px; }
+      .verdict-desc { color: #6b7280; font-size: 12px; }
+      .verdict-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; background: #e0f2fe; color: #0369a1; margin-top: 4px; }
+      .meter-row { display: table; width: 100%; margin: 4px 0; }
+      .meter-label { display: table-cell; width: 55%; vertical-align: middle; }
+      .meter-val { display: table-cell; width: 45%; text-align: right; font-weight: 700; vertical-align: middle; }
     </style>
   </head>
   <body>
     <h1><?= $esc("Contrôle technique du process : " . $packTitle) ?></h1>
     <div class="muted small">
-      Réalisé le : <?= $esc($date) ?> · Confiance du diagnostic : <?= $esc($confidenceLabel) ?>
+      Réalisé le : <?= $esc($date) ?> ; Confiance du diagnostic : <?= $esc($confidenceLabel) ?>
     </div>
 
     <div class="card score">
       <div class="left">
         <div class="muted">Score global</div>
         <div class="big"><?= $esc((string)$score) ?>/100</div>
-        <div class="badge"><?= $esc($level . " — " . $levelLabel) ?></div>
+        <div class="badge"><?= $esc($level . " - " . $levelLabel) ?></div>
       </div>
       <div class="right">
         <div class="pillars">
@@ -85,6 +95,35 @@ $cost = $result['cost_hidden'] ?? null;
       </div>
     </div>
 
+    <?php if (is_array($xlDiag)): ?>
+      <div class="verdict-box" style="border-left-color: <?= $xlDiag['verdict']['code'] === 'transformer' ? '#b83040' : ($xlDiag['verdict']['code'] === 'intermediaire' ? '#c07c10' : '#1e8a5e') ?>">
+        <div class="verdict-title"><?= $esc($xlDiag['verdict']['label']) ?></div>
+        <div class="verdict-desc"><?= $esc($xlDiag['verdict']['desc']) ?></div>
+        <div class="meter-row">
+          <div class="meter-label">Douleur actuelle</div>
+          <div class="meter-val"><?= $esc((string) $xlDiag['douleur']) ?>/100</div>
+        </div>
+        <div class="meter-row">
+          <div class="meter-label">Complexité du fichier</div>
+          <div class="meter-val"><?= $esc((string) $xlDiag['complexite']) ?>/100</div>
+        </div>
+        <div class="verdict-tag"><?= $esc($xlDiag['tag_label']) ?></div>
+      </div>
+    <?php elseif (is_array($v2Diag)): ?>
+      <div class="verdict-box" style="border-left-color: <?= $v2Diag['verdict']['code'] === 'prioritaire' ? '#1e8a5e' : ($v2Diag['verdict']['code'] === 'candidat' ? '#c07c10' : '#5e789a') ?>">
+        <div class="verdict-title"><?= $esc($v2Diag['verdict']['label']) ?> — <?= $esc($v2Diag['verdict']['desc']) ?></div>
+        <div class="meter-row">
+          <div class="meter-label">Potentiel d'automatisation</div>
+          <div class="meter-val"><?= $esc((string) $v2Diag['potentiel']) ?>/100</div>
+        </div>
+        <div class="meter-row">
+          <div class="meter-label">Complexité de mise en œuvre</div>
+          <div class="meter-val"><?= $esc((string) $v2Diag['complexite']) ?>/100</div>
+        </div>
+        <div class="verdict-tag"><?= $esc($v2Diag['tag_label']) ?></div>
+      </div>
+    <?php endif; ?>
+
     <div class="two">
       <div class="col">
         <div class="card">
@@ -130,7 +169,7 @@ $cost = $result['cost_hidden'] ?? null;
     <?php if ($bookingUrl !== ''): ?>
       <div class="cta">
         <div class="cta-title">Découvrir les opportunités suite à mon audit</div>
-        <div class="cta-desc small">Entretien de 30 min offert avec un consultant — prioriser vos opportunités et définir votre plan d'action.</div>
+        <div class="cta-desc small">Entretien de 30 min offert avec un consultant - prioriser vos opportunités et définir votre plan d'action.</div>
         <div style="margin-top: 8px;">Réserver : <span class="link"><?= $esc($bookingUrl) ?></span></div>
       </div>
     <?php endif; ?>

+ 78 - 0
test-excel-pack.ps1

@@ -0,0 +1,78 @@
+# Test script for Excel transformation pack
+Write-Host "Testing Excel Transformation Pack API..." -ForegroundColor Cyan
+
+# Test 1: Get pack data
+Write-Host ""
+Write-Host "1. Fetching pack data..." -ForegroundColor Yellow
+try {
+    $packResponse = Invoke-RestMethod -Uri "http://127.0.0.1:8765/api/pack.php?pack=transformation-excel" -Method GET
+    Write-Host "   OK Pack ID: $($packResponse.pack_id)" -ForegroundColor Green
+    Write-Host "   OK Title: $($packResponse.pack_title)" -ForegroundColor Green
+    Write-Host "   OK Questions: $($packResponse.questions.Count)" -ForegroundColor Green
+    Write-Host "   OK Pillars: $($packResponse.pillars.Count)" -ForegroundColor Green
+}
+catch {
+    Write-Host "   ERROR Failed to fetch pack: $_" -ForegroundColor Red
+    exit 1
+}
+
+# Test 2: Submit high-severity answers
+Write-Host ""
+Write-Host "2. Submitting high-severity answers..." -ForegroundColor Yellow
+
+$answersData = @{
+    pack_id = "transformation-excel"
+    answers = @{
+        X1 = "x1_3"
+        X2 = "x2_3"
+        X3 = "x3_3"
+        X4 = "x4_3"
+        X5 = "x5_3"
+        X6 = "x6_3"
+        X7 = "x7_3"
+        X8 = "x8_3"
+        X9 = "x9_3"
+        X10 = "x10_3"
+        X11 = "x11_3"
+        X12 = "x12_3"
+        X13 = "x13_3"
+        X14 = "x14_3"
+    }
+    optional = @{}
+}
+
+$jsonBody = $answersData | ConvertTo-Json -Depth 10
+
+try {
+    $scoreResponse = Invoke-RestMethod -Uri "http://127.0.0.1:8765/api/score.php" -Method POST -Body $jsonBody -ContentType "application/json"
+    
+    Write-Host "   OK Score: $($scoreResponse.score_total)/100" -ForegroundColor Green
+    Write-Host "   OK Level: $($scoreResponse.level) - $($scoreResponse.level_label)" -ForegroundColor Green
+    
+    Write-Host "   OK Pillars:" -ForegroundColor Green
+    foreach ($p in $scoreResponse.pillars) {
+        Write-Host "      - $($p.label): $($p.score)/$($p.max)" -ForegroundColor Gray
+    }
+    
+    if ($scoreResponse.excel_diagnostic) {
+        $xd = $scoreResponse.excel_diagnostic
+        Write-Host "   OK Excel Diagnostic:" -ForegroundColor Green
+        Write-Host "      - Douleur: $($xd.douleur)/100" -ForegroundColor Gray
+        Write-Host "      - Complexite: $($xd.complexite)/100" -ForegroundColor Gray
+        Write-Host "      - Verdict: $($xd.verdict.label)" -ForegroundColor Gray
+        Write-Host "      - Tag: $($xd.tag_label)" -ForegroundColor Gray
+    }
+    else {
+        Write-Host "   ERROR Excel diagnostic missing!" -ForegroundColor Red
+    }
+    
+    Write-Host "   OK Quick wins: $($scoreResponse.quick_wins_top5.Count)" -ForegroundColor Green
+    Write-Host "   OK Risks: $($scoreResponse.risks_top3.Count)" -ForegroundColor Green
+}
+catch {
+    Write-Host "   ERROR Failed to score: $_" -ForegroundColor Red
+    exit 1
+}
+
+Write-Host ""
+Write-Host "SUCCESS All tests passed!" -ForegroundColor Green

Some files were not shown because too many files changed in this diff