/* IA FOR GOOD — charte claire BUILD RH (magenta → violet), Poppins */
:root {
  --pink: #e5288f;
  --violet: #8a2c8e;
  --magenta: #b8146a;
  --grad: linear-gradient(120deg, #e5288f 0%, #8a2c8e 100%);
  --bg: #fbf7f8;
  --surface: #ffffff;
  --surface-2: #f7eef3;
  --ink: #241a20;
  --ink-2: #6b5a64;
  --line: #eddfe7;
  --ok: #1f7a5c; --ok-bg: #dff3ea;
  --shadow: 0 1px 2px rgba(60,20,45,.04), 0 6px 18px rgba(60,20,45,.06);
  --shadow-hover: 0 2px 4px rgba(60,20,45,.06), 0 14px 32px rgba(60,20,45,.10);

  --c-magenta: #b8146a; --c-magenta-bg: #fde6f1;
  --c-violet: #6d2a8e;  --c-violet-bg: #f1e6fa;
  --c-teal: #23756d;    --c-teal-bg: #def3ef;
  --c-bleu: #2350d8;    --c-bleu-bg: #e7edff;
  --c-jaune: #8a5d00;   --c-jaune-bg: #fff2cc;

  --radius: 18px;
  --fs: 1rem; --lh: 1.6; --ls: 0; --ws: 0;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root.confort {
  --font: "Atkinson Hyperlegible", system-ui, sans-serif;
  --fs: 1.125rem; --lh: 1.8; --ls: .02em; --ws: .08em;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: var(--fs); line-height: var(--lh);
  letter-spacing: var(--ls); word-spacing: var(--ws);
}
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
a { color: var(--magenta); }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; border-radius: 8px; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 8px; }

/* ---------- Barre du haut ---------- */
.topbar { background: rgba(255,255,255,.85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-in { display: flex; justify-content: space-between; align-items: center; height: 64px; gap: 12px; }
.marque { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.marque-picto { width: 36px; height: 36px; flex: none; }
.marque-txt { font-weight: 600; font-size: 1.15rem; letter-spacing: .04em; white-space: nowrap; }
.marque-txt b, .pied-marque b { font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.toggle {
  display: inline-flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: .85rem; font-weight: 600;
}
.toggle:hover { border-color: var(--magenta); }
.toggle span { font-weight: 800; color: var(--magenta); }
.toggle[aria-pressed="true"] { background: var(--magenta); color: #fff; border-color: var(--magenta); }
.toggle[aria-pressed="true"] span { color: #fff; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(900px 380px at 100% 0%, rgba(229,40,143,.11), transparent 65%),
    radial-gradient(700px 320px at 0% 100%, rgba(138,44,142,.08), transparent 60%),
    var(--surface);
  border-bottom: 1px solid var(--line); padding: 44px 0 40px;
}
.sur-titre { margin: 0 0 10px; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--magenta); }
.hero h1 { font-weight: 800; font-size: clamp(2rem, 5.5vw, 3.3rem); line-height: 1.08; margin: 0 0 14px; letter-spacing: -.02em; }
.hero h1 .hl { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin: 0 0 28px; max-width: 64ch; font-size: 1.05em; color: var(--ink-2); }

.piliers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.pilier {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.pilier:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: #e3c8d7; }
.pilier .ico { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--magenta); }
.pilier .ico svg { width: 20px; height: 20px; }
.pilier strong { display: block; font-size: .95rem; }
.pilier small { color: var(--ink-2); font-size: .82rem; }

/* ---------- Onglets + outils ---------- */
.onglets { display: flex; gap: 6px; overflow-x: auto; padding: 26px 0 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.onglet {
  flex: none; background: none; border: 0; cursor: pointer; padding: 10px 14px 12px; font-weight: 600; font-size: .95em;
  color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center;
}
.onglet:hover { color: var(--ink); }
.onglet[aria-current="true"] { color: var(--magenta); border-bottom-color: var(--magenta); }
.onglet .n { font-size: .78em; background: var(--surface-2); color: var(--ink-2); padding: 0 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }

.outils { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.search { flex: 1 1 320px; max-width: 460px; display: flex; align-items: center; background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 0 18px; }
.search svg { color: var(--magenta); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 10px; outline: none; }
.search:focus-within { border-color: var(--magenta); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: .86em; font-weight: 600; }
.chip:hover { border-color: var(--magenta); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.compte { color: var(--ink-2); font-size: .88em; margin: 6px 0 8px; min-height: 1.4em; }

/* ---------- Sections ---------- */
.section { padding: 18px 0 30px; }
.section-tete { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.section h2 { font-size: 1.45rem; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.section-tete p { margin: 4px 0 0; color: var(--ink-2); max-width: 70ch; font-size: .95em; }
.voir { background: none; border: 0; color: var(--magenta); font-weight: 600; cursor: pointer; padding: 4px 0; white-space: nowrap; }
.voir:hover { text-decoration: underline; }

.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 18px; }

/* ---------- Cartes ---------- */
.carte {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.carte:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.couv { aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.couv img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.couv-agent {
  aspect-ratio: auto; padding: 22px 20px; color: #fff; background: var(--grad); position: relative; min-height: 132px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.couv-agent svg { width: 34px; height: 34px; opacity: .95; }
.couv-agent .pour { font-size: .82rem; font-weight: 600; opacity: .95; }
.corps { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge { font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: lowercase; }
.badge.type { background: var(--surface-2); color: var(--ink-2); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.beta { background: var(--c-jaune-bg); color: var(--c-jaune); }
.badge.bientot { background: #eee; color: #555; }
.t-magenta { background: var(--c-magenta-bg); color: var(--c-magenta); }
.t-violet { background: var(--c-violet-bg); color: var(--c-violet); }
.t-teal { background: var(--c-teal-bg); color: var(--c-teal); }
.t-bleu { background: var(--c-bleu-bg); color: var(--c-bleu); }
.t-jaune { background: var(--c-jaune-bg); color: var(--c-jaune); }
.carte h3 { margin: 0; font-size: 1.08rem; line-height: 1.3; font-weight: 700; }
.carte .desc { margin: 0; color: var(--ink-2); font-size: .9em; }
.auteur { font-size: .78rem; color: var(--ink-2); margin: 0; }
.actions { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: .88em;
  padding: 9px 16px; border-radius: 999px; border: 1.5px solid transparent;
}
.btn-prim { background: var(--grad); color: #fff; }
.btn-prim:hover { filter: brightness(1.06); }
.btn-sec { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-sec:hover { border-color: var(--magenta); color: var(--magenta); }
.btn[aria-disabled="true"] { background: #eee; color: #777; pointer-events: none; }
.prix { font-weight: 800; color: var(--ink); }

.vide {
  border: 1.5px dashed #e3c8d7; border-radius: var(--radius); padding: 28px 22px; text-align: center; color: var(--ink-2); background: var(--surface);
}
.vide strong { display: block; color: var(--ink); margin-bottom: 4px; }

/* ---------- Pied de page ---------- */
.pied { border-top: 1px solid var(--line); background: var(--surface); margin-top: 30px; padding: 30px 0 36px; }
.pied-in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.pied-marque { font-weight: 600; letter-spacing: .04em; margin: 0 0 4px; font-size: 1.05rem; }
.pied-txt { margin: 0; color: var(--ink-2); font-size: .9em; max-width: 52ch; }
.pied-liens { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; align-content: flex-start; }
.pied-liens a { color: var(--ink-2); text-decoration: none; font-size: .88em; font-weight: 600; }
.pied-liens a:hover { color: var(--magenta); }

@media (max-width: 560px) {
  .toggle { padding: 6px 10px; }
  .toggle .lbl { display: none; }
  .hero { padding: 32px 0 30px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* =====================================================================
   PAGES OUTIL (Décodeur d'offres…)
   ===================================================================== */
.hero-outil { padding-bottom: 34px; }
.hero-outil .wrap { max-width: 820px; }
.sur-titre a { color: inherit; text-decoration: none; }
.sur-titre a:hover { text-decoration: underline; }
.points-cles { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.points-cles li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; font-size: .88em; color: var(--ink-2); }
.points-cles strong { color: var(--ink); }

.outil { max-width: 820px; padding-top: 28px; padding-bottom: 20px; outline: none; }
.encart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.encart h2 { margin: 0 0 6px; font-size: 1.2rem; }
.encart p { margin: 0; color: var(--ink-2); }
.methode summary { cursor: pointer; font-weight: 700; color: var(--magenta); }
.seize { margin: 14px 0 0; padding-left: 22px; columns: 2 260px; column-gap: 28px; font-size: .9em; color: var(--ink-2); }
.seize li { break-inside: avoid; padding: 2px 0; }

.bloc { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 20px 22px 22px; margin: 0 0 18px; box-shadow: var(--shadow); min-width: 0; }
.bloc legend { float: left; width: 100%; padding: 0; margin-bottom: 12px; font-weight: 800; font-size: 1.1rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bloc legend + * { clear: both; }
.bloc legend em { font-style: normal; font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); background: var(--surface-2); padding: 2px 9px; border-radius: 999px; }
.num { width: 28px; height: 28px; border-radius: 50%; background: var(--grad); color: #fff; display: inline-grid; place-items: center; font-size: .85rem; flex: none; }
.bloc label { display: block; font-weight: 600; font-size: .92em; margin: 14px 0 6px; }
.bloc label:first-of-type { margin-top: 0; }
.aide { display: block; font-weight: 400; font-size: .85em; color: var(--ink-2); }
.aide-bloc { margin: 0 0 12px; font-size: .88em; color: var(--ink-2); }
.bloc input[type=url], .bloc input[type=text], .bloc textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 14px; background: #fff; font-size: .95em; line-height: 1.5;
}
.bloc textarea { resize: vertical; }
.bloc input:focus, .bloc textarea:focus { border-color: var(--magenta); outline: none; box-shadow: 0 0 0 3px rgba(229,40,143,.14); }
[aria-invalid="true"] { border-color: #c0262d !important; }
.deux { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 0 16px; margin-bottom: 4px; }
.deux label { margin-top: 0; }

.dropzone { position: relative; border: 2px dashed #e3c8d7; border-radius: 14px; background: var(--surface-2); text-align: center; transition: border-color .15s, background .15s; }
.dropzone.survol, .dropzone:focus-within { border-color: var(--magenta); background: #fdeef6; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone label { margin: 0; padding: 22px 16px; font-weight: 400; cursor: pointer; }
.dropzone strong { color: var(--magenta); }
.statut { font-size: .86em; color: var(--ink-2); margin: 8px 0 0; min-height: 1em; }
.compteur { font-size: .8em; color: var(--ink-2); margin: 4px 0 0; text-align: right; }

.case { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; font-size: .9em !important; margin: 14px 0 0 !important; cursor: pointer; }
.case input { margin-top: 4px; accent-color: var(--magenta); width: 17px; height: 17px; flex: none; }
.erreur { background: #fdecec; color: #8f1d22; border-radius: 12px; padding: 10px 14px; margin: 14px 0 0; font-size: .92em; }
button.btn { cursor: pointer; font-family: inherit; }
.btn-grand { margin: 18px 0 10px; padding: 13px 26px; font-size: 1em; }
.btn:disabled { opacity: .6; cursor: wait; }

.progress { display: flex; gap: 16px; align-items: center; outline: none; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--surface-2); border-top-color: var(--pink); animation: tourne 1s linear infinite; flex: none; }
@keyframes tourne { to { transform: rotate(360deg); } }

.resultat { outline: none; }
.resultat-tete h2 { font-size: 1.6rem; margin: 0 0 12px; }
.resultat-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sommaire ul { list-style: none; margin: 8px 0 0; padding-left: 0; columns: 2 240px; column-gap: 28px; font-size: .9em; }
.sommaire a { color: var(--ink); text-decoration: none; }
.sommaire a:hover { color: var(--magenta); text-decoration: underline; }
.resultat-corps { margin-top: 18px; }
.partie { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 14px; box-shadow: var(--shadow); overflow-wrap: anywhere; scroll-margin-top: 80px; }
.partie h1, .partie h2 { font-size: 1.15rem; margin: 0 0 10px; color: var(--magenta); }
.partie h3 { font-size: 1rem; margin: 14px 0 6px; }
.partie p, .partie li { font-size: .95em; }
.partie ul, .partie ol { padding-left: 22px; }
.partie table { border-collapse: collapse; width: 100%; font-size: .88em; display: block; overflow-x: auto; }
.partie th, .partie td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.partie th { background: var(--surface-2); }
.partie blockquote { margin: 10px 0; padding: 8px 14px; border-left: 4px solid var(--pink); background: var(--surface-2); border-radius: 0 10px 10px 0; }
.partie pre { white-space: pre-wrap; }
.avertissement { font-size: .82em; color: var(--ink-2); margin: 6px 0 0; }
.print-only { display: none; }

@media print {
  @page { size: A4; margin: 15mm; }
  body { background: #fff; font-size: 10.5pt; }
  * { box-shadow: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .topbar, .hero, .pied, .skip, #app, #ferme, .resultat-actions, #copy-status, #remaining, .sommaire { display: none !important; }
  .outil { max-width: none; padding: 0; }
  .print-only { display: block; }
  .print-tete { border-bottom: 3px solid var(--pink); margin-bottom: 6mm; padding-bottom: 3mm; }
  .print-tete p { margin: 0; }
  .partie { border: 0; padding: 0; margin: 0 0 5mm; break-inside: auto; }
  .partie h2 { border-bottom: 1px solid var(--line); padding-bottom: 1mm; break-after: avoid; }
}

/* =====================================================================
   RUBRIQUES (v4) : produits vedettes et sous-rubriques
   ===================================================================== */
.section-titre { display: flex; gap: 14px; align-items: flex-start; }
.section-ico { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #fff; margin-top: 2px; }
.section-ico svg { width: 22px; height: 22px; }
.pilier-agent .ico { background: var(--grad); color: #fff; }

.pile { display: grid; gap: 18px; }
.vedette {
  display: grid; grid-template-columns: minmax(220px, 300px) 1fr; background: var(--surface);
  border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow);
}
.vedette-panneau {
  background: var(--grad); color: #fff; padding: 26px 24px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden;
}
.vedette-panneau::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.10); }
.vedette-ico { width: 52px; height: 52px; border-radius: 14px; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.vedette-ico svg { width: 28px; height: 28px; }
.vedette-kicker { margin: 8px 0 0; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.vedette-pour { margin: 0; font-weight: 600; font-size: .95rem; line-height: 1.4; }
.vedette .corps { padding: 24px 26px 24px; }
.vedette h3 { font-size: 1.35rem; }
.obtenez { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 7px; }
.obtenez li { display: flex; gap: 10px; align-items: flex-start; font-size: .92em; }
.obtenez svg { flex: none; width: 18px; height: 18px; color: var(--ok); margin-top: 3px; }
.vedette .actions .auteur { margin-left: auto; }
@media (max-width: 720px) {
  .vedette { grid-template-columns: 1fr; }
  .vedette-panneau { padding: 20px; }
  .vedette .corps { padding: 20px; }
  .vedette .actions .auteur { margin-left: 0; width: 100%; }
}

.sous + .sous { margin-top: 26px; }
.sous-titre { font-size: 1.02rem; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.sous-titre .n { font-size: .75rem; background: var(--surface-2); color: var(--ink-2); padding: 0 8px; border-radius: 999px; font-weight: 600; }
.section + .section { border-top: 1px solid var(--line); }
.vedette h3 { margin: 0; line-height: 1.3; font-weight: 800; }
.vedette .desc { margin: 0; color: var(--ink-2); font-size: .95em; }
.vedette .auteur { font-size: .78rem; color: var(--ink-2); }

/* Logo BUILD RH (en-tête et pied de page) */
.topbar-in { justify-content: flex-start; }
.par-buildrh { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-2); font-size: .8rem; padding-left: 16px; margin-left: 4px; border-left: 1px solid var(--line); height: 34px; }
.par-buildrh img { height: 34px; width: auto; }
.topbar .toggle { margin-left: auto; }
.pied-logo { display: inline-block; margin-bottom: 10px; line-height: 0; }
.pied-logo img { height: 44px; width: auto; }
@media (max-width: 560px) {
  .par-buildrh { padding-left: 10px; gap: 6px; }
  .par-buildrh span { display: none; }
  .par-buildrh img { height: 28px; }
  .marque-txt { font-size: 1rem; }
}
.pour-qui { margin: 0; display: inline-flex; align-self: flex-start; align-items: center; gap: 4px; font-size: .8rem; color: var(--c-teal); background: var(--c-teal-bg); padding: 3px 11px; border-radius: 999px; }
.pour-qui strong { font-weight: 700; }
