/* ==========================================================
   Composants réutilisables
   ========================================================== */

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: var(--night);
  color: var(--on-dark);
  pointer-events: none;
}
.loader__inner { display: flex; flex-direction: column; align-items: center; gap: 18px; position: relative; z-index: 2; }
.loader__logo { width: 140px; height: auto; }
.loader__count {
  font-family: var(--f-display); font-stretch: 125%; font-weight: 700;
  font-size: .8rem; letter-spacing: .2em; color: var(--hivis);
  font-variant-numeric: tabular-nums;
}
.loader__panel { position: absolute; inset: 0; background: var(--rust); transform: scaleY(0); transform-origin: bottom; z-index: 1; }
.no-js .loader, .reduced .loader { display: none; }

/* ---------- Curseur ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 150;
  width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--hivis);
  pointer-events: none;
  display: grid; place-items: center;
  transition: width .35s var(--ease-out), height .35s var(--ease-out), margin .35s var(--ease-out), background .3s;
  mix-blend-mode: normal;
  opacity: 0;
}
.cursor.is-visible { opacity: 1; }
.cursor__label {
  font-family: var(--f-display); font-stretch: 112%;
  font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink); opacity: 0; transition: opacity .2s;
  white-space: nowrap;
}
.cursor.has-label { width: 92px; height: 92px; margin: -46px 0 0 -46px; }
.cursor.has-label .cursor__label { opacity: 1; }
.cursor.is-link { width: 40px; height: 40px; margin: -20px 0 0 -20px; background: rgba(255,122,53,.25); }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- Header ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding-inline: var(--gutter);
  color: var(--ink);
  transition: transform .6s var(--ease-out), color .4s, background-color .4s;
}
.header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(250,248,244,.85), rgba(250,248,244,0));
  backdrop-filter: blur(0px);
  opacity: 0; transition: opacity .4s;
}
.header.is-scrolled::before { opacity: 1; }
.header.is-dark { color: var(--on-dark); }
.header.is-dark::before { background: linear-gradient(to bottom, rgba(23,17,15,.8), rgba(23,17,15,0)); }
.header.is-hidden { transform: translateY(-110%); }

.header__brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .9rem; padding-block: 8px; }
.header__logo { height: 22px; width: auto; transition: filter .4s; }
.header.is-dark .header__logo { filter: invert(1); }
.header__x { opacity: .5; }
/* Logo GO FIFO (blanc d'origine) : passé en noir sur fond clair */
.header__gofifo { height: 28px; width: auto; filter: invert(1); transition: filter .4s; }
.header.is-dark .header__gofifo { filter: none; }

/* Sélecteur de langue, en haut à gauche, avant le logo */
.header__start { display: flex; align-items: center; gap: clamp(14px, 1.6vw, 22px); min-width: 0; }
.lang {
  display: flex; flex: none; gap: 2px; padding: 4px; border-radius: var(--r-pill);
  background: rgba(28,25,23,.05); backdrop-filter: blur(10px);
  font-size: .7rem; font-weight: 600; letter-spacing: .1em; line-height: 1;
}
.header.is-dark .lang { background: rgba(246,238,232,.08); }
.lang__opt {
  display: grid; place-items: center; min-width: 36px; height: 30px; padding: 0 9px;
  border-radius: var(--r-pill); transition: background .3s, color .3s, opacity .3s;
}
.lang__opt.is-current { background: var(--ink); color: var(--cream); }
.header.is-dark .lang__opt.is-current { background: var(--on-dark); color: var(--night); }
a.lang__opt { opacity: .66; }
a.lang__opt:hover, a.lang__opt:focus-visible { opacity: 1; background: rgba(28,25,23,.08); }
.header.is-dark a.lang__opt:hover, .header.is-dark a.lang__opt:focus-visible { background: rgba(246,238,232,.14); }

.header__nav { display: flex; gap: 6px; padding: 5px; border-radius: var(--r-pill); background: rgba(28,25,23,.05); backdrop-filter: blur(10px); }
.header.is-dark .header__nav { background: rgba(246,238,232,.08); }
.header__nav a {
  padding: 8px 16px; border-radius: var(--r-pill); font-size: .84rem; font-weight: 500;
  transition: background .3s, color .3s;
}
.header__nav a:hover, .header__nav a.is-active { background: var(--ink); color: var(--cream); }
.header.is-dark .header__nav a:hover, .header.is-dark .header__nav a.is-active { background: var(--on-dark); color: var(--night); }

