/* ══════════════════════════════════════════════════════════════════════
   BatiPilot · fondations du design
   Inspiration : interfaces SaaS du bâtiment type Vertuoza — bleu nuit,
   bleu roi, fonds bleutés, cartes arrondies à ombre douce, titres en
   capitales avec mot-clé surligné, pastilles, accent cyan.
   Identité BatiPilot : l'orange du toit du logo, et le « plan d'archi »
   (connexion, visionneuse de plans).
   ══════════════════════════════════════════════════════════════════════ */

/* ─── Polices locales (Barlow, licence OFL) ─────────────────────────── */
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/barlow-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap; src: url("/assets/fonts/barlow-condensed-latin-800-normal.woff2") format("woff2"); }

/* ─── Thème clair ───────────────────────────────────────────────────── */
:root {
  /* Fonds et surfaces */
  --fond: #F4F7FE;
  --fond-2: #EBF0FC;
  --surface: #FFFFFF;
  --surface-2: #F8FAFF;
  --surface-3: #EFF3FD;

  /* Texte et traits */
  --encre: #0A1446;            /* bleu nuit */
  --encre-2: #4A5378;
  --encre-3: #8A93B2;
  --trait: #E2E8F6;
  --trait-fort: #C6D2EE;

  /* Couleurs d'action */
  --primaire: #1748E0;         /* bleu roi */
  --primaire-fonce: #0E35B3;
  --primaire-pale: #E8EEFE;
  --primaire-doux: #9DB4F2;
  --sur-primaire: #FFFFFF;
  --cyan: #00E3DD;             /* accent vif : badges, repères */
  --sur-cyan: #0A1446;
  --orange: #FF5A2C;           /* couleur de marque BatiPilot (toit du logo) */
  --orange-pale: #FFEDE6;

  /* États */
  --vert: #0E9F5B;   --vert-pale: #E2F6EC;
  --rouge: #E0393E;  --rouge-pale: #FDE7E8;
  --jaune: #F2B400;  --jaune-pale: #FFF5D5;  --jaune-texte: #855F00;

  /* Barre latérale (toujours sombre) */
  --marine: #0A1446;
  --marine-2: #101D5C;
  --marine-3: #18297C;
  --marine-trait: rgba(255, 255, 255, .08);
  --marine-texte: #E9EEFF;
  --marine-texte-2: #98A4D3;

  /* Corps d'état (spécification BatiPilot) */
  --t-peinture: #8B5CF6;
  --t-maconnerie: #E8692B;
  --t-plomberie: #0BA5C7;
  --t-electricite: #E0A800;
  --t-manoeuvre: #10A36A;
  --t-finition: #4F7DE8;
  --t-autre: #9AA3BD;
  /* Lots de rénovation du Gantt : couleurs franches, une par lot */
  --g-demolition: #E3201B;
  --g-maconnerie: #FF6A00;
  --g-plomberie: #1C64D1;
  --g-electricite: #FFC400;
  --g-platrerie: #0B1A52;
  --g-menuiserie: #9C5A2B;
  --g-sols: #00A19A;
  --g-peinture: #7B3FE4;
  --g-facade: #E5007D;
  --g-toiture: #A3151A;
  --g-finition: #5DAA2E;
  --g-autre: #7C86A8;
  --g-entete: #0A1446;
  --g-ligne: rgba(10, 20, 70, .22);

  /* Couleurs générées des chantiers et des salariés (teinte fixée par classe) */
  --s-site: 68%;  --l-site: 46%;  --texte-site: #FFFFFF;
  --s-pers: 66%;  --l-pers: 54%;

  /* Typographie */
  --police: "Barlow", "Segoe UI", system-ui, sans-serif;
  --police-titre: "Barlow Condensed", "Arial Narrow", "Barlow", sans-serif;
  --police-code: ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* Formes et ombres */
  --rayon: 8px;
  --rayon-l: 14px;
  --rayon-xl: 20px;
  --ombre: 0 1px 2px rgba(10, 20, 70, .04), 0 4px 14px rgba(23, 72, 224, .05);
  --ombre-carte: 0 8px 30px rgba(23, 72, 224, .10);
  --ombre-bouton: 0 6px 18px rgba(23, 72, 224, .28);
  --ombre-haute: 0 28px 70px rgba(10, 20, 70, .26);
  --transition: 180ms cubic-bezier(.25, .8, .25, 1);
  color-scheme: light;
}

