/* ═══════════════════════════════════════════════════════════════════
   EASY-IA · Outils gratuits — feuille de style unique
   ───────────────────────────────────────────────────────────────────
   Parti pris : « le registre comptable ». Vert forêt EASY-IA + accent
   ambre repris du logo. Signature : le trait de totalisation (double
   filet) sous les titres, comme la ligne de total d'un bilan. Chiffres
   monétaires à chasse fixe, à la manière d'un grand livre.
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=Inter:wght@400;500;600&family=Spline+Sans+Mono:wght@500;600&display=swap');

:root {
  /* — Palette (ancrée sur le logo EASY-IA : vert + or) — */
  --ink:        #12241d;   /* texte principal, vert-encre presque noir */
  --brand:      #1a5c46;   /* vert EASY-IA */
  --brand-deep: #0f3d2e;   /* vert profond, en-têtes */
  --amber:      #d68a2b;   /* accent or/ambre du logo */
  --amber-soft: #f6ede0;   /* fond ambré très clair */
  --paper:      #f4f7f5;   /* fond de page, vert-blanc */
  --surface:    #ffffff;
  --line:       #dde7e2;   /* filets fins */
  --muted:      #5c6f68;   /* texte secondaire */
  --danger:     #b3261e;

  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body:    'Inter', system-ui, sans-serif;
  --mono:    'Spline Sans Mono', ui-monospace, 'Cascadia Code', monospace;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,36,29,.04), 0 8px 28px rgba(16,36,29,.06);
}

* { box-sizing: border-box; }

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  margin: 0;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────── En-tête de marque ──────────────────── */
.lm-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.lm-topbar__inner {
  max-width: 960px; margin: 0 auto;
  padding: .6rem 1.2rem;
  display: flex; align-items: center; gap: 1rem;
}
/* Logo de marque : la source fait 2100 x 600 px, l'agrandissement reste net.
   Hauteur réduite sur petit écran pour ne pas écraser les liens voisins. */
.lm-topbar__logo { height: 48px; width: auto; display: block; }
@media (max-width: 640px) {
  .lm-topbar__logo { height: 38px; }
  .lm-topbar__inner { gap: .6rem; padding: .5rem .9rem; }
}
/* Sous 480px, le lien « Tous les outils » fait déborder la barre : le logo
   pointe déjà vers la même page (aria-label sur le lien), on le masque donc. */
@media (max-width: 480px) {
  .lm-topbar__back { display: none; }
}
@media (max-width: 420px) {
  .lm-topbar__logo { height: 32px; }
}
.lm-topbar__back {
  margin-left: auto;
  color: var(--brand); text-decoration: none;
  font-weight: 600; font-size: .9rem;
  padding: .4rem .8rem; border-radius: 8px;
  transition: background .15s;
}
.lm-topbar__back:hover { background: var(--paper); }

/* ─────────────────────────── Conteneur ──────────────────────────── */
.wrap {
  max-width: 720px;
  margin: 2.2rem auto;
  padding: 0 1.2rem;
}

/* ─────────────────────────── En-tête d'outil ────────────────────── */
.lm-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 1.4rem;
  align-items: start;
  margin-bottom: 1.6rem;
}
.lm-hero__eyebrow {
  font-family: var(--mono);
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--amber); font-weight: 600;
  margin: 0 0 .35rem;
}
.lm-hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.5rem, 4vw, 2.05rem);
  line-height: 1.08;
  color: var(--brand-deep);
  margin: 0;
  letter-spacing: -.01em;
}
/* Le trait de totalisation : signature de la marque (double filet) */
.lm-rule {
  height: 0; border: 0;
  border-top: 3px solid var(--brand);
  position: relative;
  margin: .9rem 0 0;
}
.lm-rule::after {
  content: ""; position: absolute; left: 0; right: 0; top: 4px;
  border-top: 1px solid var(--brand);
}
.lm-hero__lede {
  grid-column: 1 / -1;
  color: var(--muted); font-size: 1.02rem; margin: 0;
}
.lm-hero__robot {
  width: 74px; height: 74px; border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--amber);
  background: var(--amber-soft);
  box-shadow: var(--shadow);
}

/* ─────────────────────── Encart d'explication ───────────────────── */
.lm-guide {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow);
}
.lm-guide__head {
  display: flex; align-items: center; gap: .6rem;
  cursor: pointer; list-style: none;
  font-family: var(--display); font-weight: 700;
  color: var(--brand-deep); font-size: 1.02rem;
}
.lm-guide__head::-webkit-details-marker { display: none; }
.lm-guide__chev { margin-left: auto; transition: transform .2s; color: var(--muted); }
details[open] .lm-guide__chev { transform: rotate(180deg); }
.lm-guide__body { margin-top: .9rem; }
.lm-guide__purpose { margin: 0 0 1rem; color: var(--ink); }
.lm-guide__cols { display: grid; gap: 1.1rem; }
@media (min-width: 560px) { .lm-guide__cols { grid-template-columns: 1fr 1fr; } }
.lm-guide__col h3 {
  font-family: var(--mono);
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--amber); margin: 0 0 .5rem; font-weight: 600;
}
.lm-guide__col ul { margin: 0; padding-left: 1.1rem; }
.lm-guide__col li { margin: .3rem 0; font-size: .92rem; color: var(--ink); }

