/* Charte IA BF — custom styles */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg-1);
  font-family: var(--font-body);
}

/* ---------- Top progress bar ---------- */
.read-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; z-index: 100;
  background: transparent;
}
.read-progress > div {
  height: 100%;
  background: var(--bf-blue);
  width: 0%;
  transition: width 100ms linear;
}

/* ---------- Header / Nav ---------- */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.app-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.app-header__logo { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.app-header__logo img { height: 36px; }
.app-header__divider { width: 1px; height: 28px; background: var(--border); }
.app-header__title {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: var(--bf-blue); letter-spacing: -.01em;
}
.app-header__title small {
  display: block; font-family: var(--font-display); font-weight: 500;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-muted);
}
.app-header__nav { display: flex; gap: 4px; margin-left: auto; }
.app-header__nav a {
  font-family: var(--font-display); font-size: 14px; font-weight: 500;
  color: var(--fg-2); text-decoration: none;
  padding: 8px 14px; border-radius: 999px;
  white-space: nowrap;
  transition: background 150ms, color 150ms;
}
.app-header__nav a:hover { background: var(--bf-bleu-4); color: var(--bf-blue); }
.app-header__nav a.is-active { background: var(--bf-blue); color: #fff; }

.app-header__share {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid var(--border);
  color: var(--bf-blue); cursor: pointer;
  padding: 8px 14px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  transition: background 150ms;
}
.app-header__share:hover { background: var(--bf-bleu-4); border-color: var(--bf-bleu-3); }

@media (max-width: 1080px) {
  .app-header__title { display: none; }
  .app-header__divider { display: none; }
}
@media (max-width: 880px) {
  .app-header__nav a { font-size: 13px; padding: 6px 10px; }
}
@media (max-width: 640px) {
  .app-header__nav { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 64px 32px 56px;
  max-width: 1200px;
  margin: 0 auto;
}
.hero__overline {
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--bf-orange-2);
  margin-bottom: 18px;
}
.hero__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.02;
  color: var(--bf-blue);
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  max-width: min(880px, calc(100% - 280px));
}
@media (max-width: 880px) {
  .hero__title { max-width: 100%; }
}
.hero__title em {
  font-style: normal; color: var(--bf-orange-2);
}
.hero__sub {
  font-size: 19px; line-height: 1.55;
  color: var(--fg-2);
  max-width: 640px;
  margin: 0 0 36px;
}
.hero__meta {
  display: flex; gap: 24px; flex-wrap: wrap;
  align-items: center;
}
.hero__meta .chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--bf-bleu-4); color: var(--bf-blue);
  border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
}
.hero__keys {
  position: absolute; top: 80px; right: 32px;
  display: flex; gap: 8px; align-items: flex-start;
  pointer-events: none;
  max-width: 280px;
}
.hero__key {
  width: 34px; height: 130px;
  border-radius: 8px 8px 30px 30px / 8px 8px 60px 60px;
  box-shadow: 0 8px 20px rgba(22,52,95,.12);
}
@media (max-width: 880px) {
  .hero__keys { display: none; }
}

/* ---------- Sections ---------- */
section.bf-section {
  padding: 64px 32px;
  max-width: 1200px;
  margin: 0 auto;
}
section.bf-section--alt {
  background: var(--bg-subtle);
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}
section.bf-section--alt > .bf-section__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

.section__head { margin-bottom: 40px; max-width: 760px; }
.section__overline {
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--bf-orange-2);
  margin-bottom: 12px;
}
.section__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.08;
  color: var(--bf-blue);
  letter-spacing: -.02em;
  margin: 0 0 16px;
}
.section__sub {
  font-size: 17px; line-height: 1.55; color: var(--fg-2);
  margin: 0;
}

/* ---------- Finalité block ---------- */
.finalite {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 24px;
  align-items: center;
  padding: 28px 32px;
  background: var(--bf-blue);
  color: #fff;
  border-radius: 20px;
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
}
.finalite__mark {
  width: 52px; height: 52px;
  background: var(--bf-orange-2);
  border-radius: 999px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 24px;
  color: var(--bf-blue);
}
.finalite__title {
  font-family: var(--font-display); font-weight: 500; font-size: 11px;
  letter-spacing: .16em; text-transform: uppercase;
  opacity: .75; margin-bottom: 8px;
}
.finalite__text {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(17px, 1.7vw, 21px); line-height: 1.35;
  color: #fff; margin: 0;
  letter-spacing: -.005em;
}

