Bläddra i källkod

Initial commit - Audit Express Self v1

Outil de diagnostic self-serve (quiz 20 questions) avec scoring par piliers,
genereration PDF via Dompdf, capture email et 3 packs (onboarding, facture, process generique).

Co-authored-by: Cursor <cursoragent@cursor.com>
augustin.podvin 9 månader sedan
incheckning
9022deada1

+ 28 - 0
.gitignore

@@ -0,0 +1,28 @@
+# Dépendances PHP
+/vendor/
+
+# Composer archive (ne pas commiter le phar)
+composer.phar
+
+# Stockage local (emails pseudo, PDFs générés)
+/storage/outbox/
+/storage/logs/
+
+# Fichiers générés / temporaires
+*.pdf
+*.log
+
+# Fichiers de travail / documents sources
+*.docx
+*.txt
+
+# Environnement local
+.env
+.env.local
+
+# IDE / OS
+.cursor/
+.idea/
+.vscode/
+Thumbs.db
+.DS_Store

+ 34 - 0
MODX_INTEGRATION.md

@@ -0,0 +1,34 @@
+# Intégration MODX (guide rapide)
+
+Objectif : garder un front **HTML/CSS/JS** (intégrable dans un template MODX) et quelques endpoints **PHP** pour le calcul + PDF.
+
+## Option A (simple) : micro-app dans un dossier
+
+1) Copier le contenu de `public/` dans un dossier public de ton site (ex : `https://ton-site.tld/controle-technique/`).
+2) Vérifier que les endpoints sont accessibles :
+   - `.../api/pack.php`
+   - `.../api/score.php`
+   - `.../api/pdf.php`
+3) Mettre à jour le lien Calendly dans `public/index.php` (variable `$bookingUrl`).
+
+## Option B : template MODX + endpoints séparés
+
+1) **Assets**
+   - Copier `public/assets/` dans `assets/controle-technique/` (ou équivalent).
+   - Dans ton template/chunk MODX, inclure :
+     - CSS : `/assets/controle-technique/css/app.css`
+     - JS : `/assets/controle-technique/js/app.js`
+
+2) **Container**
+   - Ajouter un conteneur :
+     - `<main id="app" data-api-base="/api" data-booking-url="..."></main>`
+
+3) **Endpoints**
+   - Copier `public/api/` dans un dossier accessible, par ex `/api/controle-technique/`
+   - Puis adapter `data-api-base` en conséquence (ex : `data-api-base="/api/controle-technique"`).
+
+## Email (V1)
+
+Le brief prévoit une capture email + PDF. Dans cette V1, `POST /api/email.php` **stocke** les emails dans `storage/outbox/` (pseudo).  
+Quand tu seras prêt : remplacer `AuditExpress\\LogMailer` par une implémentation SMTP/API.
+

+ 48 - 0
README.md

@@ -0,0 +1,48 @@
+# Audit express self (V1)
+
+Stack : **HTML / CSS / JavaScript / PHP**.
+
+## Objectif
+
+Une micro-app “contrôle technique” (quiz 20 questions) qui :
+- affiche des résultats immédiats (score /100, 5 piliers, 3 risques, aperçu quick wins)
+- permet de générer un **PDF 1 page** (100% PHP)
+- prévoit une étape email (transactionnel) sous forme **pseudo** (à brancher ensuite)
+
+## Installation (local)
+
+Pré-requis : PHP 8.1+.
+
+1) Installer les dépendances PHP (PDF) :
+
+```bash
+php composer.phar install --ignore-platform-req=ext-mbstring
+```
+
+2) Lancer un serveur PHP :
+
+```bash
+php -S localhost:8000 -t public
+```
+
+Puis ouvrir `http://localhost:8000`.
+
+## Configuration
+
+- Packs quiz :
+  - `config/pack-onboarding-v1.json`
+  - `config/packs/validation-facture.json`
+- Quick wins / risques / règles :
+  - `audit-structure.json`
+
+## Endpoints (V1)
+
+- `GET /api/pack.php?pack=onboarding-v1|validation-facture`
+- `POST /api/score.php` (JSON) → calcule score + résultats
+- `POST /api/pdf.php` (JSON) → génère et renvoie un PDF
+- `POST /api/email.php` (JSON) → **pseudo** envoi : stocke dans `storage/outbox/`
+
+## Intégration MODX
+
+Approche recommandée : intégrer les **templates HTML/CSS/JS** côté MODX, et garder les endpoints PHP (dossier `api/`) accessibles sur le même domaine.
+

+ 27 - 0
api/_bootstrap.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+$root = dirname(__DIR__);
+
+// Composer autoload (required for Dompdf + PSR-4 classes)
+$autoload = $root . '/vendor/autoload.php';
+if (is_file($autoload)) {
+    require $autoload;
+}
+
+// Fallback (when dependencies aren't installed yet)
+spl_autoload_register(function (string $class) use ($root): void {
+    $prefix = 'AuditExpress\\';
+    if (!str_starts_with($class, $prefix)) {
+        return;
+    }
+    $relative = substr($class, strlen($prefix));
+    $path = $root . '/src/' . str_replace('\\', '/', $relative) . '.php';
+    if (is_file($path)) {
+        require $path;
+    }
+});
+
+return $root;
+

+ 24 - 0
api/pack.php

@@ -0,0 +1,24 @@
+<?php
+
+declare(strict_types=1);
+
+use AuditExpress\Http;
+use AuditExpress\PackRepository;
+
+$root = require __DIR__ . '/_bootstrap.php';
+
+if ($_SERVER['REQUEST_METHOD'] !== 'GET') {
+    Http::methodNotAllowed(['GET']);
+    exit;
+}
+
+$packId = (string) ($_GET['pack'] ?? 'onboarding-v1');
+
+try {
+    $repo = new PackRepository($root);
+    $pack = $repo->getPack($packId);
+    Http::json(['pack' => $pack]);
+} catch (Throwable $e) {
+    Http::json(['error' => $e->getMessage()], 404);
+}
+

+ 51 - 0
api/pdf.php

@@ -0,0 +1,51 @@
+<?php
+
+declare(strict_types=1);
+
+use AuditExpress\Engine;
+use AuditExpress\Http;
+use AuditExpress\PackRepository;
+use AuditExpress\PdfRenderer;
+use AuditExpress\RulesRepository;
+
+$root = require __DIR__ . '/_bootstrap.php';
+
+if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
+    Http::methodNotAllowed(['POST']);
+    exit;
+}
+
+$body = Http::readJsonBody();
+$packId = (string) ($body['pack_id'] ?? 'onboarding-v1');
+$answers = $body['answers'] ?? [];
+$optional = $body['optional'] ?? [];
+
+if (!is_array($answers) || !is_array($optional)) {
+    Http::json(['error' => 'Invalid payload'], 400);
+    exit;
+}
+
+$bookingUrl = (string) ($body['booking_url'] ?? '');
+
+try {
+    $packRepo = new PackRepository($root);
+    $rulesRepo = new RulesRepository($root);
+    $pack = $packRepo->getPack($packId);
+    $rules = $rulesRepo->getRules();
+
+    $result = Engine::compute($pack, $answers, $optional, $rules);
+
+    $pdf = (new PdfRenderer($root))->renderPdfBytes($pack, $result, [
+        'booking_url' => $bookingUrl,
+        'date' => date('Y-m-d'),
+    ]);
+
+    $filename = 'controle-technique-' . ($pack['pack_id'] ?? 'resultat') . '.pdf';
+    header('Content-Type: application/pdf');
+    header('Content-Disposition: attachment; filename="' . $filename . '"');
+    header('Content-Length: ' . strlen($pdf));
+    echo $pdf;
+} catch (Throwable $e) {
+    Http::json(['error' => $e->getMessage()], 400);
+}
+

+ 38 - 0
api/score.php

@@ -0,0 +1,38 @@
+<?php
+
+declare(strict_types=1);
+
+use AuditExpress\Engine;
+use AuditExpress\Http;
+use AuditExpress\PackRepository;
+use AuditExpress\RulesRepository;
+
+$root = require __DIR__ . '/_bootstrap.php';
+
+if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
+    Http::methodNotAllowed(['POST']);
+    exit;
+}
+
+$body = Http::readJsonBody();
+$packId = (string) ($body['pack_id'] ?? 'onboarding-v1');
+$answers = $body['answers'] ?? [];
+$optional = $body['optional'] ?? [];
+
+if (!is_array($answers) || !is_array($optional)) {
+    Http::json(['error' => 'Invalid payload'], 400);
+    exit;
+}
+
+try {
+    $packRepo = new PackRepository($root);
+    $rulesRepo = new RulesRepository($root);
+    $pack = $packRepo->getPack($packId);
+    $rules = $rulesRepo->getRules();
+
+    $result = Engine::compute($pack, $answers, $optional, $rules);
+    Http::json(['result' => $result]);
+} catch (Throwable $e) {
+    Http::json(['error' => $e->getMessage()], 400);
+}
+

+ 2713 - 0
audit-structure.json

