/* ==========================================================================
   L’Exposant — fondations : tokens, typographie, mise en page, navigation
   ========================================================================== */

:root {
  color-scheme: light;

  /* Neutres : le lin, un blanc cassé chaud, et une encre presque noire */
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --surface-2: #F5F1EA;
  --surface-3: #EDE7DD;
  --line: #E7E0D5;
  --line-2: #D8D0C2;
  --ink: #1A1D1B;
  --ink-2: #545954;
  --ink-3: #646862;

  /* Marque : le vert sapin, seule couleur de marque, utilisé avec parcimonie */
  --forest: #1F4D3A;
  --forest-2: #173D2E;   /* survol */
  --forest-3: #2B6A50;   /* liens */
  --sage: #B9D3C4;       /* texte discret posé sur le vert sapin */
  --mint: #4FC285;
  --mint-strong: #1E8452;
  --mint-soft: #E2F4E9;
  --cream: #FAF7F2;
  --brand: #1F4D3A;
  --brand-soft: #E5EEE8;
  --brand-ink: #1F4D3A;
  /* Bordeaux : les petites touches (rappels, progression, « bilan à faire »). Nom de variable historique.
     Jamais de rose : en fond doux, un lin neutre qui porte un texte ou une icône bordeaux. */
  --apricot: #7B2D3B;
  --apricot-strong: #5E1F2C;
  --apricot-soft: #F1EBE3;

  /* Statuts */
  --st-potential: #6363D8;
  --st-potential-soft: #EDEDFC;
  --st-potential-ink: #4646B5;
  --st-sent: #E9A23B;
  --st-sent-soft: #FFF3DA;
  --st-sent-ink: #8F5C0C;
  --st-validated: #2FA66A;
  --st-validated-soft: #E1F4E8;
  --st-validated-ink: #17744A;
  --st-refused: #D9534A;
  --st-refused-soft: #FBE9E7;
  --st-refused-ink: #A63830;

  /* Formes */
  --r-xs: 8px;
  --r-sm: 12px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --shadow-1: 0 1px 2px rgba(40, 32, 20, .04), 0 2px 10px rgba(40, 32, 20, .04);
  --shadow-2: 0 2px 6px rgba(40, 32, 20, .05), 0 12px 32px rgba(40, 32, 20, .08);
  --shadow-3: 0 20px 60px rgba(26, 29, 27, .2);

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.22, 1.2, .36, 1);

  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --notch-bg: var(--bg);

  font-family: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body.sheet-open { overflow: hidden; }

h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.02em; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--forest) 40%, transparent);
  outline-offset: 2px;
  border-radius: 10px;
}

svg.i {
  width: 20px;
  height: 20px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

[hidden] { display: none !important; }

.num { font-variant-numeric: tabular-nums; }

/* Libellé visible seulement à partir de la tablette (icône seule sur téléphone) */
.label-md { display: none; }
@media (min-width: 720px) { .label-md { display: inline; } }

/* ---------- Mise en page ---------- */

.app { min-height: 100dvh; }

.view {
  outline: none;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 92px);
}

.page-anim { animation: page-in .32s var(--ease) both; }

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* En-tête sur le lin, puis corps en « feuille » qui le chevauche */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  padding: calc(var(--safe-t) + 22px) 20px 52px;
  isolation: isolate;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(31, 77, 58, .07);
  pointer-events: none;
  z-index: -1;
}
.hero::before { width: 460px; height: 460px; right: -210px; top: -250px; }
.hero::after { width: 300px; height: 300px; right: -130px; top: -170px; border-color: rgba(123, 45, 59, .08); }

.hero-logo { display: block; width: auto; height: 30px; margin: 0 0 16px; }

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-kicker {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
}
.hero-kicker::first-letter { text-transform: uppercase; }

.hero-title {
  margin-top: 6px;
  font-size: 28px;
  line-height: 1.12;
  font-weight: 800;
}

.hero-sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-2);
}

.hero-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--forest);
  transition: background .2s;
}
.hero-btn:hover { background: var(--surface-2); }

.page-body {
  position: relative;
  margin-top: -26px;
  min-height: 40px;
  padding: 22px 16px 0;
  background: var(--bg);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.stack > * + * { margin-top: 26px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
}

.section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--forest-3);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.section-link svg.i { width: 16px; height: 16px; }

/* ---------- Barre d'onglets (mobile) ---------- */

.tabbar {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + var(--safe-b));
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  border-top: 1px solid var(--line);
}

/* Dans le téléphone de la page de vente : barre pleine, rien qui déborde sur les bords */
.is-demo .tabbar {
  background: #fff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  transition: color .2s;
}

.tab-icon {
  width: 52px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  transition: background .25s var(--ease), transform .25s var(--ease-spring);
}
.tab-icon svg.i { width: 21px; height: 21px; }

.tab[aria-current="page"] { color: var(--forest); font-weight: 700; }
.tab[aria-current="page"] .tab-icon { background: var(--brand-soft); }
.tab:active .tab-icon { transform: scale(.92); }

.tab-badge {
  position: relative;
}
.tab-badge[data-count]::after {
  content: attr(data-count);
  position: absolute;
  top: -4px;
  right: -9px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--apricot-strong);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}

/* ---------- Bouton flottant ---------- */

.fab {
  position: fixed;
  z-index: 41;
  right: 18px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--forest);
  color: var(--cream);
  box-shadow: 0 10px 24px rgba(31, 77, 58, .28), inset 0 -2px 0 rgba(0, 0, 0, .12);
  transition: transform .25s var(--ease-spring), opacity .2s, box-shadow .2s;
}
.fab svg.i { width: 26px; height: 26px; stroke-width: 2.4; }
.fab:hover { background: var(--forest-2); box-shadow: 0 14px 30px rgba(31, 77, 58, .36); }
.fab:active { transform: scale(.93); }
.fab.is-hidden { opacity: 0; transform: scale(.6); pointer-events: none; }

/* ---------- Barre latérale (ordinateur) ---------- */

.sidebar { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand strong { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.brand small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.brand-mark svg { width: 42px; height: 42px; display: block; }
.brand-logo { display: inline-flex; padding: 4px 2px; }
.brand-logo img { display: block; width: auto; height: 34px; }

@media (min-width: 1024px) {
  :root { --notch-bg: var(--bg); }

  .app {
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 26px 18px;
    background: var(--surface);
    border-right: 1px solid var(--line);
  }

  .side-nav { display: grid; gap: 4px; }

  .side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ink-2);
    text-align: left;
    transition: background .2s, color .2s;
  }
  .side-link:hover { background: var(--surface-2); color: var(--ink); }
  .side-link[aria-current="page"] { background: var(--brand-soft); color: var(--forest); }
  .side-link[aria-current="page"] .side-count { background: var(--surface); }

  .side-count {
    margin-left: auto;
    min-width: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--apricot-soft);
    color: var(--apricot-strong);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
  }

  .side-foot { margin-top: auto; }

  .tabbar { display: none; }
  .mobile-only { display: none !important; }

  .fab { right: 32px; bottom: 32px; }

  .view { padding: 0 32px 48px; max-width: 1180px; width: 100%; }

  .hero {
    margin-top: 24px;
    padding: 30px 0 10px;
  }
  .hero::before, .hero::after { display: none; }
  .hero-title { font-size: 34px; }

  .page-body {
    margin-top: 0;
    padding: 28px 0 0;
    border-radius: 0;
  }
}

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