/* === Klipa AI — En-tête & pied de page (design system Manrope/bleu) ===
   Porté depuis le prototype validé "Header Footer.dc.html". Classes préfixées
   klx- pour ne jamais entrer en collision avec l'ancien header/footer. Piloté
   par [data-theme] (même bascule que tout le site). */

:root {
  --kl-page:#F7F8FA; --kl-surface:#FFFFFF; --kl-surface2:#F7F8FA;
  --kl-border:#E5E7EB; --kl-borderS:#D1D5DB;
  --kl-text:#111827; --kl-text2:#6B7280; --kl-text3:#9CA3AF;
  --kl-hover:#EDEFF3; --kl-menu:#FFFFFF; --kl-shadow:0 12px 28px rgba(16,24,40,.14);
  --kl-footer:#0E1116; --kl-footerText:#C7CBD4; --kl-footerText2:#8A909C; --kl-footerBorder:#242A33;
}
[data-theme="dark"] {
  --kl-page:#0E1116; --kl-surface:#171A21; --kl-surface2:#1C2029;
  --kl-border:#242A33; --kl-borderS:#2A2F3A;
  --kl-text:#F3F4F6; --kl-text2:#9CA3AF; --kl-text3:#6B7280;
  --kl-hover:#1C2029; --kl-menu:#171A21; --kl-shadow:0 12px 28px rgba(0,0,0,.5);
  --kl-footer:#080A0E; --kl-footerText:#9CA3AF; --kl-footerText2:#6B7280; --kl-footerBorder:#1C2029;
}