/* ---------- Engagement cards ---------- */
.engagements { display: grid; gap: 14px; }
.engagement {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
  transition: box-shadow 200ms;
}
.engagement:hover { box-shadow: var(--shadow-sm); }
.engagement.is-open { box-shadow: var(--shadow-md); }

.engagement__main {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 24px;
  padding: 28px 32px;
  align-items: start;
}
.engagement__num {
  width: 56px; height: 56px;
  border-radius: 12px 12px 26px 26px / 12px 12px 52px 52px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 26px;
  color: #fff;
}
.engagement__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 21px; color: var(--bf-blue);
  letter-spacing: -.01em; margin: 0 0 4px;
}
.engagement__slogan {
  font-family: var(--font-display); font-weight: 500; font-size: 15px;
  color: var(--fg-2); margin: 0 0 18px;
}
.engagement__rules {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; gap: 8px 10px;
}
.engagement__rules li {
  font-size: 13.5px; line-height: 1.3;
  color: var(--fg-2);
  background: var(--bg-subtle);
  padding: 7px 13px 7px 24px;
  border-radius: 999px;
  position: relative;
}
.engagement__rules li::before {
  content: ''; position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  background: var(--engHue, var(--bf-blue));
  border-radius: 50%;
}
.engagement__exToggle {
  margin-top: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: none; cursor: pointer;
  padding: 0;
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  color: var(--bf-blue);
}
.engagement__exToggle:hover { text-decoration: underline; text-underline-offset: 3px; }
.engagement__exChev {
  display: inline-grid; place-items: center;
  transition: transform 200ms;
}
.engagement.is-open .engagement__exChev { transform: rotate(180deg); }