@@ -0,0 +1,2713 @@
+{
+  "quick_wins": [
+    {
+      "id": 1,
+      "title": "Formaliser une checklist \"jour 1 prêt\" (1 page)",
+      "effect": "Moins d'oublis, visibilité partagée",
+      "effort": "S",
+      "prerequisites": [],
+      "tags": [
+        "CLARTE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 2,
+      "title": "Nommer un owner onboarding et un relais",
+      "effect": "Cohérence, arbitrage, amélioration continue",
+      "effort": "S",
+      "prerequisites": [],
+      "tags": [
+        "CLARTE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 3,
+      "title": "Créer un modèle de plan 30-60-90 jours",
+      "effect": "Clarifie attentes, réduit ambiguïtés",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "CLARTE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 4,
+      "title": "Standardiser 5 modèles d'emails (préboarding, jour 1, accès, matériel, feedback)",
+      "effect": "Répétabilité, standardisation",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "CLARTE",
+        "PREUVE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 5,
+      "title": "Créer un \"kit manager\" (ce qu'il doit faire, quand)",
+      "effect": "Clarté des rôles, moins d'oublis",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "CLARTE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 6,
+      "title": "Ajouter une étape \"pré-check\" 48h avant jour 1",
+      "effect": "Moins d'incidents, contrôle préventif",
+      "effort": "S",
+      "prerequisites": [
+        "1"
+      ],
+      "tags": [
+        "FIABILITE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 7,
+      "title": "Définir un chemin \"exceptions\" (arrivée urgente, matériel en retard, remote)",
+      "effect": "Gestion prévisible des cas particuliers",
+      "effort": "M",
+      "prerequisites": [
+        "1"
+      ],
+      "tags": [
+        "FIABILITE"
+      ],
+      "impact": 3
+    },
+    {
+      "id": 8,
+      "title": "Mettre un tableau de statut unique (à jour) \"par personne\"",
+      "effect": "Moins de relances, visibilité partagée",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "CLARTE",
+        "FIABILITE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 9,
+      "title": "Ajouter 3 statuts obligatoires (à faire, en cours, prêt)",
+      "effect": "Visibilité de l'état, moins de relances",
+      "effort": "S",
+      "prerequisites": [
+        "8"
+      ],
+      "tags": [
+        "CLARTE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 10,
+      "title": "Mettre un point de contrôle hebdo 15 min sur onboarding en cours",
+      "effect": "Détection précoce des blocages",
+      "effort": "S",
+      "prerequisites": [
+        "8"
+      ],
+      "tags": [
+        "FIABILITE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 11,
+      "title": "Ajouter une date cible \"jour 1\" et \"fin semaine 1\" visibles",
+      "effect": "Pilotage, anticipation",
+      "effort": "S",
+      "prerequisites": [
+        "8"
+      ],
+      "tags": [
+        "CLARTE"
+      ],
+      "impact": 3
+    },
+    {
+      "id": 12,
+      "title": "Créer une règle simple de validation des demandes d'accès (qui valide quoi)",
+      "effect": "Moins d'erreurs, délais prévisibles",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "FIABILITE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 13,
+      "title": "Mettre des rôles types (pack accès par rôle)",
+      "effect": "Standardisation, moins de rework",
+      "effort": "L",
+      "prerequisites": [
+        "12"
+      ],
+      "tags": [
+        "FIABILITE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 14,
+      "title": "Créer une check \"sécurité\" minimum (droits, documents sensibles)",
+      "effect": "Risque maîtrisé, conformité",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "FIABILITE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 15,
+      "title": "Mettre une revue mensuelle des incidents onboarding (top 3 causes)",
+      "effect": "Amélioration continue, prévention",
+      "effort": "S",
+      "prerequisites": [
+        "16"
+      ],
+      "tags": [
+        "RESILIENCE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 16,
+      "title": "Écrire une mini procédure \"accès manquant\" (qui, délai, escalade)",
+      "effect": "Résolution rapide, continuité",
+      "effort": "S",
+      "prerequisites": [],
+      "tags": [
+        "FIABILITE",
+        "RESILIENCE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 17,
+      "title": "Centraliser documents onboarding dans un dossier unique par personne",
+      "effect": "Preuve, reprise rapide en cas de départ",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "PREUVE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 18,
+      "title": "Rendre obligatoire la trace \"validé par + date\" sur étapes clés",
+      "effect": "Traçabilité, preuve, audit trail",
+      "effort": "M",
+      "prerequisites": [
+        "17"
+      ],
+      "tags": [
+        "PREUVE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 19,
+      "title": "Rendre obligatoire l'attachement \"preuve\" (contrat, validation, matériel)",
+      "effect": "Preuve, transmissibilité",
+      "effort": "M",
+      "prerequisites": [
+        "17"
+      ],
+      "tags": [
+        "PREUVE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 20,
+      "title": "Ajouter un changelog simple sur modifications sensibles (droits, contenus)",
+      "effect": "Traçabilité, conformité",
+      "effort": "M",
+      "prerequisites": [
+        "17"
+      ],
+      "tags": [
+        "PREUVE"
+      ],
+      "impact": 3
+    },
+    {
+      "id": 21,
+      "title": "Mettre une délégation par défaut en cas d'absence (binôme)",
+      "effect": "Continuité, moins de dépendance",
+      "effort": "S",
+      "prerequisites": [
+        "2"
+      ],
+      "tags": [
+        "RESILIENCE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 22,
+      "title": "Documenter \"si X absent, faire Y\" (1 page)",
+      "effect": "Transmissibilité, continuité",
+      "effort": "S",
+      "prerequisites": [
+        "2"
+      ],
+      "tags": [
+        "RESILIENCE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 23,
+      "title": "Créer une escalade automatique ou manuelle après X jours de blocage",
+      "effect": "Blocages courts, continuité",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "RESILIENCE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 24,
+      "title": "Plan de secours si canal principal indisponible (ex : email down)",
+      "effect": "Continuité en cas de panne",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "RESILIENCE"
+      ],
+      "impact": 3
+    },
+    {
+      "id": 25,
+      "title": "Tester 1 fois par trimestre un scénario \"jour 1 sans RH\"",
+      "effect": "Validation de la résilience",
+      "effort": "S",
+      "prerequisites": [
+        "21",
+        "22"
+      ],
+      "tags": [
+        "RESILIENCE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 26,
+      "title": "Réduire le nombre de canaux (choisir 1 canal standard pour demandes)",
+      "effect": "Moins de pertes, moins d'oublis",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "COUT"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 27,
+      "title": "Supprimer 1 double saisie (une source de vérité)",
+      "effect": "Moins d'erreurs, gain de temps",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "COUT"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 28,
+      "title": "Regrouper les demandes en batch (2 créneaux/semaine)",
+      "effect": "Gain de temps, moins de switches",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "COUT"
+      ],
+      "impact": 3
+    },
+    {
+      "id": 29,
+      "title": "Mettre des champs obligatoires sur demande d'accès pour éviter retours",
+      "effect": "Moins de relances, moins d'allers-retours",
+      "effort": "S",
+      "prerequisites": [],
+      "tags": [
+        "COUT",
+        "FIABILITE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 30,
+      "title": "Limiter les validations \"à la tête du client\" via seuils simples",
+      "effect": "Moins de variabilité, gain de temps",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "COUT"
+      ],
+      "impact": 3
+    },
+    {
+      "id": 31,
+      "title": "Définir 2 KPI : \"jour 1 prêt\" + \"incidents onboarding/semaine 1\"",
+      "effect": "Mesure, amélioration continue",
+      "effort": "S",
+      "prerequisites": [],
+      "tags": [
+        "RESILIENCE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 32,
+      "title": "Ajouter une question \"feedback nouvel arrivant\" à J+7 (3 questions)",
+      "effect": "Mesure qualitative, amélioration",
+      "effort": "S",
+      "prerequisites": [],
+      "tags": [
+        "RESILIENCE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 33,
+      "title": "Ajouter une rétrospective mensuelle 20 min (owner + relais)",
+      "effect": "Amélioration continue, alignement",
+      "effort": "S",
+      "prerequisites": [
+        "2"
+      ],
+      "tags": [
+        "RESILIENCE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 34,
+      "title": "Standardiser un parcours \"première semaine\" (agenda type)",
+      "effect": "Expérience cohérente, moins d'oublis",
+      "effort": "M",
+      "prerequisites": [
+        "1"
+      ],
+      "tags": [
+        "CLARTE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 35,
+      "title": "Ajouter un buddy systématique (si possible)",
+      "effect": "Intégration, continuité",
+      "effort": "S",
+      "prerequisites": [],
+      "tags": [
+        "RESILIENCE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 36,
+      "title": "Créer un espace \"ressources\" unique (liens, procédures, contacts)",
+      "effect": "Autonomie, moins de relances",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "CLARTE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 37,
+      "title": "Créer un espace de documentation partagé pour ce process (Notion, Confluence, SharePoint…)",
+      "effect": "Transmissibilité, moins de dépendance individuelle",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "CLARTE",
+        "PREUVE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 38,
+      "title": "Nommer un responsable process + un suppléant avec accès complets",
+      "effect": "Continuité, cohérence, arbitrage rapide",
+      "effort": "S",
+      "prerequisites": [],
+      "tags": [
+        "CLARTE",
+        "RESILIENCE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 39,
+      "title": "Mettre en place un tableau de suivi partagé (Trello, Monday, Notion ou Asana)",
+      "effect": "Visibilité temps réel, moins de relances par email",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "CLARTE",
+        "COUT"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 40,
+      "title": "Définir un chemin pour les exceptions avec responsable et délai (1 page)",
+      "effect": "Gestion prévisible, moins de blocages improvisés",
+      "effort": "S",
+      "prerequisites": [
+        "37"
+      ],
+      "tags": [
+        "CLARTE",
+        "FIABILITE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 41,
+      "title": "Remplacer la collecte d'informations par email par un formulaire en ligne (Google Forms, Typeform, JotForm…)",
+      "effect": "Données complètes dès le départ, moins d'allers-retours",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "FIABILITE",
+        "COUT"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 42,
+      "title": "Définir des règles de validation par seuil et par rôle et les écrire en 1 page",
+      "effect": "Moins de variabilité, décisions plus rapides",
+      "effort": "S",
+      "prerequisites": [],
+      "tags": [
+        "FIABILITE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 43,
+      "title": "Connecter 2 outils pour éliminer la principale double saisie (Zapier, Make ou API native)",
+      "effect": "Gain de temps direct, suppression d'une source d'erreurs",
+      "effort": "L",
+      "prerequisites": [],
+      "tags": [
+        "COUT"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 44,
+      "title": "Centraliser les documents dans un dossier structuré unique par occurrence (Drive, SharePoint…)",
+      "effect": "Retrouvabilité, preuve, gain de temps en cas de contrôle",
+      "effort": "M",
+      "prerequisites": [
+        "37"
+      ],
+      "tags": [
+        "PREUVE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 45,
+      "title": "Activer l'historique des modifications dans les outils existants (versioning, logs)",
+      "effect": "Traçabilité sans effort supplémentaire",
+      "effort": "S",
+      "prerequisites": [],
+      "tags": [
+        "PREUVE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 46,
+      "title": "Créer un mode opératoire 1 page : étapes, rôles, outils, cas particuliers",
+      "effect": "Transmissibilité immédiate, onboarding d'un remplaçant en moins de 15 min",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "PREUVE",
+        "CLARTE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 47,
+      "title": "Identifier un backup pour chaque rôle critique et lui donner les accès nécessaires maintenant",
+      "effect": "Continuité garantie, zéro surprise en cas d'absence",
+      "effort": "S",
+      "prerequisites": [
+        "38"
+      ],
+      "tags": [
+        "RESILIENCE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 48,
+      "title": "Configurer des alertes automatiques en cas de retard ou blocage (email, notification outil)",
+      "effect": "Détection précoce, blocages courts",
+      "effort": "M",
+      "prerequisites": [
+        "39"
+      ],
+      "tags": [
+        "RESILIENCE",
+        "FIABILITE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 49,
+      "title": "Choisir 1 ou 2 KPI simples et les suivre mensuellement (délai, taux d'erreur, volume traité)",
+      "effect": "Pilotage factuel, amélioration continue",
+      "effort": "S",
+      "prerequisites": [],
+      "tags": [
+        "RESILIENCE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 50,
+      "title": "Regrouper les outils autour d'une plateforme centrale (CRM, ERP ou outil métier intégré)",
+      "effect": "Suppression des silos, gain de temps, données unifiées",
+      "effort": "L",
+      "prerequisites": [],
+      "tags": [
+        "COUT"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 51,
+      "title": "Créer un log d'incidents partagé (même un Google Sheet) pour tracer et analyser les anomalies",
+      "effect": "Récurrence évitée, causes racines identifiées",
+      "effort": "S",
+      "prerequisites": [],
+      "tags": [
+        "RESILIENCE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 52,
+      "title": "Mettre en place une validation électronique pour les approbations importantes (email structuré ou outil)",
+      "effect": "Traçabilité des validations, séparation des rôles",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "PREUVE",
+        "FIABILITE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 53,
+      "title": "Automatiser les notifications et rappels sur les étapes en attente",
+      "effect": "Moins de relances manuelles, moins d'oublis",
+      "effort": "M",
+      "prerequisites": [
+        "39"
+      ],
+      "tags": [
+        "RESILIENCE",
+        "COUT"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 54,
+      "title": "Remplacer le suivi Excel par un outil dédié adapté au process (CRM, ticketing, gestion de projet…)",
+      "effect": "Statuts automatiques, historique, collaboration temps réel",
+      "effort": "L",
+      "prerequisites": [],
+      "tags": [
+        "COUT",
+        "CLARTE"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 55,
+      "title": "Définir des champs obligatoires dans les formulaires/outils pour éviter les informations manquantes",
+      "effect": "Moins de relances, données complètes dès la saisie",
+      "effort": "S",
+      "prerequisites": [],
+      "tags": [
+        "FIABILITE",
+        "COUT"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 56,
+      "title": "Documenter le plan de continuité : 'si X est absent, faire Y, contacter Z, accès ici'",
+      "effect": "Zéro panique en cas d'absence imprévue",
+      "effort": "S",
+      "prerequisites": [
+        "46"
+      ],
+      "tags": [
+        "RESILIENCE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 57,
+      "title": "Cartographier le process en atelier (2h)",
+      "effect": "Alignement équipe + identification des vrais goulots",
+      "effort": "S",
+      "prerequisites": [],
+      "tags": [
+        "FRICTION"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 58,
+      "title": "Automatiser les relances et notifications",
+      "effect": "Fin des relances manuelles, délais réduits",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "FRICTION"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 59,
+      "title": "Centraliser les données dans un outil unique",
+      "effect": "Moins de ressaisies, données fiables",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "DONNEES"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 60,
+      "title": "Créer un tableau de bord statut temps réel",
+      "effect": "Visibilité instantanée, relances divisées par 3",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "COLLABORATION"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 61,
+      "title": "Documenter et valider les règles de décision",
+      "effect": "Réduction des exceptions, onboarding facilité",
+      "effort": "S",
+      "prerequisites": [],
+      "tags": [
+        "VARIABILITE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 62,
+      "title": "Intégrer les outils via API / webhooks",
+      "effect": "Suppression des ressaisies entre outils",
+      "effort": "L",
+      "prerequisites": [],
+      "tags": [
+        "OUTILS"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 63,
+      "title": "Nommer un owner de process + suppléant",
+      "effect": "Arbitrage rapide, continuité garantie",
+      "effort": "S",
+      "prerequisites": [],
+      "tags": [
+        "DEPLOIEMENT"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 64,
+      "title": "Standardiser le traitement des exceptions",
+      "effect": "Moins d'imprévisibilité, délais maîtrisés",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "VARIABILITE"
+      ],
+      "impact": 4
+    },
+    {
+      "id": 65,
+      "title": "Réduire les étapes de validation redondantes",
+      "effect": "Délai de traitement divisé par 2",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "COLLABORATION"
+      ],
+      "impact": 5
+    },
+    {
+      "id": 66,
+      "title": "Implémenter une traçabilité complète (audit log)",
+      "effect": "Conformité assurée, litiges traitables en 10 min",
+      "effort": "M",
+      "prerequisites": [],
+      "tags": [
+        "RISQUE"
+      ],
+      "impact": 5
+    }
+  ],
+  "risks_onboarding": [
+    {
+      "id": 1,
+      "title": "Jour 1 partiellement prêt",
+      "what_happens": "Des accès ou éléments critiques arrivent en retard et créent du rework la première semaine.",
+      "severity": 5,
+      "tags": [
+        "FIABILITE"
+      ]
+    },
+    {
+      "id": 2,
+      "title": "Accès critiques manquants en semaine 1",
+      "what_happens": "Le collaborateur ne peut pas travailler efficacement, perte de productivité et image employeur dégradée.",
+      "severity": 5,
+      "tags": [
+        "FIABILITE"
+      ]
+    },
+    {
+      "id": 3,
+      "title": "Oubli matériel ou badge",
+      "what_happens": "Rattrapage en urgence, perte de temps et mauvaise première impression.",
+      "severity": 4,
+      "tags": [
+        "FIABILITE"
+      ]
+    },
+    {
+      "id": 4,
+      "title": "Rework massif sur droits et outils",
+      "what_happens": "Corrections multiples, temps perdu, frustration.",
+      "severity": 4,
+      "tags": [
+        "FIABILITE"
+      ]
+    },
+    {
+      "id": 5,
+      "title": "Dépendance à une personne clé",
+      "what_happens": "Rupture en cas de départ ou absence, onboarding bloqué.",
+      "severity": 5,
+      "tags": [
+        "RESILIENCE"
+      ]
+    },
+    {
+      "id": 6,
+      "title": "Absence sans relais → onboarding bloqué",
+      "what_happens": "Process arrêté, jour 1 raté, escalade non maîtrisée.",
+      "severity": 5,
+      "tags": [
+        "RESILIENCE"
+      ]
+    },
+    {
+      "id": 7,
+      "title": "Statut flou → relances permanentes",
+      "what_happens": "Coordination chronophage, perte de temps, frustration.",
+      "severity": 4,
+      "tags": [
+        "CLARTE"
+      ]
+    },
+    {
+      "id": 8,
+      "title": "Documents dispersés → perte de preuve",
+      "what_happens": "Impossible de prouver ou reprendre vite en cas de départ.",
+      "severity": 4,
+      "tags": [
+        "PREUVE"
+      ]
+    },
+    {
+      "id": 9,
+      "title": "Mauvaise attribution des responsabilités",
+      "what_happens": "Étapes non faites, confusion, délais non tenus.",
+      "severity": 4,
+      "tags": [
+        "CLARTE"
+      ]
+    },
+    {
+      "id": 10,
+      "title": "Plan 30-60-90 absent → performance floue",
+      "what_happens": "Attentes floues, allers-retours, ambiguïtés.",
+      "severity": 3,
+      "tags": [
+        "CLARTE"
+      ]
+    },
+    {
+      "id": 11,
+      "title": "Incidents non tracés → répétition",
+      "what_happens": "Mêmes erreurs répétées, pas d'amélioration.",
+      "severity": 4,
+      "tags": [
+        "PREUVE",
+        "RESILIENCE"
+      ]
+    },
+    {
+      "id": 12,
+      "title": "Droits trop larges → risque sécurité",
+      "what_happens": "Exposition de données sensibles, non-conformité.",
+      "severity": 4,
+      "tags": [
+        "FIABILITE"
+      ]
+    },
+    {
+      "id": 13,
+      "title": "Droits pas revus → risque persistant",
+      "what_happens": "Accès obsolètes, risque sécurité et conformité.",
+      "severity": 4,
+      "tags": [
+        "FIABILITE"
+      ]
+    },
+    {
+      "id": 14,
+      "title": "Exceptions gérées au cas par cas → variabilité",
+      "what_happens": "Incohérence, temps perdu, imprévisibilité.",
+      "severity": 3,
+      "tags": [
+        "FIABILITE"
+      ]
+    },
+    {
+      "id": 15,
+      "title": "Mesure absente → pas d'amélioration",
+      "what_happens": "Pas de visibilité sur les problèmes, stagnation.",
+      "severity": 3,
+      "tags": [
+        "RESILIENCE"
+      ]
+    },
+    {
+      "id": 16,
+      "title": "Escalade absente → blocages longs",
+      "what_happens": "Retards non traités, frustration, jour 1 raté.",
+      "severity": 4,
+      "tags": [
+        "RESILIENCE"
+      ]
+    },
+    {
+      "id": 17,
+      "title": "Double saisie → erreurs d'info",
+      "what_happens": "Incohérences, temps perdu, source d'erreurs.",
+      "severity": 4,
+      "tags": [
+        "COUT"
+      ]
+    },
+    {
+      "id": 18,
+      "title": "Trop d'outils/canaux → pertes et oublis",
+      "what_happens": "Fragmentation, switches, informations perdues.",
+      "severity": 4,
+      "tags": [
+        "COUT"
+      ]
+    },
+    {
+      "id": 19,
+      "title": "Process non transmissible → rupture lors d'un départ",
+      "what_happens": "Impossible de reprendre en 10 minutes, perte de savoir-faire.",
+      "severity": 5,
+      "tags": [
+        "PREUVE",
+        "RESILIENCE"
+      ]
+    },
+    {
+      "id": 20,
+      "title": "Coût caché sous-estimé → saturation équipe",
+      "what_happens": "Équipe saturée, burnout, turnover.",
+      "severity": 4,
+      "tags": [
+        "COUT"
+      ]
+    }
+  ],
+  "rules": {
+    "quick_wins_triggers": [
+      {
+        "trigger": {
+          "question": "Q1",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          1,
+          2,
+          4
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q2",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          2,
+          21,
+          22
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q3",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          3,
+          5,
+          34
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q4",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          8,
+          9,
+          10
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q5",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          1,
+          6,
+          16
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q6",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          6,
+          10,
+          16
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q7",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          12,
+          29,
+          16
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q8",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          13,
+          14,
+          20
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q9",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          17,
+          18,
+          19
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q10",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          17,
+          19,
+          36
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q11",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          21,
+          22,
+          25
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q12",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          4,
+          5,
+          34
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q13",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          21,
+          22,
+          23
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q14",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          23,
+          16,
+          10
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q15",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          31,
+          15,
+          32
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q16",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          16,
+          23,
+          15
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q17",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          26,
+          28,
+          8
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q18",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          27,
+          29
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q19",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          8,
+          26,
+          29
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q20",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          1,
+          23,
+          31
+        ],
+        "weight": 0.5
+      }
+    ],
+    "risk_triggers": [
+      {
+        "trigger": {
+          "question": "Q1",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          7,
+          9,
+          19
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q2",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          5,
+          9,
+          19
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q3",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          10,
+          9
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q4",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          7,
+          20
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q5",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          1,
+          2,
+          3
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q6",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          1,
+          3
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q7",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          2,
+          4,
+          14
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q8",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          12,
+          13
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q9",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          8,
+          11,
+          19
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q10",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          8,
+          19
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q11",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          5,
+          6,
+          19
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q12",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          9,
+          14
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q13",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          5,
+          6
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q14",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          16,
+          1
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q15",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          15,
+          11
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q16",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          16,
+          11
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q17",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          18,
+          17
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q18",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          17,
+          20
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q19",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          7,
+          20
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "Q20",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          20
+        ],
+        "weight": 0.5
+      }
+    ]
+  },
+  "risks_generic": [
+    {
+      "id": 1,
+      "title": "Process non documenté",
+      "what_happens": "Tout repose sur la mémoire des individus ou des emails épars introuvables. Quand quelqu'un part ou est absent, l'équipe fouille dans les boîtes mail pour reconstituer comment ça marche — sans garantie de retrouver la bonne version.",
+      "severity": 5,
+      "tags": [
+        "CLARTE"
+      ]
+    },
+    {
+      "id": 2,
+      "title": "Pas de responsable identifié",
+      "what_happens": "Quand un problème surgit (facture bloquée, demande sans suite, délai dépassé), personne ne sait qui doit trancher. Les emails tournent en rond et les décisions traînent jusqu'à ce que quelqu'un prenne les choses en main par défaut.",
+      "severity": 5,
+      "tags": [
+        "CLARTE"
+      ]
+    },
+    {
+      "id": 3,
+      "title": "Suivi par email = relances constantes",
+      "what_happens": "Quand l'avancement existe uniquement dans des fils d'emails ou un Excel local non partagé, chaque partie prenante doit relancer pour savoir où ça en est. C'est du temps perdu que un outil de suivi partagé élimine en quelques jours.",
+      "severity": 4,
+      "tags": [
+        "CLARTE"
+      ]
+    },
+    {
+      "id": 4,
+      "title": "Exceptions gérées au fil de l'eau",
+      "what_happens": "Chaque cas hors-norme génère un email, une réunion improvisée ou un appel. Sans chemin défini, le délai de traitement dépend de qui est disponible ce jour-là — et varie à chaque fois.",
+      "severity": 3,
+      "tags": [
+        "CLARTE"
+      ]
+    },
+    {
+      "id": 5,
+      "title": "Pas de vérification avant de continuer",
+      "what_happens": "Sans formulaire avec champs obligatoires ou checklist de validation, les données manquantes ou erronées passent à l'étape suivante. Le rework en aval coûte 3 à 5 fois plus cher que la vérification initiale.",
+      "severity": 5,
+      "tags": [
+        "FIABILITE"
+      ]
+    },
+    {
+      "id": 6,
+      "title": "Collecte d'informations par email",
+      "what_happens": "Un email de demande sans format fixe retourne des informations incomplètes dans 60 % des cas. Résultat : 2 à 4 allers-retours avant de pouvoir traiter. Un formulaire en ligne avec champs obligatoires règle ça en une heure.",
+      "severity": 4,
+      "tags": [
+        "FIABILITE"
+      ]
+    },
+    {
+      "id": 7,
+      "title": "Accès partagés ou non contrôlés",
+      "what_happens": "Mot de passe commun, accès administrateur pour tout le monde, fichier Excel modifiable par tous… N'importe qui peut effacer une donnée ou modifier un enregistrement sans laisser de trace.",
+      "severity": 4,
+      "tags": [
+        "FIABILITE"
+      ]
+    },
+    {
+      "id": 8,
+      "title": "Validations par email sans workflow",
+      "what_happens": "Un 'OK' dans un email n'est pas une validation traçable. Si la boîte mail est inaccessible ou que la personne quitte l'entreprise, la preuve d'approbation disparaît avec elle.",
+      "severity": 4,
+      "tags": [
+        "FIABILITE"
+      ]
+    },
+    {
+      "id": 9,
+      "title": "Aucune trace de qui a fait quoi",
+      "what_happens": "En cas de litige ou de question ('qui a validé ça ?', 'quand a-t-on reçu ce document ?'), la seule preuve disponible est une recherche dans les emails — longue, incomplète, et non opposable. Un outil avec historique horodaté change tout.",
+      "severity": 5,
+      "tags": [
+        "PREUVE"
+      ]
+    },
+    {
+      "id": 10,
+      "title": "Documents dans les boîtes email",
+      "what_happens": "Les pièces jointes échangées par email vivent sur le poste ou dans la boîte de la personne qui les a reçues. Un départ, un accident, une réinitialisation de compte — et ces documents sont irrécupérables.",
+      "severity": 4,
+      "tags": [
+        "PREUVE"
+      ]
+    },
+    {
+      "id": 11,
+      "title": "Process non transmissible",
+      "what_happens": "Si tout le process est dans la tête d'une personne, dans sa boîte email ou sur son Excel local, personne d'autre ne peut reprendre sans passer 1 à 2 jours à reconstituer l'historique. Un mode opératoire partagé sur Drive ou Notion réduit ce risque à zéro.",
+      "severity": 5,
+      "tags": [
+        "PREUVE",
+        "RESILIENCE"
+      ]
+    },
+    {
+      "id": 12,
+      "title": "Chacun exécute à sa façon",
+      "what_happens": "Sans template ni mode opératoire partagé, deux personnes qui font 'la même chose' produisent des résultats différents. Les erreurs et oublis varient selon les individus — impossible à corriger sans standardiser.",
+      "severity": 3,
+      "tags": [
+        "PREUVE"
+      ]
+    },
+    {
+      "id": 13,
+      "title": "Dépendance à une personne clé",
+      "what_happens": "Les accès aux outils sont sur son compte, les fichiers Excel sont sur son poste, les contacts fournisseurs sont dans sa boîte mail. En cas d'absence imprévue, l'équipe ne peut pas avancer — même si elle le voulait.",
+      "severity": 5,
+      "tags": [
+        "RESILIENCE"
+      ]
+    },
+    {
+      "id": 14,
+      "title": "Blocages invisibles jusqu'à la crise",
+      "what_happens": "Sans alerte automatique, une demande en attente depuis 5 jours reste silencieuse jusqu'à ce que quelqu'un s'en plaigne. Avec une règle d'escalade ou une notification automatique, le même blocage est résolu en 24h.",
+      "severity": 4,
+      "tags": [
+        "RESILIENCE"
+      ]
+    },
+    {
+      "id": 15,
+      "title": "Pilotage à vue",
+      "what_happens": "Sans KPI suivi régulièrement (délai moyen, taux d'erreur, volume traité), les problèmes chroniques passent pour normaux. Un seul tableau de bord, même simple, suffit à déclencher les bonnes conversations.",
+      "severity": 3,
+      "tags": [
+        "RESILIENCE"
+      ]
+    },
+    {
+      "id": 16,
+      "title": "Incidents qui se répètent",
+      "what_happens": "Chaque anomalie est traitée en urgence par email ou appel, puis oubliée. Sans log partagé, les mêmes erreurs reviennent tous les mois. Tenir un simple tableau 'incident / cause / action' suffit à briser ce cycle.",
+      "severity": 4,
+      "tags": [
+        "RESILIENCE"
+      ]
+    },
+    {
+      "id": 17,
+      "title": "Email + Excel + Word + messagerie + Drive…",
+      "what_happens": "Plus il y a d'outils non connectés, plus le risque de perte d'information est élevé. L'information saisie dans un email doit être recopiée dans l'Excel, puis dans le logiciel — chaque transfert est une occasion d'erreur ou d'oubli.",
+      "severity": 4,
+      "tags": [
+        "COUT"
+      ]
+    },
+    {
+      "id": 18,
+      "title": "Copier-coller comme méthode de travail",
+      "what_happens": "Re-saisir manuellement des données depuis un email dans un Excel, puis dans un logiciel : sur 100 occurrences, c'est en moyenne 3 à 5 jours-homme perdus par mois — et une source d'erreurs difficile à détecter.",
+      "severity": 4,
+      "tags": [
+        "COUT"
+      ]
+    },
+    {
+      "id": 19,
+      "title": "Plus de 5 échanges par dossier",
+      "what_happens": "5 emails ou messages pour finaliser une occurrence de ce process = environ 30 min de coordination gaspillée par dossier. Multiplié par le volume mensuel, cela représente un poste de coût invisible mais bien réel.",
+      "severity": 4,
+      "tags": [
+        "COUT"
+      ]
+    },
+    {
+      "id": 20,
+      "title": "Coût caché non chiffré",
+      "what_happens": "Additionner le temps de relance, le temps de re-saisie, le temps de recherche dans les emails et le temps de correction des erreurs donne souvent un total surprenant. Ce coût reste invisible car personne ne l'a jamais mesuré.",
+      "severity": 4,
+      "tags": [
+        "COUT"
+      ]
+    }
+  ],
+  "rules_generic": {
+    "quick_wins_triggers": [
+      {
+        "trigger": {
+          "question": "G1",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          46,
+          37,
+          40
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G2",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          38,
+          47,
+          56
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G3",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          39,
+          54,
+          53
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G4",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          40,
+          48,
+          51
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G5",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          41,
+          55,
+          45
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G6",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          41,
+          55,
+          42
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G7",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          42,
+          45,
+          52
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G8",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          42,
+          52,
+          53
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G9",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          45,
+          44,
+          52
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G10",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          44,
+          37,
+          46
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G11",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          56,
+          47,
+          46
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G12",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          46,
+          37,
+          40
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G13",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          47,
+          56,
+          38
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G14",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          48,
+          53,
+          51
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G15",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          49,
+          51,
+          39
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G16",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          51,
+          48,
+          49
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G17",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          50,
+          43,
+          54
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G18",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          43,
+          41,
+          55
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G19",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          39,
+          53,
+          43
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G20",
+          "condition": "score <= 2"
+        },
+        "quick_win_ids": [
+          46,
+          48,
+          49
+        ],
+        "weight": 0.5
+      }
+    ],
+    "risk_triggers": [
+      {
+        "trigger": {
+          "question": "G1",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          1,
+          3,
+          11
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G2",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          2,
+          13,
+          11
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G3",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          3,
+          19
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G4",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          4,
+          3
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G5",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          5,
+          6,
+          8
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G6",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          6,
+          5
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G7",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          7,
+          9
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G8",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          8,
+          7
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G9",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          9,
+          10,
+          11
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G10",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          10,
+          11
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G11",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          11,
+          13,
+          2
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G12",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          12,
+          4
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G13",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          13,
+          11
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G14",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          14,
+          3
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G15",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          15,
+          20
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G16",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          16,
+          15
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G17",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          17,
+          20
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G18",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          18,
+          20
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G19",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          19,
+          20
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "G20",
+          "condition": "score <= 2"
+        },
+        "risk_ids": [
+          20
+        ],
+        "weight": 0.5
+      }
+    ]
+  },
+  "risks_v2": [
+    {
+      "id": 1,
+      "title": "Goulot d'étranglement humain",
+      "what_happens": "Le process mobilise un temps excessif. À volume constant ou croissant, l'équipe sature et les délais dérivent sans levier d'amélioration.",
+      "severity": 5,
+      "tags": [
+        "FRICTION"
+      ]
+    },
+    {
+      "id": 2,
+      "title": "Surcharge de relances permanentes",
+      "what_happens": "Les relances deviennent un travail à plein temps. Elles masquent un problème de visibilité ou de fiabilité qui ne se résoudra pas seul.",
+      "severity": 4,
+      "tags": [
+        "FRICTION"
+      ]
+    },
+    {
+      "id": 3,
+      "title": "Erreurs par ressaisie multiple",
+      "what_happens": "Chaque ressaisie est un risque d'erreur. À fort volume, les incohérences s'accumulent et deviennent coûteuses à corriger.",
+      "severity": 4,
+      "tags": [
+        "FRICTION",
+        "DONNEES"
+      ]
+    },
+    {
+      "id": 4,
+      "title": "Volume non maîtrisé en croissance",
+      "what_happens": "La charge augmente sans que le process s'adapte. Sans action, la qualité d'exécution se dégrade et les incidents se multiplient.",
+      "severity": 5,
+      "tags": [
+        "VOLUME"
+      ]
+    },
+    {
+      "id": 5,
+      "title": "Délais excessifs impactant les clients",
+      "what_happens": "Un délai de traitement long dégrade l'expérience client ou partenaire et génère des escalades récurrentes.",
+      "severity": 4,
+      "tags": [
+        "VOLUME"
+      ]
+    },
+    {
+      "id": 6,
+      "title": "Risque de conformité non couvert",
+      "what_happens": "Sans traçabilité ni contrôle, un audit ou un litige expose l'organisation. L'impact peut être financier, réglementaire ou réputationnel.",
+      "severity": 5,
+      "tags": [
+        "RISQUE"
+      ]
+    },
+    {
+      "id": 7,
+      "title": "Données dispersées ou non fiables",
+      "what_happens": "Des données incomplètes ou contradictoires conduisent à de mauvaises décisions et rendent toute automatisation risquée sans phase de nettoyage.",
+      "severity": 4,
+      "tags": [
+        "DONNEES"
+      ]
+    },
+    {
+      "id": 8,
+      "title": "Fragmentation entre outils sans intégration",
+      "what_happens": "Chaque transfert manuel entre outils est une source d'erreur et de délai. L'absence d'intégration bloque toute montée en échelle.",
+      "severity": 4,
+      "tags": [
+        "OUTILS"
+      ]
+    },
+    {
+      "id": 9,
+      "title": "Règles implicites = variabilité non contrôlée",
+      "what_happens": "Sans règles documentées, chaque personne applique sa propre interprétation. Le résultat est imprévisible et difficile à améliorer.",
+      "severity": 4,
+      "tags": [
+        "VARIABILITE"
+      ]
+    },
+    {
+      "id": 10,
+      "title": "Absence d'owner = projet bloqué",
+      "what_happens": "Sans responsable identifié, les projets de transformation tournent en rond. Les décisions traînent et les équipes se déresponsabilisent.",
+      "severity": 5,
+      "tags": [
+        "DEPLOIEMENT"
+      ]
+    }
+  ],
+  "rules_v2": {
+    "quick_wins_triggers": [
+      {
+        "trigger": {
+          "question": "H1",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          57,
+          58
+        ],
+        "weight": 1.5
+      },
+      {
+        "trigger": {
+          "question": "H2",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          58,
+          60
+        ],
+        "weight": 1.5
+      },
+      {
+        "trigger": {
+          "question": "H3",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          59,
+          62
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H4",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          60,
+          59
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H5",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          58,
+          65
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "H6",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          65,
+          57
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H7",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          57,
+          58
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "H8",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          66,
+          61
+        ],
+        "weight": 1.5
+      },
+      {
+        "trigger": {
+          "question": "H9",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          66,
+          59
+        ],
+        "weight": 1.5
+      },
+      {
+        "trigger": {
+          "question": "H10",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          66
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H11",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          59,
+          62
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H12",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          59,
+          66
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H13",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          59,
+          61
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "H14",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          62,
+          57
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H15",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          62,
+          58
+        ],
+        "weight": 1.5
+      },
+      {
+        "trigger": {
+          "question": "H16",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          57
+        ],
+        "weight": 0.8
+      },
+      {
+        "trigger": {
+          "question": "H17",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          64,
+          61
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H18",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          61,
+          64
+        ],
+        "weight": 1.5
+      },
+      {
+        "trigger": {
+          "question": "H19",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          64,
+          61
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "H20",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          60,
+          65
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H21",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          65,
+          60
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H22",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          60,
+          58
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "H23",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          63
+        ],
+        "weight": 1.5
+      },
+      {
+        "trigger": {
+          "question": "H24",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          57,
+          63
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "H25",
+          "condition": "score >= 2"
+        },
+        "quick_win_ids": [
+          57,
+          60
+        ],
+        "weight": 1
+      }
+    ],
+    "risk_triggers": [
+      {
+        "trigger": {
+          "question": "H1",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          1
+        ],
+        "weight": 1.5
+      },
+      {
+        "trigger": {
+          "question": "H2",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          2
+        ],
+        "weight": 1.5
+      },
+      {
+        "trigger": {
+          "question": "H3",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          3
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H4",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          3,
+          7
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "H5",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          4
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "H6",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          5
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H7",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          4
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H8",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          6
+        ],
+        "weight": 1.5
+      },
+      {
+        "trigger": {
+          "question": "H9",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          6
+        ],
+        "weight": 1.5
+      },
+      {
+        "trigger": {
+          "question": "H10",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          6
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H11",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          7,
+          3
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H12",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          7
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H13",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          7,
+          6
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "H14",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          8
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H15",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          8,
+          3
+        ],
+        "weight": 1.5
+      },
+      {
+        "trigger": {
+          "question": "H17",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          9
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H18",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          9
+        ],
+        "weight": 1.5
+      },
+      {
+        "trigger": {
+          "question": "H19",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          9
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "H20",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          1,
+          5
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "H21",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          5,
+          2
+        ],
+        "weight": 1.2
+      },
+      {
+        "trigger": {
+          "question": "H22",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          2,
+          5
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "H23",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          10
+        ],
+        "weight": 1.5
+      },
+      {
+        "trigger": {
+          "question": "H24",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          10
+        ],
+        "weight": 1
+      },
+      {
+        "trigger": {
+          "question": "H25",
+          "condition": "score >= 2"
+        },
+        "risk_ids": [
+          10
+        ],
+        "weight": 1
+      }
+    ]
+  }
+}

+ 16 - 0
composer.json

@@ -0,0 +1,16 @@
+{
+  "name": "intersel/audit-express-self",
+  "description": "Contrôle technique d’un process (quiz self-serve) - HTML/CSS/JS + PHP",
+  "type": "project",
+  "require": {
+    "php": ">=8.1",
+    "dompdf/dompdf": "^2.0",
+    "symfony/polyfill-mbstring": "^1.0"
+  },
+  "autoload": {
+    "psr-4": {
+      "AuditExpress\\": "src/"
+    }
+  }
+}
+

+ 391 - 0
composer.lock

@@ -0,0 +1,391 @@
+{
+    "_readme": [
+        "This file locks the dependencies of your project to a known state",
+        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+        "This file is @generated automatically"
+    ],
+    "content-hash": "175df0937ab9a4553f1a65ec7e4f7864",
+    "packages": [
+        {
+            "name": "dompdf/dompdf",
+            "version": "v2.0.8",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/dompdf/dompdf.git",
+                "reference": "c20247574601700e1f7c8dab39310fca1964dc52"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/dompdf/dompdf/zipball/c20247574601700e1f7c8dab39310fca1964dc52",
+                "reference": "c20247574601700e1f7c8dab39310fca1964dc52",
+                "shasum": ""
+            },
+            "require": {
+                "ext-dom": "*",
+                "ext-mbstring": "*",
+                "masterminds/html5": "^2.0",
+                "phenx/php-font-lib": ">=0.5.4 <1.0.0",
+                "phenx/php-svg-lib": ">=0.5.2 <1.0.0",
+                "php": "^7.1 || ^8.0"
+            },
+            "require-dev": {
+                "ext-json": "*",
+                "ext-zip": "*",
+                "mockery/mockery": "^1.3",
+                "phpunit/phpunit": "^7.5 || ^8 || ^9",
+                "squizlabs/php_codesniffer": "^3.5"
+            },
+            "suggest": {
+                "ext-gd": "Needed to process images",
+                "ext-gmagick": "Improves image processing performance",
+                "ext-imagick": "Improves image processing performance",
+                "ext-zlib": "Needed for pdf stream compression"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Dompdf\\": "src/"
+                },
+                "classmap": [
+                    "lib/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "LGPL-2.1"
+            ],
+            "authors": [
+                {
+                    "name": "The Dompdf Community",
+                    "homepage": "https://github.com/dompdf/dompdf/blob/master/AUTHORS.md"
+                }
+            ],
+            "description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter",
+            "homepage": "https://github.com/dompdf/dompdf",
+            "support": {
+                "issues": "https://github.com/dompdf/dompdf/issues",
+                "source": "https://github.com/dompdf/dompdf/tree/v2.0.8"
+            },
+            "time": "2024-04-29T13:06:17+00:00"
+        },
+        {
+            "name": "masterminds/html5",
+            "version": "2.10.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/Masterminds/html5-php.git",
+                "reference": "fcf91eb64359852f00d921887b219479b4f21251"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/fcf91eb64359852f00d921887b219479b4f21251",
+                "reference": "fcf91eb64359852f00d921887b219479b4f21251",
+                "shasum": ""
+            },
+            "require": {
+                "ext-dom": "*",
+                "php": ">=5.3.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8 || ^9"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.7-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Masterminds\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Matt Butcher",
+                    "email": "technosophos@gmail.com"
+                },
+                {
+                    "name": "Matt Farina",
+                    "email": "matt@mattfarina.com"
+                },
+                {
+                    "name": "Asmir Mustafic",
+                    "email": "goetas@gmail.com"
+                }
+            ],
+            "description": "An HTML5 parser and serializer.",
+            "homepage": "http://masterminds.github.io/html5-php",
+            "keywords": [
+                "HTML5",
+                "dom",
+                "html",
+                "parser",
+                "querypath",
+                "serializer",
+                "xml"
+            ],
+            "support": {
+                "issues": "https://github.com/Masterminds/html5-php/issues",
+                "source": "https://github.com/Masterminds/html5-php/tree/2.10.0"
+            },
+            "time": "2025-07-25T09:04:22+00:00"
+        },
+        {
+            "name": "phenx/php-font-lib",
+            "version": "0.5.6",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/dompdf/php-font-lib.git",
+                "reference": "a1681e9793040740a405ac5b189275059e2a9863"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/a1681e9793040740a405ac5b189275059e2a9863",
+                "reference": "a1681e9793040740a405ac5b189275059e2a9863",
+                "shasum": ""
+            },
+            "require": {
+                "ext-mbstring": "*"
+            },
+            "require-dev": {
+                "symfony/phpunit-bridge": "^3 || ^4 || ^5 || ^6"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "FontLib\\": "src/FontLib"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "LGPL-2.1-or-later"
+            ],
+            "authors": [
+                {
+                    "name": "Fabien Ménager",
+                    "email": "fabien.menager@gmail.com"
+                }
+            ],
+            "description": "A library to read, parse, export and make subsets of different types of font files.",
+            "homepage": "https://github.com/PhenX/php-font-lib",
+            "support": {
+                "issues": "https://github.com/dompdf/php-font-lib/issues",
+                "source": "https://github.com/dompdf/php-font-lib/tree/0.5.6"
+            },
+            "time": "2024-01-29T14:45:26+00:00"
+        },
+        {
+            "name": "phenx/php-svg-lib",
+            "version": "0.5.4",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/dompdf/php-svg-lib.git",
+                "reference": "46b25da81613a9cf43c83b2a8c2c1bdab27df691"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/46b25da81613a9cf43c83b2a8c2c1bdab27df691",
+                "reference": "46b25da81613a9cf43c83b2a8c2c1bdab27df691",
+                "shasum": ""
+            },
+            "require": {
+                "ext-mbstring": "*",
+                "php": "^7.1 || ^8.0",
+                "sabberworm/php-css-parser": "^8.4"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Svg\\": "src/Svg"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "LGPL-3.0-or-later"
+            ],
+            "authors": [
+                {
+                    "name": "Fabien Ménager",
+                    "email": "fabien.menager@gmail.com"
+                }
+            ],
+            "description": "A library to read, parse and export to PDF SVG files.",
+            "homepage": "https://github.com/PhenX/php-svg-lib",
+            "support": {
+                "issues": "https://github.com/dompdf/php-svg-lib/issues",
+                "source": "https://github.com/dompdf/php-svg-lib/tree/0.5.4"
+            },
+            "time": "2024-04-08T12:52:34+00:00"
+        },
+        {
+            "name": "sabberworm/php-css-parser",
+            "version": "v8.9.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/MyIntervals/PHP-CSS-Parser.git",
+                "reference": "d8e916507b88e389e26d4ab03c904a082aa66bb9"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/MyIntervals/PHP-CSS-Parser/zipball/d8e916507b88e389e26d4ab03c904a082aa66bb9",
+                "reference": "d8e916507b88e389e26d4ab03c904a082aa66bb9",
+                "shasum": ""
+            },
+            "require": {
+                "ext-iconv": "*",
+                "php": "^5.6.20 || ^7.0.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "5.7.27 || 6.5.14 || 7.5.20 || 8.5.41",
+                "rawr/cross-data-providers": "^2.0.0"
+            },
+            "suggest": {
+                "ext-mbstring": "for parsing UTF-8 CSS"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "9.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Sabberworm\\CSS\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Raphael Schweikert"
+                },
+                {
+                    "name": "Oliver Klee",
+                    "email": "github@oliverklee.de"
+                },
+                {
+                    "name": "Jake Hotson",
+                    "email": "jake.github@qzdesign.co.uk"
+                }
+            ],
+            "description": "Parser for CSS Files written in PHP",
+            "homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser",
+            "keywords": [
+                "css",
+                "parser",
+                "stylesheet"
+            ],
+            "support": {
+                "issues": "https://github.com/MyIntervals/PHP-CSS-Parser/issues",
+                "source": "https://github.com/MyIntervals/PHP-CSS-Parser/tree/v8.9.0"
+            },
+            "time": "2025-07-11T13:20:48+00:00"
+        },
+        {
+            "name": "symfony/polyfill-mbstring",
+            "version": "v1.33.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-mbstring.git",
+                "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493",
+                "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493",
+                "shasum": ""
+            },
+            "require": {
+                "ext-iconv": "*",
+                "php": ">=7.2"
+            },
+            "provide": {
+                "ext-mbstring": "*"
+            },
+            "suggest": {
+                "ext-mbstring": "For best performance"
+            },
+            "type": "library",
+            "extra": {
+                "thanks": {
+                    "url": "https://github.com/symfony/polyfill",
+                    "name": "symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "files": [
+                    "bootstrap.php"
+                ],
+                "psr-4": {
+                    "Symfony\\Polyfill\\Mbstring\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p@tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill for the Mbstring extension",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "mbstring",
+                "polyfill",
+                "portable",
+                "shim"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://github.com/nicolas-grekas",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2024-12-23T08:48:59+00:00"
+        }
+    ],
+    "packages-dev": [],
+    "aliases": [],
+    "minimum-stability": "stable",
+    "stability-flags": {},
+    "prefer-stable": false,
+    "prefer-lowest": false,
+    "platform": {
+        "php": ">=8.1"
+    },
+    "platform-dev": {},
+    "plugin-api-version": "2.9.0"
+}

+ 1032 - 0
config/pack-onboarding-v1.json

@@ -0,0 +1,1032 @@
+{
+  "pack_id": "onboarding-v1",
+  "pack_title": "Onboarding collaborateur",
+  "pillars": [
+    {
+      "id": "CLARTE",
+      "label": "Clarté du flux"
+    },
+    {
+      "id": "FIABILITE",
+      "label": "Fiabilité et contrôle"
+    },
+    {
+      "id": "PREUVE",
+      "label": "Traçabilité et preuve"
+    },
+    {
+      "id": "RESILIENCE",
+      "label": "Résilience et continuité"
+    },
+    {
+      "id": "COUT",
+      "label": "Coût caché et friction"
+    }
+  ],
+  "questions": [
+    {
+      "id": "Q1",
+      "pillar_id": "CLARTE",
+      "label": "Votre onboarding est-il décrit quelque part, avec les étapes clés et les responsables ?",
+      "help": "Sans description partagée, le process dépend des individus et génère variabilité.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q1_0",
+          "label": "Non, rien d'écrit",
+          "points": 0
+        },
+        {
+          "id": "q1_2",
+          "label": "Partiellement (checklist incomplète)",
+          "points": 2
+        },
+        {
+          "id": "q1_3",
+          "label": "Oui, checklist complète mais pas à jour",
+          "points": 3
+        },
+        {
+          "id": "q1_5",
+          "label": "Oui, clair et à jour",
+          "points": 5
+        },
+        {
+          "id": "q1_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q1_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q2",
+      "pillar_id": "CLARTE",
+      "label": "Qui est responsable du \"process\" onboarding de bout en bout ?",
+      "help": "Ownership = cohérence, arbitrage, amélioration continue.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q2_0",
+          "label": "Personne / pas clair",
+          "points": 0
+        },
+        {
+          "id": "q2_2",
+          "label": "Une personne \"de fait\" mais pas officiel",
+          "points": 2
+        },
+        {
+          "id": "q2_4",
+          "label": "Responsable identifié, mais sans relais",
+          "points": 4
+        },
+        {
+          "id": "q2_5",
+          "label": "Responsable + relais / binôme",
+          "points": 5
+        },
+        {
+          "id": "q2_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q2_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q3",
+      "pillar_id": "CLARTE",
+      "label": "Le nouveau collaborateur a-t-il un plan 30-60-90 jours (ou équivalent) validé ?",
+      "help": "Clarifie attentes, réduit allers-retours et ambiguïtés.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q3_0",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "q3_2",
+          "label": "Informel",
+          "points": 2
+        },
+        {
+          "id": "q3_3",
+          "label": "Oui mais pas systématique",
+          "points": 3
+        },
+        {
+          "id": "q3_5",
+          "label": "Oui systématique et partagé",
+          "points": 5
+        },
+        {
+          "id": "q3_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q3_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q4",
+      "pillar_id": "CLARTE",
+      "label": "Avez-vous une \"source unique\" pour suivre le statut onboarding (jour 1 prêt, accès, matériel, formation) ?",
+      "help": "Visibilité de l'état réduit relances.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q4_0",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "q4_2",
+          "label": "Plusieurs supports non synchronisés",
+          "points": 2
+        },
+        {
+          "id": "q4_4",
+          "label": "Un support unique mais manuel",
+          "points": 4
+        },
+        {
+          "id": "q4_5",
+          "label": "Un support unique avec alertes / rappels",
+          "points": 5
+        },
+        {
+          "id": "q4_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q4_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q5",
+      "pillar_id": "FIABILITE",
+      "label": "\"Jour 1 prêt\" : à quelle fréquence tout est prêt (matériel + accès + infos) sans rattrapage ?",
+      "help": "Fiabilité perçue, perte de temps cachée.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q5_0",
+          "label": "Rarement",
+          "points": 0
+        },
+        {
+          "id": "q5_2",
+          "label": "1 fois sur 2",
+          "points": 2
+        },
+        {
+          "id": "q5_4",
+          "label": "Souvent",
+          "points": 4
+        },
+        {
+          "id": "q5_5",
+          "label": "Presque toujours",
+          "points": 5
+        },
+        {
+          "id": "q5_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q5_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q6",
+      "pillar_id": "FIABILITE",
+      "label": "Avez-vous un contrôle \"avant jour 1\" (check final) avec responsable et deadline ?",
+      "help": "Contrôle préventif diminue incidents.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q6_0",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "q6_2",
+          "label": "Oui mais pas systématique",
+          "points": 2
+        },
+        {
+          "id": "q6_4",
+          "label": "Oui systématique",
+          "points": 4
+        },
+        {
+          "id": "q6_5",
+          "label": "Oui + escalade si retard",
+          "points": 5
+        },
+        {
+          "id": "q6_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q6_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q7",
+      "pillar_id": "FIABILITE",
+      "label": "Les demandes d'accès (outils, droits) passent-elles par un canal standard avec validation ?",
+      "help": "Autorisation / approbation = contrôle interne, limite erreurs.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q7_0",
+          "label": "Non, messages dispersés",
+          "points": 0
+        },
+        {
+          "id": "q7_2",
+          "label": "Oui, mais sans validation claire",
+          "points": 2
+        },
+        {
+          "id": "q7_4",
+          "label": "Oui, canal standard + validation",
+          "points": 4
+        },
+        {
+          "id": "q7_5",
+          "label": "Oui, + règles par rôle",
+          "points": 5
+        },
+        {
+          "id": "q7_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q7_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q8",
+      "pillar_id": "FIABILITE",
+      "label": "Les informations sensibles (RH, contrats, docs) sont-elles gérées avec des droits d'accès adaptés ?",
+      "help": "Contrôle d'accès limite risque et erreurs.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q8_0",
+          "label": "Non / inconnu",
+          "points": 0
+        },
+        {
+          "id": "q8_2",
+          "label": "Partiellement",
+          "points": 2
+        },
+        {
+          "id": "q8_4",
+          "label": "Oui globalement",
+          "points": 4
+        },
+        {
+          "id": "q8_5",
+          "label": "Oui, avec revue régulière des accès",
+          "points": 5
+        },
+        {
+          "id": "q8_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q8_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q9",
+      "pillar_id": "PREUVE",
+      "label": "Pouvez-vous retracer facilement \"qui a fait quoi, quand\" sur les étapes clés (contrat, accès, matériel, validations) ?",
+      "help": "Un audit trail repose sur événements horodatés et attribution.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q9_0",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "q9_2",
+          "label": "Partiellement",
+          "points": 2
+        },
+        {
+          "id": "q9_4",
+          "label": "Oui sur la majorité",
+          "points": 4
+        },
+        {
+          "id": "q9_5",
+          "label": "Oui, historisé et horodaté",
+          "points": 5
+        },
+        {
+          "id": "q9_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q9_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q10",
+      "pillar_id": "PREUVE",
+      "label": "Les documents et validations sont-ils rattachés au dossier du collaborateur (au même endroit) ?",
+      "help": "Preuve et recherche rapide.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q10_0",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "q10_2",
+          "label": "Dispersés",
+          "points": 2
+        },
+        {
+          "id": "q10_4",
+          "label": "Centralisés mais incomplets",
+          "points": 4
+        },
+        {
+          "id": "q10_5",
+          "label": "Centralisés et complets",
+          "points": 5
+        },
+        {
+          "id": "q10_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q10_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q11",
+      "pillar_id": "PREUVE",
+      "label": "En cas de départ d'un manager ou RH, est-ce que quelqu'un peut reprendre l'onboarding en 10 minutes ?",
+      "help": "Traçabilité opérationnelle = transmissibilité.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q11_0",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "q11_2",
+          "label": "Difficile",
+          "points": 2
+        },
+        {
+          "id": "q11_4",
+          "label": "Oui avec effort",
+          "points": 4
+        },
+        {
+          "id": "q11_5",
+          "label": "Oui facilement",
+          "points": 5
+        },
+        {
+          "id": "q11_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q11_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q12",
+      "pillar_id": "PREUVE",
+      "label": "Avez-vous des \"modèles\" standard (emails, checklists, messages jour 1, kits) ?",
+      "help": "Standardisation crée répétabilité et preuve.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q12_0",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "q12_2",
+          "label": "Quelques modèles",
+          "points": 2
+        },
+        {
+          "id": "q12_4",
+          "label": "Oui mais pas à jour",
+          "points": 4
+        },
+        {
+          "id": "q12_5",
+          "label": "Oui à jour et utilisés systématiquement",
+          "points": 5
+        },
+        {
+          "id": "q12_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q12_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q13",
+      "pillar_id": "RESILIENCE",
+      "label": "Si la personne clé (RH/Office/IT) est absente, l'onboarding continue-t-il sans dégrader le jour 1 ?",
+      "help": "Réduire les points uniques de défaillance est un principe de continuité.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q13_0",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "q13_2",
+          "label": "Partiellement",
+          "points": 2
+        },
+        {
+          "id": "q13_4",
+          "label": "Oui mais plus lent",
+          "points": 4
+        },
+        {
+          "id": "q13_5",
+          "label": "Oui sans impact majeur",
+          "points": 5
+        },
+        {
+          "id": "q13_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q13_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q14",
+      "pillar_id": "RESILIENCE",
+      "label": "Avez-vous un mécanisme d'escalade si une étape critique est en retard (accès, matériel, contrat) ?",
+      "help": "Continuité = réagir vite en cas de blocage.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q14_0",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "q14_2",
+          "label": "Informel",
+          "points": 2
+        },
+        {
+          "id": "q14_4",
+          "label": "Oui, règle claire",
+          "points": 4
+        },
+        {
+          "id": "q14_5",
+          "label": "Oui, règle + responsable + délai",
+          "points": 5
+        },
+        {
+          "id": "q14_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q14_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q15",
+      "pillar_id": "RESILIENCE",
+      "label": "Mesurez-vous au moins 1 indicateur onboarding (ex : \"jour 1 prêt\", temps de mise en productivité, incidents) ?",
+      "help": "Sans mesure, pas d'amélioration continue.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q15_0",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "q15_2",
+          "label": "Mesure ponctuelle",
+          "points": 2
+        },
+        {
+          "id": "q15_4",
+          "label": "Mesure mensuelle",
+          "points": 4
+        },
+        {
+          "id": "q15_5",
+          "label": "Mesure régulière + actions",
+          "points": 5
+        },
+        {
+          "id": "q15_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q15_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q16",
+      "pillar_id": "RESILIENCE",
+      "label": "Avez-vous une procédure simple en cas d'incident onboarding (ex : accès manquant) : qui contacter, délai, résolution ?",
+      "help": "Continuité opérationnelle, proche de la logique de plan de contingence.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q16_0",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "q16_2",
+          "label": "Informel",
+          "points": 2
+        },
+        {
+          "id": "q16_4",
+          "label": "Oui",
+          "points": 4
+        },
+        {
+          "id": "q16_5",
+          "label": "Oui + suivi des incidents",
+          "points": 5
+        },
+        {
+          "id": "q16_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q16_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q17",
+      "pillar_id": "COUT",
+      "label": "Combien de canaux/outils utilisez-vous pour un onboarding (hors email) ?",
+      "help": "Plus d'outils fragmentés = plus de switches, oublis, double saisie.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q17_5",
+          "label": "0 à 1",
+          "points": 5
+        },
+        {
+          "id": "q17_4",
+          "label": "2 à 3",
+          "points": 4
+        },
+        {
+          "id": "q17_2",
+          "label": "4 à 6",
+          "points": 2
+        },
+        {
+          "id": "q17_0",
+          "label": "7+",
+          "points": 0
+        },
+        {
+          "id": "q17_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q17_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q18",
+      "pillar_id": "COUT",
+      "label": "Double saisie : à quelle fréquence saisissez-vous les mêmes infos à plusieurs endroits ?",
+      "help": "Double saisie = temps perdu + source d'erreurs.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q18_0",
+          "label": "Souvent",
+          "points": 0
+        },
+        {
+          "id": "q18_2",
+          "label": "Parfois",
+          "points": 2
+        },
+        {
+          "id": "q18_4",
+          "label": "Rarement",
+          "points": 4
+        },
+        {
+          "id": "q18_5",
+          "label": "Jamais",
+          "points": 5
+        },
+        {
+          "id": "q18_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q18_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q19",
+      "pillar_id": "COUT",
+      "label": "Relances : combien de relances \"internes\" par onboarding (en moyenne) ?",
+      "help": "Relances = proxy direct de friction.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q19_0",
+          "label": "10+",
+          "points": 0
+        },
+        {
+          "id": "q19_2",
+          "label": "5 à 9",
+          "points": 2
+        },
+        {
+          "id": "q19_4",
+          "label": "2 à 4",
+          "points": 4
+        },
+        {
+          "id": "q19_5",
+          "label": "0 à 1",
+          "points": 5
+        },
+        {
+          "id": "q19_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q19_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "Q20",
+      "pillar_id": "COUT",
+      "label": "Urgence : pourquoi faites-vous ce contrôle technique maintenant ?",
+      "help": "Sert à adapter le ton et la priorisation (sans trop influencer le score global).",
+      "type": "radio",
+      "options": [
+        {
+          "id": "q20_2",
+          "label": "Curiosité",
+          "points": 2
+        },
+        {
+          "id": "q20_1",
+          "label": "Incidents répétés / jour 1 raté",
+          "points": 1
+        },
+        {
+          "id": "q20_4a",
+          "label": "Croissance / vague recrutement",
+          "points": 4
+        },
+        {
+          "id": "q20_3",
+          "label": "Départ personne clé / réorganisation",
+          "points": 3
+        },
+        {
+          "id": "q20_4b",
+          "label": "Audit / exigence interne",
+          "points": 4
+        },
+        {
+          "id": "q20_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "q20_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    }
+  ],
+  "scoring": {
+    "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": {
+      "Q1": {
+        "trigger_points": 0,
+        "pillar_id": "CLARTE",
+        "cap": 12
+      },
+      "Q9": {
+        "trigger_points": 0,
+        "pillar_id": "PREUVE",
+        "cap": 10
+      },
+      "Q5": {
+        "trigger_points": 0,
+        "pillar_id": "FIABILITE",
+        "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"
+      }
+    }
+  },
+  "cost_hidden": {
+    "formula": "minutes_per_onboarding = Q19_minutes + Q18_minutes + Q5_minutes + Q17_minutes",
+    "default_hourly_cost": 50,
+    "components": {
+      "Q19": {
+        "option_mapping": {
+          "q19_5": 10,
+          "q19_4": 30,
+          "q19_2": 60,
+          "q19_0": 90
+        }
+      },
+      "Q18": {
+        "option_mapping": {
+          "q18_5": 0,
+          "q18_4": 10,
+          "q18_2": 25,
+          "q18_0": 45
+        }
+      },
+      "Q5": {
+        "option_mapping": {
+          "q5_0": 120,
+          "q5_2": 60,
+          "q5_4": 30,
+          "q5_5": 10
+        }
+      },
+      "Q17": {
+        "option_mapping": {
+          "q17_5": 5,
+          "q17_4": 15,
+          "q17_2": 30,
+          "q17_0": 45
+        }
+      }
+    },
+    "cap_max_hours": 12,
+    "cap_min_hours": 0.5,
+    "cap_min_condition": "friction_faibles_count >= 2",
+    "friction_faibles_definition": "Q17 (0-1 ou 2-3), Q18 (jamais ou rarement), Q19 (0-1), Q5 (souvent ou presque toujours) - option avec points >= 4"
+  },
+  "optional_questions": {
+    "company_size": {
+      "id": "company_size",
+      "label": "Taille d'entreprise",
+      "type": "radio",
+      "required": false,
+      "options": [
+        {
+          "id": "size_1_10",
+          "label": "1-10"
+        },
+        {
+          "id": "size_11_50",
+          "label": "11-50"
+        },
+        {
+          "id": "size_51_200",
+          "label": "51-200"
+        },
+        {
+          "id": "size_200_plus",
+          "label": "200+"
+        }
+      ]
+    },
+    "role": {
+      "id": "role",
+      "label": "Fonction",
+      "type": "radio",
+      "required": false,
+      "options": [
+        {
+          "id": "role_rh",
+          "label": "RH"
+        },
+        {
+          "id": "role_ops",
+          "label": "Ops"
+        },
+        {
+          "id": "role_finance",
+          "label": "Finance"
+        },
+        {
+          "id": "role_it",
+          "label": "IT"
+        },
+        {
+          "id": "role_direction",
+          "label": "Direction"
+        },
+        {
+          "id": "role_autre",
+          "label": "Autre"
+        }
+      ]
+    },
+    "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
+        }
+      ]
+    },
+    "monthly_volume_recruits": {
+      "id": "monthly_volume_recruits",
+      "label": "Recrutements par mois",
+      "type": "radio",
+      "required_for_cost": true,
+      "options": [
+        {
+          "id": "vol_0_2",
+          "label": "0-2",
+          "value": 1
+        },
+        {
+          "id": "vol_3_5",
+          "label": "3-5",
+          "value": 4
+        },
+        {
+          "id": "vol_6_10",
+          "label": "6-10",
+          "value": 8
+        },
+        {
+          "id": "vol_11_20",
+          "label": "11-20",
+          "value": 15
+        },
+        {
+          "id": "vol_21_plus",
+          "label": "21+",
+          "value": 25
+        }
+      ]
+    }
+  }
+}

+ 357 - 0
config/packs/process-generique-v2.json

@@ -0,0 +1,357 @@
+{
+  "pack_id": "process-generique-v2",
+  "pack_title": "Diagnostic d'opportunité",
+  "pack_description": "Évaluez sur 8 axes si ce process est prioritaire à automatiser ou fiabiliser : friction, volume, risque, données, outils, variabilité, collaboration, déploiement.",
+  "pillars": [
+    { "id": "FRICTION",      "label": "Friction opérationnelle", "max": 12 },
+    { "id": "VOLUME",        "label": "Volume et fréquence",     "max": 9  },
+    { "id": "RISQUE",        "label": "Risque et conformité",    "max": 9  },
+    { "id": "DONNEES",       "label": "Données et documents",    "max": 9  },
+    { "id": "OUTILS",        "label": "Outils et intégrations",  "max": 9  },
+    { "id": "VARIABILITE",   "label": "Variabilité et exceptions","max": 9 },
+    { "id": "COLLABORATION", "label": "Collaboration et handoffs","max": 9 },
+    { "id": "DEPLOIEMENT",   "label": "Capacité de déploiement", "max": 9  }
+  ],
+  "questions": [
+    {
+      "id": "H1", "pillar_id": "FRICTION",
+      "label": "Combien de temps humain par semaine est consacré à ce processus ?",
+      "help": "Temps cumulé de toutes les personnes impliquées (saisie, validation, relances, corrections…).",
+      "type": "radio",
+      "options": [
+        { "id": "h1_0", "label": "< 1h",    "points": 0 },
+        { "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": "H2", "pillar_id": "FRICTION",
+      "label": "Le process génère-t-il des relances (mails, Teams, appels) ?",
+      "help": "Les relances signalent un manque de visibilité ou de fiabilité dans le flux.",
+      "type": "radio",
+      "options": [
+        { "id": "h2_0", "label": "Rarement",    "points": 0 },
+        { "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": "H3", "pillar_id": "FRICTION",
+      "label": "Combien de ressaisies des mêmes infos dans ce process ?",
+      "help": "La ressaisie multiple est un indicateur direct de fragmentation ou d'absence d'intégration.",
+      "type": "radio",
+      "options": [
+        { "id": "h3_0", "label": "0",     "points": 0 },
+        { "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": "H4", "pillar_id": "FRICTION",
+      "label": "À quelle fréquence doit-on « chercher l'info » (où est le doc, qui valide, quel statut) ?",
+      "help": "Chaque recherche d'info non structurée est du temps perdu et une source d'erreur.",
+      "type": "radio",
+      "options": [
+        { "id": "h4_0", "label": "Presque jamais",          "points": 0 },
+        { "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": "H5", "pillar_id": "VOLUME",
+      "label": "Combien de cas traités par mois via ce process ?",
+      "help": "Le volume amplifie l'impact de chaque inefficacité.",
+      "type": "radio",
+      "options": [
+        { "id": "h5_0", "label": "< 10",     "points": 0 },
+        { "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": "H6", "pillar_id": "VOLUME",
+      "label": "Quel est le délai moyen de traitement aujourd'hui ?",
+      "help": "Un délai long signale généralement des attentes, des blocages ou des validations multiples.",
+      "type": "radio",
+      "options": [
+        { "id": "h6_0", "label": "< 1 jour",    "points": 0 },
+        { "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": "H7", "pillar_id": "VOLUME",
+      "label": "Le volume de cas est-il en croissance sur 12 mois ?",
+      "help": "Un volume croissant rend l'amélioration encore plus urgente.",
+      "type": "radio",
+      "options": [
+        { "id": "h7_0", "label": "Stable ou en baisse",         "points": 0 },
+        { "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": "H8", "pillar_id": "RISQUE",
+      "label": "Quand il y a une erreur dans ce process, l'impact est :",
+      "help": "L'impact d'une erreur mesure la criticité réelle du process.",
+      "type": "radio",
+      "options": [
+        { "id": "h8_0", "label": "Négligeable",                              "points": 0 },
+        { "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": "H9", "pillar_id": "RISQUE",
+      "label": "Avez-vous déjà vécu un incident lié à ce process (audit, litige, accès non coupé, paiement erroné…) ?",
+      "help": "Un incident passé est le meilleur prédicteur d'un incident futur si rien ne change.",
+      "type": "radio",
+      "options": [
+        { "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": "H10", "pillar_id": "RISQUE",
+      "label": "Le process doit-il être traçable (qui a fait quoi, quand, pourquoi) ?",
+      "help": "Exigence légale, contractuelle ou opérationnelle de traçabilité.",
+      "type": "radio",
+      "options": [
+        { "id": "h10_0", "label": "Non",         "points": 0 },
+        { "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": "H11", "pillar_id": "DONNEES",
+      "label": "Les informations nécessaires au process sont :",
+      "help": "La structuration des données conditionne la possibilité d'automatiser.",
+      "type": "radio",
+      "options": [
+        { "id": "h11_0", "label": "Déjà structurées dans un outil",           "points": 0 },
+        { "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": "H12", "pillar_id": "DONNEES",
+      "label": "Les documents (contrats, justificatifs, formulaires) sont :",
+      "help": "La dispersion documentaire génère erreurs, doublons et pertes.",
+      "type": "radio",
+      "options": [
+        { "id": "h12_0", "label": "Centralisés",                "points": 0 },
+        { "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": "H13", "pillar_id": "DONNEES",
+      "label": "Qualité des données (complètes, à jour, cohérentes) :",
+      "help": "Des données incorrectes rendent toute automatisation risquée.",
+      "type": "radio",
+      "options": [
+        { "id": "h13_0", "label": "Bonne",                       "points": 0 },
+        { "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": "H14", "pillar_id": "OUTILS",
+      "label": "Combien d'outils sont impliqués dans ce process (SIRH, ERP, CRM, ITSM, Drive…) ?",
+      "help": "Plus il y a d'outils, plus le risque de fragmentation et de perte d'info est élevé.",
+      "type": "radio",
+      "options": [
+        { "id": "h14_0", "label": "1",     "points": 0 },
+        { "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": "H15", "pillar_id": "OUTILS",
+      "label": "Y a-t-il des intégrations existantes entre ces outils ?",
+      "help": "L'absence d'intégration impose des ressaisies et des synchronisations manuelles.",
+      "type": "radio",
+      "options": [
+        { "id": "h15_0", "label": "Oui, bien intégrés",     "points": 0 },
+        { "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": "H16", "pillar_id": "OUTILS",
+      "label": "L'IT peut-il ouvrir des accès API / webhooks / SSO si besoin ?",
+      "help": "La faisabilité technique conditionne la rapidité de mise en œuvre.",
+      "type": "radio",
+      "options": [
+        { "id": "h16_0", "label": "Oui facilement",    "points": 0 },
+        { "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": "H17", "pillar_id": "VARIABILITE",
+      "label": "Le process est :",
+      "help": "Un process très variable est plus difficile à automatiser sans étape de standardisation préalable.",
+      "type": "radio",
+      "options": [
+        { "id": "h17_0", "label": "Standard dans 90 % des cas",      "points": 0 },
+        { "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": "H18", "pillar_id": "VARIABILITE",
+      "label": "Les règles de décision sont :",
+      "help": "Des règles implicites empêchent l'automatisation et créent des incohérences.",
+      "type": "radio",
+      "options": [
+        { "id": "h18_0", "label": "Claires et documentées",              "points": 0 },
+        { "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": "H19", "pillar_id": "VARIABILITE",
+      "label": "Les exceptions (cas hors norme) sont :",
+      "help": "Des exceptions fréquentes signalent un process sous-spécifié ou soumis à forte variabilité métier.",
+      "type": "radio",
+      "options": [
+        { "id": "h19_0", "label": "Rares",          "points": 0 },
+        { "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": "H20", "pillar_id": "COLLABORATION",
+      "label": "Combien d'équipes différentes interviennent dans ce process (RH, IT, finance, manager…) ?",
+      "help": "Chaque handoff entre équipes est un risque de délai, de perte d'info ou de désaccord.",
+      "type": "radio",
+      "options": [
+        { "id": "h20_0", "label": "1",  "points": 0 },
+        { "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": "H21", "pillar_id": "COLLABORATION",
+      "label": "Combien d'étapes de validation comporte ce process ?",
+      "help": "Chaque validation supplémentaire ajoute du délai et un risque de blocage.",
+      "type": "radio",
+      "options": [
+        { "id": "h21_0", "label": "0 - 1", "points": 0 },
+        { "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": "H22", "pillar_id": "COLLABORATION",
+      "label": "Les statuts du process sont-ils visibles en temps réel pour toutes les parties prenantes ?",
+      "help": "L'absence de visibilité génère des relances inutiles et des décisions sur des données périmées.",
+      "type": "radio",
+      "options": [
+        { "id": "h22_0", "label": "Oui",                      "points": 0 },
+        { "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": "H23", "pillar_id": "DEPLOIEMENT",
+      "label": "Il y a un owner clair du process (responsable, arbitre) :",
+      "help": "Sans owner, le projet de transformation n'a pas d'interlocuteur décisionnaire.",
+      "type": "radio",
+      "options": [
+        { "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": "H24", "pillar_id": "DEPLOIEMENT",
+      "label": "Sponsoring de la direction pour améliorer ce process :",
+      "help": "Un faible sponsoring ralentit ou bloque les projets de transformation.",
+      "type": "radio",
+      "options": [
+        { "id": "h24_0", "label": "Fort",    "points": 0 },
+        { "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": "H25", "pillar_id": "DEPLOIEMENT",
+      "label": "Les utilisateurs sont-ils prêts à changer (ou souffrent-ils assez pour accepter le changement) ?",
+      "help": "L'adhésion des utilisateurs est le premier facteur de succès d'une transformation process.",
+      "type": "radio",
+      "options": [
+        { "id": "h25_0", "label": "Oui",            "points": 0 },
+        { "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 }
+      ]
+    }
+  ],
+  "scoring": {
+    "triggers_mode": "highest",
+    "level_thresholds": {
+      "A": { "min": 75, "max": 100, "label": "Urgence élevée" },
+      "B": { "min": 55, "max": 74,  "label": "Fort potentiel" },
+      "C": { "min": 30, "max": 54,  "label": "Potentiel modéré" },
+      "D": { "min": 0,  "max": 29,  "label": "Priorité faible" }
+    },
+    "anti_cheat_caps": {}
+  },
+  "confidence": {
+    "dk_count_thresholds": {
+      "high":   { "max_dk": 3,  "label": "Haute confiance" },
+      "medium": { "min_dk": 4,  "max_dk": 8, "label": "Confiance moyenne" },
+      "low":    { "min_dk": 9,  "label": "Faible confiance" }
+    }
+  }
+}

+ 972 - 0
config/packs/process-generique.json

@@ -0,0 +1,972 @@
+{
+  "pack_id": "process-generique",
+  "pack_title": "Process générique",
+  "pack_description": "Applicable à tout process opérationnel : achat, production, relation client, support, projet, etc.",
+  "pillars": [
+    {
+      "id": "CLARTE",
+      "label": "Clarté du flux",
+      "description": "Rôles, étapes, statut, gestion des exceptions"
+    },
+    {
+      "id": "FIABILITE",
+      "label": "Fiabilité et contrôle",
+      "description": "Points de contrôle, validations, règles, qualité d'exécution"
+    },
+    {
+      "id": "PREUVE",
+      "label": "Traçabilité et preuve",
+      "description": "Historique, pièces jointes, capacité de retracer"
+    },
+    {
+      "id": "RESILIENCE",
+      "label": "Résilience et continuité",
+      "description": "Continuité en cas d'absence, escalade, mesure, incidents"
+    },
+    {
+      "id": "COUT",
+      "label": "Coût caché et friction",
+      "description": "Outils, double saisie, relances, fragmentation"
+    }
+  ],
+  "questions": [
+    {
+      "id": "G1",
+      "pillar_id": "CLARTE",
+      "label": "Comment ce process est-il décrit et partagé aujourd'hui ?",
+      "help": "Sans documentation partagée, le process vit dans les têtes. Un départ ou une absence remet tout à zéro.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g1_0",
+          "label": "Dans la tête des personnes — rien d'écrit",
+          "points": 0
+        },
+        {
+          "id": "g1_2",
+          "label": "Un email ou document Word épars, rarement consulté",
+          "points": 2
+        },
+        {
+          "id": "g1_3",
+          "label": "Une procédure écrite, mais pas maintenue à jour",
+          "points": 3
+        },
+        {
+          "id": "g1_5",
+          "label": "Documentation à jour dans un espace partagé (Drive, Notion, SharePoint…)",
+          "points": 5
+        },
+        {
+          "id": "g1_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g1_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G2",
+      "pillar_id": "CLARTE",
+      "label": "Qui orchestre ce process de bout en bout quand quelque chose se bloque ?",
+      "help": "Sans owner clairement désigné, les problèmes ne remontent pas et les décisions traînent.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g2_0",
+          "label": "Personne — les problèmes restent sans responsable",
+          "points": 0
+        },
+        {
+          "id": "g2_2",
+          "label": "Une personne 'de fait', mais ça n'est pas officiel",
+          "points": 2
+        },
+        {
+          "id": "g2_4",
+          "label": "Un responsable identifié, mais sans backup",
+          "points": 4
+        },
+        {
+          "id": "g2_5",
+          "label": "Un responsable + un remplaçant identifié avec accès",
+          "points": 5
+        },
+        {
+          "id": "g2_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g2_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G3",
+      "pillar_id": "CLARTE",
+      "label": "Comment les parties prenantes suivent-elles l'avancement de ce process ?",
+      "help": "Si les gens relancent par email pour savoir 'où ça en est', c'est le symptôme n°1 d'un process sans visibilité digitale.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g3_0",
+          "label": "Elles relancent par email ou demandent à l'oral",
+          "points": 0
+        },
+        {
+          "id": "g3_2",
+          "label": "Via un fichier Excel ou Google Sheet mis à jour manuellement",
+          "points": 2
+        },
+        {
+          "id": "g3_4",
+          "label": "Via un outil partagé, mais avec saisie manuelle des statuts",
+          "points": 4
+        },
+        {
+          "id": "g3_5",
+          "label": "Via un tableau de bord ou outil avec mises à jour automatiques",
+          "points": 5
+        },
+        {
+          "id": "g3_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g3_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G4",
+      "pillar_id": "CLARTE",
+      "label": "Quand quelque chose se bloque ou sort du cas standard, comment est-ce géré ?",
+      "help": "Les exceptions gérées au cas par cas par email deviennent des blocages récurrents qui mobilisent du temps en urgence.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g4_0",
+          "label": "Chacun se débrouille — pas de règle ni de chemin défini",
+          "points": 0
+        },
+        {
+          "id": "g4_2",
+          "label": "Par email ou message, au cas par cas selon la personne",
+          "points": 2
+        },
+        {
+          "id": "g4_4",
+          "label": "Un chemin est défini (qui contacter, quoi faire), mais parfois contourné",
+          "points": 4
+        },
+        {
+          "id": "g4_5",
+          "label": "Chemin défini + responsable + délai cible + alerte si dépassement",
+          "points": 5
+        },
+        {
+          "id": "g4_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g4_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G5",
+      "pillar_id": "FIABILITE",
+      "label": "À chaque étape critique, comment vérifiez-vous que les conditions sont remplies pour continuer ?",
+      "help": "Sans point de contrôle, les erreurs passent d'une étape à l'autre et coûtent beaucoup plus cher à corriger en aval.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g5_0",
+          "label": "Pas de vérification — on avance et on découvre les erreurs après",
+          "points": 0
+        },
+        {
+          "id": "g5_2",
+          "label": "Vérification informelle, dépend de la vigilance individuelle",
+          "points": 2
+        },
+        {
+          "id": "g5_4",
+          "label": "Une checklist ou règle définie, appliquée manuellement",
+          "points": 4
+        },
+        {
+          "id": "g5_5",
+          "label": "Validation formalisée dans l'outil, avec blocage automatique si non rempli",
+          "points": 5
+        },
+        {
+          "id": "g5_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g5_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G6",
+      "pillar_id": "FIABILITE",
+      "label": "Comment recueillez-vous les informations nécessaires pour démarrer ce process ?",
+      "help": "Un formulaire digital standardisé élimine les allers-retours pour informations manquantes et réduit les erreurs d'input.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g6_0",
+          "label": "Par email ou à l'oral, sans format défini",
+          "points": 0
+        },
+        {
+          "id": "g6_2",
+          "label": "Par email avec une liste de questions, variable selon les personnes",
+          "points": 2
+        },
+        {
+          "id": "g6_4",
+          "label": "Via un template ou formulaire standardisé, rempli manuellement",
+          "points": 4
+        },
+        {
+          "id": "g6_5",
+          "label": "Via un formulaire en ligne avec champs obligatoires et validation automatique",
+          "points": 5
+        },
+        {
+          "id": "g6_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g6_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G7",
+      "pillar_id": "FIABILITE",
+      "label": "Qui peut modifier les données ou déclencher les étapes importantes de ce process ?",
+      "help": "Des accès non cadrés sont un risque d'erreurs, de fraude et de non-conformité.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g7_0",
+          "label": "Tout le monde — pas de règle d'accès",
+          "points": 0
+        },
+        {
+          "id": "g7_2",
+          "label": "Des habitudes informelles, mais sans règle écrite ni contrôle",
+          "points": 2
+        },
+        {
+          "id": "g7_4",
+          "label": "Des rôles définis globalement, sans revue régulière",
+          "points": 4
+        },
+        {
+          "id": "g7_5",
+          "label": "Rôles définis par étape, avec revue périodique des droits",
+          "points": 5
+        },
+        {
+          "id": "g7_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g7_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G8",
+      "pillar_id": "FIABILITE",
+      "label": "Comment les validations et approbations importantes sont-elles demandées et accordées ?",
+      "help": "Les approbations par email ne sont pas auditables et ne garantissent pas la séparation des rôles.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g8_0",
+          "label": "À l'oral ou par message informel, sans trace",
+          "points": 0
+        },
+        {
+          "id": "g8_2",
+          "label": "Par email, sans workflow ni règle claire de délégation",
+          "points": 2
+        },
+        {
+          "id": "g8_4",
+          "label": "Par email structuré ou outil, avec règle définie",
+          "points": 4
+        },
+        {
+          "id": "g8_5",
+          "label": "Via un workflow dans l'outil, avec séparation des rôles formalisée",
+          "points": 5
+        },
+        {
+          "id": "g8_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g8_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G9",
+      "pillar_id": "PREUVE",
+      "label": "Si un litige ou une question surgit sur ce qui s'est passé, pouvez-vous retrouver les traces en moins de 10 minutes ?",
+      "help": "Un audit trail numérique horodaté est la seule preuve fiable. Les emails et les souvenirs ne suffisent pas.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g9_0",
+          "label": "Non — impossible de savoir qui a fait quoi",
+          "points": 0
+        },
+        {
+          "id": "g9_2",
+          "label": "En fouillant les emails : possible mais long et incomplet",
+          "points": 2
+        },
+        {
+          "id": "g9_4",
+          "label": "Oui, sur la majorité des étapes via l'outil utilisé",
+          "points": 4
+        },
+        {
+          "id": "g9_5",
+          "label": "Oui, historique horodaté complet, facilement accessible",
+          "points": 5
+        },
+        {
+          "id": "g9_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g9_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G10",
+      "pillar_id": "PREUVE",
+      "label": "Où sont stockés les documents, pièces jointes et résultats intermédiaires de ce process ?",
+      "help": "Les documents éparpillés dans les boîtes mail personnelles sont introuvables lors d'un contrôle ou d'un départ.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g10_0",
+          "label": "Dans les boîtes email personnelles des collaborateurs",
+          "points": 0
+        },
+        {
+          "id": "g10_2",
+          "label": "Dans des dossiers partagés mal organisés (Drive, SharePoint…)",
+          "points": 2
+        },
+        {
+          "id": "g10_4",
+          "label": "Dans un dossier structuré par occurrence, mais sans vérification de complétude",
+          "points": 4
+        },
+        {
+          "id": "g10_5",
+          "label": "Dans un outil dédié avec attachement systématique et structuré",
+          "points": 5
+        },
+        {
+          "id": "g10_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g10_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G11",
+      "pillar_id": "PREUVE",
+      "label": "Si la personne en charge aujourd'hui est absente demain, à quoi ressemble la passation ?",
+      "help": "La transmissibilité d'un process est le test ultime de sa maturité digitale.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g11_0",
+          "label": "Impossible — tout est dans sa tête ou sa boîte email",
+          "points": 0
+        },
+        {
+          "id": "g11_2",
+          "label": "Un collègue reprend, mais en fouillant longuement",
+          "points": 2
+        },
+        {
+          "id": "g11_4",
+          "label": "Avec effort : les infos existent mais sont dispersées",
+          "points": 4
+        },
+        {
+          "id": "g11_5",
+          "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",
+          "points": 1
+        },
+        {
+          "id": "g11_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G12",
+      "pillar_id": "PREUVE",
+      "label": "Comment transmettez-vous les informations à quelqu'un qui doit exécuter ce process pour la première fois ?",
+      "help": "Sans documentation opérationnelle à jour, chaque nouvelle personne repart de zéro et répète les mêmes erreurs.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g12_0",
+          "label": "À l'oral ou par email de contexte improvisé",
+          "points": 0
+        },
+        {
+          "id": "g12_2",
+          "label": "Un document Word ou email avec quelques instructions épars",
+          "points": 2
+        },
+        {
+          "id": "g12_4",
+          "label": "Un guide ou template partagé, pas toujours à jour",
+          "points": 4
+        },
+        {
+          "id": "g12_5",
+          "label": "Un mode opératoire structuré, dans un espace partagé, maintenu à jour",
+          "points": 5
+        },
+        {
+          "id": "g12_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g12_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G13",
+      "pillar_id": "RESILIENCE",
+      "label": "En cas d'absence imprévue de la personne clé, comment est assurée la continuité ?",
+      "help": "Un point unique de défaillance humaine est le risque de continuité n°1. Si les accès et le process ne sont pas partagés, l'absence devient une crise.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g13_0",
+          "label": "Le process s'arrête ou se dégrade fortement",
+          "points": 0
+        },
+        {
+          "id": "g13_2",
+          "label": "Un collègue reprend, sans process ni accès définis",
+          "points": 2
+        },
+        {
+          "id": "g13_4",
+          "label": "Un backup est identifié, avec accès partiels",
+          "points": 4
+        },
+        {
+          "id": "g13_5",
+          "label": "Backup + process écrit + accès complets prêts à l'avance",
+          "points": 5
+        },
+        {
+          "id": "g13_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g13_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G14",
+      "pillar_id": "RESILIENCE",
+      "label": "Comment une étape bloquée depuis trop longtemps est-elle signalée et traitée ?",
+      "help": "Sans alerte sur les blocages, un retard de 2 jours peut facilement devenir 2 semaines sans que personne ne le sache.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g14_0",
+          "label": "On le découvre trop tard, par hasard ou lors d'une réunion",
+          "points": 0
+        },
+        {
+          "id": "g14_2",
+          "label": "La personne concernée finit par relancer manuellement",
+          "points": 2
+        },
+        {
+          "id": "g14_4",
+          "label": "Règle claire : après X jours, Y est contacté",
+          "points": 4
+        },
+        {
+          "id": "g14_5",
+          "label": "Alerte automatique dans l'outil + responsable + délai défini",
+          "points": 5
+        },
+        {
+          "id": "g14_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g14_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G15",
+      "pillar_id": "RESILIENCE",
+      "label": "Comment mesurez-vous si ce process fonctionne bien ?",
+      "help": "Sans indicateur, on pilote à vue. Un seul KPI suivi régulièrement (délai, taux d'erreur, volume) suffit pour déclencher l'amélioration.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g15_0",
+          "label": "Pas de mesure — on le voit quand ça dysfonctionne",
+          "points": 0
+        },
+        {
+          "id": "g15_2",
+          "label": "Mesure ponctuelle, en cas de problème signalé",
+          "points": 2
+        },
+        {
+          "id": "g15_4",
+          "label": "Suivi régulier d'au moins un indicateur",
+          "points": 4
+        },
+        {
+          "id": "g15_5",
+          "label": "Tableau de bord régulier + actions correctives formalisées",
+          "points": 5
+        },
+        {
+          "id": "g15_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g15_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G16",
+      "pillar_id": "RESILIENCE",
+      "label": "Quand une anomalie ou un incident se produit, comment est-il traité et mémorisé ?",
+      "help": "Les incidents non documentés se répètent. Un simple log partagé suffit pour identifier les causes racines et éviter la récurrence.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g16_0",
+          "label": "En urgence, sans règle ni trace — on oublie vite",
+          "points": 0
+        },
+        {
+          "id": "g16_2",
+          "label": "La personne concernée gère comme elle peut, sans formalisation",
+          "points": 2
+        },
+        {
+          "id": "g16_4",
+          "label": "Règle de gestion des incidents définie",
+          "points": 4
+        },
+        {
+          "id": "g16_5",
+          "label": "Règle + log des incidents + revue périodique pour éviter la récurrence",
+          "points": 5
+        },
+        {
+          "id": "g16_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g16_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G17",
+      "pillar_id": "COUT",
+      "label": "Combien d'outils ou supports différents interviennent dans l'exécution de ce process ?",
+      "help": "Email + Excel + Word + messagerie + dossier Dropbox… Chaque outil supplémentaire = un risque de perte d'info, de double saisie et de temps perdu en switch.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g17_5",
+          "label": "1 outil principal (ou tout est intégré dans une plateforme)",
+          "points": 5
+        },
+        {
+          "id": "g17_4",
+          "label": "2 à 3 outils qui communiquent partiellement",
+          "points": 4
+        },
+        {
+          "id": "g17_2",
+          "label": "4 à 6 outils sans lien entre eux (email + Excel + Word + messagerie…)",
+          "points": 2
+        },
+        {
+          "id": "g17_0",
+          "label": "7+ outils ou supports, chacun dans son coin",
+          "points": 0
+        },
+        {
+          "id": "g17_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g17_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G18",
+      "pillar_id": "COUT",
+      "label": "Les mêmes informations sont-elles ressaisies manuellement dans plusieurs outils (copier-coller, re-saisie) ?",
+      "help": "La double saisie est la forme la plus visible de gaspillage digital. Elle révèle des outils non connectés entre eux.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g18_0",
+          "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",
+          "points": 2
+        },
+        {
+          "id": "g18_4",
+          "label": "Rarement — quelques cas résiduels non prioritaires",
+          "points": 4
+        },
+        {
+          "id": "g18_5",
+          "label": "Jamais — les données circulent automatiquement entre outils",
+          "points": 5
+        },
+        {
+          "id": "g18_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g18_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G19",
+      "pillar_id": "COUT",
+      "label": "Combien d'échanges internes (emails, messages, réunions de relance) faut-il en moyenne par occurrence de ce process ?",
+      "help": "Les relances sont un proxy direct de friction. Chaque relance est du temps perdu qui pourrait être évité avec les bons outils et le bon process.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g19_0",
+          "label": "10+",
+          "points": 0
+        },
+        {
+          "id": "g19_2",
+          "label": "5 à 9",
+          "points": 2
+        },
+        {
+          "id": "g19_4",
+          "label": "2 à 4",
+          "points": 4
+        },
+        {
+          "id": "g19_5",
+          "label": "0 à 1",
+          "points": 5
+        },
+        {
+          "id": "g19_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g19_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "G20",
+      "pillar_id": "COUT",
+      "label": "Pourquoi réalisez-vous ce diagnostic aujourd'hui ?",
+      "help": "Sert à adapter le ton et les recommandations sans trop influencer le score global.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "g20_2",
+          "label": "Curiosité",
+          "points": 2
+        },
+        {
+          "id": "g20_1",
+          "label": "Incidents répétés / blocages récurrents",
+          "points": 1
+        },
+        {
+          "id": "g20_4a",
+          "label": "Croissance / volume augmentant",
+          "points": 4
+        },
+        {
+          "id": "g20_3",
+          "label": "Départ d'une personne clé / réorganisation",
+          "points": 3
+        },
+        {
+          "id": "g20_4b",
+          "label": "Projet de digitalisation / audit interne",
+          "points": 4
+        },
+        {
+          "id": "g20_dk",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "g20_na",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    }
+  ],
+  "scoring": {
+    "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": "Fragile, risques probables"
+      },
+      "D": {
+        "min": 0,
+        "max": 49,
+        "label": "Instable, risque élevé"
+      }
+    },
+    "anti_cheat_caps": {
+      "G1": {
+        "trigger_points": 0,
+        "pillar_id": "CLARTE",
+        "cap": 12
+      },
+      "G9": {
+        "trigger_points": 0,
+        "pillar_id": "PREUVE",
+        "cap": 10
+      },
+      "G5": {
+        "trigger_points": 0,
+        "pillar_id": "FIABILITE",
+        "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"
+      }
+    }
+  },
+  "cost_hidden": {
+    "formula": "minutes_per_occurrence = G19_minutes + G18_minutes + G17_minutes",
+    "default_hourly_cost": 50,
+    "components": {
+      "G19": {
+        "option_mapping": {
+          "g19_5": 10,
+          "g19_4": 30,
+          "g19_2": 60,
+          "g19_0": 90
+        }
+      },
+      "G18": {
+        "option_mapping": {
+          "g18_5": 0,
+          "g18_4": 10,
+          "g18_2": 25,
+          "g18_0": 45
+        }
+      },
+      "G17": {
+        "option_mapping": {
+          "g17_5": 5,
+          "g17_4": 15,
+          "g17_2": 30,
+          "g17_0": 45
+        }
+      }
+    },
+    "cap_max_hours": 12,
+    "cap_min_hours": 0.5
+  },
+  "optional_questions": {
+    "monthly_volume_occurrences": {
+      "id": "monthly_volume_occurrences",
+      "label": "Volume : combien d'occurrences de ce process par mois ?",
+      "type": "radio",
+      "required_for_cost": true,
+      "options": [
+        {
+          "id": "vol_0_2",
+          "label": "0-2",
+          "value": 1
+        },
+        {
+          "id": "vol_3_10",
+          "label": "3-10",
+          "value": 6
+        },
+        {
+          "id": "vol_11_30",
+          "label": "11-30",
+          "value": 20
+        },
+        {
+          "id": "vol_31_100",
+          "label": "31-100",
+          "value": 60
+        },
+        {
+          "id": "vol_100p",
+          "label": "100+",
+          "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
+        }
+      ]
+    }
+  }
+}

+ 901 - 0
config/packs/validation-facture.json

@@ -0,0 +1,901 @@
+{
+  "pack_id": "validation-facture",
+  "pack_title": "Validation de facture",
+  "pillars": [
+    {
+      "id": "CLARTE",
+      "label": "Clarté du flux",
+      "description": "Rôles, étapes, statut, gestion des exceptions"
+    },
+    {
+      "id": "FIABILITE",
+      "label": "Fiabilité et contrôle",
+      "description": "Contrôles préventifs, validation, règles, droits, qualité d'exécution"
+    },
+    {
+      "id": "PREUVE",
+      "label": "Traçabilité et preuve",
+      "description": "Historique, pièces jointes, capacité de prouver"
+    },
+    {
+      "id": "RESILIENCE",
+      "label": "Résilience et continuité",
+      "description": "Continuité en cas d'absence, escalade, mesure, traitement incident"
+    },
+    {
+      "id": "COUT",
+      "label": "Coût caché et friction",
+      "description": "Friction, relances, double saisie, volume"
+    }
+  ],
+  "questions": [
+    {
+      "id": "F1",
+      "pillar_id": "CLARTE",
+      "label": "Le circuit \"réception facture → validation → paiement\" est-il décrit avec étapes et rôles ?",
+      "help": "Une description partagée réduit la variabilité et les oublis.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "Non, rien d'écrit",
+          "points": 0
+        },
+        {
+          "id": "B",
+          "label": "Partiellement (checklist incomplète)",
+          "points": 2
+        },
+        {
+          "id": "C",
+          "label": "Oui, checklist complète mais pas à jour",
+          "points": 3
+        },
+        {
+          "id": "D",
+          "label": "Oui, clair et à jour",
+          "points": 5
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F2",
+      "pillar_id": "CLARTE",
+      "label": "Existe-t-il un responsable du process factures (bout en bout) ?",
+      "help": "Un owner identifié assure cohérence et arbitrage.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "Personne / pas clair",
+          "points": 0
+        },
+        {
+          "id": "B",
+          "label": "Une personne \"de fait\" mais pas officiel",
+          "points": 2
+        },
+        {
+          "id": "C",
+          "label": "Responsable identifié, mais sans relais",
+          "points": 4
+        },
+        {
+          "id": "D",
+          "label": "Responsable + relais / binôme",
+          "points": 5
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F3",
+      "pillar_id": "CLARTE",
+      "label": "Statut : savez-vous à tout moment où en est une facture (reçue, en validation, bloquée, prête paiement) ?",
+      "help": "La visibilité de l'état réduit les relances.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "B",
+          "label": "Parfois",
+          "points": 2
+        },
+        {
+          "id": "C",
+          "label": "Oui mais manuel",
+          "points": 4
+        },
+        {
+          "id": "D",
+          "label": "Oui + alertes sur blocages",
+          "points": 5
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F4",
+      "pillar_id": "CLARTE",
+      "label": "Les exceptions (litige, facture sans commande, montant inhabituel) ont-elles un chemin clair ?",
+      "help": "Un traitement défini évite les blocages et retards.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "B",
+          "label": "Informel",
+          "points": 2
+        },
+        {
+          "id": "C",
+          "label": "Oui",
+          "points": 4
+        },
+        {
+          "id": "D",
+          "label": "Oui + délai cible + responsable",
+          "points": 5
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F5",
+      "pillar_id": "FIABILITE",
+      "label": "Contrôle doublons : comment évitez-vous de payer deux fois ?",
+      "help": "Un contrôle systématique limite les paiements en double.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "Aucun contrôle",
+          "points": 0
+        },
+        {
+          "id": "B",
+          "label": "Contrôle manuel ponctuel",
+          "points": 2
+        },
+        {
+          "id": "C",
+          "label": "Contrôle systématique",
+          "points": 4
+        },
+        {
+          "id": "D",
+          "label": "Contrôle systématique + alerte",
+          "points": 5
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F6",
+      "pillar_id": "FIABILITE",
+      "label": "Séparation des tâches : est-ce que la même personne peut créer, approuver et déclencher le paiement ?",
+      "help": "La séparation des tâches réduit erreurs et fraude.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "Oui, souvent",
+          "points": 0
+        },
+        {
+          "id": "B",
+          "label": "Oui, parfois",
+          "points": 2
+        },
+        {
+          "id": "C",
+          "label": "Rarement",
+          "points": 4
+        },
+        {
+          "id": "D",
+          "label": "Non, règles strictes",
+          "points": 5
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F7",
+      "pillar_id": "FIABILITE",
+      "label": "Validation : y a-t-il des seuils d'approbation (montant, type dépense) ?",
+      "help": "Des seuils clairs cadrent les validations et accélèrent le flux.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "B",
+          "label": "Partiel",
+          "points": 2
+        },
+        {
+          "id": "C",
+          "label": "Oui",
+          "points": 4
+        },
+        {
+          "id": "D",
+          "label": "Oui + revu périodiquement",
+          "points": 5
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F8",
+      "pillar_id": "FIABILITE",
+      "label": "Pièces justificatives : facture rattachée à commande/contrat/bon de réception quand applicable ?",
+      "help": "Le rattachement systématique limite les erreurs et facilite l'audit.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "Rarement",
+          "points": 0
+        },
+        {
+          "id": "B",
+          "label": "Parfois",
+          "points": 2
+        },
+        {
+          "id": "C",
+          "label": "Souvent",
+          "points": 4
+        },
+        {
+          "id": "D",
+          "label": "Systématiquement",
+          "points": 5
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F9",
+      "pillar_id": "PREUVE",
+      "label": "Audit trail : pouvez-vous prouver qui a validé quoi, quand, et pourquoi ?",
+      "help": "Les audit trails reposent sur des événements horodatés et un historique exploitable.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "B",
+          "label": "Partiellement",
+          "points": 2
+        },
+        {
+          "id": "C",
+          "label": "Oui sur la majorité",
+          "points": 4
+        },
+        {
+          "id": "D",
+          "label": "Oui, historisé et horodaté",
+          "points": 5
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F10",
+      "pillar_id": "PREUVE",
+      "label": "Les justificatifs et échanges (litiges, validations) sont-ils centralisés avec la facture ?",
+      "help": "Une centralisation complète facilite l'audit et la résolution des litiges.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "B",
+          "label": "Dispersés",
+          "points": 2
+        },
+        {
+          "id": "C",
+          "label": "Centralisés incomplets",
+          "points": 4
+        },
+        {
+          "id": "D",
+          "label": "Centralisés complets",
+          "points": 5
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F11",
+      "pillar_id": "PREUVE",
+      "label": "Modifications : les changements (RIB fournisseur, montants, coordonnées) sont-ils tracés ?",
+      "help": "La traçabilité des modifications limite les risques de fraude.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "Non / inconnu",
+          "points": 0
+        },
+        {
+          "id": "B",
+          "label": "Partiellement",
+          "points": 2
+        },
+        {
+          "id": "C",
+          "label": "Oui",
+          "points": 4
+        },
+        {
+          "id": "D",
+          "label": "Oui + alerte sur changements sensibles",
+          "points": 5
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F12",
+      "pillar_id": "PREUVE",
+      "label": "Archivage : accès facile à une facture et ses preuves 12 mois après ?",
+      "help": "Un archivage structuré facilite les contrôles et litiges.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "Difficile",
+          "points": 0
+        },
+        {
+          "id": "B",
+          "label": "Faisable mais long",
+          "points": 2
+        },
+        {
+          "id": "C",
+          "label": "Rapide",
+          "points": 4
+        },
+        {
+          "id": "D",
+          "label": "Rapide + règles d'accès",
+          "points": 5
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F13",
+      "pillar_id": "RESILIENCE",
+      "label": "Si un valideur est absent, existe-t-il un mécanisme de délégation automatique ou clair ?",
+      "help": "Une délégation définie évite les blocages en cas d'absence.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "B",
+          "label": "Informel",
+          "points": 2
+        },
+        {
+          "id": "C",
+          "label": "Oui",
+          "points": 4
+        },
+        {
+          "id": "D",
+          "label": "Oui + délais",
+          "points": 5
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F14",
+      "pillar_id": "RESILIENCE",
+      "label": "Escalade : une facture bloquée déclenche-t-elle une alerte après X jours ?",
+      "help": "Une escalade claire limite la durée des blocages.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "B",
+          "label": "Informel",
+          "points": 2
+        },
+        {
+          "id": "C",
+          "label": "Oui, règle claire",
+          "points": 4
+        },
+        {
+          "id": "D",
+          "label": "Oui, règle + responsable + délai",
+          "points": 5
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F15",
+      "pillar_id": "RESILIENCE",
+      "label": "Mesure : suivez-vous au moins 1 indicateur (délai validation, factures en retard, exceptions) ?",
+      "help": "Sans mesure, pas d'amélioration continue.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "Non",
+          "points": 0
+        },
+        {
+          "id": "B",
+          "label": "Mesure ponctuelle",
+          "points": 2
+        },
+        {
+          "id": "C",
+          "label": "Mesure mensuelle",
+          "points": 4
+        },
+        {
+          "id": "D",
+          "label": "Mesure régulière + actions",
+          "points": 5
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F16",
+      "pillar_id": "RESILIENCE",
+      "label": "Continuité : que se passe-t-il si l'outil ou la boîte mail facture est indisponible ?",
+      "help": "La continuité repose sur préparation et capacité de reprise.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "Aucun plan",
+          "points": 0
+        },
+        {
+          "id": "B",
+          "label": "Plan informel",
+          "points": 2
+        },
+        {
+          "id": "C",
+          "label": "Plan simple",
+          "points": 4
+        },
+        {
+          "id": "D",
+          "label": "Plan testé",
+          "points": 5
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F17",
+      "pillar_id": "COUT",
+      "label": "Volume : combien de factures par mois ?",
+      "help": "Le volume amplifie le coût caché quand le flux est faible.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "<50",
+          "points": 5
+        },
+        {
+          "id": "B",
+          "label": "50-200",
+          "points": 4
+        },
+        {
+          "id": "C",
+          "label": "200-1000",
+          "points": 2
+        },
+        {
+          "id": "D",
+          "label": "1000+",
+          "points": 0
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F18",
+      "pillar_id": "COUT",
+      "label": "Double saisie : combien de fois ressaisissez-vous les infos facture ?",
+      "help": "La double saisie = temps perdu + source d'erreurs.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "Souvent",
+          "points": 0
+        },
+        {
+          "id": "B",
+          "label": "Parfois",
+          "points": 2
+        },
+        {
+          "id": "C",
+          "label": "Rarement",
+          "points": 4
+        },
+        {
+          "id": "D",
+          "label": "Jamais",
+          "points": 5
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F19",
+      "pillar_id": "COUT",
+      "label": "Relances : combien de relances internes par facture \"bloquée\" en moyenne ?",
+      "help": "Les relances sont un proxy direct de friction.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "3+",
+          "points": 0
+        },
+        {
+          "id": "B",
+          "label": "2",
+          "points": 2
+        },
+        {
+          "id": "C",
+          "label": "1",
+          "points": 4
+        },
+        {
+          "id": "D",
+          "label": "0",
+          "points": 5
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    },
+    {
+      "id": "F20",
+      "pillar_id": "COUT",
+      "label": "Urgence / déclencheur : pourquoi maintenant ?",
+      "help": "Sert à adapter le ton et la priorisation.",
+      "type": "radio",
+      "options": [
+        {
+          "id": "A",
+          "label": "Curiosité",
+          "points": 2
+        },
+        {
+          "id": "B",
+          "label": "Retards de paiement / litiges",
+          "points": 1
+        },
+        {
+          "id": "C",
+          "label": "Croissance volume / nouveau fournisseur",
+          "points": 4
+        },
+        {
+          "id": "D",
+          "label": "Audit / contrôle interne",
+          "points": 4
+        },
+        {
+          "id": "E",
+          "label": "Fraude ou suspicion",
+          "points": 3
+        },
+        {
+          "id": "DK",
+          "label": "Je ne sais pas",
+          "points": 1
+        },
+        {
+          "id": "NA",
+          "label": "Non pertinent — N/A",
+          "points": 3
+        }
+      ]
+    }
+  ],
+  "scoring": {
+    "level_thresholds": {
+      "A": {
+        "min": 85,
+        "max": 100,
+        "label": "Robuste"
+      },
+      "B": {
+        "min": 70,
+        "max": 84,
+        "label": "Solide, quelques points fragiles"
+      },
+      "C": {
+        "min": 50,
+        "max": 69,
+        "label": "Fragile, risques probables"
+      },
+      "D": {
+        "min": 0,
+        "max": 49,
+        "label": "Instable, risque élevé"
+      }
+    },
+    "anti_cheat_caps": {
+      "F1": {
+        "trigger_points": 0,
+        "pillar_id": "CLARTE",
+        "cap": 12
+      },
+      "F9": {
+        "trigger_points": 0,
+        "pillar_id": "PREUVE",
+        "cap": 10
+      },
+      "F5": {
+        "trigger_points": 0,
+        "pillar_id": "FIABILITE",
+        "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"
+      }
+    }
+  },
+  "cost_hidden": {
+    "formula": "(base_min + double_saisie_min + relance_min) * volume_multiplier",
+    "description": "Heures/mois estimées. volume_multiplier = nb factures représentatif (F17). Coût horaire en optionnel.",
+    "F17_volume_multiplier": {
+      "<50": 25,
+      "50-200": 125,
+      "200-1000": 600,
+      "1000+": 1500
+    },
+    "F19_relance_min_per_invoice": {
+      "0": 0,
+      "1": 5,
+      "2": 10,
+      "3+": 15
+    },
+    "F18_double_saisie_min_per_invoice": {
+      "Souvent": 5,
+      "Parfois": 3,
+      "Rarement": 1,
+      "Jamais": 0
+    },
+    "base_min_per_invoice": 4,
+    "notes": "Formule : (base + F18 + F19) * F17_volume_mult. Coût horaire indicatif demandé en optionnel pour conversion EUR."
+  },
+  "notes": null
+}

+ 25 - 0
public/api/_bootstrap.php

@@ -0,0 +1,25 @@
+<?php
+
+declare(strict_types=1);
+
+$root = dirname(__DIR__, 2);
+
+$autoload = $root . '/vendor/autoload.php';
+if (is_file($autoload)) {
+    require $autoload;
+}
+
+spl_autoload_register(function (string $class) use ($root): void {
+    $prefix = 'AuditExpress\\';
+    if (!str_starts_with($class, $prefix)) {
+        return;
+    }
+    $relative = substr($class, strlen($prefix));
+    $path = $root . '/src/' . str_replace('\\', '/', $relative) . '.php';
+    if (is_file($path)) {
+        require $path;
+    }
+});
+
+return $root;
+

+ 61 - 0
public/api/email.php

@@ -0,0 +1,61 @@
+<?php
+
+declare(strict_types=1);
+
+use AuditExpress\Engine;
+use AuditExpress\Http;
+use AuditExpress\LogMailer;
+use AuditExpress\PackRepository;
+use AuditExpress\PdfRenderer;
+use AuditExpress\RulesRepository;
+
+$root = require __DIR__ . '/_bootstrap.php';
+
+if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
+    Http::methodNotAllowed(['POST']);
+    exit;
+}
+
+$body = Http::readJsonBody();
+$packId = (string) ($body['pack_id'] ?? 'onboarding-v1');
+$answers = $body['answers'] ?? [];
+$optional = $body['optional'] ?? [];
+$email = (string) ($body['email'] ?? '');
+$bookingUrl = (string) ($body['booking_url'] ?? '');
+
+if ($email === '' || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
+    Http::json(['error' => 'Email invalide'], 400);
+    exit;
+}
+if (!is_array($answers) || !is_array($optional)) {
+    Http::json(['error' => 'Invalid payload'], 400);
+    exit;
+}
+
+try {
+    $packRepo = new PackRepository($root);
+    $rulesRepo = new RulesRepository($root);
+    $pack = $packRepo->getPack($packId);
+    $rules = $rulesRepo->getRules();
+
+    $result = Engine::compute($pack, $answers, $optional, $rules);
+    $pdfBytes = (new PdfRenderer($root))->renderPdfBytes($pack, $result, [
+        'booking_url' => $bookingUrl,
+        'date' => date('Y-m-d'),
+    ]);
+
+    $filename = 'controle-technique-' . ($pack['pack_id'] ?? 'resultat') . '.pdf';
+    $subject = 'Votre contrôle technique : synthèse PDF';
+    $text = "Bonjour,\n\nVoici votre synthèse PDF.\n\nCordialement,\n";
+
+    $mailer = new LogMailer($root . '/storage/outbox');
+    $mailer->sendPdf($email, $subject, $text, $filename, $pdfBytes);
+
+    Http::json([
+        'status' => 'stored',
+        'message' => 'V1 pseudo: email stocké dans storage/outbox (à brancher sur SMTP/API).',
+    ]);
+} catch (Throwable $e) {
+    Http::json(['error' => $e->getMessage()], 400);
+}
+

+ 42 - 0
public/api/notify.php

@@ -0,0 +1,42 @@
+<?php
+
+declare(strict_types=1);
+
+use AuditExpress\Http;
+
+$root = require __DIR__ . '/_bootstrap.php';
+
+if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
+    Http::methodNotAllowed(['POST']);
+    exit;
+}
+
+$body  = Http::readJsonBody();
+$email = (string) ($body['email'] ?? '');
+$tool  = (string) ($body['tool']  ?? 'unknown');
+
+if ($email === '' || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
+    Http::json(['error' => 'Email invalide'], 400);
+    exit;
+}
+
+$outboxDir = $root . '/storage/outbox';
+if (!is_dir($outboxDir)) {
+    @mkdir($outboxDir, 0775, true);
+}
+
+$id   = date('Ymd_His') . '_' . bin2hex(random_bytes(4));
+$meta = [
+    'id'         => $id,
+    'type'       => 'notify_interest',
+    'tool'       => $tool,
+    'email'      => $email,
+    'created_at' => date(DATE_ATOM),
+];
+
+file_put_contents(
+    $outboxDir . DIRECTORY_SEPARATOR . $id . '_notify.json',
+    json_encode($meta, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT)
+);
+
+Http::json(['status' => 'ok']);

+ 24 - 0
public/api/pack.php

@@ -0,0 +1,24 @@
+<?php
+
+declare(strict_types=1);
+
+use AuditExpress\Http;
+use AuditExpress\PackRepository;
+
+$root = require __DIR__ . '/_bootstrap.php';
+
+if ($_SERVER['REQUEST_METHOD'] !== 'GET') {
+    Http::methodNotAllowed(['GET']);
+    exit;
+}
+
+$packId = (string) ($_GET['pack'] ?? 'onboarding-v1');
+
+try {
+    $repo = new PackRepository($root);
+    $pack = $repo->getPack($packId);
+    Http::json(['pack' => $pack]);
+} catch (Throwable $e) {
+    Http::json(['error' => $e->getMessage()], 404);
+}
+

+ 51 - 0
public/api/pdf.php

@@ -0,0 +1,51 @@
+<?php
+
+declare(strict_types=1);
+
+use AuditExpress\Engine;
+use AuditExpress\Http;
+use AuditExpress\PackRepository;
+use AuditExpress\PdfRenderer;
+use AuditExpress\RulesRepository;
+
+$root = require __DIR__ . '/_bootstrap.php';
+
+if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
+    Http::methodNotAllowed(['POST']);
+    exit;
+}
+
+$body = Http::readJsonBody();
+$packId = (string) ($body['pack_id'] ?? 'onboarding-v1');
+$answers = $body['answers'] ?? [];
+$optional = $body['optional'] ?? [];
+
+if (!is_array($answers) || !is_array($optional)) {
+    Http::json(['error' => 'Invalid payload'], 400);
+    exit;
+}
+
+$bookingUrl = (string) ($body['booking_url'] ?? '');
+
+try {
+    $packRepo = new PackRepository($root);
+    $rulesRepo = new RulesRepository($root);
+    $pack = $packRepo->getPack($packId);
+    $rules = $rulesRepo->getRules();
+
+    $result = Engine::compute($pack, $answers, $optional, $rules);
+
+    $pdf = (new PdfRenderer($root))->renderPdfBytes($pack, $result, [
+        'booking_url' => $bookingUrl,
+        'date' => date('Y-m-d'),
+    ]);
+
+    $filename = 'controle-technique-' . ($pack['pack_id'] ?? 'resultat') . '.pdf';
+    header('Content-Type: application/pdf');
+    header('Content-Disposition: attachment; filename="' . $filename . '"');
+    header('Content-Length: ' . strlen($pdf));
+    echo $pdf;
+} catch (Throwable $e) {
+    Http::json(['error' => $e->getMessage()], 400);
+}
+

+ 38 - 0
public/api/score.php

@@ -0,0 +1,38 @@
+<?php
+
+declare(strict_types=1);
+
+use AuditExpress\Engine;
+use AuditExpress\Http;
+use AuditExpress\PackRepository;
+use AuditExpress\RulesRepository;
+
+$root = require __DIR__ . '/_bootstrap.php';
+
+if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
+    Http::methodNotAllowed(['POST']);
+    exit;
+}
+
+$body = Http::readJsonBody();
+$packId = (string) ($body['pack_id'] ?? 'onboarding-v1');
+$answers = $body['answers'] ?? [];
+$optional = $body['optional'] ?? [];
+
+if (!is_array($answers) || !is_array($optional)) {
+    Http::json(['error' => 'Invalid payload'], 400);
+    exit;
+}
+
+try {
+    $packRepo = new PackRepository($root);
+    $rulesRepo = new RulesRepository($root);
+    $pack = $packRepo->getPack($packId);
+    $rules = $rulesRepo->getRules();
+
+    $result = Engine::compute($pack, $answers, $optional, $rules);
+    Http::json(['result' => $result]);
+} catch (Throwable $e) {
+    Http::json(['error' => $e->getMessage()], 400);
+}
+

+ 565 - 0
public/assets/css/app.css

@@ -0,0 +1,565 @@
+@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;500;700&display=swap');
+
+:root {
+  --navy:    #173258;
+  --blue:    #2F506D;
+  --cyan:    #00BEF3;
+  --dark:    #04173d;
+  --bg:      #f2f6fa;
+  --bg-card: #ffffff;
+  --border:  #dde5ed;
+  --muted:   #5e789a;
+  --text:    #2F506D;
+  --good:    #1e8a5e;
+  --warn:    #c07c10;
+  --bad:     #b83040;
+  --radius:  8px;
+  --shadow:  0 2px 12px rgba(23,50,88,.09);
+  --shadow-lg: 0 6px 28px rgba(23,50,88,.13);
+}
+
+* { box-sizing: border-box; }
+
+body {
+  margin: 0;
+  font-family: Lato, 'Segoe UI', Arial, sans-serif;
+  font-size: 16px;
+  line-height: 1.6;
+  color: var(--text);
+  background: var(--bg);
+}
+
+/* ── Layout ── */
+.container { max-width: 920px; margin: 0 auto; padding: 32px 18px 52px; }
+
+.header {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  gap: 12px;
+  margin-bottom: 28px;
+  padding-bottom: 18px;
+  border-bottom: 2px solid var(--navy);
+}
+.brand__logo { font-size: 20px; font-weight: 700; color: var(--navy); letter-spacing: .3px; }
+.brand__sub   { color: var(--muted); font-size: 13px; margin-top: 2px; font-weight: 400; }
+.brand__badge {
+  font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
+  background: var(--cyan); color: #fff; padding: 3px 9px; border-radius: 4px;
+}
+
+.footer { margin-top: 32px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 14px; }
+.footer a { color: var(--muted); text-decoration: underline; }
+.footer a:hover { color: var(--blue); }
+
+/* ── Cards ── */
+.card {
+  background: var(--bg-card);
+  border: 1px solid var(--border);
+  border-radius: var(--radius);
+  padding: 24px 22px;
+  box-shadow: var(--shadow);
+}
+.card + .card { margin-top: 16px; }
+
+.grid { display: grid; gap: 18px; }
+.grid--2 { grid-template-columns: 1fr; }
+@media (min-width: 780px) { .grid--2 { grid-template-columns: 1fr 1fr; } }
+.grid--3 { grid-template-columns: 1fr; }
+@media (min-width: 780px) { .grid--3 { grid-template-columns: 1fr 1fr 1fr; } }
+
+/* ── Typography ── */
+.h1 {
+  font-size: 28px; font-weight: 700; line-height: 1.15;
+  color: var(--navy); margin: 0 0 10px;
+}
+.h2 { font-size: 20px; font-weight: 700; color: var(--navy); margin: 0 0 8px; }
+.lead { color: var(--blue); margin: 0 0 14px; font-size: 15px; font-weight: 400; }
+.muted { color: var(--muted); }
+.hint { color: var(--muted); font-size: 13px; margin-top: 8px; }
+.small { font-size: 13px; }
+
+/* ── Tags / pills ── */
+.tag {
+  display: inline-flex; align-items: center; gap: 5px;
+  font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
+  border-radius: 4px; padding: 3px 8px;
+  background: #eaf4fb; color: #1870a0; border: 1px solid #b8dcf0;
+}
+.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; }
+
+/* ── Bullets ── */
+.bullets { margin: 0 0 16px; padding: 0 0 0 18px; }
+.bullets li { margin: 5px 0; color: var(--blue); }
+
+/* ── Buttons ── */
+.btnrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
+
+.btn {
+  display: inline-flex; align-items: center; justify-content: center;
+  gap: 6px; border-radius: var(--radius);
+  padding: 10px 20px; font-family: Lato, sans-serif;
+  font-size: 15px; font-weight: 700; letter-spacing: .2px;
+  cursor: pointer; text-decoration: none; transition: opacity .15s, background .15s;
+  border: 2px solid transparent; white-space: nowrap;
+}
+.btn--primary {
+  background: var(--dark); color: #fff; border-color: var(--dark);
+}
+.btn--primary:hover { background: var(--navy); border-color: var(--navy); }
+
+.btn--outline {
+  background: transparent; color: var(--blue); border-color: var(--border);
+}
+.btn--outline:hover { border-color: var(--blue); }
+
+.btn--cyan {
+  background: var(--cyan); color: #fff; border-color: var(--cyan);
+}
+.btn--cyan:hover { opacity: .85; }
+
+.btn:disabled { opacity: .38; cursor: not-allowed; }
+
+/* ── Section label ── */
+.section-label {
+  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
+  color: var(--muted); margin-bottom: 10px;
+  display: flex; align-items: center; gap: 8px;
+}
+.section-label::after {
+  content: ''; flex: 1; height: 1px; background: var(--border);
+}
+
+/* ── Resume notice ── */
+.resume-notice {
+  display: inline-flex; align-items: center; gap: 8px;
+  background: #eef7f2; border: 1px solid #a8d9bc; border-radius: var(--radius);
+  padding: 8px 14px; font-size: 13px; color: #1a6b45; font-weight: 700;
+  margin-bottom: 4px;
+}
+
+/* ── Pack cards ── */
+.pack-card {
+  background: var(--bg-card);
+  border: 2px solid var(--border);
+  border-radius: var(--radius);
+  padding: 20px 18px;
+  cursor: pointer;
+  transition: border-color .15s, box-shadow .15s;
+  box-shadow: var(--shadow);
+}
+.pack-card:hover { border-color: var(--cyan); box-shadow: var(--shadow-lg); }
+.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; }
+
+/* ── Quiz ── */
+.quizHead {
+  display: flex; justify-content: space-between; align-items: center; gap: 10px;
+  margin-bottom: 10px;
+}
+.quizStep { font-size: 15px; color: var(--muted); line-height: 1; }
+.quizStep strong { font-size: 22px; font-weight: 700; color: var(--navy); }
+
+.progressWrap { margin-bottom: 18px; }
+.progress {
+  height: 10px; background: var(--border); border-radius: 999px; overflow: hidden;
+}
+.progress > div { height: 100%; background: var(--cyan); transition: width .35s ease; }
+.progressMeta {
+  display: flex; justify-content: space-between; align-items: center;
+  margin-top: 5px; font-size: 12px; color: var(--muted);
+}
+.progressPct { font-weight: 700; color: var(--cyan); font-size: 13px; }
+.progressRemain { font-style: italic; }
+
+.qTitle { font-size: 20px; font-weight: 700; color: var(--navy); margin: 0 0 6px; line-height: 1.3; }
+.qHelp  { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
+
+.options { display: grid; gap: 8px; margin-top: 12px; }
+.opt {
+  display: flex; gap: 12px; align-items: flex-start;
+  padding: 12px 14px; border-radius: var(--radius);
+  border: 1.5px solid var(--border); background: var(--bg-card);
+  cursor: pointer; transition: border-color .15s, background .1s;
+}
+.opt:hover { border-color: var(--cyan); background: #f0faff; }
+.opt--selected {
+  border-color: var(--cyan); background: #e4f6fe;
+  box-shadow: 0 0 0 2px rgba(0,190,243,.18);
+}
+.opt--na {
+  border-style: dashed; opacity: .75;
+}
+.opt--na:hover { opacity: 1; }
+.opt input[type="radio"] { margin-top: 3px; accent-color: var(--cyan); flex-shrink: 0; }
+.opt strong { display: block; font-weight: 500; color: var(--navy); }
+.opt span   { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
+
+/* ── Score ── */
+.scoreBox {
+  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
+  justify-content: space-between; margin-bottom: 18px;
+}
+.scoreBig { font-size: 48px; font-weight: 700; color: var(--navy); line-height: 1; }
+.scoreLabel { font-size: 13px; color: var(--muted); font-weight: 400; margin-bottom: 2px; }
+
+.level-badge {
+  display: inline-flex; align-items: center; gap: 8px;
+  border: 2px solid var(--border); border-radius: var(--radius);
+  padding: 6px 12px; font-weight: 700; color: var(--navy); font-size: 15px;
+  background: #fff;
+}
+.level-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
+
+.confidence { font-size: 13px; color: var(--muted); margin-top: 4px; }
+
+/* ── Pillars ── */
+.pillars { display: grid; gap: 10px; margin-top: 14px; }
+.pRow { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
+.pRow .name { color: var(--blue); font-size: 14px; }
+.pRow .val  { font-weight: 700; color: var(--navy); font-size: 14px; }
+.bar { grid-column: 1/-1; height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
+.bar > div { height: 100%; background: var(--cyan); }
+
+/* ── Results columns ── */
+.cols { display: grid; gap: 16px; margin-top: 16px; }
+@media (min-width: 780px) { .cols { grid-template-columns: 1fr 1fr; } }
+.cols .card { box-shadow: none; }
+
+.list { margin: 10px 0 0; padding: 0 0 0 18px; }
+.list li { margin: 8px 0; }
+.list li strong { color: var(--navy); font-weight: 700; }
+.list li .hint { margin-top: 2px; }
+
+.sep { height: 1px; background: var(--border); margin: 16px 0; }
+
+/* ── Cost block ── */
+.cost-block { background: #f7fafd; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-top: 16px; }
+.cost-block .h2 { font-size: 16px; }
+.cost-figures { display: flex; gap: 28px; flex-wrap: wrap; margin: 8px 0 4px; }
+.cost-fig span { display: block; }
+.cost-fig .val { font-size: 22px; font-weight: 700; color: var(--navy); }
+.cost-fig .lbl { font-size: 12px; color: var(--muted); }
+
+/* ── Forms / inputs ── */
+.field { display: grid; gap: 6px; margin: 10px 0; }
+.field label { font-weight: 700; font-size: 14px; color: var(--navy); }
+.field input {
+  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;
+}
+.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;
+}
+.check input[type="checkbox"] { margin-top: 2px; accent-color: var(--cyan); flex-shrink: 0; }
+
+/* ── V2 Diagnostic card ── */
+.v2-diagnostic { padding: 28px 24px; }
+
+.v2-meters {
+  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 20px;
+}
+@media (max-width: 480px) { .v2-meters { grid-template-columns: 1fr; } }
+
+.v2-meter { display: flex; flex-direction: column; align-items: center; text-align: center; }
+.v2-meter__num {
+  font-size: 52px; font-weight: 700; line-height: 1; letter-spacing: -1px;
+}
+.v2-meter__sub  { font-size: 16px; color: var(--muted); margin-top: -4px; margin-bottom: 6px; }
+.v2-meter__lbl  { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 8px; }
+.v2-meter__track {
+  width: 100%; height: 8px; background: var(--border); border-radius: 999px; overflow: hidden;
+}
+.v2-meter__fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
+
+.v2-badges {
+  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
+}
+.v2-verdict-badge {
+  display: inline-flex; align-items: center;
+  border: 2px solid; border-radius: var(--radius);
+  padding: 7px 14px; font-weight: 700; font-size: 14px;
+  background: #fff;
+}
+.v2-tag-badge {
+  display: inline-flex; align-items: center;
+  border-radius: var(--radius); padding: 7px 14px;
+  font-size: 13px; font-weight: 700;
+}
+.v2-tag-badge--qw   { background: #e4f8f1; color: #1a6b45; border: 1.5px solid #a8d9bc; }
+.v2-tag-badge--proj { background: #eaf1fb; color: #1b4a9e; border: 1.5px solid #b0c8f0; }
+
+/* ── V2 Mini plan ── */
+.v2-mini-plan { display: grid; gap: 16px; margin-top: 0; }
+
+.v2-plan-cols {
+  display: grid; gap: 16px; grid-template-columns: 1fr;
+}
+@media (min-width: 640px) { .v2-plan-cols { grid-template-columns: 1fr 1fr; } }
+
+.v2-plan-section { padding: 20px; }
+.v2-plan-section--qw { background: #f5f9ff; }
+
+.v2-plan-title {
+  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
+  color: var(--muted); margin-bottom: 12px;
+  display: flex; align-items: center; gap: 8px;
+}
+.v2-plan-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
+.v2-plan-title--risk { color: var(--bad); }
+
+.v2-plan-list { margin: 0; padding: 0 0 0 18px; }
+.v2-plan-list li { margin: 8px 0; color: var(--navy); }
+.v2-plan-list li strong { font-weight: 700; }
+.v2-plan-list li .hint { margin-top: 1px; }
+
+.v2-plan-risk-block {
+  background: #fff8f8; border: 1.5px solid #f0c8c8; border-radius: var(--radius);
+  padding: 18px 20px;
+}
+.v2-plan-risk-card strong { font-size: 15px; font-weight: 700; color: var(--navy); }
+.v2-plan-risk-card p { margin: 4px 0 0; }
+
+/* ── Unlock gate ── */
+.unlock-gate {
+  border-radius: var(--radius);
+  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
+  padding: 2px;
+  box-shadow: var(--shadow-lg);
+}
+.unlock-gate__inner {
+  background: #fff;
+  border-radius: calc(var(--radius) - 2px);
+  padding: 32px 28px;
+  text-align: center;
+}
+.unlock-gate__icon {
+  font-size: 28px; color: var(--cyan); font-weight: 700;
+  margin-bottom: 12px; line-height: 1;
+  animation: bounce 1.4s ease-in-out infinite;
+}
+@keyframes bounce {
+  0%, 100% { transform: translateY(0); }
+  50% { transform: translateY(5px); }
+}
+.unlock-gate .h2 { text-align: center; font-size: 22px; }
+.unlock-gate .lead { text-align: center; max-width: 480px; margin: 0 auto 18px; }
+
+/* Risques teaser dans l'unlock gate */
+.unlock-risks {
+  display: grid; gap: 10px; margin-bottom: 24px;
+  text-align: left; max-width: 520px; margin-left: auto; margin-right: auto;
+}
+.unlock-risk {
+  display: flex; gap: 14px; align-items: flex-start;
+  background: #fff8f8; border: 1px solid #f0c8c8; border-radius: var(--radius);
+  padding: 12px 14px;
+}
+.unlock-risk__num {
+  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
+  background: var(--bad); color: #fff;
+  font-size: 12px; font-weight: 700;
+  display: flex; align-items: center; justify-content: center;
+  margin-top: 1px;
+}
+.unlock-risk__body { display: flex; flex-direction: column; gap: 2px; }
+.unlock-risk__body strong { font-size: 14px; font-weight: 700; color: var(--navy); }
+.unlock-risk__body span  { font-size: 13px; color: var(--muted); line-height: 1.4; }
+
+.unlock-form { display: flex; flex-direction: column; align-items: center; }
+.unlock-row {
+  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%;
+  max-width: 480px;
+}
+.unlock-row input[type="email"] {
+  flex: 1; min-width: 220px;
+  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;
+}
+.unlock-row input[type="email"]:focus { outline: none; border-color: var(--cyan); }
+.btn--unlock { padding: 12px 28px; font-size: 16px; }
+
+/* ── CTAs débloqués ── */
+.unlocked-ctas {
+  border-radius: var(--radius);
+  background: linear-gradient(135deg, #00BEF3 0%, #1a8ecb 100%);
+  padding: 2px;
+  box-shadow: var(--shadow-lg);
+}
+.unlocked-ctas__inner {
+  background: #fff;
+  border-radius: calc(var(--radius) - 2px);
+  padding: 32px 28px;
+  text-align: center;
+}
+.unlocked-ctas .h2 { text-align: center; font-size: 22px; }
+.unlocked-ctas .lead { text-align: center; max-width: 480px; margin: 0 auto; }
+
+/* Bloc CTA commerciaux */
+.cta-block {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  gap: 12px;
+  margin: 0 auto;
+  max-width: 420px;
+}
+.btn--cta-main {
+  width: 100%;
+  padding: 16px 24px;
+  font-size: 17px;
+  font-weight: 700;
+  letter-spacing: .01em;
+  box-shadow: 0 4px 14px rgba(0,190,243,.35);
+}
+.btn--cta-secondary {
+  width: 100%;
+  padding: 13px 24px;
+  font-size: 15px;
+  font-weight: 600;
+}
+@media (max-width: 500px) {
+  .btn--cta-main  { font-size: 15px; padding: 14px 16px; }
+  .btn--cta-secondary { font-size: 14px; }
+}
+
+/* ── Tags outils ── */
+.tag--roi { background: #fffbe8; color: #8a5a00; border-color: #f0d090; }
+.tag--qwf { background: #e8faf6; color: #0a6a50; border-color: #90d8c0; }
+
+/* ── ROI Calculator ── */
+.roi-grid { display: grid; gap: 14px; }
+@media (min-width: 600px) { .roi-grid { grid-template-columns: 1fr 1fr; } }
+.roi-field { display: grid; gap: 4px; }
+.roi-field > label { font-weight: 700; font-size: 14px; color: var(--navy); }
+.roi-unit { font-weight: 400; font-size: 12px; color: var(--muted); }
+.roi-field input {
+  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; width: 100%;
+}
+.roi-field input:focus { outline: none; border-color: var(--cyan); }
+.field-hint { font-size: 11px; color: var(--muted); margin-top: 2px; }
+
+.confidence-pill {
+  display: inline-flex; align-items: center; gap: 6px;
+  padding: 4px 12px; border-radius: 99px; font-size: 12px; font-weight: 700; border: 1.5px solid;
+}
+.confidence-pill--fort   { background: #eef7f2; color: #1a6b45; border-color: #a8d9bc; }
+.confidence-pill--moyen  { background: #fff8ed; color: #a05a00; border-color: #f0cc8a; }
+.confidence-pill--faible { background: #fff0f0; color: #b83040; border-color: #f0b3bb; }
+
+.roi-hero {
+  display: flex; flex-wrap: wrap; gap: 24px; padding: 20px 0;
+  justify-content: center; align-items: center; text-align: center;
+}
+.roi-hero__sep { width: 1px; height: 50px; background: var(--border); }
+@media (max-width: 500px) { .roi-hero__sep { display: none; } }
+.roi-hero__val { font-size: 40px; font-weight: 700; color: var(--navy); line-height: 1; }
+.roi-hero__lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }
+.roi-hero__sub { font-size: 16px; font-weight: 700; color: var(--blue); margin-top: 3px; }
+
+.lever-cards { display: grid; gap: 12px; margin-top: 12px; }
+@media (min-width: 600px) { .lever-cards { grid-template-columns: 1fr 1fr; } }
+.lever-card {
+  background: var(--bg); border: 1.5px solid var(--border);
+  border-radius: var(--radius); padding: 14px 16px;
+}
+.lever-card--top { border-color: var(--cyan); background: #f0faff; }
+.lever-card__lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
+.lever-card__amt { font-size: 24px; font-weight: 700; color: var(--navy); margin: 4px 0 2px; }
+.lever-card__det { font-size: 12px; color: var(--muted); }
+
+.conclusion-box {
+  background: linear-gradient(135deg, var(--navy), var(--blue));
+  border-radius: var(--radius); padding: 20px 24px; color: #fff; text-align: center;
+}
+.conclusion-box p { margin: 0; font-size: 15px; line-height: 1.55; }
+.conclusion-box .hint { color: rgba(255,255,255,.65); margin-top: 8px; font-size: 13px; }
+
+/* ── Quick Wins Finder ── */
+.signal-list { display: grid; gap: 8px; margin-top: 10px; }
+.signal-row {
+  display: flex; align-items: center; justify-content: space-between; gap: 12px;
+  background: var(--bg-card); border: 1.5px solid var(--border);
+  border-radius: var(--radius); padding: 12px 16px;
+}
+.signal-row__lbl { font-size: 14px; color: var(--navy); flex: 1; line-height: 1.4; }
+.signal-row__btns { display: flex; gap: 6px; flex-shrink: 0; }
+.signal-btn {
+  padding: 6px 16px; border-radius: 6px; font-size: 13px; font-weight: 700;
+  cursor: pointer; border: 1.5px solid var(--border); background: var(--bg);
+  color: var(--muted); font-family: Lato, sans-serif;
+  transition: border-color .12s, background .12s, color .12s;
+}
+.signal-btn:hover { border-color: var(--blue); color: var(--blue); }
+.signal-btn--oui.active { background: #eef7f2; border-color: #1a6b45; color: #1a6b45; }
+.signal-btn--non.active { background: #f5f5f5; border-color: #999; color: #555; }
+
+.qw-cards { display: grid; gap: 16px; }
+.qw-card { border: 2px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
+.qw-card__head {
+  background: var(--navy); color: #fff;
+  padding: 14px 18px; display: flex; align-items: center; gap: 14px;
+}
+.qw-card__num {
+  width: 30px; height: 30px; border-radius: 50%; background: var(--cyan); color: #fff;
+  font-size: 14px; font-weight: 700; flex-shrink: 0;
+  display: flex; align-items: center; justify-content: center;
+}
+.qw-card__head-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
+.qw-card__body { background: var(--bg-card); padding: 16px 18px; display: grid; gap: 12px; }
+.qw-card__result {
+  background: #eef7f2; border-left: 3px solid #1a6b45;
+  padding: 10px 14px; border-radius: 0 6px 6px 0;
+  font-size: 14px; color: #1a6b45; font-weight: 600;
+}
+.qw-section { display: grid; gap: 3px; }
+.qw-section__lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
+.qw-section__val { font-size: 14px; color: var(--navy); line-height: 1.45; }
+.qw-meta { display: flex; flex-wrap: wrap; gap: 8px; }
+.badge-effort { background: #f0f5ff; border: 1px solid #b3c8f5; color: #3a5fc8; border-radius: 4px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
+.badge-delay  { background: #f5f0fd; border: 1px solid #ccb3f5; color: #5e3b9e; border-radius: 4px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
+.impact-chips { display: flex; flex-wrap: wrap; gap: 6px; }
+.impact-chip  { background: #fff3e8; border: 1px solid #f5c49a; color: #b85c10; border-radius: 4px; padding: 2px 8px; font-size: 12px; }
+
+/* ── Coming-soon card ── */
+.pack-card--soon { position: relative; overflow: hidden; }
+.soon-overlay {
+  position: absolute; inset: 0;
+  background: rgba(23, 50, 88, 0.9);
+  border-radius: calc(var(--radius) - 2px);
+  display: flex; flex-direction: column;
+  align-items: center; justify-content: center; gap: 8px;
+  opacity: 0; transition: opacity .2s;
+}
+.pack-card--soon:hover .soon-overlay { opacity: 1; }
+.soon-overlay__label {
+  color: var(--cyan); font-size: 10px; font-weight: 700;
+  letter-spacing: 1.2px; text-transform: uppercase;
+}
+.soon-overlay__text { color: #fff; font-weight: 700; font-size: 15px; }
+.tag--soon { background: #f0f5ff; color: #3a5fc8; border-color: #b3c8f5; }
+
+/* ── Dialog ── */
+.dialog { border: none; padding: 0; background: transparent; }
+.dialog::backdrop { background: rgba(23,50,88,.45); }
+.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;
+}
+.dialog__head {
+  display: flex; justify-content: space-between; align-items: center;
+  padding: 16px 20px; border-bottom: 1px solid var(--border);
+}
+.dialog__head strong { font-size: 17px; font-weight: 700; color: var(--navy); }
+.dialog__body { padding: 18px 20px; }

+ 1230 - 0
public/assets/js/app.js

@@ -0,0 +1,1230 @@
+/* Audit Express Self — Livinweb */
+
+const appEl = document.getElementById('app');
+const API_BASE    = appEl?.dataset?.apiBase    || '/api';
+const BOOKING_URL = appEl?.dataset?.bookingUrl || '';
+const DEVIS_URL   = appEl?.dataset?.devisUrl   || '';
+
+/* ── Catalogue packs ── */
+const PACK_CATALOGUE = [
+  {
+    id: 'onboarding-v1',
+    title: 'Onboarding collaborateur',
+    desc: "Fiabilisez l'intégration de vos nouveaux collaborateurs : clarté du flux, traçabilité, continuité.",
+    tag: 'Pré-configuré',
+    tagStyle: '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.',
+    tag: 'Pré-configuré',
+    tagStyle: 'tag--pre',
+  },
+  {
+    id: 'process-generique',
+    title: 'Process générique',
+    desc: 'Applicable à tout process opérationnel : achat, production, relation client, support, projet…',
+    tag: 'Universel',
+    tagStyle: 'tag--new',
+  },
+  {
+    id: 'process-generique-v2',
+    title: 'Diagnostic d\'opportunité',
+    desc: 'Évaluez sur 8 axes si ce process est prioritaire à automatiser : friction, volume, risque, données, outils, variabilité, collaboration, déploiement.',
+    tag: 'V2 — 25 questions',
+    tagStyle: 'tag--v2',
+  },
+];
+
+/* ── Outils à venir ── */
+const COMING_SOON_TOOLS = [
+  {
+    id: 'process-mapper',
+    title: 'Process Mapper',
+    desc: 'Cartographiez visuellement votre process étape par étape, identifiez les goulots d\'étranglement et générez une documentation structurée prête à partager.',
+  },
+];
+
+const state = {
+  view: 'landing',
+  packId: null,
+  pack: null,
+  idx: 0,
+  answers: {},
+  optional: {},
+  result: null,
+  emailUnlocked: false,
+  captureEmail: '',
+  notifyTool: '',
+  roiInputs: { volume: '', tempsActuel: '', tempsCible: '', coutHoraire: '', tauxErreurs: '', tempsErreur: '', delaiActuel: '', delaiCible: '' },
+  roiResult: null,
+  qwfSignals: {},
+  qwfResult: null,
+};
+
+let autoAdvanceTimer = null;
+
+/* ── DOM helpers ── */
+function h(tag, attrs = {}, children = []) {
+  const el = document.createElement(tag);
+  for (const [k, v] of Object.entries(attrs || {})) {
+    if (k === 'class') el.className = v;
+    else if (k.startsWith('on') && typeof v === 'function') el.addEventListener(k.slice(2).toLowerCase(), v);
+    else if (v !== undefined && v !== null && v !== false) el.setAttribute(k, String(v));
+  }
+  for (const child of (Array.isArray(children) ? children : [children])) {
+    if (child == null) continue;
+    el.appendChild(typeof child === 'string' ? document.createTextNode(child) : child);
+  }
+  return el;
+}
+
+function storageKey(packId) { return `aes_${packId}_v1`; }
+
+function saveProgress() {
+  if (!state.packId) return;
+  localStorage.setItem(storageKey(state.packId), JSON.stringify({ answers: state.answers, optional: state.optional }));
+}
+
+function loadProgress(packId) {
+  try {
+    const obj = JSON.parse(localStorage.getItem(storageKey(packId)) || '{}');
+    return {
+      answers: typeof obj?.answers === 'object' ? obj.answers : {},
+      optional: typeof obj?.optional === 'object' ? obj.optional : {},
+    };
+  } catch { return { answers: {}, optional: {} }; }
+}
+
+async function apiJson(path, { method = 'GET', body } = {}) {
+  const res = await fetch(`${API_BASE}${path}`, {
+    method,
+    headers: body ? { 'Content-Type': 'application/json' } : undefined,
+    body: body ? JSON.stringify(body) : undefined,
+  });
+  const data = await res.json().catch(() => ({}));
+  if (!res.ok) throw new Error(data?.error || 'Erreur API');
+  return data;
+}
+
+function setView(v) { state.view = v; render(); }
+
+function goStart() {
+  Object.assign(state, { packId: null, pack: null, idx: 0, answers: {}, optional: {}, result: null, emailUnlocked: false, captureEmail: '' });
+  setView('select');
+}
+
+async function selectPack(packId) {
+  state.packId = packId;
+  const saved = loadProgress(packId);
+  state.answers = saved.answers;
+  state.optional = saved.optional;
+  try {
+    const data = await apiJson(`/pack.php?pack=${encodeURIComponent(packId)}`);
+    state.pack = data.pack;
+    state.idx = 0;
+    setView('intro');
+  } catch (e) {
+    alert('Impossible de charger le pack : ' + (e.message || ''));
+  }
+}
+
+function levelColor(level) {
+  return { A: '#1e8a5e', B: '#1e8a5e', C: '#c07c10', D: '#b83040' }[level] || '#2F506D';
+}
+
+/* ── LANDING ── */
+function renderLanding() {
+  return h('div', { class: 'grid' }, [
+    h('div', { class: 'card' }, [
+      h('div', { style: 'margin-bottom:14px' }, [
+        h('span', { class: 'tag tag--pre', style: 'font-size:12px' }, ['Diagnostic self-serve']),
+      ]),
+      h('h1', { class: 'h1' }, ['Contrôle technique de votre process opérationnel']),
+      h('p', { class: 'lead' }, [
+        'En 7 minutes, obtenez une note sur 100, vos risques probables et 5 actions prioritaires pour fiabiliser votre process.'
+      ]),
+      h('ul', { class: 'bullets' }, [
+        h('li', {}, ['20 questions, 1 écran à la fois, langage simple']),
+        h('li', {}, ['Résultats immédiats — PDF 1 page partageable']),
+        h('li', {}, ['Données minimales, suppression sur demande']),
+      ]),
+      h('div', { class: 'btnrow' }, [
+        h('button', { class: 'btn btn--primary', onClick: goStart }, ['Lancer le contrôle technique →']),
+        BOOKING_URL
+          ? h('a', { class: 'btn btn--outline', href: '#exemple', onClick: (e) => { e.preventDefault(); showExemple(); } }, ['Voir un exemple de résultat'])
+          : null,
+      ]),
+      h('p', { class: 'hint' }, ['Aucun jargon. Aucun discours "outil". Juste un diagnostic actionnable.']),
+    ]),
+    h('div', { class: 'grid--2 grid', style: 'margin-top:0' }, [
+      ...PACK_CATALOGUE.map(p =>
+        h('div', { class: 'pack-card', style: 'cursor:default; opacity:.75' }, [
+          h('span', { class: `tag ${p.tagStyle}` }, [p.tag]),
+          h('div', { class: 'title', style: 'margin-top:8px' }, [p.title]),
+          h('div', { class: 'desc' }, [p.desc]),
+        ])
+      ),
+      ...COMING_SOON_TOOLS.map(makeComingSoonCard),
+    ]),
+    renderNotifyDialog(),
+  ]);
+}
+
+function showExemple() {
+  alert(
+    'Exemple de résultat :\n\n' +
+    'Score : 67/100 — Niveau C (Fragile)\n' +
+    '• Clarté du flux : 14/20\n• Fiabilité : 11/20\n• Traçabilité : 10/20\n' +
+    '• Résilience : 15/20\n• Coût caché : 17/20\n\n' +
+    'Risques : Statut flou → relances permanentes / Documents dispersés / Dépendance personne clé\n\n' +
+    'Quick wins : Checklist jour 1 prêt · Pré-check 48h · Tableau statut unique · Centraliser docs · Escalade simple'
+  );
+}
+
+/* ── COMING-SOON card helper ── */
+function makeComingSoonCard(tool) {
+  return h('div', {
+    class: 'pack-card pack-card--soon',
+    onClick: () => {
+      state.notifyTool = tool.id;
+      document.getElementById('notifyDialog')?.showModal();
+    },
+  }, [
+    h('span', { class: 'tag tag--soon' }, ['Bientôt disponible']),
+    h('div', { class: 'title', style: 'margin-top:8px' }, [tool.title]),
+    h('div', { class: 'desc' }, [tool.desc]),
+    h('div', { class: 'soon-overlay' }, [
+      h('div', { class: 'soon-overlay__label' }, ['Bientôt disponible']),
+      h('div', { class: 'soon-overlay__text' }, ['Me notifier du lancement →']),
+    ]),
+  ]);
+}
+
+/* ── NOTIFY DIALOG (Coming soon) ── */
+function renderNotifyDialog() {
+  const toolMeta = COMING_SOON_TOOLS.find(t => t.id === state.notifyTool);
+  const toolName = toolMeta?.title || 'cet outil';
+
+  const onSubmit = async (e) => {
+    e.preventDefault();
+    const email = e.target.querySelector('input[type="email"]').value.trim();
+    if (!email) return;
+    const btn = e.target.querySelector('button[type="submit"]');
+    btn.disabled = true;
+    btn.textContent = 'Envoi…';
+    try {
+      await apiJson('/notify.php', { method: 'POST', body: { email, tool: state.notifyTool } });
+      const body = document.querySelector('#notifyDialog .dialog__body');
+      if (body) {
+        body.innerHTML = '';
+        body.appendChild(h('div', { style: 'text-align:center;padding:20px 0' }, [
+          h('div', { style: 'font-size:36px;margin-bottom:12px;color:var(--good)' }, ['✓']),
+          h('div', { class: 'h2', style: 'color:var(--good);margin-bottom:8px' }, ['C\'est noté !']),
+          h('p', { class: 'lead' }, [`Vous serez parmi les premiers informés du lancement de ${toolName}.`]),
+          h('button', {
+            class: 'btn btn--primary', style: 'margin-top:16px',
+            onClick: () => document.getElementById('notifyDialog')?.close(),
+          }, ['Fermer']),
+        ]));
+      }
+    } catch (err) {
+      btn.disabled = false;
+      btn.textContent = 'Me prévenir au lancement →';
+      alert('Erreur : ' + (err.message || 'Réessayez.'));
+    }
+  };
+
+  return h('dialog', { id: 'notifyDialog', class: 'dialog' }, [
+    h('div', { class: 'dialog__inner' }, [
+      h('div', { class: 'dialog__head' }, [
+        h('strong', {}, [`Soyez informé : ${toolName}`]),
+        h('button', {
+          class: 'btn btn--outline', style: 'padding:6px 12px;font-size:13px', type: 'button',
+          onClick: () => document.getElementById('notifyDialog')?.close(),
+        }, ['Fermer']),
+      ]),
+      h('div', { class: 'dialog__body' }, [
+        h('p', { class: 'lead', style: 'margin-bottom:16px' }, [
+          `${toolName} est en cours de développement. Laissez votre email et on vous prévient en priorité au lancement.`,
+        ]),
+        h('form', { onSubmit }, [
+          h('div', { class: 'field' }, [
+            h('label', { for: 'notifyEmail' }, ['Email professionnel']),
+            h('input', {
+              id: 'notifyEmail', type: 'email', required: 'required',
+              placeholder: 'vous@entreprise.com', autocomplete: 'email',
+            }),
+          ]),
+          h('div', { class: 'btnrow', style: 'margin-top:14px' }, [
+            h('button', { class: 'btn btn--primary', type: 'submit' }, ['Me prévenir au lancement →']),
+          ]),
+          h('p', { class: 'hint' }, ['Aucun spam. Désabonnement en 1 clic.']),
+        ]),
+      ]),
+    ]),
+  ]);
+}
+
+/* ── SELECT ── */
+function renderSelect() {
+  const makeCard = (p) =>
+    h('div', { class: 'pack-card', onClick: () => selectPack(p.id) }, [
+      h('span', { class: `tag ${p.tagStyle}` }, [p.tag]),
+      h('div', { class: 'title' }, [p.title, h('span', { class: 'arrow' }, [' →'])]),
+      h('div', { class: 'desc' }, [p.desc]),
+    ]);
+
+  const preConfigured = PACK_CATALOGUE.filter(p => p.id !== 'process-generique' && p.id !== 'process-generique-v2');
+  const generic   = PACK_CATALOGUE.find(p => p.id === 'process-generique');
+  const genericV2 = PACK_CATALOGUE.find(p => p.id === 'process-generique-v2');
+
+  return h('div', { class: 'grid' }, [
+    h('div', { class: 'card' }, [
+      h('h1', { class: 'h1' }, ['Choisissez le process à diagnostiquer']),
+      h('p', { class: 'lead' }, ['Sélectionnez un pack pré-configuré ou utilisez le questionnaire universel.']),
+
+      h('div', { class: 'section-label', style: 'margin-top:18px' }, ['Packs pré-configurés']),
+      h('div', { class: 'grid grid--2' }, preConfigured.map(makeCard)),
+
+      h('div', { class: 'section-label', style: 'margin-top:18px' }, ['Process universel']),
+      h('div', { class: 'grid grid--2' }, [
+        generic   ? makeCard(generic)   : null,
+        genericV2 ? makeCard(genericV2) : null,
+      ]),
+
+      h('div', { class: 'section-label', style: 'margin-top:18px' }, ['Outils complémentaires']),
+      h('div', { class: 'grid grid--2' }, [
+        h('div', { class: 'pack-card', onClick: () => setView('roi') }, [
+          h('span', { class: 'tag tag--roi' }, ['ROI Calculator']),
+          h('div', { class: 'title' }, ['ROI Calculator', h('span', { class: 'arrow' }, [' →'])]),
+          h('div', { class: 'desc' }, ['Transformez "ça nous coûte" en "ça vaut X €". 10 questions pour chiffrer le gain mensuel, le ROI annuel et les 2 leviers qui pèsent le plus.']),
+        ]),
+        h('div', { class: 'pack-card', onClick: () => setView('qwf') }, [
+          h('span', { class: 'tag tag--qwf' }, ['Quick Wins Finder']),
+          h('div', { class: 'title' }, ['Quick Wins Finder', h('span', { class: 'arrow' }, [' →'])]),
+          h('div', { class: 'desc' }, ['3 actions concrètes et personnalisées basées sur vos signaux — résultat attendu, effort estimé et délai typique pour chaque recommandation.']),
+        ]),
+      ]),
+
+      h('div', { class: 'section-label', style: 'margin-top:18px' }, ['Bientôt disponible']),
+      h('div', { class: 'grid grid--2' }, COMING_SOON_TOOLS.map(makeComingSoonCard)),
+
+      h('div', { class: 'btnrow', style: 'margin-top:18px' }, [
+        h('button', { class: 'btn btn--outline', onClick: () => setView('landing') }, ['← Retour']),
+      ]),
+    ]),
+    renderNotifyDialog(),
+  ]);
+}
+
+/* ── INTRO ── */
+function renderIntro() {
+  const meta = PACK_CATALOGUE.find(p => p.id === state.packId);
+  const answeredCount = Object.keys(state.answers).length;
+  const total = state.pack?.questions?.length || 20;
+  const hasSaved = answeredCount > 0;
+
+  const startFresh = () => {
+    state.answers = {};
+    state.optional = {};
+    state.idx = 0;
+    state.emailUnlocked = false;
+    state.captureEmail = '';
+    saveProgress();
+    setView('quiz');
+  };
+
+  const resume = () => {
+    const qs = state.pack?.questions || [];
+    let resumeIdx = 0;
+    for (let i = 0; i < qs.length; i++) {
+      if (state.answers[qs[i].id]) resumeIdx = i;
+    }
+    state.idx = Math.min(resumeIdx + 1, qs.length - 1);
+    setView('quiz');
+  };
+
+  return h('div', { class: 'grid' }, [
+    h('div', { class: 'card' }, [
+      h('span', { class: `tag ${meta?.tagStyle || ''}`, style: 'margin-bottom:12px;display:inline-block' }, [
+        state.pack?.pack_title || '',
+      ]),
+      h('h1', { class: 'h1' }, ['Avant de commencer']),
+      h('p', { class: 'lead' }, [
+        'Répondez franchement. Le score sert à prioriser, pas à juger. ',
+        'Temps estimé : 7 minutes. Questions : 20.',
+      ]),
+      state.pack?.pack_description
+        ? h('p', { style: 'color:var(--muted);font-size:14px;margin-top:0' }, [state.pack.pack_description])
+        : null,
+      hasSaved
+        ? h('div', { class: 'resume-notice' }, [
+            h('span', {}, [`Progression sauvegardée : ${answeredCount} / ${total} questions`]),
+          ])
+        : null,
+      h('div', { class: 'btnrow' }, [
+        h('button', { class: 'btn btn--outline', onClick: () => setView('select') }, ['← Choisir un autre pack']),
+        hasSaved
+          ? h('button', { class: 'btn btn--outline', onClick: startFresh }, ['Recommencer à zéro'])
+          : null,
+        h('button', { class: 'btn btn--primary', onClick: hasSaved ? resume : startFresh }, [
+          hasSaved ? `Reprendre (Q${Math.min(Object.keys(state.answers).length + 1, total)}) →` : 'Commencer →',
+        ]),
+      ]),
+    ]),
+  ]);
+}
+
+/* ── QUIZ ── */
+function renderQuiz() {
+  const q = state.pack?.questions?.[state.idx];
+  if (!q) return h('div', { class: 'card' }, ['Chargement…']);
+
+  const total = state.pack.questions.length;
+  const pos = state.idx + 1;
+  const pct = Math.round(((pos - 1) / total) * 100);
+  const selected = state.answers[q.id] || '';
+
+  const opts = (q.options || []).map(opt => {
+    const id = `opt_${q.id}_${opt.id}`;
+    const isSelected = selected === opt.id;
+    const isNa = opt.id === 'NA' || opt.id.toLowerCase().endsWith('_na');
+    return h('label', { class: `opt${isSelected ? ' opt--selected' : ''}${isNa ? ' opt--na' : ''}`, for: id }, [
+      h('input', {
+        id, type: 'radio', name: q.id, value: opt.id,
+        checked: isSelected ? 'checked' : null,
+        onChange: (e) => {
+          state.answers[q.id] = e.target.value;
+          saveProgress();
+          render();
+          if (autoAdvanceTimer) clearTimeout(autoAdvanceTimer);
+          autoAdvanceTimer = setTimeout(() => {
+            autoAdvanceTimer = null;
+            const t = state.pack?.questions?.length || 0;
+            if (state.idx < t - 1) { state.idx++; saveProgress(); render(); }
+            else setView('optional');
+          }, 380);
+        },
+      }),
+      h('div', {}, [h('strong', {}, [opt.label])]),
+    ]);
+  });
+
+  const canPrev = state.idx > 0;
+  const canNext = !!selected;
+  const isLast = state.idx === total - 1;
+
+  const next = async () => {
+    if (!canNext) return;
+    if (!isLast) { state.idx++; saveProgress(); render(); return; }
+    setView('optional');
+  };
+
+  return h('div', { class: 'grid' }, [
+    h('div', { class: 'card' }, [
+      h('div', { class: 'quizHead' }, [
+        h('span', { class: 'tag', style: 'font-size:11px' }, [state.pack.pack_title]),
+        h('div', { class: 'quizStep' }, [
+          h('strong', {}, [`${pos}`]),
+          h('span', {}, [` / ${total}`]),
+        ]),
+      ]),
+      h('div', { class: 'progressWrap' }, [
+        h('div', { class: 'progress' }, [h('div', { style: `width:${pct}%` })]),
+        h('div', { class: 'progressMeta' }, [
+          h('span', { class: 'progressPct' }, [`${pct}\u00a0%`]),
+          h('span', { class: 'progressRemain' }, [
+            isLast ? 'Dernière question' : `encore ${total - pos} question${total - pos > 1 ? 's' : ''}`,
+          ]),
+        ]),
+      ]),
+      h('div', { class: 'qTitle' }, [q.label]),
+      q.help ? h('p', { class: 'qHelp' }, [q.help]) : null,
+      h('div', { class: 'options' }, opts),
+      h('div', { class: 'btnrow', style: 'margin-top:18px' }, [
+        h('button', { class: 'btn btn--outline', disabled: canPrev ? null : 'disabled', onClick: () => { state.idx--; saveProgress(); render(); } }, ['← Précédent']),
+        h('button', { class: `btn ${canNext ? 'btn--primary' : 'btn--outline'}`, disabled: canNext ? null : 'disabled', onClick: next }, [
+          isLast ? 'Voir mon résultat →' : 'Suivant →',
+        ]),
+      ]),
+      h('p', { class: 'hint', style: 'margin-top:10px' }, ['Vous pouvez modifier vos réponses avant la fin.']),
+    ]),
+  ]);
+}
+
+/* ── OPTIONAL ── */
+function renderOptional() {
+  const opt = state.pack?.optional_questions || {};
+  const volumeKey = Object.keys(opt).find(k => opt[k]?.required_for_cost);
+  const volumeQ = volumeKey ? opt[volumeKey] : null;
+  const hourlyQ = opt.hourly_cost || null;
+
+  const makeRadioGroup = (q, stateKey) => {
+    const cur = state.optional[stateKey];
+    return h('div', { class: 'field' }, [
+      h('label', {}, [q.label]),
+      h('div', { class: 'options', style: 'margin-top:6px' }, q.options.map(o => {
+        const id = `opt_${stateKey}_${o.id}`;
+        const val = String(o.value ?? o.id);
+        return h('label', { class: 'opt', for: id }, [
+          h('input', {
+            id, type: 'radio', name: stateKey, value: val,
+            checked: String(cur) === val ? 'checked' : null,
+            onChange: (e) => { state.optional[stateKey] = Number(e.target.value); saveProgress(); },
+          }),
+          h('div', {}, [h('strong', {}, [o.label])]),
+        ]);
+      })),
+    ]);
+  };
+
+  const compute = async () => {
+    try {
+      const data = await apiJson('/score.php', {
+        method: 'POST',
+        body: { pack_id: state.packId, answers: state.answers, optional: state.optional },
+      });
+      state.result = data.result;
+      saveProgress();
+      setView('results');
+    } catch (e) { alert(e.message || 'Erreur'); }
+  };
+
+  return h('div', { class: 'grid' }, [
+    h('div', { class: 'card' }, [
+      h('span', { class: 'tag tag--new', style: 'margin-bottom:12px;display:inline-block' }, ['Optionnel']),
+      h('h1', { class: 'h1' }, ['Quelques infos pour le coût caché']),
+      h('p', { class: 'lead' }, ['Ces données servent uniquement à estimer le coût caché en heures/mois (indicatif). Vous pouvez passer.']),
+      volumeQ ? makeRadioGroup(volumeQ, volumeKey) : null,
+      hourlyQ  ? makeRadioGroup(hourlyQ, 'hourly_cost') : null,
+      h('div', { class: 'btnrow', style: 'margin-top:20px' }, [
+        h('button', { class: 'btn btn--outline', onClick: () => setView('quiz') }, ['← Retour']),
+        h('button', { class: 'btn btn--primary', onClick: compute }, ['Voir mes résultats →']),
+      ]),
+    ]),
+  ]);
+}
+
+/* ── RESULTS ── */
+function renderResults() {
+  const r = state.result;
+  if (!r) return h('div', { class: 'card' }, ['Calcul en cours…']);
+
+  const dotColor = levelColor(r.level);
+  const cost = r.cost_hidden;
+  const unlocked = state.emailUnlocked;
+
+  const pillarRows = (r.pillars || []).map(p => {
+    const pct = p.max ? Math.round((p.score / p.max) * 100) : 0;
+    return h('div', { class: 'pRow' }, [
+      h('div', { class: 'name' }, [p.label]),
+      h('div', { class: 'val'  }, [`${p.score}/${p.max}`]),
+      h('div', { class: 'bar' }, [h('div', { style: `width:${pct}%` })]),
+    ]);
+  });
+
+  const riskItems = (r.risks_top3 || []).map(x =>
+    h('li', {}, [
+      h('strong', {}, [x.title]),
+      h('div', { class: 'hint' }, [x.what_happens]),
+    ])
+  );
+
+  const winItems = (r.quick_wins_preview || []).map(x =>
+    h('li', {}, [
+      h('strong', {}, [x.title]),
+      h('div', { class: 'hint' }, [`${x.effect} · Effort : ${x.effort}`]),
+    ])
+  );
+
+  /* ── V2 Diagnostic ── */
+  const v2 = r.v2_diagnostic || null;
+
+  const renderV2Diagnostic = () => {
+    if (!v2) return null;
+    const potColor  = v2.potentiel  >= 70 ? '#1e8a5e' : v2.potentiel  >= 40 ? '#c07c10' : '#b83040';
+    const cplxColor = v2.complexite <= 35 ? '#1e8a5e' : v2.complexite <= 65 ? '#c07c10' : '#b83040';
+    const verdictColor = { prioritaire: '#1e8a5e', candidat: '#c07c10', attente: '#5e789a' }[v2.verdict.code] || '#2F506D';
+
+    const meter = (score, label, color) =>
+      h('div', { class: 'v2-meter' }, [
+        h('div', { class: 'v2-meter__num', style: `color:${color}` }, [String(score)]),
+        h('div', { class: 'v2-meter__sub' }, ['/100']),
+        h('div', { class: 'v2-meter__lbl' }, [label]),
+        h('div', { class: 'v2-meter__track' }, [
+          h('div', { class: 'v2-meter__fill', style: `width:${score}%;background:${color}` }),
+        ]),
+      ]);
+
+    return h('div', { class: 'card v2-diagnostic' }, [
+      h('div', { class: 'v2-meters' }, [
+        meter(v2.potentiel,  'Potentiel d\'automatisation', potColor),
+        meter(v2.complexite, 'Complexité de mise en œuvre', cplxColor),
+      ]),
+      h('div', { class: 'v2-badges' }, [
+        h('span', { class: 'v2-verdict-badge', style: `border-color:${verdictColor};color:${verdictColor}` }, [
+          `${v2.verdict.label} — ${v2.verdict.desc}`,
+        ]),
+        h('span', { class: `v2-tag-badge${v2.tag === 'quick_win' ? ' v2-tag-badge--qw' : ' v2-tag-badge--proj'}` }, [
+          v2.tag_label,
+        ]),
+      ]),
+    ]);
+  };
+
+  const renderMiniPlan = () => {
+    if (!v2 || !unlocked) return null;
+    const actionList = (items, startNum) =>
+      h('ol', { class: 'v2-plan-list', start: String(startNum) },
+        (items || []).map(a => h('li', {}, [
+          h('strong', {}, [a.title]),
+          h('span', { class: 'hint' }, [` — ${a.effect} · Effort : ${a.effort}`]),
+        ]))
+      );
+
+    return h('div', { class: 'v2-mini-plan' }, [
+      h('div', { class: 'v2-plan-cols' }, [
+        h('div', { class: 'card v2-plan-section' }, [
+          h('div', { class: 'v2-plan-title' }, ['3 actions immédiates']),
+          actionList(v2.actions, 1),
+        ]),
+        h('div', { class: 'card v2-plan-section v2-plan-section--qw' }, [
+          h('div', { class: 'v2-plan-title' }, ['2 quick wins possibles']),
+          actionList(v2.quick_wins, 4),
+        ]),
+      ]),
+      v2.risque_majeur ? h('div', { class: 'v2-plan-risk-block' }, [
+        h('div', { class: 'v2-plan-title v2-plan-title--risk' }, ['1 risque majeur à adresser en parallèle']),
+        h('div', { class: 'v2-plan-risk-card' }, [
+          h('strong', {}, [v2.risque_majeur.title]),
+          h('p', { class: 'hint', style: 'margin-top:4px' }, [v2.risque_majeur.what_happens]),
+        ]),
+      ]) : null,
+    ]);
+  };
+
+  /* ── Unlock gate ── */
+  const renderUnlockGate = () => {
+    const onUnlock = (e) => {
+      e.preventDefault();
+      const email = e.target.querySelector('input[type="email"]').value.trim();
+      if (!email.includes('@') || email.length < 5) return;
+      state.captureEmail = email;
+      state.emailUnlocked = true;
+      saveProgress();
+      render();
+      setTimeout(() => document.getElementById('pdfDialog')?.showModal(), 80);
+    };
+
+    /* Teaser basé sur les vrais risques calculés */
+    const teaser = (r.risks_top3 || []).slice(0, 3).map(x => ({
+      title: x.title,
+      desc: x.what_happens,
+    }));
+
+    return h('div', { class: 'unlock-gate' }, [
+      h('div', { class: 'unlock-gate__inner' }, [
+        h('div', { class: 'unlock-gate__icon' }, ['↓']),
+        h('div', { class: 'h2', style: 'margin-bottom:6px' }, ['Débloquez vos axes d\'amélioration']),
+        h('p', { class: 'lead', style: 'margin-bottom:20px' }, [
+          'Entrez votre email professionnel pour accéder aux 5 actions prioritaires et télécharger votre PDF synthèse.',
+        ]),
+
+        teaser.length ? h('div', { class: 'unlock-risks' }, teaser.map((t, i) =>
+          h('div', { class: 'unlock-risk' }, [
+            h('div', { class: 'unlock-risk__num' }, [String(i + 1)]),
+            h('div', { class: 'unlock-risk__body' }, [
+              h('strong', {}, [t.title]),
+              h('span', {}, [t.desc]),
+            ]),
+          ])
+        )) : null,
+
+        h('form', { class: 'unlock-form', onSubmit: onUnlock }, [
+          h('div', { class: 'unlock-row' }, [
+            h('input', {
+              type: 'email', required: 'required',
+              placeholder: 'vous@entreprise.com',
+              autocomplete: 'email',
+            }),
+            h('button', { class: 'btn btn--primary btn--unlock', type: 'submit' }, ['Débloquer →']),
+          ]),
+          h('p', { class: 'hint', style: 'margin-top:8px;text-align:center' }, [
+            'Aucun spam. Désinscription en 1 clic.',
+          ]),
+        ]),
+      ]),
+    ]);
+  };
+
+  /* ── CTAs débloqués ── */
+  const renderUnlockedCtas = () =>
+    h('div', { class: 'unlocked-ctas' }, [
+      h('div', { class: 'unlocked-ctas__inner' }, [
+
+        /* En-tête */
+        h('div', { class: 'h2', style: 'margin-bottom:6px' }, ['Et maintenant ?']),
+        h('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 avec les bons outils digitaux.',
+        ]),
+
+        /* CTAs commerciaux */
+        h('div', { class: 'cta-block' }, [
+          BOOKING_URL ? h('a', {
+            class: 'btn btn--primary btn--cta-main',
+            href: BOOKING_URL, target: '_blank', rel: 'noreferrer',
+          }, ['📅\u00a0 Réserver un appel découverte gratuit — 30 min']) : null,
+
+          DEVIS_URL ? h('a', {
+            class: 'btn btn--outline btn--cta-secondary',
+            href: DEVIS_URL,
+          }, ['✉\u00a0 Demander un devis']) : null,
+        ]),
+
+        h('p', { class: 'hint', style: 'text-align:center;margin-top:10px' }, [
+          'Pas d\'engagement. On analyse vos résultats ensemble et on vous propose une solution adaptée.',
+        ]),
+
+        /* Séparateur */
+        h('hr', { style: 'border:none;border-top:1px solid var(--border,#e2e8f0);margin:24px 0' }),
+
+        /* Actions secondaires */
+        h('div', { class: 'btnrow', style: 'justify-content:center;gap:10px' }, [
+          h('button', {
+            class: 'btn btn--outline',
+            onClick: () => document.getElementById('pdfDialog')?.showModal(),
+          }, ['⬇\u00a0 Télécharger mon PDF']),
+          h('button', {
+            class: 'btn btn--outline',
+            style: 'font-size:13px',
+            onClick: goStart,
+          }, ['Diagnostiquer un autre process']),
+        ]),
+      ]),
+    ]);
+
+  return h('div', { class: 'grid' }, [
+
+    /* Score header */
+    h('div', { class: 'card' }, [
+      h('div', { style: 'display:flex;align-items:center;gap:10px;margin-bottom:16px' }, [
+        h('span', { class: 'tag' }, [state.pack?.pack_title || '']),
+      ]),
+      h('div', { class: 'scoreBox' }, [
+        h('div', {}, [
+          h('div', { class: 'scoreLabel' }, ['Score global']),
+          h('div', { class: 'scoreBig' }, [`${r.score_total}/100`]),
+          h('div', { class: 'level-badge', style: 'margin-top:10px' }, [
+            h('span', { class: 'level-dot', style: `background:${dotColor}` }),
+            h('span', {}, [`${r.level} — ${r.level_label}`]),
+          ]),
+          h('div', { class: 'confidence' }, [`Confiance du diagnostic : ${r.confidence?.label || ''}`]),
+        ]),
+      ]),
+      h('div', { class: 'pillars' }, pillarRows),
+    ]),
+
+    /* V2 : carte diagnostic (toujours visible) */
+    v2 ? renderV2Diagnostic() : null,
+
+    /* Non-V2 : risques (toujours visibles) */
+    !v2 ? h('div', { class: 'card' }, [
+      h('div', { class: 'h2' }, ['3 risques probables']),
+      riskItems.length
+        ? h('ol', { class: 'list' }, riskItems)
+        : h('p', { class: 'muted small' }, ['Aucun risque majeur détecté.']),
+    ]) : null,
+
+    /* Non-V2 : coût caché */
+    !v2 && cost ? h('div', { class: 'cost-block' }, [
+      h('div', { class: 'h2' }, ['Coût caché estimé']),
+      h('div', { class: 'cost-figures' }, [
+        h('div', { class: 'cost-fig' }, [
+          h('span', { class: 'val' }, [`${cost.hours_per_month} h`]),
+          h('span', { class: 'lbl' }, ['par mois (estimé)']),
+        ]),
+        h('div', { class: 'cost-fig' }, [
+          h('span', { class: 'val' }, [`~${cost.eur_per_month} €`]),
+          h('span', { class: 'lbl' }, ['par mois (indicatif)']),
+        ]),
+      ]),
+      h('p', { class: 'hint' }, ['Estimation indicative, à valider par mesure réelle.']),
+    ]) : null,
+
+    /* Gate ou contenu débloqué */
+    unlocked ? null : renderUnlockGate(),
+
+    /* V2 : mini plan (débloqué) */
+    v2 ? renderMiniPlan() : null,
+
+    /* Non-V2 : quick wins (débloqués) */
+    !v2 && unlocked ? h('div', { class: 'card' }, [
+      h('div', { class: 'h2' }, ['5 quick wins prioritaires']),
+      winItems.length
+        ? h('ol', { class: 'list' }, winItems)
+        : h('p', { class: 'muted small' }, ['—']),
+      h('p', { class: 'hint', style: 'margin-top:8px' }, ['Le PDF contient les 5 actions avec détail effort/impact.']),
+    ]) : null,
+
+    /* CTA débloqué */
+    unlocked ? renderUnlockedCtas() : null,
+
+    renderPdfDialog(),
+  ]);
+}
+
+/* ── PDF DIALOG ── */
+function renderPdfDialog() {
+  const onSubmit = async (e) => {
+    e.preventDefault();
+    const email = e.target.email.value.trim();
+    if (!email) return;
+    try {
+      const res = await fetch(`${API_BASE}/pdf.php`, {
+        method: 'POST',
+        headers: { 'Content-Type': 'application/json' },
+        body: JSON.stringify({
+          pack_id: state.packId, answers: state.answers,
+          optional: state.optional, booking_url: BOOKING_URL, email,
+        }),
+      });
+      if (!res.ok) { const j = await res.json().catch(() => ({})); throw new Error(j?.error || 'Erreur PDF'); }
+      const blob = await res.blob();
+      const url = URL.createObjectURL(blob);
+      const a = document.createElement('a');
+      a.href = url; a.download = `controle-technique-${state.packId}.pdf`;
+      document.body.appendChild(a); a.click(); a.remove(); URL.revokeObjectURL(url);
+      document.getElementById('pdfDialog')?.close();
+    } catch (err) { alert(err.message || 'Erreur'); }
+  };
+
+  return h('dialog', { id: 'pdfDialog', class: 'dialog' }, [
+    h('form', { class: 'dialog__inner', onSubmit }, [
+      h('div', { class: 'dialog__head' }, [
+        h('strong', {}, ['Télécharger votre synthèse PDF']),
+        h('button', { class: 'btn btn--outline', style: 'padding:6px 12px;font-size:13px', type: 'button',
+          onClick: () => document.getElementById('pdfDialog')?.close() }, ['Fermer']),
+      ]),
+      h('div', { class: 'dialog__body' }, [
+        h('div', { class: 'field' }, [
+          h('label', { for: 'pdfEmail' }, ['Email professionnel']),
+          h('input', {
+            id: 'pdfEmail', name: 'email', type: 'email', required: 'required',
+            placeholder: 'vous@entreprise.com',
+            value: state.captureEmail || '',
+          }),
+        ]),
+        h('label', { class: 'check' }, [
+          h('input', { type: 'checkbox', required: 'required' }),
+          h('span', {}, ['J\'accepte de recevoir mon PDF et un email de suivi éventuel.']),
+        ]),
+        h('div', { class: 'btnrow', style: 'margin-top:14px' }, [
+          h('button', { class: 'btn btn--primary', type: 'submit' }, ['Télécharger mon PDF →']),
+        ]),
+        h('p', { class: 'hint' }, ['Désinscription en 1 clic. Suppression des données sur demande.']),
+      ]),
+    ]),
+  ]);
+}
+
+/* ════════════════════════════════════════════════════
+   ROI CALCULATOR — données & calcul
+════════════════════════════════════════════════════ */
+
+const ROI_DEFAULTS = { coutHoraire: 60, tauxErreurs: 10, tempsErreur: 15 };
+
+function computeRoi(inp) {
+  const v   = Math.max(0, parseFloat(inp.volume)      || 0);
+  const tA  = Math.max(0, parseFloat(inp.tempsActuel) || 0);
+  const tC  = Math.max(0, parseFloat(inp.tempsCible)  || 0);
+  const ch  = inp.coutHoraire !== '' ? (parseFloat(inp.coutHoraire) || 0) : ROI_DEFAULTS.coutHoraire;
+  const te  = inp.tauxErreurs !== '' ? (parseFloat(inp.tauxErreurs) || 0) : ROI_DEFAULTS.tauxErreurs;
+  const tpe = inp.tempsErreur !== '' ? (parseFloat(inp.tempsErreur) || 0) : ROI_DEFAULTS.tempsErreur;
+
+  const usedDefaults = [inp.coutHoraire, inp.tauxErreurs, inp.tempsErreur].filter(x => x === '').length;
+  const confidence   = usedDefaults === 0 ? 'Fort' : usedDefaults <= 1 ? 'Moyen' : 'Faible';
+
+  const gainTempsMin   = v * Math.max(0, tA - tC);
+  const gainTempsH     = gainTempsMin / 60;
+  const gainTraitement = gainTempsH * ch;
+
+  const nbErreurs      = v * (te / 100);
+  const gainErreursMin = nbErreurs * tpe;
+  const gainErreursH   = gainErreursMin / 60;
+  const gainErreurs    = gainErreursH * ch;
+
+  const roiMensuel = gainTraitement + gainErreurs;
+  const roiAnnuel  = roiMensuel * 12;
+
+  const levers = [
+    { label: 'Gain de traitement',    euros: gainTraitement, heures: gainTempsH,   detail: `${v} cas × ${Math.max(0, tA - tC)} min gagnées` },
+    { label: 'Réduction des erreurs', euros: gainErreurs,    heures: gainErreursH, detail: `~${Math.round(nbErreurs * 10) / 10} erreurs évitées × ${tpe} min` },
+  ].sort((a, b) => b.euros - a.euros);
+
+  const conclusion =
+    roiAnnuel >= 50000 ? 'À ce niveau, l\'investissement se rentabilise en quelques semaines — difficile de ne pas le faire.' :
+    roiAnnuel >= 20000 ? 'À ce niveau, ça se rentabilise en moins de 3 mois sur la plupart des projets.' :
+    roiAnnuel >= 5000  ? 'Des gains concrets et mesurables — suffisant pour déclencher une discussion interne.' :
+                         'Des gains modestes en valeur absolue, mais chaque heure récupérée libère du temps à forte valeur.';
+
+  return { gainTempsH, gainTraitement, gainErreursH, gainErreurs, roiMensuel, roiAnnuel, levers, conclusion, confidence, usedDefaults };
+}
+
+function renderRoi() {
+  const inp = state.roiInputs;
+
+  const roiField = (key, label, unit, required, placeholder, defHint) =>
+    h('div', { class: 'roi-field' }, [
+      h('label', { for: `roi_${key}` }, [
+        label,
+        h('span', { class: 'roi-unit' }, [` (${unit})`]),
+      ]),
+      h('input', {
+        id: `roi_${key}`, type: 'number', min: '0', step: 'any',
+        required: required ? 'required' : null,
+        placeholder: placeholder != null ? String(placeholder) : undefined,
+        value: inp[key] !== undefined ? String(inp[key]) : '',
+        onInput: (e) => { state.roiInputs[key] = e.target.value; },
+      }),
+      defHint ? h('div', { class: 'field-hint' }, [defHint]) : null,
+    ]);
+
+  return h('div', { class: 'grid' }, [
+    h('form', { class: 'card', onSubmit: (e) => { e.preventDefault(); state.roiResult = computeRoi(state.roiInputs); setView('roi-results'); } }, [
+      h('div', { style: 'margin-bottom:14px' }, [h('span', { class: 'tag tag--roi' }, ['ROI Calculator'])]),
+      h('h1', { class: 'h1' }, ['Calculez le gain potentiel de votre optimisation']),
+      h('p', { class: 'lead' }, [
+        'Renseignez vos données — les valeurs par défaut permettent d\'avancer sans avoir tous les chiffres.',
+      ]),
+
+      h('div', { class: 'section-label', style: 'margin-top:18px' }, ['Données de base']),
+      h('p', { class: 'hint', style: 'margin:0 0 10px' }, ['Ces 3 champs sont nécessaires au calcul.']),
+      h('div', { class: 'roi-grid' }, [
+        roiField('volume',      'Volume mensuel',         'cas/mois', true, 80),
+        roiField('tempsActuel', 'Temps actuel par cas',   'min',      true, 45),
+        roiField('tempsCible',  'Temps cible après opt.', 'min',      true, 20),
+      ]),
+
+      h('div', { class: 'section-label', style: 'margin-top:20px' }, ['Paramètres de coût']),
+      h('p', { class: 'hint', style: 'margin:0 0 10px' }, ['Pré-remplis avec des valeurs types — modifiez si vous les connaissez.']),
+      h('div', { class: 'roi-grid' }, [
+        roiField('coutHoraire', 'Coût horaire chargé',    '€/h', false, null, 'Par défaut : 60 €/h'),
+        roiField('tauxErreurs', 'Taux erreurs / retours', '%',   false, null, 'Par défaut : 10 %'),
+        roiField('tempsErreur', 'Temps perdu par erreur', 'min', false, null, 'Par défaut : 15 min'),
+      ]),
+
+      h('div', { class: 'btnrow', style: 'margin-top:24px' }, [
+        h('button', { class: 'btn btn--outline', type: 'button', onClick: () => setView('select') }, ['← Retour']),
+        h('button', { class: 'btn btn--primary', type: 'submit' }, ['Calculer mon ROI →']),
+      ]),
+    ]),
+  ]);
+}
+
+function renderRoiResults() {
+  const r = state.roiResult;
+  if (!r) { setView('roi'); return h('div', {}); }
+
+  const fmt  = (n) => Math.round(n).toLocaleString('fr-FR');
+  const fmtH = (n) => n < 1 ? `${Math.round(n * 60)} min` : `${(Math.round(n * 10) / 10).toLocaleString('fr-FR')} h`;
+
+  const confClass = { Fort: 'confidence-pill--fort', Moyen: 'confidence-pill--moyen', Faible: 'confidence-pill--faible' }[r.confidence] || '';
+  const confLabel = {
+    Fort:   '● Confiance forte — vos propres chiffres',
+    Moyen:  '◐ Confiance moyenne — mix données + défauts',
+    Faible: '○ Confiance faible — majorité de valeurs par défaut',
+  }[r.confidence] || '';
+
+  return h('div', { class: 'grid' }, [
+    h('div', { class: 'card' }, [
+      h('div', { style: 'display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-bottom:12px' }, [
+        h('span', { class: 'tag tag--roi' }, ['ROI Calculator — Résultats']),
+        h('span', { class: `confidence-pill ${confClass}` }, [confLabel]),
+      ]),
+      h('div', { class: 'roi-hero' }, [
+        h('div', { class: 'roi-hero__item' }, [
+          h('div', { class: 'roi-hero__val' }, [`${fmt(r.roiMensuel)} €`]),
+          h('div', { class: 'roi-hero__lbl' }, ['ROI mensuel estimé']),
+          h('div', { class: 'roi-hero__sub' }, [`≈ ${fmt(r.roiAnnuel)} €/an`]),
+        ]),
+        h('div', { class: 'roi-hero__sep' }),
+        h('div', { class: 'roi-hero__item' }, [
+          h('div', { class: 'roi-hero__val' }, [fmtH(r.gainTempsH + r.gainErreursH)]),
+          h('div', { class: 'roi-hero__lbl' }, ['Heures récupérées / mois']),
+        ]),
+      ]),
+    ]),
+
+    h('div', { class: 'card' }, [
+      h('div', { class: 'h2' }, ['Les 2 leviers qui pèsent le plus']),
+      h('div', { class: 'lever-cards' }, r.levers.map((l, i) =>
+        h('div', { class: `lever-card${i === 0 ? ' lever-card--top' : ''}` }, [
+          h('div', { class: 'lever-card__lbl' }, [i === 0 ? '🏆 Levier principal' : 'Levier secondaire']),
+          h('div', { style: 'font-weight:700;font-size:15px;color:var(--navy);margin:4px 0 2px' }, [l.label]),
+          h('div', { class: 'lever-card__amt' }, [`${fmt(l.euros)} €/mois`]),
+          h('div', { class: 'lever-card__det' }, [`${fmtH(l.heures)} récupérées · ${l.detail}`]),
+        ])
+      )),
+    ]),
+
+    h('div', { class: 'conclusion-box' }, [
+      h('p', {}, [r.conclusion]),
+      r.usedDefaults > 0
+        ? h('p', { class: 'hint' }, [
+            `${r.usedDefaults} valeur${r.usedDefaults > 1 ? 's' : ''} par défaut utilisée${r.usedDefaults > 1 ? 's' : ''} — affinez avec vos chiffres réels pour plus de précision.`,
+          ])
+        : null,
+    ]),
+
+    h('div', { class: 'card' }, [
+      h('div', { class: 'h2' }, ['Et maintenant ?']),
+      h('p', { class: 'lead', style: 'margin-bottom:16px' }, [
+        'Utilisez ces chiffres pour déclencher une décision. La prochaine étape : identifier les 3 actions concrètes à mettre en œuvre.',
+      ]),
+      h('div', { class: 'btnrow' }, [
+        h('button', { class: 'btn btn--primary', onClick: () => setView('qwf') }, ['Trouver mes 3 quick wins →']),
+        BOOKING_URL ? h('a', { class: 'btn btn--outline', href: BOOKING_URL, target: '_blank', rel: 'noreferrer' }, ['Réserver un appel découverte']) : null,
+      ]),
+      h('div', { class: 'btnrow', style: 'margin-top:6px' }, [
+        h('button', { class: 'btn btn--outline', style: 'font-size:13px', onClick: () => setView('roi') }, ['← Modifier mes données']),
+        h('button', { class: 'btn btn--outline', style: 'font-size:13px', onClick: () => setView('select') }, ['Autres outils']),
+      ]),
+    ]),
+  ]);
+}
+
+/* ════════════════════════════════════════════════════
+   QUICK WINS FINDER — données & calcul
+════════════════════════════════════════════════════ */
+
+const QW_LIBRARY = [
+  {
+    id: 'statuts-notifications',
+    title: 'Statuts uniques + notifications ciblées',
+    result: 'Fin des relances et visibilité instantanée sur l\'avancement',
+    setup: 'Statut central (ex : "à valider", "en cours IT", "bloqué", "terminé") + notifications automatiques aux bons rôles',
+    prereqs: 'Définir un owner, les statuts métier, accès boîtes mail ou Teams',
+    effort: 'S à M', delay: '2 à 4 semaines',
+    impact: ['Baisse du délai global', 'Moins d\'interruptions', 'Moins de relances'],
+    triggers: { relancesFrequentes: 3, validationsMultiples: 1 },
+  },
+  {
+    id: 'formulaire-intelligent',
+    title: 'Formulaire intelligent de collecte',
+    result: 'Moins de retours arrière, dossiers complets dès le départ',
+    setup: 'Champs conditionnels + contrôles à la saisie + pièces demandées au bon moment + validation de cohérence',
+    prereqs: 'Liste des champs obligatoires, règles simples, rôles définis',
+    effort: 'M', delay: '3 à 6 semaines',
+    impact: ['Baisse des erreurs', 'Baisse du temps de traitement', 'Moins de rejets'],
+    triggers: { erreursFréquentes: 3, validationsMultiples: 2 },
+  },
+  {
+    id: 'suppression-double-saisie',
+    title: 'Suppression de la double saisie entre outils',
+    result: 'Arrêt du copier-coller Excel/email vers outil final',
+    setup: 'Synchronisation des champs clés (push) ou import structuré automatique entre les outils',
+    prereqs: 'Accès API ou export/import structuré, mapping des champs clés',
+    effort: 'M', delay: '4 à 8 semaines',
+    impact: ['Gain de temps direct', 'Moins d\'erreurs de saisie', 'Données fiables partout'],
+    triggers: { doubleSaisie: 3, nbOutilsEleve: 2 },
+  },
+  {
+    id: 'dossier-unique',
+    title: 'Dossier unique par dossier',
+    result: 'Fin du chaos documentaire — tout au même endroit',
+    setup: 'Convention de nommage + dépôt structuré des pièces + lien unique accessible depuis le process',
+    prereqs: 'Choix d\'un espace de stockage partagé, définition des règles de nommage',
+    effort: 'S', delay: '1 à 3 semaines',
+    impact: ['Moins de temps perdu à chercher', 'Moins d\'erreurs', 'Meilleure traçabilité'],
+    triggers: { docsEparpilles: 3, erreursFréquentes: 1 },
+  },
+  {
+    id: 'workflow-validation',
+    title: 'Workflow de validation simplifié',
+    result: 'Validation en un clic, délais réduits, zéro perte en route',
+    setup: 'Règles de validation claires + SLA définis + tableau de bord de suivi des en-cours',
+    prereqs: 'Matrice de validation, SLA définis, accès configuré pour les validateurs',
+    effort: 'M', delay: '3 à 5 semaines',
+    impact: ['Baisse du délai global', 'Moins de blocages', 'Meilleure traçabilité'],
+    triggers: { validationsMultiples: 3, relancesFrequentes: 1 },
+  },
+  {
+    id: 'exports-automatiques',
+    title: 'Exports propres automatiques',
+    result: 'Fin du reporting manuel — données toujours à jour',
+    setup: 'Export planifié + format standard + envoi automatique aux destinataires',
+    prereqs: 'Accès aux sources de données, liste des destinataires, fréquence définie',
+    effort: 'S à M', delay: '2 à 5 semaines',
+    impact: ['Temps récupéré sur le reporting', 'Fiabilité des données', 'Partage facilité'],
+    triggers: { reportingManuel: 3, nbOutilsEleve: 1 },
+  },
+];
+
+const QWF_QUESTIONS = [
+  { id: 'doubleSaisie',         label: 'Des données sont saisies manuellement dans plusieurs outils différents (copier-coller, ressaisie…)' },
+  { id: 'validationsMultiples', label: 'Plusieurs personnes ou étapes distinctes doivent valider chaque dossier' },
+  { id: 'relancesFrequentes',   label: 'Des relances sont nécessaires pour savoir où en est un dossier' },
+  { id: 'docsEparpilles',       label: 'Les documents d\'un dossier sont éparpillés (email, drive, bureau local…)' },
+  { id: 'reportingManuel',      label: 'Du reporting est préparé manuellement (copier-coller, recomposition de données)' },
+  { id: 'erreursFréquentes',    label: 'Des dossiers reviennent en arrière à cause d\'informations manquantes ou incorrectes' },
+  { id: 'nbOutilsEleve',        label: 'Ce process fait intervenir 3 outils ou plus (ERP, email, tableur, outil métier…)' },
+];
+
+function computeQuickWins(signals) {
+  return QW_LIBRARY
+    .map(qw => {
+      let score = 0;
+      for (const [trigger, weight] of Object.entries(qw.triggers)) {
+        if (signals[trigger]) score += weight;
+      }
+      return { ...qw, score };
+    })
+    .sort((a, b) => b.score - a.score)
+    .slice(0, 3);
+}
+
+function renderQwf() {
+  const sig = state.qwfSignals;
+
+  const makeSignalRow = (q) => {
+    const isOui = sig[q.id] === true;
+    const isNon = sig[q.id] === false;
+
+    return h('div', { class: 'signal-row' }, [
+      h('span', { class: 'signal-row__lbl' }, [q.label]),
+      h('div', { class: 'signal-row__btns' }, [
+        h('button', {
+          type: 'button',
+          class: `signal-btn signal-btn--oui${isOui ? ' active' : ''}`,
+          onClick: () => { state.qwfSignals[q.id] = isOui ? undefined : true; render(); },
+        }, ['Oui']),
+        h('button', {
+          type: 'button',
+          class: `signal-btn signal-btn--non${isNon ? ' active' : ''}`,
+          onClick: () => { state.qwfSignals[q.id] = isNon ? undefined : false; render(); },
+        }, ['Non']),
+      ]),
+    ]);
+  };
+
+  const answeredCount = QWF_QUESTIONS.filter(q => sig[q.id] !== undefined).length;
+  const canSubmit = answeredCount >= 3;
+
+  return h('div', { class: 'grid' }, [
+    h('div', { class: 'card' }, [
+      h('div', { style: 'margin-bottom:14px' }, [h('span', { class: 'tag tag--qwf' }, ['Quick Wins Finder'])]),
+      h('h1', { class: 'h1' }, ['Identifiez vos 3 actions prioritaires']),
+      h('p', { class: 'lead' }, [
+        'Répondez à ces 7 signaux pour recevoir 3 recommandations concrètes adaptées à votre process.',
+      ]),
+      h('div', { class: 'signal-list' }, QWF_QUESTIONS.map(makeSignalRow)),
+      h('div', { class: 'btnrow', style: 'margin-top:22px' }, [
+        h('button', { class: 'btn btn--outline', onClick: () => setView('select') }, ['← Retour']),
+        h('button', {
+          class: 'btn btn--primary',
+          disabled: canSubmit ? null : 'disabled',
+          onClick: () => { if (canSubmit) { state.qwfResult = computeQuickWins(state.qwfSignals); setView('qwf-results'); } },
+        }, [canSubmit ? 'Voir mes 3 quick wins →' : `Répondre à encore ${3 - answeredCount} signal${3 - answeredCount > 1 ? 's' : ''}`]),
+      ]),
+      h('p', { class: 'hint', style: 'margin-top:8px' }, ['Répondez à au moins 3 signaux pour déverrouiller le résultat.']),
+    ]),
+  ]);
+}
+
+function renderQwfResults() {
+  const qws = state.qwfResult;
+  if (!qws || qws.length === 0) { setView('qwf'); return h('div', {}); }
+
+  const makeQwCard = (qw, idx) =>
+    h('div', { class: 'qw-card' }, [
+      h('div', { class: 'qw-card__head' }, [
+        h('div', { class: 'qw-card__num' }, [String(idx + 1)]),
+        h('div', { class: 'qw-card__head-title' }, [qw.title]),
+      ]),
+      h('div', { class: 'qw-card__body' }, [
+        h('div', { class: 'qw-card__result' }, [`✓ ${qw.result}`]),
+        h('div', { class: 'qw-section' }, [
+          h('div', { class: 'qw-section__lbl' }, ['Ce qu\'on met en place']),
+          h('div', { class: 'qw-section__val' }, [qw.setup]),
+        ]),
+        h('div', { class: 'qw-section' }, [
+          h('div', { class: 'qw-section__lbl' }, ['Pré-requis']),
+          h('div', { class: 'qw-section__val' }, [qw.prereqs]),
+        ]),
+        h('div', { class: 'qw-meta' }, [
+          h('span', { class: 'badge-effort' }, [`Effort : ${qw.effort}`]),
+          h('span', { class: 'badge-delay' }, [`Délai : ${qw.delay}`]),
+        ]),
+        h('div', { class: 'impact-chips' }, qw.impact.map(i =>
+          h('span', { class: 'impact-chip' }, [i])
+        )),
+      ]),
+    ]);
+
+  return h('div', { class: 'grid' }, [
+    h('div', { class: 'card' }, [
+      h('div', { style: 'margin-bottom:12px' }, [h('span', { class: 'tag tag--qwf' }, ['Quick Wins Finder — Résultats'])]),
+      h('h1', { class: 'h1' }, ['Vos 3 actions prioritaires']),
+      h('p', { class: 'lead' }, [
+        'Commencez par la première — elle a le plus fort impact selon vos signaux. Chaque fiche contient tout ce qu\'il faut pour démarrer.',
+      ]),
+    ]),
+    h('div', { class: 'qw-cards' }, qws.map(makeQwCard)),
+    h('div', { class: 'card' }, [
+      h('div', { class: 'h2' }, ['Et maintenant ?']),
+      h('p', { class: 'lead', style: 'margin-bottom:16px' }, [
+        'Ces 3 quick wins sont un point de départ solide. Un appel découverte permet de valider les priorités et de cadrer le quick win n°1 en plan d\'action.',
+      ]),
+      h('div', { class: 'btnrow' }, [
+        BOOKING_URL ? h('a', {
+          class: 'btn btn--primary', href: BOOKING_URL, target: '_blank', rel: 'noreferrer',
+        }, ['📅\u00a0 Réserver un appel découverte — 30 min']) : null,
+        h('button', { class: 'btn btn--outline', onClick: () => setView('roi') }, ['Calculer le ROI →']),
+      ]),
+      h('div', { class: 'btnrow', style: 'margin-top:6px' }, [
+        h('button', { class: 'btn btn--outline', style: 'font-size:13px', onClick: () => setView('qwf') }, ['← Modifier mes signaux']),
+        h('button', { class: 'btn btn--outline', style: 'font-size:13px', onClick: () => setView('select') }, ['Autres outils']),
+      ]),
+    ]),
+  ]);
+}
+
+/* ── RENDER ── */
+function render() {
+  if (!appEl) return;
+  appEl.innerHTML = '';
+  const views = {
+    landing:       renderLanding,
+    select:        renderSelect,
+    intro:         renderIntro,
+    quiz:          renderQuiz,
+    optional:      renderOptional,
+    results:       renderResults,
+    'roi':         renderRoi,
+    'roi-results': renderRoiResults,
+    'qwf':         renderQwf,
+    'qwf-results': renderQwfResults,
+  };
+  appEl.appendChild((views[state.view] || renderLanding)());
+}
+
+/* ── HEADER update ── */
+function initHeader() {
+  const header = document.querySelector('.header');
+  if (!header) return;
+  header.innerHTML = '';
+  const brand = document.createElement('div');
+  brand.innerHTML =
+    '<div class="brand__logo">Contrôle technique process</div>' +
+    '<div class="brand__sub">Diagnostic self-serve · Livinweb</div>';
+  const badge = document.createElement('span');
+  badge.className = 'brand__badge';
+  badge.textContent = 'V1';
+  header.appendChild(brand);
+  header.appendChild(badge);
+}
+
+initHeader();
+render();

+ 65 - 0
public/index.php

@@ -0,0 +1,65 @@
+<?php
+declare(strict_types=1);
+
+$bookingUrl = 'https://calendly.com/livinweb/diagnostic'; // TODO: remplacer par votre lien Calendly
+$devisUrl   = 'mailto:contact@livinweb.fr?subject=Demande%20de%20devis%20%E2%80%94%20Audit%20Express';  // TODO: remplacer par votre URL devis
+?>
+<!doctype html>
+<html lang="fr">
+  <head>
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width,initial-scale=1" />
+    <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 />
+    <link rel="stylesheet" href="/assets/css/app.css" />
+  </head>
+  <body>
+    <div class="container">
+      <header class="header">
+        <div>
+          <div class="brand__logo">Contrôle technique process</div>
+          <div class="brand__sub">Diagnostic self-serve · <a href="https://livinweb.fr" target="_blank" rel="noreferrer" style="color:inherit;text-decoration:none">Livinweb</a></div>
+        </div>
+        <span class="brand__badge">V1</span>
+      </header>
+
+      <main id="app"
+            data-api-base="/api"
+            data-booking-url="<?= htmlspecialchars($bookingUrl, ENT_QUOTES) ?>"
+            data-devis-url="<?= htmlspecialchars($devisUrl, ENT_QUOTES) ?>">
+      </main>
+
+      <footer class="footer">
+        <a href="#" id="privacyLink">Données &amp; confidentialité</a>
+        &nbsp;·&nbsp;
+        <a href="https://livinweb.fr" target="_blank" rel="noreferrer">Livinweb</a>
+      </footer>
+    </div>
+
+    <dialog id="privacyDialog" class="dialog">
+      <div class="dialog__inner">
+        <div class="dialog__head">
+          <strong>Données &amp; confidentialité</strong>
+          <button class="btn btn--outline" style="padding:6px 12px;font-size:13px" id="closePrivacy">Fermer</button>
+        </div>
+        <div class="dialog__body">
+          <p><strong>Données collectées</strong> : réponses au questionnaire, et email uniquement si vous demandez le PDF.</p>
+          <p><strong>Finalité</strong> : calculer un score, générer votre PDF, et vous l'envoyer.</p>
+          <p><strong>Durée</strong> : sessions sans email 7 jours ; avec email 90 jours max.</p>
+          <p><strong>Droits</strong> : accès, rectification, effacement. Contact : <a href="mailto:contact@livinweb.fr">contact@livinweb.fr</a></p>
+        </div>
+      </div>
+    </dialog>
+
+    <script type="module" src="/assets/js/app.js"></script>
+    <script>
+      const link = document.getElementById('privacyLink');
+      const dlg  = document.getElementById('privacyDialog');
+      const cls  = document.getElementById('closePrivacy');
+      if (link && dlg) link.addEventListener('click', (e) => { e.preventDefault(); dlg.showModal(); });
+      if (cls  && dlg) cls.addEventListener('click', () => dlg.close());
+    </script>
+  </body>
+</html>

+ 392 - 0
src/Engine.php

@@ -0,0 +1,392 @@
+<?php
+
+declare(strict_types=1);
+
+namespace AuditExpress;
+
+final class Engine
+{
+    public static function compute(array $pack, array $answers, array $optional = [], ?array $rulesBundle = null): array
+    {
+        $pillars = [];
+        foreach (($pack['pillars'] ?? []) as $p) {
+            $pillars[(string) $p['id']] = [
+                'id' => (string) $p['id'],
+                'label' => (string) ($p['label'] ?? $p['id']),
+                'score' => 0,
+                'max' => isset($p['max']) ? (int) $p['max'] : 20,
+            ];
+        }
+
+        $questions = [];
+        foreach (($pack['questions'] ?? []) as $q) {
+            $questions[(string) $q['id']] = $q;
+        }
+
+        $perQuestion = [];
+        $dkCount = 0;
+
+        foreach ($questions as $qid => $q) {
+            $selectedOptionId = $answers[$qid] ?? null;
+            if (!is_string($selectedOptionId) || $selectedOptionId === '') {
+                throw new \InvalidArgumentException("Missing answer for $qid");
+            }
+
+            $points = null;
+            $label = null;
+            foreach (($q['options'] ?? []) as $opt) {
+                if (($opt['id'] ?? null) === $selectedOptionId) {
+                    $points = (int) ($opt['points'] ?? 0);
+                    $label = (string) ($opt['label'] ?? '');
+                    break;
+                }
+            }
+            if ($points === null) {
+                throw new \InvalidArgumentException("Invalid option for $qid");
+            }
+
+            // DK ("Je ne sais pas") convention: points=1 + option_id ends with "_dk" or equals "DK"
+            $optIdLower = strtolower($selectedOptionId);
+            if ($points === 1 && ($optIdLower === 'dk' || str_ends_with($optIdLower, '_dk'))) {
+                $dkCount++;
+            }
+
+            // N/A ("Non pertinent") convention: option_id ends with "_na" or equals "NA"
+            // Compté comme incertitude au même titre que DK pour le score de confiance
+            if ($optIdLower === 'na' || str_ends_with($optIdLower, '_na')) {
+                $dkCount++;
+            }
+
+            $pillarId = (string) ($q['pillar_id'] ?? '');
+            if ($pillarId !== '' && isset($pillars[$pillarId])) {
+                $pillars[$pillarId]['score'] += $points;
+            }
+
+            $perQuestion[$qid] = [
+                'question_id' => $qid,
+                'option_id' => $selectedOptionId,
+                'points' => $points,
+            ];
+        }
+
+        // Anti-cheat caps (deterministic)
+        $caps = (array) (($pack['scoring']['anti_cheat_caps'] ?? []) ?: []);
+        foreach ($caps as $capQuestionId => $capRule) {
+            $capQuestionId = (string) $capQuestionId;
+            if (!isset($perQuestion[$capQuestionId])) {
+                continue;
+            }
+            $triggerPoints = (int) ($capRule['trigger_points'] ?? 0);
+            if ((int) $perQuestion[$capQuestionId]['points'] !== $triggerPoints) {
+                continue;
+            }
+
+            $pillarId = (string) ($capRule['pillar_id'] ?? '');
+            $cap = (int) ($capRule['cap'] ?? 0);
+            if ($pillarId !== '' && isset($pillars[$pillarId])) {
+                $pillars[$pillarId]['score'] = min($pillars[$pillarId]['score'], $cap);
+            }
+        }
+
+        $rawTotal = 0;
+        $maxTotal = 0;
+        foreach ($pillars as $p) {
+            $rawTotal += (int) $p['score'];
+            $maxTotal += (int) $p['max'];
+        }
+        // Normalize to /100 (transparent for existing packs where maxTotal=100)
+        $scoreTotal = $maxTotal > 0 ? (int) round(($rawTotal / $maxTotal) * 100) : 0;
+
+        $level = self::levelFromScore((int) $scoreTotal, (array) ($pack['scoring']['level_thresholds'] ?? []));
+        $confidence = self::confidenceFromDkCount($dkCount, (array) ($pack['confidence']['dk_count_thresholds'] ?? []));
+
+        $quickWins = [];
+        $risks = [];
+        if (is_array($rulesBundle)) {
+            $triggersMode = (string) ($pack['scoring']['triggers_mode'] ?? 'lowest');
+            [$quickWins, $risks] = self::selectWinsAndRisks($rulesBundle, $perQuestion, (string) ($pack['pack_id'] ?? ''), $triggersMode);
+        }
+
+        $costHidden = null;
+        if (isset($pack['cost_hidden']) && is_array($pack['cost_hidden'])) {
+            $costHidden = self::computeCostHidden($pack, $answers, $optional);
+        }
+
+        $packIdStr = (string) ($pack['pack_id'] ?? '');
+        $v2Diagnostic = null;
+        if ($packIdStr === 'process-generique-v2') {
+            $v2Diagnostic = self::computeV2Diagnostic($pillars, $quickWins, $risks);
+        }
+
+        return [
+            'pack_id' => $packIdStr,
+            'score_total' => $scoreTotal,
+            'level' => $level['level'],
+            'level_label' => $level['label'],
+            'pillars' => array_values($pillars),
+            'answers' => $perQuestion,
+            'confidence' => [
+                'dk_count' => $dkCount,
+                'level' => $confidence['level'],
+                'label' => $confidence['label'],
+            ],
+            'risks_top3' => array_slice($risks, 0, 3),
+            'quick_wins_preview' => array_slice($quickWins, 0, 2),
+            'quick_wins_top5' => array_slice($quickWins, 0, 5),
+            'cost_hidden' => $costHidden,
+            'v2_diagnostic' => $v2Diagnostic,
+        ];
+    }
+
+    private static function levelFromScore(int $score, array $thresholds): array
+    {
+        foreach (['A', 'B', 'C', 'D'] as $key) {
+            if (!isset($thresholds[$key])) {
+                continue;
+            }
+            $min = (int) ($thresholds[$key]['min'] ?? 0);
+            $max = (int) ($thresholds[$key]['max'] ?? 100);
+            if ($score >= $min && $score <= $max) {
+                return ['level' => $key, 'label' => (string) ($thresholds[$key]['label'] ?? $key)];
+            }
+        }
+        return ['level' => 'D', 'label' => ''];
+    }
+
+    private static function confidenceFromDkCount(int $dkCount, array $thresholds): array
+    {
+        $high = $thresholds['high'] ?? null;
+        $med = $thresholds['medium'] ?? null;
+        $low = $thresholds['low'] ?? null;
+
+        if (is_array($high) && $dkCount <= (int) ($high['max_dk'] ?? 2)) {
+            return ['level' => 'high', 'label' => (string) ($high['label'] ?? 'Haute confiance')];
+        }
+        if (is_array($med)) {
+            $min = (int) ($med['min_dk'] ?? 3);
+            $max = (int) ($med['max_dk'] ?? 6);
+            if ($dkCount >= $min && $dkCount <= $max) {
+                return ['level' => 'medium', 'label' => (string) ($med['label'] ?? 'Confiance moyenne')];
+            }
+        }
+        if (is_array($low) && $dkCount >= (int) ($low['min_dk'] ?? 7)) {
+            return ['level' => 'low', 'label' => (string) ($low['label'] ?? 'Faible confiance')];
+        }
+        return ['level' => 'medium', 'label' => 'Confiance moyenne'];
+    }
+
+    private static function selectWinsAndRisks(array $rulesBundle, array $perQuestion, string $packId = '', string $triggersMode = 'lowest'): 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) {
+            $riskLib = (array) ($rulesBundle['risks_v2'] ?? $rulesBundle['risks_generic'] ?? []);
+            $rules   = (array) ($rulesBundle['rules_v2'] ?? []);
+            $triggersMode = 'highest';
+        } elseif ($isGeneric) {
+            $riskLib = (array) ($rulesBundle['risks_generic'] ?? $rulesBundle['risks_onboarding'] ?? []);
+            $rules   = (array) ($rulesBundle['rules_generic'] ?? $rulesBundle['rules'] ?? []);
+        } else {
+            $riskLib = (array) ($rulesBundle['risks_onboarding'] ?? []);
+            $rules   = (array) ($rulesBundle['rules'] ?? []);
+        }
+
+        $winsById = [];
+        foreach ($winsLib as $w) {
+            $winsById[(int) ($w['id'] ?? 0)] = $w;
+        }
+        $risksById = [];
+        foreach ($riskLib as $r) {
+            $risksById[(int) ($r['id'] ?? 0)] = $r;
+        }
+
+        $winScores = [];
+        foreach ((array) ($rules['quick_wins_triggers'] ?? []) as $rule) {
+            $qid = (string) ($rule['trigger']['question'] ?? '');
+            if ($qid === '' || !isset($perQuestion[$qid])) {
+                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) {
+                continue;
+            }
+
+            $weight = (float) ($rule['weight'] ?? 1);
+            foreach ((array) ($rule['quick_win_ids'] ?? []) as $winId) {
+                $winId = (int) $winId;
+                $impact = (int) ($winsById[$winId]['impact'] ?? 3);
+                $winScores[$winId] = ($winScores[$winId] ?? 0) + ($weight * max(1, $impact));
+            }
+        }
+
+        $riskScores = [];
+        foreach ((array) ($rules['risk_triggers'] ?? []) as $rule) {
+            $qid = (string) ($rule['trigger']['question'] ?? '');
+            if ($qid === '' || !isset($perQuestion[$qid])) {
+                continue;
+            }
+            $pts = (int) $perQuestion[$qid]['points'];
+            if ($triggersMode === 'highest' ? $pts < 2 : $pts > 2) {
+                continue;
+            }
+
+            $weight = (float) ($rule['weight'] ?? 1);
+            foreach ((array) ($rule['risk_ids'] ?? []) as $riskId) {
+                $riskId = (int) $riskId;
+                $severity = (int) ($risksById[$riskId]['severity'] ?? 3);
+                $riskScores[$riskId] = ($riskScores[$riskId] ?? 0) + ($weight * max(1, $severity));
+            }
+        }
+
+        arsort($winScores);
+        arsort($riskScores);
+
+        $wins = [];
+        foreach (array_keys($winScores) as $id) {
+            if (!isset($winsById[$id])) {
+                continue;
+            }
+            $w = $winsById[$id];
+            $wins[] = [
+                'id' => (int) $w['id'],
+                'title' => (string) ($w['title'] ?? ''),
+                'effect' => (string) ($w['effect'] ?? ''),
+                'effort' => (string) ($w['effort'] ?? ''),
+                'impact' => (int) ($w['impact'] ?? 3),
+            ];
+        }
+
+        $risks = [];
+        foreach (array_keys($riskScores) as $id) {
+            if (!isset($risksById[$id])) {
+                continue;
+            }
+            $r = $risksById[$id];
+            $risks[] = [
+                'id' => (int) $r['id'],
+                'title' => (string) ($r['title'] ?? ''),
+                'what_happens' => (string) ($r['what_happens'] ?? ''),
+                'severity' => (int) ($r['severity'] ?? 3),
+            ];
+        }
+
+        return [$wins, $risks];
+    }
+
+    private static function computeV2Diagnostic(array $pillars, array $quickWins, array $risks): array
+    {
+        // Potentiel = friction opérationnelle + volume + risque + données + outils + collaboration
+        $potentielAxes  = ['FRICTION', 'VOLUME', 'RISQUE', 'DONNEES', 'OUTILS', 'COLLABORATION'];
+        // Complexité = variabilité + capacité de déploiement (owner, sponsor, résistance)
+        $complexiteAxes = ['VARIABILITE', 'DEPLOIEMENT'];
+
+        $potentielRaw = 0; $potentielMax = 0;
+        $complexiteRaw = 0; $complexiteMax = 0;
+
+        foreach ($pillars as $p) {
+            $pid = (string) ($p['id'] ?? '');
+            if (in_array($pid, $potentielAxes, true)) {
+                $potentielRaw += (int) $p['score'];
+                $potentielMax += (int) $p['max'];
+            }
+            if (in_array($pid, $complexiteAxes, true)) {
+                $complexiteRaw += (int) $p['score'];
+                $complexiteMax += (int) $p['max'];
+            }
+        }
+
+        $potentiel  = $potentielMax  > 0 ? (int) round(($potentielRaw  / $potentielMax)  * 100) : 0;
+        $complexite = $complexiteMax > 0 ? (int) round(($complexiteRaw / $complexiteMax) * 100) : 0;
+
+        // Tag : Quick win si la complexité est maîtrisable
+        $tag      = $complexite <= 50 ? 'quick_win'      : 'projet_structurant';
+        $tagLabel = $tag === 'quick_win' ? 'Quick win (2–6 semaines)' : 'Projet structurant (6–16 semaines)';
+
+        // Verdict basé sur le potentiel
+        if ($potentiel >= 70) {
+            $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 {
+            $verdict = ['code' => 'attente',     'label' => 'Pas prioritaire', 'desc' => 'Process trop flou ou faible impact'];
+        }
+
+        return [
+            'potentiel'     => $potentiel,
+            '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'] ?? []);
+        $components = (array) ($cfg['components'] ?? []);
+        if ($components === []) {
+            return null;
+        }
+
+        $minutes = 0;
+        foreach ($components as $qid => $component) {
+            $qid = (string) $qid;
+            $selectedOption = $answers[$qid] ?? null;
+            if (!is_string($selectedOption)) {
+                continue;
+            }
+            $map = (array) (($component['option_mapping'] ?? []) ?: []);
+            if (!isset($map[$selectedOption])) {
+                continue;
+            }
+            $minutes += (int) $map[$selectedOption];
+        }
+
+        $capMaxHours = (float) ($cfg['cap_max_hours'] ?? 12);
+        $minutes = min($minutes, (int) round($capMaxHours * 60));
+
+        // Accept any monthly_volume_* key (recruits, occurrences, invoices, …)
+        $volume = null;
+        foreach ($optional as $k => $v) {
+            if (str_starts_with($k, 'monthly_volume')) {
+                $volume = $v;
+                break;
+            }
+        }
+        if ($volume === null || (!is_int($volume) && !is_float($volume) && !is_numeric($volume))) {
+            return null;
+        }
+        $volume = (int) $volume;
+        $volume = max(0, $volume);
+
+        $hoursPerMonth = ($minutes * $volume) / 60;
+
+        $hourlyCost = $optional['hourly_cost'] ?? ($cfg['default_hourly_cost'] ?? 50);
+        if (!is_int($hourlyCost) && !is_float($hourlyCost) && !is_numeric($hourlyCost)) {
+            $hourlyCost = (float) ($cfg['default_hourly_cost'] ?? 50);
+        }
+        $hourlyCost = (float) $hourlyCost;
+
+        $eurPerMonth = $hoursPerMonth * $hourlyCost;
+
+        return [
+            'minutes_per_item' => $minutes,
+            'volume_per_month' => $volume,
+            'hours_per_month' => round($hoursPerMonth, 1),
+            'eur_per_month' => round($eurPerMonth, 0),
+            'assumptions' => [
+                'hourly_cost' => $hourlyCost,
+                'default_hourly_cost' => (float) ($cfg['default_hourly_cost'] ?? 50),
+            ],
+        ];
+    }
+}
+

+ 40 - 0
src/Http.php

@@ -0,0 +1,40 @@
+<?php
+
+declare(strict_types=1);
+
+namespace AuditExpress;
+
+final class Http
+{
+    public static function readJsonBody(): array
+    {
+        $raw = file_get_contents('php://input');
+        if ($raw === false || trim($raw) === '') {
+            return [];
+        }
+
+        $decoded = json_decode($raw, true);
+        if (!is_array($decoded)) {
+            self::json(['error' => 'Invalid JSON body'], 400);
+            exit;
+        }
+
+        return $decoded;
+    }
+
+    public static function json(array $data, int $status = 200): void
+    {
+        http_response_code($status);
+        header('Content-Type: application/json; charset=utf-8');
+        header('Cache-Control: no-store');
+        echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
+    }
+
+    public static function methodNotAllowed(array $allow): void
+    {
+        http_response_code(405);
+        header('Allow: ' . implode(', ', $allow));
+        self::json(['error' => 'Method not allowed'], 405);
+    }
+}
+

+ 40 - 0
src/LogMailer.php

@@ -0,0 +1,40 @@
+<?php
+
+declare(strict_types=1);
+
+namespace AuditExpress;
+
+final class LogMailer implements MailerInterface
+{
+    public function __construct(
+        private readonly string $outboxDir
+    ) {
+    }
+
+    public function sendPdf(string $toEmail, string $subject, string $textBody, string $filename, string $pdfBytes): void
+    {
+        if (!is_dir($this->outboxDir)) {
+            @mkdir($this->outboxDir, 0775, true);
+        }
+
+        $id = date('Ymd_His') . '_' . bin2hex(random_bytes(4));
+        $pdfPath = rtrim($this->outboxDir, '/\\') . DIRECTORY_SEPARATOR . $id . '_' . $filename;
+        file_put_contents($pdfPath, $pdfBytes);
+
+        $meta = [
+            'id' => $id,
+            'to' => $toEmail,
+            'subject' => $subject,
+            'text' => $textBody,
+            'attachment' => basename($pdfPath),
+            'created_at' => date(DATE_ATOM),
+            'note' => 'V1 pseudo: email non envoyé, stocké dans storage/outbox',
+        ];
+
+        file_put_contents(
+            rtrim($this->outboxDir, '/\\') . DIRECTORY_SEPARATOR . $id . '.json',
+            json_encode($meta, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT)
+        );
+    }
+}
+

+ 15 - 0
src/MailerInterface.php

@@ -0,0 +1,15 @@
+<?php
+
+declare(strict_types=1);
+
+namespace AuditExpress;
+
+interface MailerInterface
+{
+    /**
+     * Envoi transactionnel (PDF).
+     * V1: peut être branché sur SMTP/API ; fallback: log/outbox.
+     */
+    public function sendPdf(string $toEmail, string $subject, string $textBody, string $filename, string $pdfBytes): void;
+}
+

+ 49 - 0
src/PackRepository.php

@@ -0,0 +1,49 @@
+<?php
+
+declare(strict_types=1);
+
+namespace AuditExpress;
+
+final class PackRepository
+{
+    public function __construct(
+        private readonly string $rootDir
+    ) {
+    }
+
+    public function getPack(string $packId): array
+    {
+        $packId = trim($packId);
+        if ($packId === 'onboarding') {
+            $packId = 'onboarding-v1';
+        }
+        if ($packId === 'facture') {
+            $packId = 'validation-facture';
+        }
+
+        $path = match ($packId) {
+            'onboarding-v1'         => $this->rootDir . '/config/pack-onboarding-v1.json',
+            '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',
+            default => null,
+        };
+
+        if ($path === null || !is_file($path)) {
+            throw new \RuntimeException('Unknown pack: ' . $packId);
+        }
+
+        $raw = file_get_contents($path);
+        if ($raw === false) {
+            throw new \RuntimeException('Unable to read pack file');
+        }
+
+        $decoded = json_decode($raw, true);
+        if (!is_array($decoded)) {
+            throw new \RuntimeException('Invalid pack JSON');
+        }
+
+        return $decoded;
+    }
+}
+

+ 60 - 0
src/PdfRenderer.php

@@ -0,0 +1,60 @@
+<?php
+
+declare(strict_types=1);
+
+namespace AuditExpress;
+
+use Dompdf\Dompdf;
+use Dompdf\Options;
+
+final class PdfRenderer
+{
+    public function __construct(
+        private readonly string $rootDir
+    ) {
+    }
+
+    public function renderPdfBytes(array $pack, array $result, array $meta = []): string
+    {
+        if (!class_exists(Dompdf::class)) {
+            throw new \RuntimeException('Dompdf is not installed. Run: composer install');
+        }
+
+        $html = $this->renderHtml($pack, $result, $meta);
+
+        $options = new Options();
+        $options->set('isRemoteEnabled', false);
+        $options->set('isHtml5ParserEnabled', true);
+
+        $dompdf = new Dompdf($options);
+        $dompdf->loadHtml($html, 'UTF-8');
+        $dompdf->setPaper('A4', 'portrait');
+        $dompdf->render();
+
+        return $dompdf->output();
+    }
+
+    private function renderHtml(array $pack, array $result, array $meta): string
+    {
+        $data = [
+            'pack_title' => (string) ($pack['pack_title'] ?? ''),
+            'date' => (string) ($meta['date'] ?? date('Y-m-d')),
+            'booking_url' => (string) ($meta['booking_url'] ?? ''),
+            'result' => $result,
+        ];
+
+        $tpl = $this->rootDir . '/templates/pdf_a4.php';
+        if (!is_file($tpl)) {
+            throw new \RuntimeException('Missing template: templates/pdf_a4.php');
+        }
+
+        ob_start();
+        /** @noinspection PhpIncludeInspection */
+        $data = $data;
+        include $tpl;
+        $html = (string) ob_get_clean();
+
+        return $html;
+    }
+}
+

+ 30 - 0
src/RulesRepository.php

@@ -0,0 +1,30 @@
+<?php
+
+declare(strict_types=1);
+
+namespace AuditExpress;
+
+final class RulesRepository
+{
+    public function __construct(
+        private readonly string $rootDir
+    ) {
+    }
+
+    public function getRules(): array
+    {
+        $path = $this->rootDir . '/audit-structure.json';
+        $raw = file_get_contents($path);
+        if ($raw === false) {
+            throw new \RuntimeException('Unable to read rules file');
+        }
+
+        $decoded = json_decode($raw, true);
+        if (!is_array($decoded)) {
+            throw new \RuntimeException('Invalid rules JSON');
+        }
+
+        return $decoded;
+    }
+}
+

+ 136 - 0
templates/pdf_a4.php

@@ -0,0 +1,136 @@
+<?php
+/** @var array $data */
+
+$esc = static fn(string $s): string => htmlspecialchars($s, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
+
+$result = $data['result'];
+$packTitle = $data['pack_title'] ?? 'Contrôle technique du process';
+$date = $data['date'] ?? date('Y-m-d');
+$bookingUrl = (string) ($data['booking_url'] ?? '');
+
+$score = (int) ($result['score_total'] ?? 0);
+$level = (string) ($result['level'] ?? '');
+$levelLabel = (string) ($result['level_label'] ?? '');
+$confidenceLabel = (string) ($result['confidence']['label'] ?? '');
+
+$pillars = (array) ($result['pillars'] ?? []);
+$risks = (array) ($result['risks_top3'] ?? []);
+$wins = (array) ($result['quick_wins_top5'] ?? []);
+$cost = $result['cost_hidden'] ?? null;
+
+?>
+<!doctype html>
+<html lang="fr">
+  <head>
+    <meta charset="utf-8" />
+    <style>
+      @page { size: A4; margin: 18mm 16mm; }
+      body { font-family: DejaVu Sans, Arial, sans-serif; color: #111827; font-size: 12px; }
+      h1 { font-size: 18px; margin: 0 0 4px 0; }
+      .muted { color: #6b7280; }
+      .row { display: block; }
+      .card { border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
+      .score { display: table; width: 100%; }
+      .score .left, .score .right { display: table-cell; vertical-align: top; }
+      .big { font-size: 28px; font-weight: 700; }
+      .badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-weight: 700; background: #f3f4f6; }
+      .bar { height: 8px; background: #f3f4f6; border-radius: 999px; overflow: hidden; }
+      .bar > span { display: block; height: 100%; background: #111827; }
+      .pillars { margin-top: 8px; }
+      .pillar { margin: 7px 0; }
+      .pillar .top { display: table; width: 100%; }
+      .pillar .top .name, .pillar .top .val { display: table-cell; }
+      .pillar .top .val { text-align: right; font-weight: 700; }
+      .list { margin: 6px 0 0 0; padding: 0 0 0 14px; }
+      .list li { margin: 4px 0; }
+      .two { display: table; width: 100%; }
+      .two .col { display: table-cell; width: 50%; vertical-align: top; padding-right: 8px; }
+      .two .col:last-child { padding-right: 0; padding-left: 8px; }
+      .small { font-size: 11px; }
+      .cta { margin-top: 10px; }
+      .link { color: #111827; text-decoration: none; }
+      .hr { border-top: 1px solid #e5e7eb; margin: 10px 0; }
+    </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) ?>
+    </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>
+      <div class="right">
+        <div class="pillars">
+          <?php foreach ($pillars as $p): 
+            $pScore = (int) ($p['score'] ?? 0);
+            $pMax = (int) ($p['max'] ?? 20);
+            $pct = $pMax > 0 ? (int) round(($pScore / $pMax) * 100) : 0;
+          ?>
+            <div class="pillar">
+              <div class="top">
+                <div class="name"><?= $esc((string) ($p['label'] ?? $p['id'] ?? '')) ?></div>
+                <div class="val"><?= $esc((string)$pScore) ?>/<?= $esc((string)$pMax) ?></div>
+              </div>
+              <div class="bar"><span style="width: <?= $esc((string)$pct) ?>%"></span></div>
+            </div>
+          <?php endforeach; ?>
+        </div>
+      </div>
+    </div>
+
+    <div class="two">
+      <div class="col">
+        <div class="card">
+          <strong>Top 3 risques probables</strong>
+          <ol class="list">
+            <?php foreach ($risks as $r): ?>
+              <li>
+                <strong><?= $esc((string) ($r['title'] ?? '')) ?></strong><br/>
+                <span class="small"><?= $esc((string) ($r['what_happens'] ?? '')) ?></span>
+              </li>
+            <?php endforeach; ?>
+          </ol>
+        </div>
+      </div>
+      <div class="col">
+        <div class="card">
+          <strong>Actions prioritaires (30 jours)</strong>
+          <ol class="list">
+            <?php foreach ($wins as $w): ?>
+              <li>
+                <strong><?= $esc((string) ($w['title'] ?? '')) ?></strong><br/>
+                <span class="small"><?= $esc((string) ($w['effect'] ?? '')) ?></span>
+              </li>
+            <?php endforeach; ?>
+          </ol>
+        </div>
+      </div>
+    </div>
+
+    <div class="card">
+      <strong>Coût caché estimé</strong>
+      <div class="small muted">Estimation indicative, à valider par mesure réelle.</div>
+      <div class="hr"></div>
+      <?php if (is_array($cost)): ?>
+        <div>Temps perdu estimé : <strong><?= $esc((string) ($cost['hours_per_month'] ?? '')) ?> h/mois</strong></div>
+        <div>Estimation : <strong><?= $esc((string) ($cost['eur_per_month'] ?? '')) ?> €/mois</strong></div>
+        <div class="small muted">Hypothèses : volume <?= $esc((string) ($cost['volume_per_month'] ?? '')) ?>/mois, coût horaire <?= $esc((string) ($cost['assumptions']['hourly_cost'] ?? '')) ?>€.</div>
+      <?php else: ?>
+        <div class="muted small">Non calculé (volume/cout horaire non renseignés).</div>
+      <?php endif; ?>
+    </div>
+
+    <?php if ($bookingUrl !== ''): ?>
+      <div class="cta small">
+        Prochain pas : Revue express 20 minutes — <span class="muted">valider le diagnostic, prioriser, décider du plan minimal.</span><br/>
+        Lien : <span class="link"><?= $esc($bookingUrl) ?></span>
+      </div>
+    <?php endif; ?>
+  </body>
+</html>
+