/* ETB ENERGIES — charte « Quatre flux » appliquée à l'application.
 * Source : docs/design/ (charte graphique validée). Tokens, thème sombre, logotype. */

:root {
  color-scheme: light;

  /* Marque (charte, page 04) */
  --graphite: #1F2328;
  --ardoise: #5F6368;
  --beton: #E7E7E3;
  --papier: #F5F5F3;
  --filet: #D3D3CE;
  --blanc: #FFFFFF;

  /* Métiers (charte, page 05) : signature / texte AA sur fond clair */
  --chauffage: #E0573C;     --chauffage-texte: #B83E26;
  --plomberie: #2F7FCE;     --plomberie-texte: #1F63A8;
  --ventilation: #2B9A6C;   --ventilation-texte: #1E7A53;
  --climatisation: #3AA3C4; --climatisation-texte: #1F7F9C;

  /* Rôles d'interface */
  --bg: var(--papier);
  --surface: var(--blanc);
  --surface-2: #FAFAF8;
  --sunk: var(--beton);
  --ink: #1A1C1E;
  --ink-2: #3F4348;
  --ink-3: var(--ardoise);
  --line: var(--filet);
  --line-soft: #E7E7E3;
  --primary: var(--graphite);
  --on-primary: var(--papier);
  --action: var(--chauffage);           /* urgence 24/7, appel à l'action */
  --on-action: #FFFFFF;                 /* icônes et grands textes seulement (3,75:1) */
  --on-action-text: #1A1C1E;            /* texte courant sur l'orange : encre de la charte, 4,56:1 (WCAG AA) */
  --alert-fixed: #B83E26;               /* fond d'alerte, même valeur en thème sombre (texte clair 5,1:1) */
  --link: var(--plomberie-texte);
  --ok: var(--ventilation-texte);
  --ok-soft: #E3F1EA;
  --danger: var(--chauffage-texte);
  --danger-soft: #FBE6E1;
  --info: var(--plomberie-texte);
  --info-soft: #E4EEF9;
  /* Tuile du planning (lot 9 B) : fond selon l'état. Textes de la tuile (encre, ardoise) AA sur
     chacun, rayures comprises ; un peu plus soutenus que --info-soft et --ok-soft pour se
     distinguer d'un coup d'œil. L'orange pâle n'est ni l'orange d'action (#E0573C) ni l'alerte
     (--danger-soft, rosé). */
  --tile-done: #DCE9F8;     /* terminée */
  --tile-billed: #D5ECDD;   /* terminée et facturée (gérant seulement) */
  --tile-follow: #FBE1C3;   /* suite à donner ouverte */
  --follow-text: #8A4B12;   /* texte et pictogramme « Suite à donner » (6,8:1 sur blanc, 5,4:1 sur l'orange pâle) */
  --focus: var(--plomberie);
  --shadow: 0 1px 2px rgba(31, 35, 40, .06), 0 4px 16px rgba(31, 35, 40, .06);
  --shadow-lg: 0 8px 32px rgba(31, 35, 40, .18);

  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-text: 'Barlow', Arial, sans-serif;
  --radius: 6px;          /* charte : rayon des angles 6 px */
  --radius-lg: 10px;
  --tap: 48px;            /* cible tactile minimale (terrain, gants, caves) */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111315;
    --surface: #1A1D21;
    --surface-2: #202328;
    --sunk: #0C0E10;
    --ink: #F1F1EE;
    --ink-2: #C9CBCC;
    --ink-3: #9A9EA3;
    --line: #33373D;
    --line-soft: #26292E;
    --primary: var(--papier);
    --on-primary: var(--graphite);
    --link: #7DB5EC;
    --ok: #5CC596;
    --ok-soft: #173327;
    --danger: #F08A73;
    --danger-soft: #3A1E18;
    --info: #7DB5EC;
    --info-soft: #172A3D;
    --tile-done: #183049;
    --tile-billed: #163A28;
    --tile-follow: #42301A;
    --follow-text: #F2B36B;
    --chauffage-texte: #F08A73;
    --plomberie-texte: #7DB5EC;
    --ventilation-texte: #5CC596;
    --climatisation-texte: #6CC4DF;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111315;
  --surface: #1A1D21;
  --surface-2: #202328;
  --sunk: #0C0E10;
  --ink: #F1F1EE;
  --ink-2: #C9CBCC;
  --ink-3: #9A9EA3;
  --line: #33373D;
  --line-soft: #26292E;
  --primary: var(--papier);
  --on-primary: var(--graphite);
  --link: #7DB5EC;
  --ok: #5CC596;
  --ok-soft: #173327;
  --danger: #F08A73;
  --danger-soft: #3A1E18;
  --info: #7DB5EC;
  --info-soft: #172A3D;
  --tile-done: #183049;
  --tile-billed: #163A28;
  --tile-follow: #42301A;
  --follow-text: #F2B36B;
  --chauffage-texte: #F08A73;
  --plomberie-texte: #7DB5EC;
  --ventilation-texte: #5CC596;
  --climatisation-texte: #6CC4DF;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, .5);
}