.engagement__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 250ms ease;
}
.engagement.is-open .engagement__body { grid-template-rows: 1fr; }
.engagement__bodyInner { overflow: hidden; }
.engagement__examples {
  margin: 0 32px 28px 128px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.engagement__exTitle {
  font-family: var(--font-display); font-weight: 700;
  font-size: 13px; letter-spacing: .04em;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.engagement__exTitle.ok { color: var(--bf-vert-1); }
.engagement__exTitle.ko { color: var(--bf-rouge-1); }
.engagement__exTitle .dot {
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  font-size: 11px; font-weight: 700;
}
.engagement__exTitle.ok .dot { background: var(--bf-vert-2); }
.engagement__exTitle.ko .dot { background: var(--bf-rouge-2); }
.engagement__exList { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.engagement__exList li {
  font-size: 14px; line-height: 1.45;
  padding-left: 16px; position: relative;
  color: var(--fg-2);
}
.engagement__exList li::before {
  content: ''; position: absolute; left: 0; top: 8px;
  width: 8px; height: 1.5px; background: currentColor; opacity: .5;
}

@media (max-width: 720px) {
  .engagement__main { grid-template-columns: 48px 1fr; gap: 16px; padding: 22px 20px; }
  .engagement__num { width: 48px; height: 48px; font-size: 22px; }
  .engagement__examples { margin: 0 20px 22px 20px; grid-template-columns: 1fr; gap: 18px; }
}

/* ---------- Codes IA-A / C / G / D ---------- */
.codes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 32px;
}
.code-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0;
  display: flex; flex-direction: column;
  transition: box-shadow 200ms, transform 200ms;
  position: relative;
  overflow: hidden;
}
.code-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.code-card__top {
  background: var(--codeHue, var(--bf-blue));
  padding: 22px 22px 18px;
  position: relative;
  overflow: hidden;
}
.code-card__top::after {
  content: '';
  position: absolute;
  right: -14px; top: -10px;
  width: 56px; height: 110px;
  background: rgba(255,255,255,.16);
  border-radius: 10px 10px 28px 28px / 10px 10px 56px 56px;
  transform: rotate(12deg);
  pointer-events: none;
}
.code-card__id {
  font-family: var(--font-display); font-weight: 700; font-size: 36px;
  color: #fff;
  letter-spacing: -.02em;
  line-height: 1;
  margin: 0;
  position: relative; z-index: 1;
}
.code-card__label {
  font-family: var(--font-display); font-weight: 600; font-size: 11px;
  letter-spacing: .16em; text-transform: uppercase;
  color: rgba(255,255,255,.88);
  margin-top: 10px;
  position: relative; z-index: 1;
}

.code-card__body {
  padding: 20px 22px 22px;
  display: flex; flex-direction: column; gap: 12px;
  flex: 1;
}
.code-card__pitch {
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  color: var(--bf-blue); margin: 0; line-height: 1.3;
  letter-spacing: -.005em;
}
.code-card__examples { font-size: 13.5px; color: var(--fg-2); margin: 0; line-height: 1.5; }
.code-card__mention {
  background: var(--bg-subtle); border-radius: 10px;
  padding: 12px 14px; font-size: 12.5px; color: var(--fg-2);
  font-style: italic; line-height: 1.45;
  border-left: 3px solid var(--codeHue, var(--bf-blue));
  margin-top: auto;
}
.code-card__copy {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 14px; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 12px;
  color: var(--bf-blue);
  align-self: flex-start;
  transition: background 150ms;
}
.code-card__copy:hover { background: var(--bf-bleu-4); }
.code-card__copy.is-copied { background: var(--bf-vert-4); color: var(--bf-vert-1); border-color: var(--bf-vert-3); }

@media (max-width: 980px) { .codes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .codes-grid { grid-template-columns: 1fr; } }

/* ---------- Helpers (decision tools) ---------- */
.helpers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 32px;
}
.helper {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  display: flex; flex-direction: column;
  min-height: 320px;
}
.helper__head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
}
.helper__icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bf-orange-3);
  display: grid; place-items: center;
  color: var(--bf-orange-1);
}
.helper__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 19px; color: var(--bf-blue); margin: 0;
}
.helper__sub { font-size: 14px; color: var(--fg-muted); margin: 2px 0 0; }
.helper__step { font-size: 14.5px; color: var(--fg-2); margin-bottom: 12px; }
.helper__choices { display: flex; flex-wrap: wrap; gap: 8px; }
.helper__choice {
  background: var(--bg-subtle);
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  color: var(--bf-blue);
  transition: all 150ms;
}
.helper__choice:hover { border-color: var(--bf-bleu-3); background: var(--bf-bleu-4); }
.helper__choice.is-active { background: var(--bf-blue); color: #fff; border-color: var(--bf-blue); }

.helper__result {
  margin-top: auto;
  padding: 18px 20px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.55;
}
.helper__result.ok { background: var(--bf-vert-4); color: var(--bf-vert-1); border: 1px solid var(--bf-vert-3); }
.helper__result.warn { background: var(--bf-orange-4); color: var(--bf-orange-1); border: 1px solid var(--bf-orange-3); }
.helper__result.ko { background: var(--bf-rouge-4); color: var(--bf-rouge-1); border: 1px solid var(--bf-rouge-3); }
.helper__resultTitle {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.helper__resultCode {
  display: inline-block;
  background: rgba(255,255,255,.7); padding: 2px 8px; border-radius: 6px;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  margin-left: 6px;
}
.helper__reset {
  background: transparent; border: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 12px;
  color: var(--bf-blue); text-decoration: underline;
  align-self: flex-start; margin-top: 8px; padding: 4px 0;
}

@media (max-width: 860px) { .helpers { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}
.faq-search {
  display: flex; align-items: center; gap: 10px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 12px 18px;
  transition: border-color 150ms;
}
.faq-search:focus-within { border-color: var(--bf-blue); }
.faq-search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--font-body); font-size: 15px; color: var(--bf-blue);
}
.faq-search input::placeholder { color: var(--fg-muted); }
.faq-clear {
  background: transparent; border: none; cursor: pointer;
  color: var(--fg-muted); font-size: 13px;
  font-family: var(--font-display);
}

.faq-cats {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 32px;
}
.faq-cat {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  color: var(--fg-2);
  transition: all 150ms;
}
.faq-cat:hover { border-color: var(--bf-bleu-3); color: var(--bf-blue); }
.faq-cat.is-active {
  background: var(--bf-blue); border-color: var(--bf-blue); color: #fff;
}
.faq-cat__count {
  background: rgba(0,0,0,.06); padding: 1px 7px; border-radius: 999px;
  font-size: 11px;
}
.faq-cat.is-active .faq-cat__count { background: rgba(255,255,255,.18); }

.faq-section { margin-bottom: 36px; scroll-margin-top: 120px; }
.faq-section__head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
}
.faq-section__dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
}
.faq-section__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 22px; color: var(--bf-blue); margin: 0;
  letter-spacing: -.01em;
}

