/* ============================================================
   CARRIER-FR — Appel d'offres transporteurs
   Design system

   Repris de WAREHOUSE-FR (logistique.wanhaofrance.com), avec quatre
   corrections délibérées :
     1. AUCUNE police Google. Pile système — le site est consulté depuis la
        France ET la Chine, où fonts.googleapis.com est bloqué : la page y
        restait en attente avant de retomber sur un rendu dégradé.
     2. Thème SOMBRE en plus du clair (l'original n'avait aucun
        prefers-color-scheme).
     3. Une SEULE palette (l'original avait un site orange et un dashboard teal).
     4. Le texte reste capé pour la lecture, mais graphes et tableaux prennent
        la largeur de l'écran — un tableau de volumes dans 1180 px, c'est deux
        bandes vides et une colonne illisible.
   ============================================================ */

:root {
  color-scheme: light dark;

  --ink: #1c1b19;
  --ink-soft: #2e2c29;
  --muted: #6b6862;
  --muted-2: #97938b;
  --paper: #f7f5f1;
  --paper-2: #ffffff;
  --paper-3: #f1eee8;
  --line: #e6e2da;
  --line-strong: #d2ccc1;

  /* Accent unique du site ET des graphes. */
  --accent: #1f6f6b;
  --accent-600: #175a57;
  --accent-soft: #e6f2f1;

  --ok: #15803d;
  --ok-soft: #ecfdf3;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --bad: #b91c1c;
  --bad-soft: #fef2f2;

  /* Série catégorielle des graphes — lisible dans les deux thèmes. */
  --s1: #1f6f6b; --s2: #c26b2c; --s3: #4b6bab; --s4: #7d9a3c;
  --s5: #9b5a8d; --s6: #a8a29a;

  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.06);
  --shadow-md: 0 4px 12px rgba(15,23,42,.08);

  /* Pile SYSTÈME : rien à télécharger, rendu natif, aucune dépendance. */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Cap de LECTURE seulement. Les grilles de données ne s'y plient pas. */
  --maxw-text: 78ch;
  --maxw: 1400px;
}

/* Le toggle doit gagner dans les DEUX sens : d'où la garde :not(). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ece9e3;
    --ink-soft: #d8d4cd;
    --muted: #9d988f;
    --muted-2: #7c776f;
    --paper: #161715;
    --paper-2: #1e201d;
    --paper-3: #262824;
    --line: #32352f;
    --line-strong: #454941;
    --accent: #4fb3ad;
    --accent-600: #6cc7c1;
    --accent-soft: #17302f;
    --ok-soft: #10241a; --warn-soft: #2a2010; --bad-soft: #2c1616;
    --s1: #4fb3ad; --s2: #e0954f; --s3: #7f9ede; --s4: #a8c766;
    --s5: #c68ab8; --s6: #8b877f;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,.45);
  }
}
:root[data-theme="dark"] {
  --ink: #ece9e3; --ink-soft: #d8d4cd; --muted: #9d988f; --muted-2: #7c776f;
  --paper: #161715; --paper-2: #1e201d; --paper-3: #262824;
  --line: #32352f; --line-strong: #454941;
  --accent: #4fb3ad; --accent-600: #6cc7c1; --accent-soft: #17302f;
  --ok-soft: #10241a; --warn-soft: #2a2010; --bad-soft: #2c1616;
  --s1: #4fb3ad; --s2: #e0954f; --s3: #7f9ede; --s4: #a8c766;
  --s5: #c68ab8; --s6: #8b877f;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); font-weight: 650; }
h3 { font-size: 1.02rem; font-weight: 620; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.prose { max-width: var(--maxw-text); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ── Barre du haut ───────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper-2) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .container { display: flex; align-items: center; gap: 18px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 640; }
.brand .logo {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; display: grid; place-items: center;
  font-size: .74rem; font-weight: 700; letter-spacing: .02em;
}
.brand .ref { display: block; font-size: .68rem; color: var(--muted); font-weight: 500; }
.nav-spacer { flex: 1; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: var(--ink-soft); font-size: .9rem; font-weight: 500; }

/* Segmenté langue + thème : le texte se rabat, rien ne saute. */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.seg button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: inherit; font-size: .78rem; font-weight: 600; padding: 5px 11px;
}
.seg button.active { background: var(--accent); color: #fff; }

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--paper-2); color: var(--ink);
  border-radius: var(--radius-sm); padding: 9px 16px;
  font: inherit; font-size: .9rem; font-weight: 550;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--paper-3); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-600); border-color: var(--accent-600); }
.btn-sm { padding: 6px 12px; font-size: .84rem; }
.btn svg { width: 15px; height: 15px; }

/* ── Hero ─────────────────────────────────────────────────────────────────
   Même parti pris que l'appel d'offres logistique : fond sombre, halo d'accent,
   accroche en évidence. Sans le bandeau vidéo YouTube de l'original : le
   domaine est bloqué en Chine, où ce site sera consulté. */
