/* ============================================================
   SophIA · feuille de style globale (100% statique, zero Wix)
   ============================================================ */

:root {
  --navy: #334158;
  --navy-deep: #324158;
  --ink: #101213;
  --slate: #687A96;
  --peach: #F8BE98;
  --peach-soft: #FBD6C3;
  --cream: #FCF7F1;
  --cream-2: #EFECEA;
  --focus: #62BEED;
  --game-blue: #B3EBFF;
  --white: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1200px;
  --gutter: 24px;
  --shadow: 0 18px 50px rgba(51, 65, 88, 0.12);
  --shadow-sm: 0 8px 24px rgba(51, 65, 88, 0.10);
}

* { box-sizing: border-box; }

/* clip (et non hidden) : coupe le tiroir de menu range hors-ecran en mobile
   sans creer de conteneur de scroll, donc le header sticky continue de coller. */
html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  font-family: "Syne", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3 { color: var(--navy); font-weight: 600; letter-spacing: 0.005em; line-height: 1.24; margin: 0; }

/* .section / .section-sm sont poses sur les memes elements que .wrap :
   padding vertical uniquement, sinon la gouttiere laterale saute. */
.section { padding-top: 90px; padding-bottom: 90px; }
.section-sm { padding-top: 60px; padding-bottom: 60px; }

.center { text-align: center; }

