/* Masar Conseil : charte graphique (valeurs lues dans masar_charte_graphique.pdf, validée par le CEO le 17/11/2026).
   Structure : 1) jetons de la charte (jamais modifiés ici) ; 2) jetons sémantiques, clair/sombre définis une seule fois ;
   3) surfaces bleu nuit ; 4) composants qui n'utilisent QUE les jetons sémantiques. */

/* 1. Jetons de la charte */
:root {
  --charte-nuit: #1b2558;
  --charte-terre-fonce: #b4432b;   /* accent sur fond clair */
  --charte-terre: #e07b52;         /* accent sur fond sombre */
  --charte-blanc: #ffffff;
  --charte-gris: #f2f2f2;
  --charte-bordure: #e6e6e6;       /* 2 px */
  --charte-rayon: 32px;
  --charte-ombre: 5px 5px 12px rgba(0, 0, 0, .12);
  --charte-motif-opacite: .12;

  /* Hors charte, signalés pour validation : mode sombre (la charte n'en définit pas) et états d'erreur / de succès. */
  --nuit-profond: #131a3e;         /* nuit assombri de 30 %, fond du mode sombre */
  --erreur: #c0392b;
  --succes: #1e7b45;
  --rayon-champ: 16px;             /* la charte ne dit rien des champs de formulaire */
  /* Motif d'étoiles : reconstruction vectorielle mesurée sur le bandeau LinkedIn de Kyan (période 44 px, trait ~1 px, points aux
     coins de la cellule), en attendant le fichier source. Blanc plein : l'intensité vient de --charte-motif-opacite. */
  --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 332 332'%3E%3Cg fill='%23fff'%3E%3Cpath d='M316.9 166.0L311.4 158.4L298.3 152.1L286.9 146.8L277.0 142.4L268.4 138.6L262.1 134.8L258.1 130.6L256.2 125.9L256.0 120.1L257.8 113.0L261.2 104.2L265.0 94.0L269.4 82.3L274.2 68.6L272.7 59.3L263.4 57.8L249.7 62.6L238.0 67.0L227.8 70.8L219.0 74.2L211.9 76.0L206.1 75.8L201.4 73.9L197.2 69.9L193.4 63.6L189.6 55.0L185.2 45.1L179.9 33.7L173.6 20.6L166.0 15.1L158.4 20.6L152.1 33.7L146.8 45.1L142.4 55.0L138.6 63.6L134.8 69.9L130.6 73.9L125.9 75.8L120.1 76.0L113.0 74.2L104.2 70.8L94.0 67.0L82.3 62.6L68.6 57.8L59.3 59.3L57.8 68.6L62.6 82.3L67.0 94.0L70.8 104.2L74.2 113.0L76.0 120.1L75.8 125.9L73.9 130.6L69.9 134.8L63.6 138.6L55.0 142.4L45.1 146.8L33.7 152.1L20.6 158.4L15.1 166.0L20.6 173.6L33.7 179.9L45.1 185.2L55.0 189.6L63.6 193.4L69.9 197.2L73.9 201.4L75.8 206.1L76.0 211.9L74.2 219.0L70.8 227.8L67.0 238.0L62.6 249.7L57.8 263.4L59.3 272.7L68.6 274.2L82.3 269.4L94.0 265.0L104.2 261.2L113.0 257.8L120.1 256.0L125.9 256.2L130.6 258.1L134.8 262.1L138.6 268.4L142.4 277.0L146.8 286.9L152.1 298.3L158.4 311.4L166.0 316.9L173.6 311.4L179.9 298.3L185.2 286.9L189.6 277.0L193.4 268.4L197.2 262.1L201.4 258.1L206.1 256.2L211.9 256.0L219.0 257.8L227.8 261.2L238.0 265.0L249.7 269.4L263.4 274.2L272.7 272.7L274.2 263.4L269.4 249.7L265.0 238.0L261.2 227.8L257.8 219.0L256.0 211.9L256.2 206.1L258.1 201.4L262.1 197.2L268.4 193.4L277.0 189.6L286.9 185.2L298.3 179.9L311.4 173.6Z' fill='none' stroke='%23fff' stroke-width='7.3' stroke-linejoin='round'/%3E%3Ccircle cx='0' cy='0' r='11.0'/%3E%3Ccircle cx='332' cy='0' r='11.0'/%3E%3Ccircle cx='0' cy='332' r='11.0'/%3E%3Ccircle cx='332' cy='332' r='11.0'/%3E%3C/g%3E%3C/svg%3E");
  --motif-periode: 48px;

  --police: "Montserrat", "Segoe UI", Arial, sans-serif;
  --police-ar: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif; /* à valider : la charte ne définit pas l'arabe */
  color-scheme: light dark;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* 2. Jetons sémantiques (clair, sombre) */
:root {
  --fond: light-dark(var(--charte-blanc), var(--nuit-profond));
  --fond-alt: light-dark(var(--charte-gris), var(--charte-nuit));
  --carte: light-dark(var(--charte-blanc), rgba(255, 255, 255, .06));
  --texte: light-dark(var(--charte-nuit), #ffffff);
  --accent: light-dark(var(--charte-terre-fonce), var(--charte-terre));
  --sur-accent: light-dark(var(--charte-blanc), var(--charte-nuit));
  --filet: light-dark(var(--charte-bordure), rgba(230, 230, 230, .28));
  --focus: light-dark(var(--charte-nuit), #ffffff);
}

/* 3. Surfaces bleu nuit : mêmes jetons dans les deux modes */
.entete, .hero, .langues-bloc, .contact, .pied {
  --fond: var(--charte-nuit);
  --texte: #ffffff;
  --accent: var(--charte-terre);
  --sur-accent: var(--charte-nuit);
  --filet: rgba(230, 230, 230, .28);
  --focus: #ffffff;
  background: var(--charte-nuit);
  color: var(--texte);
}
/* Carte blanche posée sur une surface nuit (formulaire) : jetons du mode clair */
.formulaire {
  --fond: var(--charte-blanc);
  --texte: var(--charte-nuit);
  --accent: var(--charte-terre-fonce);
  --sur-accent: var(--charte-blanc);
  --filet: var(--charte-bordure);
  --focus: var(--charte-nuit);
}

/* 4. Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body { margin: 0; background: var(--fond); color: var(--texte); font-family: var(--police); font-weight: 400; font-size: 16px; line-height: 1.65; }
[dir="rtl"] body, [lang="ar"], [dir="rtl"] { font-family: var(--police-ar); }
[dir="rtl"] body { line-height: 1.85; }
[lang="tzm-Tfng"] { font-family: "Noto Sans Tifinagh", var(--police); }
[lang="fr"], [lang="en"] { font-family: var(--police); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .18em; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 16px; font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.15rem; }
strong { font-weight: 600; }
[dir="rtl"] h1, [dir="rtl"] h2 { letter-spacing: 0; line-height: 1.45; }
p { margin: 0 0 16px; }

.conteneur { width: min(1160px, 100% - 32px); margin-inline: auto; }
.etroit { width: min(760px, 100% - 32px); }
.evitement { position: absolute; inset-inline-start: 8px; top: -80px; background: var(--charte-nuit); color: #fff; padding: 8px 20px; z-index: 100; border-radius: var(--charte-rayon); font-weight: 600; }
.evitement:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }


/* En-tête */
.entete { position: sticky; top: 0; z-index: 50; }
.entete-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 84px; }
.marque img { width: 112px; height: auto; margin-block: 6px; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { color: var(--texte); text-decoration: none; font-size: .95rem; }
.nav a:hover { color: var(--accent); text-decoration: underline; }
.langues { display: flex; gap: 4px; padding-inline-start: 20px; border-inline-start: 2px solid var(--filet); }
.langue { padding: 4px 12px; border-radius: var(--charte-rayon); font-size: .85rem; font-weight: 600; color: var(--texte); }
.langue.actif { background: #fff; color: var(--charte-nuit); }
.burger { display: none; background: none; border: 2px solid var(--charte-bordure); color: var(--texte); font: inherit; font-weight: 600; padding: 8px 18px; border-radius: var(--charte-rayon); cursor: pointer; }
@media (max-width: 900px) {
  .burger { display: block; }
  .nav { display: none; position: absolute; inset-inline: 0; top: 84px; background: var(--charte-nuit); flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 20px; box-shadow: var(--charte-ombre); }
  .nav.ouvert { display: flex; }
  .nav a { padding: 12px 4px; border-bottom: 2px solid var(--filet); }
  .langues { border: 0; padding: 12px 0 0; }
}

/* Boutons : coins 32 px */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 28px; border-radius: var(--charte-rayon); font: inherit; font-weight: 600; text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: background .15s, color .15s, border-color .15s, box-shadow .15s; }
.bouton.principal { background: var(--accent); color: var(--sur-accent); }
.bouton.principal:hover { box-shadow: var(--charte-ombre); }
.bouton.contour { border-color: var(--charte-bordure); color: var(--texte); }
.bouton.contour:hover { border-color: var(--accent); color: var(--accent); }
.bouton[disabled] { cursor: wait; }
.ico-petit { width: 18px; height: 18px; flex: none; }
[dir="rtl"] .ico-petit { transform: scaleX(-1); }

/* Motif de la charte : sur bleu nuit, 12 % de blanc. Données dans --motif (data: URI : la CSP du site n'autorise ni style en ligne ni image externe). */
.hero, .langues-bloc, .contact, .pied { position: relative; isolation: isolate; }
.hero::before, .langues-bloc::before, .contact::before, .pied::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--motif) 0 0 / var(--motif-periode) var(--motif-periode) repeat;
  opacity: var(--charte-motif-opacite);
  /* variante « avec dégradé » de la charte : centre dégagé, là où se trouve le texte */
  -webkit-mask-image: radial-gradient(ellipse 80% 90% at 50% 50%, transparent 42%, #000 72%);
  mask-image: radial-gradient(ellipse 80% 90% at 50% 50%, transparent 42%, #000 72%);
}

/* Pied de page : variante « sans dégradé » (texte blanc seulement, aucun texte terre cuite). */
.pied::before { -webkit-mask-image: none; mask-image: none; }

/* Contact : le texte est dans la colonne de gauche (droite en arabe), le motif reste dans les marges haute et basse. */
.contact::before {
  -webkit-mask-image: linear-gradient(#000, transparent 56px, transparent calc(100% - 56px), #000);
  mask-image: linear-gradient(#000, transparent 56px, transparent calc(100% - 56px), #000);
}

/* Héros */
.hero { padding: 112px 0 0; }
.hero-in { position: relative; max-width: 820px; margin-inline: auto; text-align: center; padding-bottom: 72px; }
.hero .chapeau { font-size: 1.15rem; max-width: 680px; margin-inline: auto; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 32px; }
.trait { display: flex; align-items: center; padding-bottom: 40px; }
.trait span { flex: 1; height: 2px; background: var(--accent); }
.icone-masar { border-radius: 8%; }
.trait .icone-masar { width: 56px; height: 56px; margin-inline: 12px; }

.surtitre { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 600; color: var(--accent); margin-bottom: 12px; }
[dir="rtl"] .surtitre { letter-spacing: 0; text-transform: none; font-size: .95rem; }

/* Blocs */
.bloc { padding: 96px 0; }
.pale { background: var(--fond-alt); }
.chapeau-sombre { max-width: 680px; font-size: 1.05rem; margin-bottom: 40px; }
.deux { display: grid; grid-template-columns: 1.3fr 1fr; gap: 64px; align-items: center; }
.chiffres { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.chiffres li { display: flex; flex-direction: column; padding: 20px 28px; background: var(--carte); border: 2px solid var(--filet); border-radius: var(--charte-rayon); }
.chiffres strong { font-size: 1.7rem; color: var(--accent); }

.grille { display: grid; gap: 24px; }
.trois { grid-template-columns: repeat(3, 1fr); }
.carte { background: var(--carte); border: 2px solid var(--filet); border-radius: var(--charte-rayon); padding: 32px 28px; transition: box-shadow .15s; }
.carte:hover { box-shadow: var(--charte-ombre); }
.carte .ico { width: 44px; height: 44px; color: var(--accent); margin-bottom: 20px; }
.carte ul { margin: 0; padding: 0; list-style: none; }
.carte li { position: relative; padding-inline-start: 20px; margin-bottom: 8px; }
.carte li::before { content: ""; position: absolute; inset-inline-start: 0; top: .6em; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; }
.carte p { margin: 0; }

.langues-bloc { text-align: center; }
.langues-bloc .chapeau { max-width: 720px; margin-inline: auto; font-size: 1.1rem; }
.pastilles { list-style: none; padding: 0; margin: 40px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.pastilles li { padding: 12px 28px; border: 2px solid var(--charte-bordure); border-radius: var(--charte-rayon); font-size: 1.15rem; font-weight: 600; }

.etapes { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.etapes li { position: relative; }
.etapes .num { display: inline-grid; place-items: center; width: 44px; height: 44px; background: var(--accent); color: var(--sur-accent); font-weight: 600; border-radius: 16px; margin-bottom: 16px; }
.etapes li:not(:last-child)::after { content: ""; position: absolute; top: 21px; inset-inline-start: 60px; inset-inline-end: -12px; height: 2px; background: var(--filet); }

.partenaire { padding: 64px 0; border-top: 2px solid var(--filet); }
.partenaire-in { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.partenaire p:not(.surtitre) { max-width: 640px; margin: 0; }

/* Contact */
.contact .deux { align-items: start; }
.coord { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 16px; }
.coord li { display: flex; align-items: center; gap: 12px; }
.coord .ico { width: 24px; height: 24px; color: var(--accent); flex: none; }
.coord a { color: var(--texte); }
.formulaire { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; background: var(--fond); color: var(--texte); padding: 36px; border-radius: var(--charte-rayon); box-shadow: var(--charte-ombre); }
.champ { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; }
.large { grid-column: 1 / -1; }
.champ input, .champ textarea { font: inherit; font-weight: 400; color: var(--texte); background: var(--fond); padding: 12px 16px; border: 2px solid var(--charte-nuit); border-radius: var(--rayon-champ); width: 100%; }
.champ input:focus-visible, .champ textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.champ.invalide input, .champ.invalide textarea { border-color: var(--erreur); background: #fff6f5; }
.accord { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.accord input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--charte-nuit); }
.accord.invalide { color: var(--erreur); }
.statut { margin: 0; font-weight: 600; min-height: 1.4em; }
.statut.ok { color: var(--succes); }
.statut.erreur { color: var(--erreur); }
.piege { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Pages simples */
.page-simple { text-align: center; min-height: 55vh; }
.page-simple .icone-masar { width: 72px; height: 72px; margin: 0 auto 24px; }
.page-simple.texte { text-align: start; }
.page-simple.texte h2 { font-size: 1.2rem; margin-top: 32px; }
.maj { font-size: .9rem; margin-top: 40px; }

/* Pied */
.pied { padding: 48px 0; font-size: .92rem; }
.pied-in { display: grid; grid-template-columns: auto 1fr auto; gap: 32px; align-items: center; }
.pied img { width: 96px; }
.pied p { margin: 0 0 4px; }
.pied a { color: var(--texte); }

@media (max-width: 900px) {
  /* Petits écrans : le texte occupe toute la largeur ; le motif reste dans les 56 px de marge haute et basse (padding des blocs : 72 px). */
  .hero::before, .langues-bloc::before, .contact::before {
    -webkit-mask-image: linear-gradient(#000, transparent 56px, transparent calc(100% - 56px), #000);
    mask-image: linear-gradient(#000, transparent 56px, transparent calc(100% - 56px), #000);
  }
  .bloc { padding: 72px 0; }
  .hero { padding-top: 72px; }
  .deux, .trois { grid-template-columns: 1fr; gap: 40px; }
  .trois { gap: 24px; }
  .etapes { grid-template-columns: 1fr 1fr; }
  .etapes li::after { display: none; }
  .partenaire-in { flex-direction: column; align-items: flex-start; }
  .pied-in { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}
@media (max-width: 560px) {
  .formulaire { grid-template-columns: 1fr; padding: 24px 20px; }
  .etapes { grid-template-columns: 1fr; }
  .actions .bouton { width: 100%; }
}
