/* ==========================================================================
   Unicornis GEO — thème Voyage Privé
   Charte Brand Design 2025 « New Normal ».
   Couleurs p.14 · typographie p.19-20 · formes p.22-26 du Brand_Guidelines_FR.

   Les sélecteurs reprennent exactement les classes de l'application
   (.card, .kpi, .pill, .bar, .note, .btn…) : aucune page PHP n'a besoin
   de connaître le thème. Pour un autre client, dupliquer ce fichier et
   changer 'theme' dans inc/config.php.
   ========================================================================== */

/* ---------------------------------------------------------------- Polices */

@font-face {
  font-family: "The Future";
  src: url("fonts/TheFuture-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "The Future";
  src: url("fonts/TheFuture-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ----------------------------------------------------------------- Tokens */

:root {
  /* Palette de marque — les cinq seules couleurs de la charte. */
  --lime:     #E2FEA8;   /* New Lime      · PMS 379C */
  --obsidian: #1D1D1D;   /* Obsidian Grey */
  --aspen:    #ECEBE4;   /* Aspen Snow    */
  --beige:    #F8F7F4;   /* Beige Light   */
  --white:    #FFFFFF;   /* Snow White    */

  /* Variables historiques de l'application, remappées sur la charte. */
  --bg:   var(--beige);
  --bd:   #DEDCD3;
  --mut:  #6B6B69;
  --acc:  var(--obsidian);

  /* New Lime ne passe pas en couleur de texte sur fond clair.
     --acc-deep est son équivalent lisible : texte, filets, focus. */
  --acc-deep:  #7E9B3C;
  --acc-quiet: #F0FED2;

  --ok:   #4F7A21;  --ok-bg:   #EDF5DE;
  --warn: #A9761B;  --warn-bg: #F7EFDC;
  --err:  #9C3A2E;  --err-bg:  #F6E5E1;

  --ink:   var(--obsidian);
  --faint: #9A9A96;
  --line-strong: #C6C4B9;

  /* Formes de la charte : hublot, carte, gélule. */
  --r-hublot: 24px;
  --r-carte:  14px;
  --r-sm:     8px;
  --r-gelule: 999px;

  --ombre: 0 1px 2px rgba(29,29,29,.04), 0 6px 20px rgba(29,29,29,.05);
  --ease:  cubic-bezier(.2,.7,.3,1);

  --font: "The Future", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* ------------------------------------------------------------------- Base */

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 400 14px/1.45 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--lime); color: var(--obsidian); }

:focus-visible {
  outline: 2px solid var(--acc-deep);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ---------------------------------------------------------------- En-tête */

header {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 22px;
  background: var(--obsidian);
  color: var(--white);
}

header .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  letter-spacing: -.01em;
}

header .brand img { height: 24px; width: auto; display: block; }

/* Nom de l'outil, discret à côté du logo client. */
header .brand span {
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,.22);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.72);
}

header a {
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: var(--r-gelule);
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
header a:hover { color: var(--obsidian); background: var(--lime); }

header .sp {
  margin-left: auto;
  font-size: 12px;
  color: rgba(255,255,255,.55);
  display: flex;
  align-items: center;
  gap: 4px;
}
header .sp a { padding: 4px 10px; }

/* -------------------------------------------------------------- Structure */

main { max-width: 1180px; margin: 28px auto 64px; padding: 0 22px; }

h1 {
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.02em;
  margin: 0 0 6px;
}

h2 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--mut);
  margin: 34px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bd);
}

h2 .small { letter-spacing: 0; text-transform: none; }

.sub { color: var(--mut); font-size: 14px; margin: 0 0 22px; max-width: 76ch; }

/* ----------------------------------------------------------------- Cartes */

.card {
  background: var(--white);
  border: 1px solid var(--bd);
  border-radius: var(--r-carte);
  padding: 18px;
  margin-bottom: 16px;
}

.card.mut { color: var(--mut); background: var(--aspen); border-color: transparent; }

/* --------------------------------------------------------------- Tableaux */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  background: var(--white);
  border: 1px solid var(--bd);
  border-radius: var(--r-carte);
  overflow: hidden;
}

th, td {
  border: 0;
  border-bottom: 1px solid var(--bd);
  padding: 8px 11px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--aspen);
  border-bottom-color: var(--line-strong);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--mut);
  white-space: nowrap;
}

tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--beige); }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Boutons d'action en fin de ligne : version compacte, sinon chaque ligne
   du tableau prend la hauteur d'un bouton. */
td .btn, td button { padding: 5px 13px; font-size: 12px; }

