/* ============================================================================
   Charte visuelle v2 (26/11/2026) — « sérieux de A + touches vivantes de B »
   S'applique aux pages dont le <body> porte la classe .charte-v2.
   Elle redéfinit les variables de marketing.css (thème clair ET sombre) et ajoute
   les éléments de signature : papier millimétré, surlignage, formes douces, couleurs des ceintures.
   Pour revenir en arrière sur une page : retirer la classe .charte-v2 du <body>.
   ============================================================================ */

/* ---------- Thème clair : ivoire, encre, sarcelle ---------- */
body.charte-v2 {
  --mkt-navy: #fbfaf7;            /* fond de page : ivoire */
  --mkt-panel: #ffffff;
  --mkt-panel-soft: #f3f1ec;
  --mkt-section-contrast: #f4f2ed;
  --mkt-border: #e7e5df;
  --mkt-text: #111827;
  --mkt-muted: #4b5563;
  --mkt-teal: #0f6b64;            /* couleur de marque */
  --mkt-amber: #b45309;
  --mkt-primary-ink: #ffffff;
  --mkt-accent-ink: #ffffff;
  --mkt-hero-glow: rgba(153, 246, 228, .30);
  --mkt-yellow-soft: rgba(217, 119, 6, .08);
  --mkt-hover: rgba(17, 24, 39, .04);
  --mkt-focus: #0f6b64;
  --v2-grid: rgba(17, 24, 39, .045);       /* traits du papier millimétré */
  --v2-mark: #fde68a;                       /* surligneur */
  --v2-blob-1: rgba(153, 246, 228, .40);    /* menthe */
  --v2-blob-2: rgba(254, 215, 170, .45);    /* abricot */
  --v2-shadow: 0 30px 60px -34px rgba(15, 107, 100, .45);
  --v2-yellow-bg: #fef3c7; --v2-yellow-ink: #92400e;
  --v2-green-bg: #d1fae5;  --v2-green-ink: #065f46;
  --v2-black-bg: #e5e7eb;  --v2-black-ink: #1f2937;
  background: var(--mkt-navy);
}

/* ---------- Thème sombre : encre de nuit, sarcelle lumineuse ---------- */
[data-theme="dark"] body.charte-v2 {
  --mkt-navy: #0b1120;
  --mkt-panel: #111a2c;
  --mkt-panel-soft: #162238;
  --mkt-section-contrast: #0e1628;
  --mkt-border: rgba(148, 163, 184, .18);
  --mkt-text: #f1f5f9;
  --mkt-muted: #a7b4c6;
  --mkt-teal: #2dd4bf;
  --mkt-amber: #f59e0b;
  --mkt-primary-ink: #042f2e;
  --mkt-accent-ink: #291700;
  --mkt-hero-glow: rgba(45, 212, 191, .14);
  --mkt-yellow-soft: rgba(245, 158, 11, .10);
  --mkt-hover: rgba(255, 255, 255, .06);
  --mkt-focus: #5eead4;
  --v2-grid: rgba(148, 163, 184, .07);
  --v2-mark: rgba(245, 158, 11, .38);
  --v2-blob-1: rgba(45, 212, 191, .14);
  --v2-blob-2: rgba(245, 158, 11, .10);
  --v2-shadow: 0 30px 60px -34px rgba(0, 0, 0, .8);
  --v2-yellow-bg: rgba(245, 158, 11, .15); --v2-yellow-ink: #fcd34d;
  --v2-green-bg: rgba(52, 211, 153, .15);  --v2-green-ink: #6ee7b7;
  --v2-black-bg: rgba(148, 163, 184, .16); --v2-black-ink: #e2e8f0;
}

/* ---------- Typographie ---------- */
body.charte-v2 h1 { letter-spacing: -.025em; }
body.charte-v2 mark, body.charte-v2 .v2-mark {
  background: linear-gradient(180deg, transparent 60%, var(--v2-mark) 60%);
  color: inherit; padding: 0 .06em; border-radius: 2px;
}