/* Burger + menu plein écran (mobile / tablette) */
.header__burger { display: none; position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; background: rgba(28,25,23,.06); color: inherit; transition: background .3s; }
.header.is-dark .header__burger { background: rgba(246,238,232,.1); }
.header__burger span { position: absolute; left: 13px; right: 13px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .45s var(--ease-out), top .45s var(--ease-out); }
.header__burger span:nth-child(1) { top: 17px; }
.header__burger span:nth-child(2) { top: 25px; }
.is-menu-open .header__burger span { top: 21px; }
.is-menu-open .header__burger span:nth-child(1) { transform: rotate(45deg); }
.is-menu-open .header__burger span:nth-child(2) { transform: rotate(-45deg); }

.mnav {
  position: fixed; inset: 0; z-index: 95;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--header-h) + 24px) var(--gutter) clamp(28px, 6vh, 48px);
  background: var(--night); color: var(--on-dark);
  clip-path: inset(0 0 100% 0); visibility: hidden;
  transition: clip-path .7s var(--ease-out), visibility 0s linear .7s;
}
.is-menu-open .mnav { clip-path: inset(0); visibility: visible; transition: clip-path .7s var(--ease-out), visibility 0s; }
.mnav__label { color: var(--hivis-soft); }
.mnav__links { margin-top: 16px; display: grid; border-top: 1px solid var(--line-dark); }
.mnav__links a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--line-dark);
  font-family: var(--f-display); font-size: clamp(2rem, 9vw, 3.2rem); font-weight: 650; letter-spacing: -.04em; line-height: 1;
  opacity: 0; transform: translateY(24px); transition: opacity .5s, transform .7s var(--ease-out), color .3s;
}
.mnav__links a em { font-style: normal; font-family: var(--f-body); font-size: .72rem; font-weight: 600; letter-spacing: .1em; color: var(--hivis); }
.mnav__links a:hover { color: var(--hivis-soft); }
.is-menu-open .mnav__links a { opacity: 1; transform: none; }
.is-menu-open .mnav__links a:nth-child(1) { transition-delay: .12s; }
.is-menu-open .mnav__links a:nth-child(2) { transition-delay: .17s; }
.is-menu-open .mnav__links a:nth-child(3) { transition-delay: .22s; }
.is-menu-open .mnav__links a:nth-child(4) { transition-delay: .27s; }
.mnav__cta { margin-top: 28px; align-self: flex-start; }

@media (max-width: 900px) {
  .header__nav { display: none; }
  .header__burger { display: block; }
  .header { gap: 12px; }
  .header > .btn--pill { margin-left: auto; }
}
@media (max-width: 480px) {
  .header > .btn--pill { padding: 11px 16px; font-size: .85rem; }
  .header > .btn--pill .btn__icon { display: none; }
  .header__brand { gap: 7px; }
}
@media (max-width: 560px) {
  /* téléphones : sélecteur FR/EN + logo + menu ; « Commencer » reste dans le menu et dans le hero */
  .header > .btn--pill { display: none; }
}
@media (max-width: 359px) {
  .header__start { gap: 8px; }
  .header__brand { gap: 5px; }
  .lang__opt { min-width: 30px; padding: 0 6px; }
}
/* le logo ne se tasse jamais (pas d'image déformée) */
.header__brand, .header__brand img { flex: none; }
@media (min-width: 901px) { .mnav { display: none; } }

/* ---------- Boutons ---------- */
.btn {
  --btn-bg: var(--ink); --btn-fg: var(--cream);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  padding: 14px 22px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-family: var(--f-body); font-weight: 500; font-size: .95rem; line-height: 1;
  border-radius: var(--r-sm);
  transition: background .3s, color .3s, transform .3s var(--ease-out);
  overflow: hidden;
  isolation: isolate;
  white-space: nowrap;
}
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--btn-hover, var(--rust));
  transform: translateY(101%); transition: transform .5s var(--ease-out);
  border-radius: inherit;
}
.btn:hover::after { transform: translateY(0); }
.btn--pill { border-radius: var(--r-pill); padding: 8px 8px 8px 24px; }
.btn--dark  { --btn-bg: var(--ink); --btn-fg: var(--cream); --btn-hover: var(--rust); }
.btn--light { --btn-bg: var(--paper); --btn-fg: var(--ink); --btn-hover: var(--blush); }
.btn--rust  { --btn-bg: var(--rust); --btn-fg: #fff; --btn-hover: var(--ink); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink-2); border: 1px solid var(--line); }
.btn--outline-light { --btn-bg: transparent; --btn-fg: var(--on-dark); border: 1px solid var(--on-dark-3); padding: 18px 26px; --btn-hover: rgba(246,238,232,.1); }
.btn--block { width: 100%; padding: 16px; }
.btn.is-disabled { pointer-events: none; opacity: .7; }
.btn.is-disabled::after { display: none; }

.btn__icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.14);
  transition: transform .5s var(--ease-out);
}
.btn--light .btn__icon, .btn--ghost .btn__icon { background: rgba(28,25,23,.08); }
.btn__icon--accent { background: var(--hivis) !important; color: var(--ink); }
.btn__icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover .btn__icon { transform: rotate(45deg); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--rust); color: #fff;
  font-family: var(--f-body); font-style: normal;
  font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.badge--soon { background: var(--blush); color: var(--rust-deep); }