/* Ligne de la marque mesurée : repérable d'un coup d'œil dans un classement. */
tr.client td { background: var(--acc-quiet); font-weight: 500; }
tr.client:hover td { background: var(--acc-quiet); }
tr.client td:first-child { box-shadow: inset 3px 0 0 var(--acc-deep); }

/* ---------------------------------------------------------- Formulaires */

input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-gelule);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

textarea {
  min-height: 110px;
  border-radius: var(--r-carte);
  resize: vertical;
  line-height: 1.5;
}

input::placeholder, textarea::placeholder { color: var(--faint); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--acc-deep);
  box-shadow: 0 0 0 3px rgba(126,155,60,.28);
}

label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--mut);
  margin: 12px 0 5px;
}

/* -------------------------------------------------- Boutons — forme gélule */

button, .btn {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: var(--r-gelule);
  background: var(--obsidian);
  color: var(--white);
  font: inherit;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}

button:hover, .btn:hover { background: #333331; color: var(--white); }

.btn.sec {
  background: var(--white);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn.sec:hover { background: var(--aspen); color: var(--ink); }

/* Action principale d'une page : le seul endroit où le lime prend la parole. */
.btn.cta { background: var(--lime); color: var(--obsidian); }
.btn.cta:hover { background: #D3F58C; color: var(--obsidian); }

.btn.danger { background: var(--white); color: var(--err); border-color: var(--err); }
.btn.danger:hover { background: var(--err-bg); color: var(--err); }

button:disabled, .btn.disabled { opacity: .45; pointer-events: none; }

/* --------------------------------------------------------------- Messages */

.flash {
  background: var(--warn-bg);
  border: 1px solid transparent;
  border-left: 3px solid var(--warn);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
}
.flash.ok  { background: var(--ok-bg);  border-left-color: var(--ok);  color: inherit; }
.flash.err { background: var(--err-bg); border-left-color: var(--err); color: inherit; }

/* Le lime est reserve a la marque mesuree : une note explicative ne doit
   jamais ressembler a une ligne « client » dans un tableau. */
.note {
  background: var(--white);
  border: 1px solid var(--bd);
  border-left: 3px solid var(--acc-deep);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
  margin: 12px 0;
}

.box {
  background: var(--warn-bg);
  border: 1px solid transparent;
  border-left: 3px solid var(--warn);
  border-radius: var(--r-sm);
  padding: 11px 15px;
  margin-top: 18px;
}

/* ------------------------------------------------------- Indicateurs (KPI) */

.kpi { display: flex; gap: 14px; flex-wrap: wrap; }

.kpi > div {
  flex: 1 1 170px;
  min-width: 170px;
  background: var(--white);
  border: 1px solid var(--bd);
  border-radius: var(--r-carte);
  padding: 16px 18px;
}

.kpi .l {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--mut);
}

.kpi .v {
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  margin: 10px 0 6px;
}

.kpi .ic { font-size: 11.5px; color: var(--mut); }
.kpi .v .ic { font-size: 14px; }

/* -------------------------------------------------- Étiquettes — gélule */

.pill {
  display: inline-block;
  padding: 2px 11px;
  border: 0;
  border-radius: var(--r-gelule);
  background: var(--aspen);
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.7;
}

.pill.ok   { background: var(--ok-bg);   color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.err  { background: var(--err-bg);  color: var(--err); }

/* Marque mesurée. */
.pill.client { background: var(--lime); color: var(--obsidian); }

/* ----------------------------------------------------------------- Jauges */

.bar {
  height: 8px;
  background: var(--aspen);
  border-radius: var(--r-gelule);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #C8EE6A;   /* New Lime assombri : lisible en aplat de 8 px */
  transition: width 400ms var(--ease);
}

/* Lime par défaut (progression, marque mesurée), gris pour les concurrents :
   dans un classement, la ligne du client se repère sans lire les chiffres. */
.bar i.rival { background: var(--line-strong); }

/* ------------------------------------------------------------- Utilitaires */

.ok { color: var(--ok); } .warn { color: var(--warn); } .err { color: var(--err); }
.mut { color: var(--mut); }
.small { font-size: 12px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }

code {
  background: var(--aspen);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: "SF Mono", "Cascadia Mono", Consolas, monospace;
  font-size: .92em;
}

a { color: var(--ink); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--acc-deep); }

/* Bandeau mode développement — volontairement hors charte : il doit détonner. */
.dev-flag {
  background: #7f1d1d;
  color: #fff;
  padding: 10px 15px;
  border-radius: var(--r-sm);
  margin-bottom: 16px;
  font-size: 13px;
}
.dev-flag code { background: rgba(0,0,0,.25); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