/* ---------- En-tête de page : papier millimétré + formes douces ---------- */
body.charte-v2 .v2-hero { position: relative; overflow: hidden; isolation: isolate;
  background-color: var(--mkt-navy);
  background-image: linear-gradient(var(--v2-grid) 1px, transparent 1px), linear-gradient(90deg, var(--v2-grid) 1px, transparent 1px);
  background-size: 28px 28px; }
body.charte-v2 .v2-hero::before, body.charte-v2 .v2-hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(40px); z-index: -1; pointer-events: none; }
body.charte-v2 .v2-hero::before { width: 420px; height: 420px; background: var(--v2-blob-1); right: 4%; top: -140px; }
body.charte-v2 .v2-hero::after { width: 320px; height: 320px; background: var(--v2-blob-2); right: 34%; bottom: -190px; }
body.charte-v2 .v2-bell { position: absolute; left: -60px; bottom: -6px; width: 560px; max-width: 70%; opacity: .30; z-index: -1; pointer-events: none; }
[data-theme="dark"] body.charte-v2 .v2-bell { opacity: .22; }

/* Pastille « nouveau » */
body.charte-v2 .v2-pill { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; color: var(--mkt-text);
  background: var(--mkt-panel); border: 1px solid var(--mkt-border); padding: 5px 12px 5px 5px; border-radius: 999px;
  box-shadow: 0 4px 14px -8px rgba(17, 24, 39, .25); margin-bottom: 18px; text-decoration: none; }
body.charte-v2 .v2-pill b { background: var(--v2-green-bg); color: var(--v2-green-ink); border-radius: 999px; padding: 3px 9px; font-size: .72rem; }
body.charte-v2 .v2-pill:hover { border-color: var(--mkt-teal); }

/* Couleurs des ceintures */
body.charte-v2 .v2-belts { display: flex; gap: 8px; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; }
body.charte-v2 .v2-belts li { font-size: .78rem; font-weight: 600; padding: 5px 11px; border-radius: 999px; }
body.charte-v2 .v2-belts .y { background: var(--v2-yellow-bg); color: var(--v2-yellow-ink); }
body.charte-v2 .v2-belts .g { background: var(--v2-green-bg); color: var(--v2-green-ink); }
body.charte-v2 .v2-belts .k { background: var(--v2-black-bg); color: var(--v2-black-ink); }

/* Bande de chiffres */
body.charte-v2 .v2-stats { background: var(--mkt-panel); border-block: 1px solid var(--mkt-border); }
body.charte-v2 .v2-stats .container { display: grid; grid-template-columns: repeat(4, 1fr); }
body.charte-v2 .v2-stats div { padding: 24px 10px; text-align: center; border-right: 1px solid var(--mkt-border); }
body.charte-v2 .v2-stats div:last-child { border-right: 0; }
body.charte-v2 .v2-stats strong { display: block; font: 800 2rem/1.1 var(--font-display); color: var(--mkt-text); }
body.charte-v2 .v2-stats strong em { font-style: normal; color: var(--mkt-teal); }
body.charte-v2 .v2-stats span { color: var(--mkt-muted); font-size: .88rem; }

/* Boutons : sarcelle pleine avec ombre colorée */
body.charte-v2.marketing-page .btn-primary { box-shadow: 0 12px 24px -14px var(--mkt-teal); }
body.charte-v2.marketing-page .btn { transition: transform .15s, box-shadow .15s, filter .15s; }
body.charte-v2.marketing-page .btn:hover { transform: translateY(-1px); }
body.charte-v2.marketing-page .btn-outline { background: var(--mkt-panel); }