.eyebrow {
  display: inline-block;
  background: var(--cream-2);
  color: var(--slate);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn-primary { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-peach { background: var(--peach); color: var(--ink); }
.btn-peach:hover { transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252, 247, 241, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(51, 65, 88, 0.06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--gutter);
  max-width: var(--maxw);
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 40px; height: 40px; }
.brand span { font-size: 22px; font-weight: 500; color: var(--navy); letter-spacing: 0.01em; }
.brand span b { font-weight: 800; }

.nav { display: flex; align-items: center; gap: 30px; }
.nav a.nav-link { font-weight: 600; color: var(--navy); font-size: 15px; transition: color .15s; }
.nav a.nav-link:hover { color: var(--slate); }

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.burger span { width: 26px; height: 2px; background: var(--navy); border-radius: 2px; transition: .25s; }
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding-top: 70px; padding-bottom: 40px; text-align: center; }
.hero h1 { font-size: clamp(34px, 5vw, 58px); max-width: 900px; margin: 0 auto; }
.hero .lead {
  max-width: 620px;
  margin: 22px auto 30px;
  color: var(--slate);
  font-size: 18px;
  font-weight: 500;
}
.hero-media { position: relative; margin: 46px auto 0; max-width: 980px; }
.hero-media img { width: 100%; border-radius: var(--radius); position: relative; z-index: 1; }
.float-card {
  position: absolute; z-index: 3;
  display: flex; flex-direction: column; gap: 14px;
  width: 148px; padding: 20px 18px;
  background: var(--navy); color: #fff;
  border-radius: 20px;
  box-shadow: 0 22px 55px rgba(51,65,88,0.35);
  will-change: transform;
}
.float-card .ic {
  width: 52px; height: 52px; border-radius: 14px;
  background: rgba(255,255,255,0.10);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 22px rgba(255,255,255,0.35);
}
.float-card .ic svg { width: 26px; height: 26px; stroke: #fff; fill: none; }
.float-card span { font-weight: 600; font-size: 15px; line-height: 1.22; }
.fc-emotions { top: 34%; left: -38px; }
.fc-growth { top: 4%; right: -28px; }
.fc-daily { bottom: 7%; right: 22px; }

.pills { display: none; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 34px; }
.pill {
  background: var(--navy);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
}

/* ---------- Clients ---------- */
.clients { text-align: center; padding-top: 70px; padding-bottom: 70px; }
.clients h2 { font-size: clamp(26px, 3.5vw, 40px); }
.clients p { color: var(--slate); max-width: 640px; margin: 14px auto 0; }
.client-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 40px 70px;
  margin-top: 44px;
}
.client-logo-img { width: 150px; height: auto; opacity: .82; }

/* ---------- Mission ---------- */
.mission { text-align: center; }
.mission h2 { font-size: clamp(30px, 4.5vw, 48px); }
.mission p { max-width: 720px; margin: 22px auto 30px; color: var(--slate); font-size: 17px; }

/* ---------- Feature cards (navy) ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin-top: 10px;
}
.feature-card {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 32px;
}
.feature-card h3 { color: #fff; font-size: 21px; text-transform: uppercase; margin-bottom: 12px; }
.feature-card p { margin: 0; color: rgba(255,255,255,0.82); font-size: 15px; font-weight: 500; }

/* ---------- Why choose (numbered peach cards) ---------- */
.why { text-align: center; }
.why h2 { font-size: clamp(30px, 4.5vw, 48px); margin-top: 16px; }
.why .intro { max-width: 760px; margin: 20px auto 0; color: var(--slate); font-size: 17px; }
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 50px;
  text-align: left;
}
.why-card {
  background: var(--cream-2);
  border: 2px solid var(--peach);
  border-radius: var(--radius);
  padding: 30px 26px;
}
.why-num {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--peach);
  color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px;
  margin-bottom: 18px;
}
.why-card h3 { text-transform: uppercase; font-size: 18px; margin-bottom: 12px; }
.why-card p { margin: 0; color: #3a4453; font-size: 14.5px; font-weight: 500; }

/* ---------- Final CTA tiles ---------- */
.final-cta { text-align: center; }
.final-cta h2 { font-size: clamp(30px, 5vw, 54px); max-width: 820px; margin: 0 auto; text-transform: uppercase; }
.final-cta .sub { color: var(--slate); margin: 22px auto 46px; font-size: 17px; }
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.tile {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 46px 24px;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
}
.tile .ic {
  width: 64px; height: 64px;
  margin: 0 auto 22px;
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
}
.tile .ic svg { width: 30px; height: 30px; stroke: #fff; fill: none; }

/* ---------- Footer ---------- */
.site-footer { padding: 70px 0 40px; border-top: 1px solid rgba(51,65,88,0.10); margin-top: 40px; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.footer-left { max-width: 360px; }
.footer-left .brand { margin-bottom: 26px; }
.footer-menu h4 { color: var(--navy); font-size: 22px; font-weight: 800; margin: 0 0 16px; }
.footer-menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-menu a { color: var(--slate); font-weight: 600; }
.footer-menu a:hover { color: var(--navy); }
.footer-bottom {
  max-width: var(--maxw);
  margin: 40px auto 0;
  padding: 24px var(--gutter) 0;
  border-top: 1px solid rgba(51,65,88,0.10);
  text-align: right;
  color: var(--slate);
  font-size: 14px;
}

/* ---------- Product page ---------- */
.prod-hero { text-align: center; padding-top: 60px; padding-bottom: 20px; }
.prod-hero h1 { font-size: clamp(40px, 6vw, 68px); }
.prod-hero p { max-width: 560px; margin: 18px auto 26px; color: var(--slate); font-size: 17px; }

.prod-banner {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 40px auto;
  max-width: 760px;
  min-height: 320px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #fff; padding: 40px;
}
.prod-banner::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(rgba(16,18,19,0.55), rgba(16,18,19,0.55));
}
.prod-banner img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.prod-banner h2, .prod-banner .btn { position: relative; z-index: 1; }
.prod-banner h2 { color: #fff; font-size: clamp(28px, 4vw, 44px); text-transform: uppercase; margin-bottom: 26px; }

.prod-lead { text-align: center; font-size: clamp(28px, 4vw, 44px); max-width: 760px; margin: 60px auto; }

.prod-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
  margin: 90px 0;
}
.prod-row.reverse .prod-text { order: 2; }
.prod-row img { border-radius: var(--radius); width: 100%; }
.prod-text h3 { font-size: clamp(24px, 3vw, 34px); text-transform: uppercase; margin-bottom: 16px; }
.prod-text p { color: var(--slate); font-size: 16px; }
.prod-badge { display: inline-flex; align-items: center; gap: 10px; color: var(--slate); font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.prod-badge .dot { width: 34px; height: 34px; border-radius: 9px; background: var(--navy); display: flex; align-items: center; justify-content: center; }
.prod-badge .dot svg { width: 18px; height: 18px; stroke: #fff; fill: none; }

/* stats */
.stats-block { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 50px; align-items: center; margin: 90px 0; }
.stats-block h3 { font-size: clamp(24px, 3vw, 34px); text-transform: uppercase; margin-bottom: 16px; }
.stats-block > div p { color: var(--slate); }
/* minmax(0,1fr) et non 1fr : sinon les tuiles refusent de passer sous leur
   largeur min-content et debordent l'ecran sur les petits telephones. */
.stats-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; }
.stat {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 26px;
}
.stat .n { font-size: 34px; font-weight: 800; color: var(--peach); }
.stat .l { font-size: 14px; color: rgba(255,255,255,0.82); font-weight: 600; margin-top: 6px; }

/* ---------- Connexion ---------- */
.auth-wrap {
  min-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
}
.auth-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: var(--radius);
  padding: 44px 40px;
  box-shadow: var(--shadow);
  text-align: center;
}
.auth-card h1 { font-size: 36px; margin-bottom: 12px; }
.auth-card .sub { color: var(--slate); font-size: 15px; margin-bottom: 28px; }
.field { text-align: left; margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--cream-2);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  background: var(--cream);
  color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(98,190,237,0.20); }
.auth-card .btn { width: 100%; margin-top: 8px; }
.form-msg { min-height: 22px; margin-top: 14px; font-size: 14px; font-weight: 600; color: #c0392b; }
.form-msg.ok { color: #2e7d5b; }

/* ---------- Chat ---------- */
.chat-page { padding: 30px 0 60px; }
.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.chat-side {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px;
  align-self: start;
}
.chat-side img.portrait { width: 100%; border-radius: var(--radius-sm); margin-bottom: 20px; }
.chat-side h3 { color: #fff; font-size: 20px; margin-bottom: 10px; }
.chat-side p { color: rgba(255,255,255,0.80); font-size: 14px; }
.chat-side .examples { margin-top: 20px; display: grid; gap: 10px; }
.chat-side .examples span {
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 500;
}
.chat-main {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 560px;
}
.chat-beta {
  background: var(--peach-soft);
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 8px;
}
.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
}
.chat-message {
  display: flex;
  align-items: flex-start;
  max-width: 78%;
  width: fit-content;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  word-break: break-word;
  font-size: 15px;
}
.user-message { background: var(--slate); color: #fff; align-self: flex-end; margin-left: auto; flex-direction: row-reverse; }
.ai-message { background: var(--peach); color: var(--ink); align-self: flex-start; margin-right: auto; }
.chat-message .avatar { width: 30px; height: 30px; border-radius: 8px; margin-right: 10px; object-fit: cover; }
.chat-inputbar { display: flex; gap: 10px; padding: 16px; border-top: 1px solid var(--cream-2); background: var(--slate); }
.chat-inputbar input {
  flex: 1;
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--slate);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
}
.chat-inputbar input::placeholder { color: rgba(255,255,255,0.75); }
.chat-inputbar input:focus { outline: none; }
.chat-send {
  width: 46px; height: 46px;
  border: none; border-radius: var(--radius-sm);
  background: #fff; color: var(--slate);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.chat-send svg { width: 22px; height: 22px; transform: rotate(-45deg); }
.chat-send:disabled { opacity: .5; cursor: default; }

/* ---------- Test / mini-game ---------- */
.test-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: start;
  margin-top: 30px;
}
.game-panel { display: flex; flex-direction: column; align-items: center; }
#game-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1 / 1;
  border-top: 2px solid var(--navy);
  border-left: 2px solid var(--navy);
}
.cell {
  border-right: 2px solid var(--navy);
  border-bottom: 2px solid var(--navy);
  background: var(--cream);
  position: relative;
  cursor: default;
}
/* pastilles rondes centrées dans les cases carrées */
.cell.visited::after,
.cell.available::after,
.cell.current::before {
  content: "";
  position: absolute;
  inset: 15%;
  border-radius: 50%;
}
.cell.visited::after { background: var(--navy-deep); }
.cell.available::after { background: var(--game-blue); }
.cell.available { cursor: pointer; }
.cell.available:hover::after { filter: brightness(0.94); }
/* case courante : rond navy + anneau blanc */
.cell.current::before { background: var(--navy-deep); }
.cell.current::after {
  content: "";
  position: absolute;
  inset: 33%;
  border-radius: 50%;
  border: 3px solid #fff;
  background: transparent;
}

.test-rules h1 { font-size: 30px; margin-bottom: 14px; }
.test-rules p { color: var(--slate); font-size: 15px; margin: 0 0 10px; }
.game-controls { display: flex; gap: 14px; align-items: center; margin-top: 20px; }
.icon-btn {
  width: 54px; height: 54px;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #fff; border: none; cursor: pointer;
  font-size: 22px; display: flex; align-items: center; justify-content: center;
}
.game-progress { margin-top: 18px; color: var(--slate); font-weight: 600; }

.hints { margin-top: 28px; }
.hint-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; align-items: start; }
.hint-col { display: flex; flex-direction: column; gap: 10px; }
.hint-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 6px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  transition: transform .15s;
}
.hint-btn:hover { transform: translateY(-2px); }
.hint-btn.active { background: var(--peach); color: var(--navy); }
.hint-item { margin: 0; }
.hint-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; border-radius: var(--radius-sm); border: 2px solid var(--cream-2); display: block; }