/* ---------- Logotype (charte, page 03) ----------
 * --s = hauteur du sigle en px (sans unité). Modificateurs : --inline, --dark, --auto
 * (--auto suit le thème : graphite en clair, papier en sombre). */
.etb-logo {
  --s: 64;
  --m: max(4px, calc(var(--s) * 0.16px));
  --logo-main: var(--graphite);
  --logo-sub: #1A1C1E;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: calc(var(--s) * 0.06px);
  line-height: 1;
}
.etb-logo--inline { flex-direction: row; align-items: baseline; gap: calc(var(--s) * 0.28px); }
.etb-logo--dark { --logo-main: var(--papier); --logo-sub: var(--papier); }
.etb-logo--auto { --logo-main: var(--primary); --logo-sub: var(--ink); }
.etb-logo__etb {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: calc(var(--s) * 1px);
  line-height: 0.9;
  color: var(--logo-main);
}
.etb-logo__row { display: flex; align-items: center; gap: calc(var(--s) * 0.14px); }
.etb-logo__marks { display: flex; align-items: center; gap: calc(var(--m) * 0.45); }
.etb-logo__marks > i { flex: none; width: var(--m); height: var(--m); border-radius: 50%; }
.etb-logo__marks > i:nth-child(1) { background: var(--chauffage); }
.etb-logo__marks > i:nth-child(2) { background: var(--plomberie); }
.etb-logo__marks > i:nth-child(3) { background: var(--ventilation); }
.etb-logo__marks > i:nth-child(4) { background: var(--climatisation); }
.etb-logo__en {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: calc(var(--s) * 0.26px);
  letter-spacing: 0.34em;
  line-height: 1;
  color: var(--logo-sub);
}
.etb-logo--inline .etb-logo__en { font-size: calc(var(--s) * 0.42px); }

/* Bandeau quatre flux (pied des documents, barre de chargement) */
.flux-band { display: flex; height: 4px; }
.flux-band > i { flex: 1; }
.flux-band > i:nth-child(1) { background: var(--chauffage); }
.flux-band > i:nth-child(2) { background: var(--plomberie); }
.flux-band > i:nth-child(3) { background: var(--ventilation); }
.flux-band > i:nth-child(4) { background: var(--climatisation); }

/* Couleur d'un métier sur n'importe quel composant : class="m-chauffage" → --m-c / --m-t */
.m-chauffage     { --m-c: var(--chauffage);     --m-t: var(--chauffage-texte); }
.m-plomberie     { --m-c: var(--plomberie);     --m-t: var(--plomberie-texte); }
.m-ventilation   { --m-c: var(--ventilation);   --m-t: var(--ventilation-texte); }
.m-climatisation { --m-c: var(--climatisation); --m-t: var(--climatisation-texte); }

/* Logo de l'entreprise (08/10/2026, public/assets/img/logo-etb.svg ; View::logo) */
.etb-mark { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.etb-mark img { display: block; height: calc(var(--s, 40) * 2.2px); width: auto; max-width: 100%; }
.etb-mark--dark { background: #fff; border-radius: 10px; padding: 6px 10px; }
.etb-mark--inline img { height: 34px; }
.etb-mark--inline.etb-mark--dark { padding: 3px 8px; border-radius: 8px; }