/* Cartes : coins plus doux, soulèvement au survol */
body.charte-v2 .offre, body.charte-v2 .home-step, body.charte-v2 .profil, body.charte-v2 .home-res a { border-radius: 18px; }
body.charte-v2 .offre { transition: transform .15s, box-shadow .15s; }
body.charte-v2 .offre:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -24px rgba(17, 24, 39, .35); }
body.charte-v2 .offre--yellow { background: linear-gradient(170deg, var(--mkt-yellow-soft), var(--mkt-panel) 55%); }

/* Numéros d'étapes colorés */
body.charte-v2 .home-step__n { border-radius: 11px; }
body.charte-v2 .home-step:nth-child(1) .home-step__n { background: var(--v2-green-bg); color: var(--v2-green-ink); }
body.charte-v2 .home-step:nth-child(2) .home-step__n { background: var(--v2-yellow-bg); color: var(--v2-yellow-ink); }
body.charte-v2 .home-step:nth-child(3) .home-step__n { background: #e0e7ff; color: #3730a3; }
[data-theme="dark"] body.charte-v2 .home-step:nth-child(3) .home-step__n { background: rgba(129, 140, 248, .18); color: #c7d2fe; }

/* Carte « question d'essai » : légère inclinaison et forme abricot derrière */
body.charte-v2 .sample { position: relative; transform: rotate(-1deg); box-shadow: var(--v2-shadow); border-radius: 20px; }
body.charte-v2 .sample::after { content: ""; position: absolute; right: -14px; bottom: -14px; width: 90px; height: 90px; border-radius: 18px; background: var(--v2-blob-2); z-index: -1; transform: rotate(8deg); }

/* Sections : fond chaud discret */
body.charte-v2 .marketing-section--soft { background: linear-gradient(180deg, var(--mkt-section-contrast), var(--mkt-navy)); }

/* Respect des préférences : pas d'animation si l'utilisateur les a réduites */
@media (prefers-reduced-motion: reduce) {
  body.charte-v2 .offre, body.charte-v2.marketing-page .btn { transition: none; }
  body.charte-v2 .offre:hover, body.charte-v2.marketing-page .btn:hover { transform: none; }
}

@media (max-width: 900px) {
  body.charte-v2 .v2-stats .container { grid-template-columns: 1fr 1fr; }
  body.charte-v2 .v2-stats div:nth-child(2) { border-right: 0; }
  body.charte-v2 .v2-stats div:nth-child(-n+2) { border-bottom: 1px solid var(--mkt-border); }
}
@media (max-width: 560px) {
  body.charte-v2 .sample { transform: none; }
  body.charte-v2 .v2-bell { display: none; }
}

/* Illustration « carte de contrôle » (accueil, section Pourquoi) */
body.charte-v2 .v2-chart { margin: 0; }
body.charte-v2 .v2-chart svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 24px 30px rgba(17, 24, 39, .10)); }
body.charte-v2 .v2-chart figcaption { color: var(--mkt-muted); font-size: .88rem; margin-top: .7rem; text-align: center; }

