/* ============================================================================
   GoForIt Learn — Feuille de style PARTAGÉE
   ----------------------------------------------------------------------------
   Ce fichier est utilisé par index.html (accueil) ET par course.html
   (détail d'un cours). Toute modification d'apparence se fait ICI, une
   seule fois, pour les deux pages.

   Organisation (dans l'ordre) :
     1. Variables (:root)        — couleurs, rayons
     2. Base                     — body, titres, liens, .wrap
     3. Header + barre catégories + menu latéral
     4. Bandeau marché
     5. Hero
     6. Sections génériques (.section-head)
     7. Features
     8. Audience (apprenants / formateurs)
     9. CTA final
    10. Footer
    11. Catalogue (cartes de cours)
    12. Mon espace (progression)
   ============================================================================ */

:root {
    --ink: #1a1f2b;
    --ink-soft: #565f70;
    --paper: #fafaf7;
    --paper-alt: #f0f0ea;
    --line: #e4e2d8;
    --blue: #1565c0;
    --blue-deep: #0d4a96;
    --amber: #f59e0b;
    --amber-deep: #b9790a;
    --green: #1f8a4c;
    --card: #ffffff;
    --radius: 18px;
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }

  body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.55;
  }

  h1, h2, h3, .display {
    font-family: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ink);
  }

  a { color: var(--blue-deep); text-decoration: none; }
  a:hover { text-decoration: underline; }

  .wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

  /* ══════════════════════════════════════════════════════════
     HEADER horizontal (barre principale + barre de catégories)
     ══════════════════════════════════════════════════════════ */
  header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(250, 250, 247, 0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }

  /* — Barre principale : logo · recherche · actions — */
  .topbar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 24px;
    max-width: 1200px;
    margin: 0 auto;
  }
  .menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink);
    display: none; /* visible seulement en mobile */
    align-items: center;
    padding: 4px;
  }
  .menu-btn svg { width: 22px; height: 22px; }
  .brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--ink);
    flex-shrink: 0;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--blue), var(--blue-deep));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.95rem;
    font-weight: 800;
    flex-shrink: 0;
  }

  /* — Recherche centrale — */
  .search-central {
    flex: 1;
    max-width: 560px;
    margin: 0 auto;
    position: relative;
  }
  .search-central svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--ink-soft);
    pointer-events: none;
  }
  .search-central input {
    width: 100%;
    padding: 11px 18px 11px 44px;
    border-radius: 100px;
    border: 1.5px solid var(--line);
    font-size: 0.92rem;
    background: white;
    color: var(--ink);
  }
  .search-central input:focus {
    outline: none;
    border-color: var(--blue);
  }

  /* — Actions à droite — */
  .topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
  }
  .icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
  }
  .icon-btn svg { width: 21px; height: 21px; }
  .icon-btn:hover { color: var(--blue-deep); }

  .btn-google {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: white;
    color: var(--ink);
    border: 1.5px solid var(--line);
    padding: 8px 16px 8px 12px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
  }
  .btn-google:hover { border-color: var(--ink); }
  .btn-google svg { width: 17px; height: 17px; flex-shrink: 0; }
  .user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    position: relative;
  }
  .user-chip img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--line);
  }
  .user-chip .name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink);
  }
  .user-menu {
    position: absolute;
    top: 44px;
    right: 0;
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 30px -8px rgba(20,30,50,0.2);
    padding: 8px;
    min-width: 160px;
    display: none;
    z-index: 60;
  }
  .user-menu.open { display: block; }
  .user-menu button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 0.86rem;
    color: var(--ink);
    cursor: pointer;
  }
  .user-menu button:hover { background: var(--paper-alt); }
  [hidden] { display: none !important; }

  /* — Barre de catégories — */
  .catbar {
    border-top: 1px solid var(--line);
    background: var(--paper);
  }
  .catbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
  }
  .catbar-inner::-webkit-scrollbar { display: none; } /* Chrome/Safari */
  .cat-link {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink-soft);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 12px 14px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    font-family: inherit;
  }
  .cat-link:hover { color: var(--blue-deep); }
  .cat-link.active {
    color: var(--blue-deep);
    border-bottom-color: var(--blue-deep);
  }

  /* — Responsive header — */
  @media (max-width: 760px) {
    .menu-btn { display: flex; }
    .brand .brand-text { display: none; } /* garde juste le logo carré */
    .search-central { max-width: none; }
    .btn-google span.g-label { display: none; } /* icône seule */
    .btn-google { padding: 8px; }
    .user-chip .name { display: none; }
  }

  /* ── Menu latéral (inchangé) ── */
  .side-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20,25,35,0.4);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .side-menu-overlay.open { opacity: 1; pointer-events: auto; }
  .side-menu {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 280px;
    background: white;
    z-index: 91;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    padding: 20px;
    overflow-y: auto;
  }
  .side-menu.open { transform: translateX(0); }
  .side-menu nav { display: flex; flex-direction: column; gap: 4px; margin: 24px 0; }
  .side-menu nav a {
    color: var(--ink);
    font-weight: 600;
    font-size: 0.96rem;
    padding: 12px 8px;
    border-radius: 10px;
  }
  .side-menu nav a:hover { background: var(--paper-alt); text-decoration: none; }
  .side-menu-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    position: absolute;
    top: 18px;
    right: 16px;
    color: var(--ink-soft);
  }

  /* ── Bandeau marché ── */
  .market-strip {
    background: var(--ink);
    color: #d7dce6;
    font-size: 0.84rem;
    padding: 10px 0;
    text-align: center;
  }
  .market-strip strong { color: white; }

  /* ── Hero ── */
  .hero {
    padding: 76px 0 64px;
    position: relative;
    overflow: hidden;
  }
  .hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 56px;
    align-items: center;
  }
  @media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  }
  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--blue-deep);
    background: #e8f1fc;
    padding: 6px 14px;
    border-radius: 100px;
    margin-bottom: 20px;
  }
  .hero h1 {
    font-size: clamp(2.1rem, 4.6vw, 3.4rem);
    line-height: 1.08;
    margin: 0 0 20px;
  }
  .hero h1 em {
    font-style: normal;
    color: var(--blue-deep);
  }
  .hero p.lead {
    font-size: 1.08rem;
    color: var(--ink-soft);
    max-width: 480px;
    margin: 0 0 30px;
  }
  .hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 26px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.96rem;
    border: none;
    cursor: pointer;
  }
  .btn-primary { background: var(--blue-deep); color: white; }
  .btn-primary:hover { background: #0a3a78; text-decoration: none; }
  .btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--line);
  }
  .btn-ghost:hover { border-color: var(--ink); text-decoration: none; }

  /* ── Signature visuelle ── */
  .stack {
    position: relative;
    height: 380px;
  }
  .lesson-card {
    position: absolute;
    width: 230px;
    background: var(--card);
    border-radius: 16px;
    border: 1px solid var(--line);
    box-shadow: 0 18px 40px -12px rgba(20, 30, 50, 0.18);
    padding: 16px;
  }
  .lesson-card .tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 100px;
    margin-bottom: 10px;
  }
  .lesson-card .tag.blue { background: #e8f1fc; color: var(--blue-deep); }
  .lesson-card .tag.amber { background: #fef3e0; color: var(--amber-deep); }
  .lesson-card h4 {
    margin: 0 0 6px;
    font-size: 0.96rem;
    font-weight: 700;
  }
  .lesson-card p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--ink-soft);
  }
  .lesson-card .meter {
    margin-top: 12px;
    height: 5px;
    border-radius: 4px;
    background: var(--paper-alt);
    overflow: hidden;
  }
  .lesson-card .meter span {
    display: block;
    height: 100%;
    border-radius: 4px;
  }
  .card-a { top: 0; left: 10%; transform: rotate(-6deg); z-index: 3; }
  .card-b { top: 90px; left: 38%; transform: rotate(4deg); z-index: 2; }
  .card-c { top: 210px; left: 6%; transform: rotate(3deg); z-index: 1; }
  @media (max-width: 860px) {
    .stack { height: 300px; }
    .lesson-card { width: 190px; }
  }
  @media (max-width: 500px) {
    .stack { display: none; }
  }

  /* ── Sections ── */
  section { padding: 72px 0; }
  .section-head { max-width: 560px; margin: 0 0 44px; }
  .section-head .eyebrow-plain {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 10px;
    display: block;
  }
  .section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 12px; }
  .section-head p { color: var(--ink-soft); margin: 0; }

  .features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
  @media (max-width: 860px) { .features { grid-template-columns: 1fr; } }
  .feature {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 24px;
  }
  .feature .icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 16px;
  }
  .feature.f1 .icon { background: #e8f1fc; }
  .feature.f2 .icon { background: #fef3e0; }
  .feature.f3 .icon { background: #e9f7ee; }
  .feature h3 { font-size: 1.06rem; margin: 0 0 8px; }
  .feature p { color: var(--ink-soft); margin: 0; font-size: 0.93rem; }

  .audience {
    background: var(--paper-alt);
  }
  .audience-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
  @media (max-width: 760px) { .audience-grid { grid-template-columns: 1fr; } }
  .audience-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid var(--line);
  }
  .audience-card .kicker {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--blue-deep);
    margin-bottom: 10px;
    display: block;
  }
  .audience-card.instructor .kicker { color: var(--amber-deep); }
  .audience-card h3 { font-size: 1.3rem; margin: 0 0 10px; }
  .audience-card p { color: var(--ink-soft); margin: 0 0 18px; }
  .audience-card ul {
    list-style: none;
    margin: 0 0 22px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .audience-card li {
    font-size: 0.92rem;
    color: var(--ink);
    display: flex;
    gap: 10px;
    align-items: flex-start;
  }
  .audience-card li::before {
    content: "✓";
    color: var(--blue-deep);
    font-weight: 800;
    flex-shrink: 0;
  }
  .audience-card.instructor li::before { color: var(--amber-deep); }

  /* ── CTA final ── */
  .cta-final {
    background: linear-gradient(135deg, var(--blue-deep), var(--blue));
    color: white;
    border-radius: 28px;
    padding: 56px 40px;
    text-align: center;
    margin: 0 24px;
  }
  .cta-final h2 { color: white; margin: 0 0 14px; }
  .cta-final p { color: #dbe8fb; margin: 0 0 28px; max-width: 480px; margin-inline: auto; }
  .cta-final .btn-primary { background: white; color: var(--blue-deep); }
  .cta-final .btn-primary:hover { background: #eef4fc; }

  /* ── Footer ── */
  footer {
    border-top: 1px solid var(--line);
    padding: 48px 0 28px;
    margin-top: 40px;
  }
  .footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 36px;
  }
  @media (max-width: 760px) {
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  }
  .footer-brand .brand { margin-bottom: 12px; }
  .footer-brand p {
    color: var(--ink-soft);
    font-size: 0.88rem;
    max-width: 320px;
    margin: 0;
  }
  .footer-col h4 {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-soft);
    margin: 0 0 14px;
  }
  .footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .footer-col a {
    color: var(--ink);
    font-size: 0.92rem;
  }
  .footer-col a:hover { color: var(--blue-deep); }
  .footer-bottom {
    border-top: 1px solid var(--line);
    padding-top: 22px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--ink-soft);
  }

  /* ── Catalogue dynamique (format liste) ── */
    .catalog-grid {
      display: flex;
      flex-direction: column;
      gap: 18px;
    }
    .course-row {
      display: flex;
      gap: 22px;
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 16px;
      overflow: hidden;
      text-decoration: none;
      color: var(--ink);
      padding: 18px;
    }
    .course-row:hover { border-color: var(--blue); text-decoration: none; }

    .row-thumb {
      flex-shrink: 0;
      width: 230px;
      height: 150px;
      border-radius: 12px;
      overflow: hidden;
      background: linear-gradient(135deg, #e8f1fc, #d7e8fb);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.8rem;
    }
    .row-thumb img { width: 100%; height: 100%; object-fit: cover; }

    .row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
    .row-top {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 4px;
    }
    .row-cat {
      font-size: 0.76rem;
      font-weight: 800;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: var(--blue-deep);
    }
    .row-title {
      font-size: 1.16rem;
      font-weight: 700;
      margin: 0 0 10px;
      line-height: 1.25;
    }
    .row-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 18px;
      margin-bottom: 10px;
    }
    .row-meta-item {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.86rem;
      color: var(--ink-soft);
    }
    .row-meta-item svg {
      width: 15px;
      height: 15px;
      color: var(--blue-deep);
      flex-shrink: 0;
    }
    .row-desc {
      font-size: 0.92rem;
      color: var(--ink-soft);
      margin: 0 0 14px;
      line-height: 1.5;
    }
    .row-foot {
      margin-top: auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    @media (max-width: 640px) {
      .course-row { flex-direction: column; gap: 14px; }
      .row-thumb { width: 100%; height: 170px; }
    }

    .catalog-empty, .catalog-loading {
      color: var(--ink-soft);
      font-size: 0.92rem;
      text-align: center;
      padding: 24px;
    }

  /* ── Mon espace ── */
  #mon-espace { background: var(--paper-alt); }
  .progress-list { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
  .progress-item {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 18px;
  }
  .progress-item .row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    gap: 12px;
  }
  .progress-item h4 { margin: 0; font-size: 0.96rem; }
  .progress-item .pct { font-size: 0.84rem; font-weight: 700; color: var(--blue-deep); flex-shrink: 0; }
  .progress-bar-track {
    height: 6px;
    border-radius: 4px;
    background: var(--paper-alt);
    overflow: hidden;
  }
  .progress-bar-fill {
    height: 100%;
    background: var(--blue);
    border-radius: 4px;
  }

/* ============================================================================
   BANNIÈRE DE CONSENTEMENT AUX COOKIES (consent-banner.js)
   Partagée par toutes les pages. Message simple : cookies nécessaires
   uniquement, pas de suivi publicitaire.
   ============================================================================ */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  background: var(--ink);
  color: #e8ebf2;
  transform: translateY(110%);
  transition: transform 0.26s ease;
  box-shadow: 0 -8px 30px -12px rgba(0, 0, 0, 0.4);
}
.cookie-banner-visible {
  transform: translateY(0);
}
.cookie-banner-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.cookie-banner-text {
  flex: 1;
  min-width: 240px;
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #cfd6e4;
}
.cookie-banner-text a {
  color: #9ec3f5;
  text-decoration: underline;
}
.cookie-banner-text a:hover {
  color: #c2dbff;
}
.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.cookie-btn {
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  font-family: inherit;
}
.cookie-btn-refuse {
  background: transparent;
  color: #cfd6e4;
  border-color: rgba(255, 255, 255, 0.25);
}
.cookie-btn-refuse:hover {
  border-color: rgba(255, 255, 255, 0.5);
}
.cookie-btn-accept {
  background: var(--blue);
  color: #ffffff;
}
.cookie-btn-accept:hover {
  background: var(--blue-deep);
}
@media (max-width: 560px) {
  .cookie-banner-inner {
    padding: 14px 18px;
  }
  .cookie-banner-actions {
    width: 100%;
  }
  .cookie-btn {
    flex: 1;
  }
}
/* ── Pile de cartes de cours (hero, décorative) ── */
.gfi-stack {
  position: relative;
  width: 340px;
  height: 360px;
  margin: 0 auto;
}
.gfi-stack-card {
  position: absolute;
  width: 300px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -12px rgba(20, 30, 50, 0.18);
  padding: 16px 18px;
}
.gfi-stack-card--1 { top: 0;     left: 0;    transform: rotate(-5deg); z-index: 3; }
.gfi-stack-card--2 { top: 115px; left: 30px; transform: rotate(3deg);  z-index: 2; }
.gfi-stack-card--3 { top: 230px; left: 5px;  transform: rotate(-4deg); z-index: 1; }

.gfi-stack-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 10px;
}
.gfi-stack-row { display: flex; align-items: center; gap: 10px; }
.gfi-stack-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.gfi-stack-icon svg { width: 20px; height: 20px; }
.gfi-stack-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.gfi-stack-meta  { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

.gfi-badge-blue   { background: #E6F1FB; color: #0C447C; }
.gfi-icon-blue    { background: #E6F1FB; color: #185FA5; }
.gfi-badge-purple { background: #EEEDFE; color: #3C3489; }
.gfi-icon-purple  { background: #EEEDFE; color: #534AB7; }
.gfi-badge-teal   { background: #E1F5EE; color: #085041; }
.gfi-icon-teal    { background: #E1F5EE; color: #0F6E56; }

/* La grille hero passe en 1 colonne à 860px : on réduit un peu la pile */
@media (max-width: 860px) {
  .gfi-stack { width: 300px; height: 340px; margin-top: 16px; }
}
/* Sur très petit écran, on masque la pile (comme l'ancienne signature) */
@media (max-width: 500px) {
  .gfi-stack { display: none; }
}