.badge--light { background: #fff; color: var(--rust); }

/* ---------- Listes ---------- */
.checks { display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 30px; color: var(--ink-2); }
.checks li strong { color: var(--ink); }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .2em;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--rust) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center/11px no-repeat;
}
.checks--sm { font-size: .9rem; gap: 8px; }

/* ---------- Coins (viseur) ---------- */
.corner { position: absolute; width: 14px; height: 14px; border-color: var(--hivis); border-style: solid; border-width: 0; pointer-events: none; }
.corner--tl { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.corner--tr { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; }
.corner--bl { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; }
.corner--br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

/* ---------- Highlight (pastille animée) ---------- */
.hl {
  --hl: 0;
  background-image: linear-gradient(var(--hl-bg, var(--hivis)), var(--hl-bg, var(--hivis)));
  background-repeat: no-repeat;
  background-size: calc(var(--hl) * 100%) 100%;
  background-position: left center;
  border-radius: .25em;
  padding: 0 .18em;
  margin: 0 -.06em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: color .3s;
}

/* ---------- Bannière cookies ---------- */
.consent {
  position: fixed; z-index: 140;
  left: clamp(12px, 2vw, 28px); bottom: clamp(12px, 2vw, 28px);
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100svh - 24px); overflow: auto; overscroll-behavior: contain;
  padding: clamp(20px, 2vw, 26px);
  border-radius: var(--r-md); border: 1px solid var(--line-dark);
  background: var(--night); color: var(--on-dark);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.6);
  opacity: 0; transform: translateY(24px);
  transition: opacity .5s, transform .7s var(--ease-out);
}
.consent.is-open { opacity: 1; transform: none; }
.consent[hidden] { display: none; }
.consent__label { color: var(--hivis-soft); }
.consent__title { margin-top: 10px; font-family: var(--f-display); font-size: 1.35rem; font-weight: 650; letter-spacing: -.025em; line-height: 1.15; }
.consent__text { margin-top: 8px; font-size: .88rem; line-height: 1.55; color: var(--on-dark-2); }
.consent__text a { color: var(--on-dark); text-decoration: underline; text-underline-offset: 3px; }
.consent__text a:hover { color: var(--hivis-soft); }
.consent__prefs { margin-top: 16px; border-top: 1px solid var(--line-dark); }
.consent__prefs[hidden] { display: none; }
.consent__row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-dark); }
.consent__row b { font-size: .9rem; font-weight: 600; }
.consent__row small { display: block; margin-top: 2px; font-size: .78rem; line-height: 1.45; color: var(--on-dark-2); }
.consent__actions { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.consent__actions .btn { padding: 14px 12px; font-size: .9rem; }
.consent__actions .btn[hidden] { display: none; }
.consent__save { grid-column: 1 / -1; }
.consent__more { margin-top: 12px; padding: 4px 0; font-size: .82rem; color: var(--on-dark-2); text-decoration: underline; text-underline-offset: 3px; transition: color .3s; }
.consent__more:hover { color: var(--on-dark); }
.consent__more[hidden] { display: none; }

.switch {
  appearance: none; -webkit-appearance: none; flex: none;
  position: relative; width: 44px; height: 26px; border-radius: var(--r-pill);
  background: rgba(246,238,232,.2); cursor: pointer; transition: background .3s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--on-dark); transition: transform .35s var(--ease-out), background .3s;
}
.switch:checked { background: var(--hivis); }
.switch:checked::after { transform: translateX(18px); background: var(--ink); }
.switch:disabled { opacity: .55; cursor: not-allowed; }
.switch:focus-visible { outline: 2px solid var(--hivis-soft); outline-offset: 3px; }

/* Lien "Gérer les cookies" du pied de page */
.footer__cookies { color: inherit; font: inherit; padding-block: 10px; margin-block: -10px; text-decoration: underline; text-underline-offset: 3px; transition: color .3s; }
.footer__cookies:hover { color: var(--hivis); }