.faq-list { display: grid; gap: 8px; }
.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 150ms;
}
.faq-item:hover { box-shadow: var(--shadow-sm); }
.faq-item.is-open { box-shadow: var(--shadow-md); border-color: var(--bf-bleu-3); }
.faq-item__q {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px;
  cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  color: var(--bf-blue);
  line-height: 1.4;
}
.faq-item__chev {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-subtle);
  display: grid; place-items: center;
  transition: transform 200ms, background 150ms;
  color: var(--bf-blue);
}
.faq-item.is-open .faq-item__chev { transform: rotate(180deg); background: var(--bf-bleu-4); }
.faq-item__q__text { flex: 1; }
.faq-item__a {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 220ms ease;
}
.faq-item.is-open .faq-item__a { grid-template-rows: 1fr; }
.faq-item__aInner { overflow: hidden; }
.faq-item__aBody {
  padding: 0 22px 20px 22px;
  font-size: 15px; line-height: 1.65; color: var(--fg-2);
  border-top: 1px solid transparent;
}
.faq-item.is-open .faq-item__aBody { border-top-color: var(--border); padding-top: 14px; }
.faq-item__aBody p { margin: 0 0 0.6em; }
.faq-item__aBody p:last-child { margin-bottom: 0; }
.faq-item__aBody strong { color: var(--bf-blue); font-weight: 700; }
.faq-item__aBody ul { margin: 0; padding-left: 0; list-style: none; }
.faq-item__aBody li {
  position: relative; padding-left: 22px; margin-bottom: 6px;
  line-height: 1.55;
}
.faq-item__aBody li::before {
  content: ''; position: absolute; left: 4px; top: 10px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--bf-orange-2);
}
.faq-item mark {
  background: var(--bf-jaune-3); color: var(--bf-blue);
  padding: 0 2px; border-radius: 3px;
}

.faq-empty {
  padding: 40px; text-align: center;
  color: var(--fg-muted);
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 16px;
}

/* ---------- Footer ---------- */
.app-footer {
  background: var(--bf-blue);
  color: rgba(255,255,255,.85);
  padding: 56px 32px 36px;
  margin-top: 80px;
}
.app-footer__inner {
  max-width: 1200px; margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
}
.app-footer__brand img { height: 40px; filter: brightness(0) invert(1); margin-bottom: 16px; }
.app-footer__brand p { font-size: 14px; line-height: 1.5; margin: 0 0 8px; color: rgba(255,255,255,.7); max-width: 360px; }
.app-footer__col h4 {
  font-family: var(--font-display); font-size: 12px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.6); margin: 0 0 14px;
}
.app-footer__col a { color: #fff; text-decoration: none; font-size: 14px; display: block; padding: 4px 0; }
.app-footer__col a:hover { text-decoration: underline; }
.app-footer__bottom {
  max-width: 1200px; margin: 36px auto 0;
  padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1);
  display: flex; justify-content: space-between;
  font-size: 12px; color: rgba(255,255,255,.5);
}

@media (max-width: 720px) {
  .app-footer__inner { grid-template-columns: 1fr; gap: 28px; }
  .app-footer__bottom { flex-direction: column; gap: 8px; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bf-blue); color: #fff;
  padding: 12px 22px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 30px rgba(22,52,95,.35);
  z-index: 100; opacity: 0;
  transition: all 200ms;
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Color hues for engagements/codes ---------- */
[data-hue="bleu"]      { --engHue: var(--bf-bleu-2); }
[data-hue="turquoise"] { --engHue: var(--bf-turquoise-2); }
[data-hue="orange"]    { --engHue: var(--bf-orange-2); }
[data-hue="vert"]      { --engHue: var(--bf-vert-2); }
[data-hue="mauve"]     { --engHue: var(--bf-mauve-2); }
[data-hue="rose"]      { --engHue: var(--bf-rose-2); }
[data-hue="fuchsia"]   { --engHue: var(--bf-fuchsia-2); }
[data-hue="violet"]    { --engHue: var(--bf-violet-2); }
[data-hue="jaune"]     { --engHue: var(--bf-jaune-2); }