/* ─── Thème sombre (bleu nuit) ──────────────────────────────────────── */
:root[data-theme="dark"] {
  --fond: #060B2B;
  --fond-2: #0A123B;
  --surface: #0D1747;
  --surface-2: #111D55;
  --surface-3: #162462;
  --encre: #EEF2FF;
  --encre-2: #AEB8DC;
  --encre-3: #7884B3;
  --trait: rgba(238, 242, 255, .09);
  --trait-fort: rgba(238, 242, 255, .2);
  --primaire: #6F8FFF;
  --primaire-fonce: #A3B6FF;
  --primaire-pale: rgba(111, 143, 255, .15);
  --primaire-doux: rgba(111, 143, 255, .45);
  --sur-primaire: #060B2B;
  --orange: #FF7B52;
  --orange-pale: rgba(255, 123, 82, .15);
  --vert: #3DDC97;   --vert-pale: rgba(61, 220, 151, .13);
  --rouge: #FF6B6F;  --rouge-pale: rgba(255, 107, 111, .14);
  --jaune: #FFD23F;  --jaune-pale: rgba(255, 210, 63, .13);  --jaune-texte: #FFD23F;
  --marine: #040824;
  --marine-2: #0A1340;
  --marine-3: #142161;
  --t-peinture: #A98BFF;
  --t-maconnerie: #FF915C;
  --t-plomberie: #4AD2EE;
  --t-electricite: #FFD23F;
  --t-manoeuvre: #4BE0A0;
  --t-finition: #86A6FF;
  --t-autre: #A3ADCF;
  --g-demolition: #FF4D47;
  --g-maconnerie: #FF8A33;
  --g-plomberie: #4D8DF5;
  --g-electricite: #FFD23F;
  --g-platrerie: #6E86F0;
  --g-menuiserie: #C98A55;
  --g-sols: #2FD1C8;
  --g-peinture: #A07BFF;
  --g-facade: #FF4FAA;
  --g-toiture: #E0504A;
  --g-finition: #7FD14A;
  --g-autre: #A3ADCF;
  --g-entete: #18297C;
  --g-ligne: rgba(238, 242, 255, .16);
  --s-site: 78%;  --l-site: 68%;  --texte-site: #060B2B;
  --s-pers: 72%;  --l-pers: 68%;
  --ombre: 0 1px 2px rgba(0, 0, 0, .3);
  --ombre-carte: 0 10px 32px rgba(0, 0, 0, .35);
  --ombre-bouton: 0 6px 20px rgba(111, 143, 255, .3);
  --ombre-haute: 0 28px 70px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ─── Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.55 var(--police);
  color: var(--encre);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: var(--primaire); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--primaire-fonce); }
:focus-visible { outline: 3px solid var(--primaire-doux); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--primaire); color: var(--sur-primaire); }
h1, h2, h3, .titre { font-family: var(--police); font-weight: 700; letter-spacing: -.01em; line-height: 1.15; margin: 0; }
p { margin: 0 0 .6em; }
small { font-size: 12.5px; }
code, kbd { font-family: var(--police-code); font-size: .85em; background: var(--surface-3); padding: 2px 6px; border-radius: 5px; }
img { max-width: 100%; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--trait-fort); border: 3px solid transparent; background-clip: padding-box; border-radius: 8px; }
* { scrollbar-width: thin; scrollbar-color: var(--trait-fort) transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