@keyframes klx-menu { from { opacity:0; transform:translateY(8px) scale(.985); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes klx-acc  { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }

/* ===================== EN-TÊTE ===================== */
.klx-header {
  position:sticky; top:0; z-index:100;
  height:66px; background:var(--kl-surface); border-bottom:1px solid var(--kl-border);
  display:flex; align-items:center; justify-content:space-between; padding:0 28px;
  font-family:'Manrope',system-ui,sans-serif;
}
.klx-left { display:flex; align-items:center; gap:26px; }
.klx-logo { display:flex; align-items:center; }
/* pas de `display` ici : ce sont les classes .logo-light/.logo-dark (style.css)
   qui gèrent la bascule clair/sombre du logo. Taille = celle d'avant la refonte. */
.klx-logo img { height:34px; width:auto; }
.klx-nav { display:flex; align-items:center; gap:2px; }

.klx-navbtn {
  display:inline-flex; align-items:center; gap:4px; height:40px; padding:0 12px;
  border:none; background:transparent; border-radius:10px; font-family:inherit;
  font-size:15px; font-weight:600; color:var(--kl-text); cursor:pointer; transition:background .12s;
}
.klx-navbtn:hover { background:var(--kl-hover); }
.klx-navbtn svg { transition:transform .18s; }
.klx-navbtn.klx-open svg { transform:rotate(180deg); }
.klx-navlink {
  display:inline-flex; align-items:center; height:40px; padding:0 12px; border-radius:10px;
  text-decoration:none; font-size:15px; font-weight:600; color:var(--kl-text); transition:background .12s;
}
.klx-navlink:hover { background:var(--kl-hover); }

.klx-right { display:flex; align-items:center; gap:8px; }
.klx-iconbtn {
  width:40px; height:40px; border:1px solid var(--kl-border); border-radius:10px;
  background:var(--kl-surface); color:var(--kl-text); cursor:pointer;
  display:flex; align-items:center; justify-content:center; transition:background .12s; position:relative;
}
.klx-iconbtn:hover { background:var(--kl-hover); }
.klx-iconbtn-wide {
  display:inline-flex; align-items:center; gap:6px; height:40px; padding:0 12px;
  border:1px solid var(--kl-border); border-radius:10px; background:var(--kl-surface);
  color:var(--kl-text); cursor:pointer; font-family:inherit; font-size:13px; font-weight:800;
}
.klx-iconbtn-wide:hover { background:var(--kl-hover); }
.klx-divider { width:1px; height:24px; background:var(--kl-border); margin:0 4px; }

.klx-cta {
  height:42px; padding:0 20px; border:none; border-radius:12px; background:var(--primary);
  color:#fff; font-family:inherit; font-size:15px; font-weight:700; cursor:pointer;
  white-space:nowrap; box-shadow:0 4px 12px rgba(37,99,235,.28); text-decoration:none;
  display:inline-flex; align-items:center;
}
.klx-cta:hover { background:var(--primary-hover); }
.klx-ghost {
  height:42px; padding:0 16px; border:1px solid var(--kl-borderS); border-radius:12px;
  background:var(--kl-surface); color:var(--kl-text); font-family:inherit; font-size:15px;
  font-weight:700; cursor:pointer; white-space:nowrap; text-decoration:none;
  display:inline-flex; align-items:center;
}
.klx-ghost:hover { background:var(--kl-hover); }
.klx-pro-link {
  display:inline-flex; align-items:center; gap:6px; height:42px; padding:0 12px; border-radius:10px;
  text-decoration:none; color:var(--accent); font-size:14px; font-weight:800;
}
.klx-pro-link:hover { background:var(--kl-hover); }
.klx-pro-dot { width:7px; height:7px; border-radius:50%; background:var(--accent); }

/* ---- Méga-menu ---- */
.klx-item { position:relative; }
.klx-mega-wrap { position:absolute; top:100%; left:0; padding-top:14px; z-index:40; }
.klx-mega {
  background:var(--kl-menu); border:1px solid var(--kl-border); border-radius:18px;
  box-shadow:var(--kl-shadow); padding:18px; display:flex; gap:14px;
  transform-origin:top left; animation:klx-menu .2s cubic-bezier(.22,1,.36,1); max-width:calc(100vw - 40px);
}
.klx-mega-tools { width:824px; flex-direction:column; gap:12px; padding:16px; }
.klx-mega-solutions { width:620px; }
.klx-mega-cols { display:flex; gap:8px; flex:1; min-width:0; }
.klx-mcol { flex:1; min-width:0; }
.klx-mcol-title {
  margin:2px 6px 8px; font-size:11px; font-weight:800; letter-spacing:.05em;
  text-transform:uppercase; color:var(--kl-text3);
}
.klx-mrows { display:flex; flex-direction:column; gap:1px; }
.klx-mrow {
  position:relative; display:flex; align-items:center; gap:11px; padding:8px 9px;
  border-radius:11px; text-decoration:none; transition:background .14s;
}
.klx-mrow:hover { background:var(--kl-hover); }
.klx-mtile {
  width:34px; height:34px; border-radius:10px; display:flex; align-items:center;
  justify-content:center; flex-shrink:0; transition:transform .16s cubic-bezier(.22,1,.36,1);
}
.klx-mrow:hover .klx-mtile { transform:scale(1.06); }
.klx-mtxt { flex:1; min-width:0; }
.klx-mhead { display:flex; align-items:center; gap:6px; }
.klx-mlabel { font-size:14px; font-weight:700; color:var(--kl-text); white-space:nowrap; }
.klx-mdesc {
  display:block; font-size:12px; font-weight:500; color:var(--kl-text2);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:1px;
}
.klx-pro {
  font-size:9px; font-weight:800; letter-spacing:.04em; color:var(--accent);
  background:rgba(124,58,237,.12); padding:1px 5px; border-radius:5px;
}
.klx-marrow {
  flex-shrink:0; opacity:0; transform:translateX(-4px); transition:all .16s; color:var(--kl-text3);
}
.klx-mrow:hover .klx-marrow { opacity:1; transform:translateX(0); }

/* barre mise en avant (Optimiseur) — pleine largeur, bas du méga-menu Outils.
   DEUX liens distincts : la zone gauche (icône+texte) ouvre l'Optimiseur, le
   bouton droit « Tous les outils » ouvre le catalogue /tools. */
.klx-feat-bar {
  display:flex; align-items:center; gap:14px; padding:14px 16px; border-radius:14px;
  background:linear-gradient(120deg,rgba(37,99,235,.10),rgba(124,58,237,.10));
  border:1px solid var(--kl-border); transition:border-color .14s;
}
.klx-feat-bar:hover { border-color:var(--primary); }
.klx-feat-main { display:flex; align-items:center; gap:14px; flex:1; min-width:0; text-decoration:none; }
.klx-feat-ic {
  width:42px; height:42px; border-radius:12px; background:linear-gradient(135deg,#2563EB,#7C3AED);
  display:flex; align-items:center; justify-content:center; flex-shrink:0; box-shadow:0 4px 12px rgba(37,99,235,.3); color:#fff;
}
.klx-feat-txt { flex:1; min-width:0; }
.klx-feat-title { display:block; margin:0; font-size:15px; font-weight:800; color:var(--kl-text); letter-spacing:-.01em; }
.klx-feat-desc { display:block; margin:2px 0 0; font-size:13px; font-weight:500; color:var(--kl-text2); }
.klx-feat-btn {
  display:inline-flex; align-items:center; gap:6px; flex-shrink:0; height:38px; padding:0 16px; border-radius:10px;
  background:var(--primary); color:#fff; font-size:14px; font-weight:700; white-space:nowrap;
  box-shadow:0 4px 12px rgba(37,99,235,.28); text-decoration:none;
}
.klx-feat-btn:hover { background:var(--primary-hover); }

/* ---- menus déroulants (langue, compte) ---- */
.klx-drop {
  position:absolute; top:calc(100% + 10px); right:0; background:var(--kl-menu);
  border:1px solid var(--kl-border); border-radius:12px; box-shadow:var(--kl-shadow); padding:6px;
  transform-origin:top right; animation:klx-menu .18s cubic-bezier(.22,1,.36,1); z-index:40;
}
.klx-drop-lang { width:150px; }
.klx-drop-account { width:250px; border-radius:14px; padding:8px; }
.klx-langitem {
  display:flex; align-items:center; justify-content:space-between; width:100%; padding:9px 11px;
  border:none; background:transparent; border-radius:9px; font-family:inherit; font-size:14px;
  font-weight:600; color:var(--kl-text); cursor:pointer;
}
.klx-langitem:hover { background:var(--kl-hover); }
.klx-langitem.klx-active { font-weight:800; }
.klx-acct-head { padding:12px 12px 14px; }
.klx-acct-name { margin:0; font-size:15px; font-weight:800; color:var(--kl-text); }
.klx-acct-email { margin:3px 0 0; font-size:13px; font-weight:500; color:var(--kl-text2); }
.klx-acct-badge {
  display:inline-flex; align-items:center; gap:5px; margin-top:8px; height:22px; padding:0 8px;
  border-radius:99px; background:var(--kl-hover); font-size:11px; font-weight:800; color:var(--kl-text2);
}
.klx-acct-badge.klx-pro-badge { background:rgba(124,58,237,.10); color:var(--accent); }
.klx-acct-sep { height:1px; background:var(--kl-border); margin:0 4px 6px; }
.klx-acct-item {
  display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:9px;
  text-decoration:none; color:var(--kl-text); font-size:14px; font-weight:600;
  transition:background .12s; border:none; background:transparent; width:100%; cursor:pointer; font-family:inherit;
}
.klx-acct-item:hover { background:var(--kl-hover); }
.klx-acct-item.klx-danger { color:var(--error); font-weight:700; }
.klx-avatar {
  width:42px; height:42px; border-radius:50%; border:2px solid var(--kl-border);
  background:linear-gradient(135deg,#2563EB,#7C3AED); color:#fff; font-family:inherit;
  font-size:15px; font-weight:800; cursor:pointer; display:flex; align-items:center; justify-content:center;
}

/* ===================== MOBILE ===================== */
.klx-hamb, .klx-mobile-cta, .klx-mobile-right { display:none; }
.klx-hamb {
  width:40px; height:40px; border:1px solid var(--kl-border); border-radius:10px;
  background:var(--kl-surface); cursor:pointer; align-items:center; justify-content:center; color:var(--kl-text);
}
.klx-mobile-panel { display:none; }

@media (max-width:960px) {
  .klx-header { height:56px; padding:0 16px; }
  .klx-logo img { height:24px; }
  .klx-nav, .klx-right { display:none; }
  .klx-hamb { display:flex; }
  .klx-mobile-cta {
    display:inline-flex; align-items:center; height:38px; padding:0 14px; border:none; border-radius:10px;
    background:var(--primary); color:#fff; font-family:inherit; font-size:13px; font-weight:700;
    cursor:pointer; box-shadow:0 3px 10px rgba(37,99,235,.3); text-decoration:none;
  }
  .klx-mobile-right { display:flex; align-items:center; gap:8px; }

  .klx-mobile-panel {
    display:block; position:fixed; left:0; right:0; top:56px; bottom:0; z-index:99;
    background:var(--kl-page); overflow-y:auto; padding:14px 16px 40px;
    -webkit-overflow-scrolling:touch; animation:klx-acc .2s ease;
    font-family:'Manrope',system-ui,sans-serif;
  }
  .klx-mob-card {
    display:flex; align-items:center; gap:12px; padding:12px; background:var(--kl-surface);
    border:1px solid var(--kl-border); border-radius:14px; margin-bottom:14px;
  }
  .klx-mob-avatar {
    width:44px; height:44px; border-radius:50%; background:linear-gradient(135deg,#2563EB,#7C3AED);
    color:#fff; font-size:16px; font-weight:800; display:flex; align-items:center; justify-content:center; flex-shrink:0;
  }
  .klx-acc-head {
    width:100%; display:flex; align-items:center; justify-content:space-between; padding:15px 8px;
    border:none; background:transparent; font-family:inherit; font-size:16px; font-weight:700;
    color:var(--kl-text); cursor:pointer;
  }
  .klx-acc-head svg { transition:transform .18s; }
  .klx-acc-head.klx-open svg { transform:rotate(180deg); }
  .klx-acc-body { animation:klx-acc .22s cubic-bezier(.22,1,.36,1); padding:4px 2px 12px; }
  .klx-acc-grouptitle { margin:12px 6px 4px; font-size:11px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; color:var(--kl-text3); }
  .klx-mob-row { display:flex; align-items:center; gap:12px; padding:9px 8px; border-radius:11px; text-decoration:none; }
  .klx-mob-row:active { background:var(--kl-hover); }
  .klx-mob-tile { width:38px; height:38px; border-radius:11px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
  .klx-mob-label { font-size:15px; font-weight:700; color:var(--kl-text); }
  .klx-mob-desc { display:block; font-size:12px; font-weight:500; color:var(--kl-text2); margin-top:1px; }
  .klx-acc-link { display:block; padding:15px 8px; text-decoration:none; font-size:16px; font-weight:700; color:var(--kl-text); }
  .klx-mob-sep { height:1px; background:var(--kl-border); }
  .klx-mob-all { display:inline-flex; align-items:center; gap:7px; margin:10px 0 0 8px; padding:10px 0; text-decoration:none; color:var(--primary); font-size:15px; font-weight:800; }
  .klx-mob-util { display:flex; gap:10px; margin-top:16px; }
  .klx-mob-langseg { flex:1; display:flex; padding:4px; background:var(--kl-surface2); border:1px solid var(--kl-border); border-radius:12px; gap:4px; }
  .klx-mob-langbtn { flex:1; height:36px; border:none; border-radius:9px; font-family:inherit; font-size:14px; font-weight:800; cursor:pointer; background:transparent; color:var(--kl-text2); }
  .klx-mob-langbtn.klx-active { background:var(--primary); color:#fff; }
  .klx-mob-theme {
    flex:1; display:flex; align-items:center; justify-content:center; gap:8px; height:44px;
    border:1px solid var(--kl-border); border-radius:12px; background:var(--kl-surface);
    color:var(--kl-text); font-family:inherit; font-size:14px; font-weight:700; cursor:pointer;
  }
  .klx-mob-pro {
    display:flex; align-items:center; justify-content:center; gap:8px; height:46px; border-radius:12px;
    background:rgba(124,58,237,.10); text-decoration:none; color:var(--accent); font-size:15px; font-weight:800; margin-bottom:14px;
  }
  .klx-mob-danger { display:block; padding:14px 8px; font-size:15px; font-weight:700; color:var(--error); text-decoration:none; }
}

/* ===================== PIED DE PAGE ===================== */
.klx-footer { background:var(--kl-footer); padding:44px 40px 28px; font-family:'Manrope',system-ui,sans-serif; }
.klx-footer-inner { max-width:1200px; margin:0 auto; }
.klx-foot-grid { display:grid; grid-template-columns:1.4fr 1fr 1.3fr 1fr; gap:32px; }
.klx-foot-logo { height:30px; width:auto; display:block; }
.klx-foot-tagline { margin:16px 0 0; font-size:14px; line-height:1.6; color:var(--kl-footerText2); font-weight:500; max-width:240px; }
.klx-foot-title { margin:0 0 14px; font-size:12px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; color:var(--kl-footerText2); }
.klx-foot-col { display:flex; flex-direction:column; gap:10px; }
.klx-foot-tools { display:grid; grid-template-columns:1fr 1fr; gap:10px 20px; }
.klx-foot-link { text-decoration:none; font-size:14px; font-weight:600; color:var(--kl-footerText); transition:color .12s; }
.klx-foot-link:hover { color:#fff; }
.klx-foot-sep { height:1px; background:var(--kl-footerBorder); margin:32px 0 20px; }
.klx-foot-bottom { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.klx-foot-copy { margin:0; font-size:13px; font-weight:500; color:var(--kl-footerText2); }
.klx-foot-legal { display:flex; gap:16px; }
.klx-foot-linksmall { text-decoration:none; font-size:13px; font-weight:600; color:var(--kl-footerText2); }
.klx-foot-linksmall:hover { color:var(--kl-footerText); }

@media (max-width:960px) {
  .klx-footer { padding:28px 22px; }
  .klx-foot-grid { grid-template-columns:1fr; gap:26px; }
  .klx-foot-tagline { max-width:none; }
  .klx-foot-bottom { flex-direction:column-reverse; align-items:flex-start; gap:14px; }
}