/* ---------- Page Quiz (variables de style.css) ---------- */
body.charte-v2.quiz-app-page {
  --color-secondary: #0f6b64;
  --bg-dark: #fbfaf7;
  --bg-surface-light: #f3f1ec;
  --saas-border: #e7e5df;
  background-color: #fbfaf7;
  background-image: linear-gradient(var(--v2-grid) 1px, transparent 1px), linear-gradient(90deg, var(--v2-grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
[data-theme="dark"] body.charte-v2.quiz-app-page {
  --color-secondary: #2dd4bf;
  --bg-dark: #0b1120;
  --bg-surface: #111a2c;
  --bg-surface-light: #162238;
  --saas-border: rgba(148, 163, 184, .18);
  background-color: #0b1120;
}
body.charte-v2.quiz-app-page .cockpit-rail,
body.charte-v2.quiz-app-page .workspace-main,
body.charte-v2.quiz-app-page .workspace-sidebar > section { border-radius: 18px; box-shadow: 0 18px 40px -30px rgba(17, 24, 39, .30); }
body.charte-v2.quiz-app-page .app-launch { box-shadow: 0 12px 24px -14px var(--color-secondary); }

/* ============================================================================
   Couche commune : variables de style.css (toutes les autres pages du site)
   ============================================================================ */
body.charte-v2 {
  --color-secondary: #0f6b64;
  --color-secondary-light: #14b8a6;
  --bg-dark: #fbfaf7;
  --bg-surface: #ffffff;
  --bg-surface-light: #f3f1ec;
  --bg-card: rgba(255, 255, 255, .9);
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --gradient-accent: linear-gradient(135deg, #0f6b64 0%, #14b8a6 100%);
  --gradient-title: linear-gradient(135deg, #111827 0%, #0f6b64 100%);
  --gradient-hero: radial-gradient(ellipse 70% 50% at 70% -10%, rgba(153, 246, 228, .25), transparent 70%), transparent;
  --glass-bg: rgba(251, 250, 247, .82);
  --glass-border: #e7e5df;
  --saas-border: #e7e5df;
  --saas-bg-card: #ffffff;
  --saas-bg-hover: #f7f5f0;
  --option-bg: #ffffff;
  --option-border: #e7e5df;
  --option-hover-bg: #f7f5f0;
  --option-hover-border: #0f6b64;
  --shadow-glow: 0 0 30px rgba(15, 107, 100, .10);
  background-color: var(--bg-dark);
  background-image: linear-gradient(var(--v2-grid) 1px, transparent 1px), linear-gradient(90deg, var(--v2-grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
[data-theme="dark"] body.charte-v2 {
  --color-secondary: #2dd4bf;
  --color-secondary-light: #5eead4;
  --bg-dark: #0b1120;
  --bg-surface: #111a2c;
  --bg-surface-light: #162238;
  --bg-card: rgba(17, 26, 44, .9);
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --gradient-accent: linear-gradient(135deg, #0f766e 0%, #2dd4bf 100%);
  --gradient-title: linear-gradient(135deg, #f1f5f9 0%, #2dd4bf 100%);
  --gradient-hero: radial-gradient(ellipse 70% 50% at 70% -10%, rgba(45, 212, 191, .12), transparent 70%), transparent;
  --glass-bg: rgba(11, 17, 32, .82);
  --glass-border: rgba(148, 163, 184, .16);
  --saas-border: rgba(148, 163, 184, .18);
  --saas-bg-card: #111a2c;
  --saas-bg-hover: #162238;
  --option-bg: #111a2c;
  --option-border: rgba(148, 163, 184, .18);
  --option-hover-bg: #162238;
  --option-hover-border: #2dd4bf;
  background-color: #0b1120;
}
/* En-tête du site : verre ivoire / nuit */
body.charte-v2 .header { background: var(--glass-bg); border-bottom-color: var(--glass-border); }

/* Ligne légale compacte (pages sans bas de page complet : 404, spécimen, modèles vierges, lecteur…) — lot A 26/11 */
.lsp-legal-line { max-width: 1100px; margin: 40px auto 24px; padding: 14px 20px 0; border-top: 1px solid var(--mkt-border, #e7e5df);
  text-align: center; font-size: .82rem; color: var(--mkt-muted, #4b5563); }
.lsp-legal-line a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
@media print { .lsp-legal-line { display: none; } }
/* Bouton Connexion dans l'en-tête compact (articles, cours, guide) */
.header-actions .auth-btn { white-space: nowrap; }
@media (max-width: 480px) { .header-actions .auth-btn { padding: .42rem .8rem; font-size: .8rem; } }

/* Modules de cours : tableaux lisibles sur mobile (défilement horizontal, mots entiers) — lot B 26/11 */
@media (max-width: 700px) {
  .lesson-content table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .lesson-content table :is(th, td) { overflow-wrap: normal; word-break: normal; hyphens: manual; min-width: 7.5rem; }
}