/* ---------- Felicitation ---------- */
.felic {
  min-height: 66vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
}
.felic h1 { font-size: clamp(34px, 5vw, 56px); max-width: 760px; }
.felic .sig { margin-top: 26px; font-style: italic; color: var(--slate); font-size: 20px; font-weight: 500; }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  :root { --gutter: 26px; }
  .nav {
    position: fixed;
    top: 72px; right: 0;
    height: calc(100vh - 72px);
    width: min(78vw, 320px);
    background: var(--cream);
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 28px 26px;
    box-shadow: -10px 0 40px rgba(51,65,88,0.15);
    /* Ferme, le tiroir reste DANS le viewport et se masque par clip-path.
       Un translateX(105%) elargissait le viewport mobile : la page se rendait
       en 709px de large et s'affichait dezoomee sur telephone.
       Les valeurs negatives laissent depasser l'ombre a gauche/haut/bas,
       le 0 a droite garantit zero debordement horizontal. */
    clip-path: inset(-40px 0 -40px 100%);
    pointer-events: none;
    transition: clip-path .3s ease;
  }
  .nav.open { clip-path: inset(-40px 0 -40px -40px); pointer-events: auto; }
  .nav a.nav-link { font-size: 18px; padding: 8px 0; }
  .nav .btn { margin-top: 12px; width: 100%; }
  .burger { display: flex; }

  .feature-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; }
  .prod-row, .prod-row.reverse, .stats-block { grid-template-columns: minmax(0,1fr); margin: 50px 0; }
  .prod-row.reverse .prod-text { order: 0; }
  .test-layout { grid-template-columns: 1fr; }
  .hint-grid { grid-template-columns: repeat(4, 1fr); }
  .float-card { display: none; }
  .pills { display: flex; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-side { order: 2; }
  .section { padding-top: 60px; padding-bottom: 60px; }
  .footer-inner { flex-direction: column; gap: 30px; }
  .footer-bottom { text-align: left; }
}

@media (max-width: 480px) {
  .stats-grid { gap: 12px; }
  .stat { padding: 20px 16px; }
  .client-logos { gap: 26px 40px; }
  .client-logo-img { width: 120px; }
  .auth-card { padding: 32px 24px; }
  .hint-view img { max-width: 100%; }
}