.hero {
  background: linear-gradient(160deg, #232220 0%, #34322e 100%);
  color: #fff; padding: 40px 0 46px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(820px 420px at 88% -12%,
              color-mix(in srgb, var(--accent) 22%, transparent), transparent 62%);
}
.hero .container { position: relative; z-index: 2; }
.hero h1 { color: #fff; margin-top: 14px; text-shadow: 0 2px 14px rgba(0,0,0,.45); }
.hero .lead { color: #cfd6d5; text-shadow: 0 1px 10px rgba(0,0,0,.4); }
.hero .note { color: #a8b0af; }
/* Sur fond sombre, le bouton secondaire doit rester lisible. */
.hero .btn:not(.btn-primary) {
  background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.28); color: #fff;
}
.hero .btn:not(.btn-primary):hover { background: rgba(255,255,255,.16); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .75rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  padding: 6px 12px; border-radius: 999px;
}
/* L'accroche : ce qu'un transporteur doit retenir en une ligne. */
.hero-hook { color: #fff; font-weight: 700; font-size: 1rem; }

.lead { font-size: 1.08rem; color: var(--muted); max-width: var(--maxw-text); }

/* ── Grille de cartes : on ajoute des COLONNES, on ne gonfle pas les cartes ─ */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 380px));
  justify-content: start;
}
.grid-wide { grid-template-columns: repeat(auto-fill, minmax(340px, 620px)); }
.card {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: 12px; }

/* ── KPI ─────────────────────────────────────────────────────────────────── */
.kpis {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 260px));
  justify-content: start;
}
.kpi { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .v { font-size: 1.6rem; font-weight: 690; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.kpi .s { font-size: .72rem; color: var(--muted-2); margin-top: 3px; }

/* ── Graphes ─────────────────────────────────────────────────────────────── */
.chart-box { position: relative; height: 300px; }
.chart-sm { position: relative; height: 230px; }

/* ── Tableaux : ils défilent DANS leur conteneur, la page ne bouge pas ───── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { padding: 9px 13px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--paper-3); font-weight: 620; font-size: .78rem; color: var(--muted);
     text-transform: uppercase; letter-spacing: .04em; position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Divers ──────────────────────────────────────────────────────────────── */
.tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px;
       border-radius: 999px; background: var(--paper-3); color: var(--muted); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.note { font-size: .82rem; color: var(--muted); }
.section { padding: 44px 0; border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .84rem; font-weight: 570; margin-bottom: 5px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper-2);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 9px 11px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { min-height: 84px; resize: vertical; }
footer { padding: 30px 0; color: var(--muted); font-size: .84rem; }

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .nav-links { gap: 12px; }
  .nav-links a.hide-sm { display: none; }
}

/* ── Clause éliminatoire ─────────────────────────────────────────────────────
   Une règle qui fait rejeter une offre doit se voir du premier coup d'œil, sans
   pour autant crier : un liseré, pas un bandeau rouge. */
.rule-card {
  border-left: 3px solid var(--bad);
  background: var(--bad-soft);
}
.tag-bad { background: var(--bad); color: #fff; }

/* ── Graphe de saisonnalité du hero ───────────────────────────────────────────
   Barres CSS pures : la landing n'a pas à charger 200 Ko de librairie pour
   douze valeurs. Le mois le plus fort et le plus faible sont marqués — c'est
   ce qu'un transporteur regarde en premier, sa capacité en pointe. */
.season {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: 6px; align-items: end; margin-top: 10px;
}
/* La hauteur des barres est posée en PIXELS par le script : un pourcentage se
   réfère au parent flex, qui se rétracte sur son contenu — toutes les barres
   finissaient identiques, ce qui est le contraire d'un graphe. */
.season-col { display: flex; flex-direction: column; align-items: center; gap: 5px; justify-content: flex-end; }
.season-bar {
  width: 100%; border-radius: 3px 3px 0 0; flex: 0 0 auto;
  background: color-mix(in srgb, var(--accent) 55%, transparent);
}
.season-col.peak .season-bar { background: var(--accent); }
.season-col.low  .season-bar { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.season-m { font-size: .66rem; color: #a8b0af; letter-spacing: .02em; }
.season-v { font-size: .62rem; color: #cfd6d5; font-variant-numeric: tabular-nums; }
.hero-card {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius); padding: 16px 18px; margin-top: 26px;
}
.hero-card h3 { color: #fff; margin: 0 0 2px; font-size: .95rem; }

/* Conditions fermes : même poids visuel que la clause éliminatoire, ton
   différent — l'une disqualifie une méthode de chiffrage, l'autre une capacité
   opérationnelle. */
.req-card { border-left: 3px solid var(--warn); background: var(--warn-soft); }