/* ─────────────────────────── Cartes / formulaire ────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.2rem;
}
h1 { font-family: var(--display); }
h2 {
  font-family: var(--display); font-weight: 700;
  color: var(--brand-deep); font-size: 1.1rem;
  margin: 0 0 .8rem;
}

label {
  display: block; font-weight: 600;
  margin: 1.1rem 0 .35rem; color: var(--ink); font-size: .95rem;
}
input, select, textarea {
  width: 100%; padding: .65rem .8rem;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 1rem; font-family: var(--body);
  background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26,92,70,.14);
}
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
.radio label, .check label { font-weight: 400; display: flex; gap: .5rem;
  align-items: center; margin: .4rem 0; }
.help, .helptext, .form-help { font-size: .84rem; color: var(--muted); margin-top: .3rem; }
.errors, .errorlist { color: var(--danger); font-size: .9rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; } .row > div { flex: 1; min-width: 180px; }

button, .btn, .cta {
  font-family: var(--body); font-weight: 600; font-size: 1rem;
  background: var(--brand); color: #fff; border: 0;
  padding: .8rem 1.8rem; border-radius: 10px;
  margin-top: 1.5rem; cursor: pointer;
  transition: background .15s, transform .05s;
}
button:hover, .btn:hover, .cta:hover { background: var(--brand-deep); }
button:active { transform: translateY(1px); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* Boutons secondaires (téléchargement, etc.) */
.btn-pdf {
  display: inline-block; background: var(--surface); color: var(--brand);
  border: 2px solid var(--brand); padding: .6rem 1.4rem; border-radius: 10px;
  text-decoration: none; font-weight: 600; margin-top: .5rem;
}
.btn-pdf:hover { background: var(--paper); }

/* ─────────────────────────── Résultats / tableaux ───────────────── */
.hero, .lm-result-hero {
  text-align: center; padding: .5rem 0 1rem;
}
.hero .l, .lm-result-hero .l { color: var(--muted); font-size: .9rem; }
.hero .v, .lm-result-hero .v {
  font-family: var(--mono); font-weight: 600;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  color: var(--brand-deep); letter-spacing: -.02em;
}
.meta { color: var(--muted); font-size: .86rem; }
table { width: 100%; border-collapse: collapse; }
td, th { padding: .45rem .2rem; border-bottom: 1px solid var(--line); font-size: .94rem; }
td.num, th.num {
  text-align: right; font-family: var(--mono);
  font-variant-numeric: tabular-nums; font-weight: 600;
}
tr.tot td { border-top: 2px solid var(--brand); font-weight: 700; }
.note {
  background: var(--amber-soft); border-left: 4px solid var(--amber);
  padding: .5rem .8rem; border-radius: 8px; font-size: .85rem;
  margin: .4rem 0; color: var(--ink);
}
.badge {
  display: inline-block; font-size: .72rem; font-weight: 700;
  padding: .18rem .55rem; border-radius: 999px; margin-left: .5rem;
  vertical-align: middle;
}
.badge.ai { background: var(--amber-soft); color: var(--amber); }
.badge.rules { background: var(--paper); color: var(--brand); border: 1px solid var(--line); }

/* Base légale / mentions */
.legal {
  background: var(--paper); border-radius: 10px;
  padding: .6rem 1rem; font-size: .82rem; color: var(--muted);
  margin: 1rem 0;
}

/* Encart de capture email (réutilise .gate existant) */
.gate {
  border: 1px dashed #b9cfc6; border-radius: var(--radius);
  padding: 1.6rem; text-align: center;
  background: linear-gradient(180deg, var(--surface), var(--paper));
}

/* ─────────────────────────── Pied de page ───────────────────────── */
.lm-foot {
  max-width: 720px; margin: 2rem auto 3rem; padding: 0 1.2rem;
  color: var(--muted); font-size: .82rem; text-align: center;
}
.lm-foot a { color: var(--brand); }

/* Encart « télécharger un modèle de balance » */
.lm-modele {
  display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.2rem;
  justify-content: space-between;
  background: var(--amber-soft);
  border: 1px solid #ecd9bf; border-radius: var(--radius);
  padding: 1rem 1.2rem; margin-bottom: 1.2rem;
}
.lm-modele__txt { font-size: .92rem; color: var(--ink); flex: 1; min-width: 220px; }
.lm-modele__btns { display: flex; gap: .6rem; flex-wrap: wrap; }
.lm-modele__btn {
  display: inline-block; background: var(--surface); color: var(--brand-deep);
  border: 1px solid #e3cba3; border-radius: 8px;
  padding: .5rem .9rem; font-size: .88rem; font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.lm-modele__btn:hover { background: #fff; border-color: var(--amber); }

.hidden { display: none; }

/* ─────────────────────────── Accessibilité ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Encart « Ce calcul, dans EASY-IA ERP » : liens vers les modules */
.lm-module { margin: 1.4rem 0; }
.lm-module__titre {
  margin: 0 0 .55rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brand-deep);
}
.lm-module__grille {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .7rem;
}
.lm-module__carte {
  display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1rem;
  background: #fff; border: 1px solid #d7e3dd; border-left: 4px solid var(--brand);
  border-radius: 10px; text-decoration: none; color: #40514b;
  transition: transform .15s, box-shadow .15s;
}
.lm-module__carte:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15, 61, 46, .12); }
.lm-module__carte--principal { background: #f1f8f5; }
.lm-module__nom { font-weight: 700; color: var(--brand-deep); font-size: .98rem; }
.lm-module__accroche { font-size: .86rem; line-height: 1.45; }
.lm-module__go { margin-top: .2rem; font-size: .86rem; font-weight: 700; color: var(--brand); }
