body
{
   background-color: #FFFFFF;
   color: #000000;
   font-family: Arial;
   font-weight: normal;
   font-size: 16px;
   line-height: 1.1875;
   margin: 0;
   padding: 0;
}
#s1
{
   display: flex;
   position: relative;
   padding: 10px 10px 10px 10px;
   flex-direction: column;
   flex-wrap: nowrap;
   justify-content: space-around;
   align-items: center;
   align-content: center;
   margin: 0;
   box-sizing: border-box;
   font-size: 0;
}
/* ============================================================================
   ✅ CHAPTERS — PLEIN ÉCRAN + LISTE SCROLLABLE + FOOTER FIXE
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700&display=swap');

:root{
  --vh: 1vh;                 /* maj par polyfill éventuel */
  --footer-h: 56px;          /* hauteur visuelle du footer */
  --list-pad-x: 10px;        /* ✨ NOUVEAU : air interne gauche/droite de la liste */
}
html, body{
  height:100%;
  margin:0;
  overflow:hidden;           /* seule la liste scrolle */
  -webkit-text-size-adjust:100%;
}

/* Masquer toute image sans source (évite l’icône cassée) */
img[src=""], img:not([src]), img[src="#"]{ display:none !important; }

/* ============================================================================
   ✅ CONTENEUR PLEIN ÉCRAN
   ============================================================================ */
.full-screen{
  height: 100dvh;
  height: calc(var(--vh) * 100);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  text-align:center;
  gap:12px;

  padding: clamp(12px, 3vw, 24px);
  padding-left:  max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top:   max(16px, env(safe-area-inset-top, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px); /* pas d’espace sous footer */

  overflow:hidden;
}
.section-1{ background:#fff; color:#000; }

/* ============================================================================
   ✅ HEADER (logo + titre)
   ============================================================================ */
.header{
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}
.logo{
  max-width:100px;
  height:auto;
  margin:4px 0 2px;
  object-fit:contain;
}
h1{
  margin:8px 0 4px;
  line-height:1.2;
  font-family:'Montserrat', sans-serif;
  color:#000080;
  text-align:center;
  max-width: calc(100vw - 22px);
  font-size: clamp(1.6rem, 7vw, 3rem);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.title{ font-size: clamp(1.6rem, 7vw, 3rem) !important; line-height:1.2 !important; }
h2.subtitle{
  margin:0 0 4px 0;
  line-height:1.3;
  font-family:'Montserrat', sans-serif;
  color:#666;
  text-align:center;
  font-size:clamp(1.2rem, 5vw, 1.8rem);
  font-weight:600;
}

/* ============================================================================
   ✅ LISTE — scrolle, occupe l’espace restant (✳️ ajustements anti-chevauchement)
   ============================================================================ */
#chapters-list{
  width: calc(100vw - 22px);
  max-width: 640px;
  margin:0 auto;
  text-align:left;

  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  -webkit-overflow-scrolling:touch;

  /* ✨ NOUVEAU : “air” interne gauche/droite pour décoller la scrollbar des boutons */
  padding-left:  var(--list-pad-x);
  padding-right: var(--list-pad-x);

  /* bas de liste au-dessus du footer */
  padding-bottom: calc(var(--footer-h) + env(safe-area-inset-bottom, 0px) + 10px);

  /* ✅ réserve l’espace de la scrollbar quand elle apparaît */
  scrollbar-gutter: stable both-edges;

  /* ✨ important : la width inclut le padding, évite tout débordement */
  box-sizing: border-box;

  /* ✨ confort Firefox : scrollbar plus fine */
  scrollbar-width: thin;
}

/* (optionnel WebKit) — ne change que la largeur, pas les couleurs */
#chapters-list::-webkit-scrollbar{ width:10px; }

/* ============================================================================
   ✅ FOOTER FIXE
   ============================================================================ */
.footer{
  position:fixed; left:0; right:0; bottom:0;
  background:#fff; border-top:1px solid #eee; color:#000080;
  z-index:10; font-size:.9rem;

  min-height:var(--footer-h);
  padding:0 16px calc(env(safe-area-inset-bottom, 0px));
  display:flex; align-items:center; justify-content:center;
}

/* ============================================================================
   ✅ BOUTONS CHAPITRES / LEÇONS — compat `.chapter-btn` + `.chapters-btn`
   ============================================================================ */
.chapter-btn, .chapters-btn, .lesson-btn{
  appearance:none; -webkit-appearance:none;
  display:flex; align-items:center; gap:12px;
  justify-content:space-between;           /* 🔒 à droite */
  width:100%;
  background:#fff; color:#000;
  border:1px solid #000;                   /* plus visible */
  border-radius:8px;
  text-align:left;
  padding:.7em 1em; margin:8px 0; cursor:pointer;
  font-size:clamp(1rem, 3.4vw, 1.1rem);
  line-height:1.35;
  box-sizing:border-box;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
  text-decoration:none;

  /* ✅ cible tactile minimale */
  min-height:44px;
}
.chapter-btn:hover, .chapters-btn:hover, .lesson-btn:hover{ background:#f5f5f5; border-color:#222; }
.chapter-btn:active, .chapters-btn:active, .lesson-btn:active{ transform:translateY(1px); }

/* ✅ focus clavier visible (a11y) */
.chapter-btn:focus-visible,
.chapters-btn:focus-visible,
.lesson-btn:focus-visible{
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* label + verrou à droite */
.chapter-btn .label, .chapters-btn .label, .lesson-btn .label{ flex:1 1 auto; word-break:break-word; }
.right-icon{
  flex:0 0 auto;
  margin-left:12px;                 /* pousse l’icône à droite */
  font-size:18px; line-height:1;
  opacity:.85; user-select:none;
}

/* Etat verrouillé */
.chapter-btn.locked, .chapters-btn.locked{
  opacity:.9;
  cursor:pointer;                   /* on garde le cursor pour modal */
}
.chapter-btn.locked:hover, .chapters-btn.locked:hover{
  background:#fff;                  /* pas d’effet hover “gratuit” */
  border-color:#000;
}

/* ============================================================================
   ✅ BARRE DE PROGRÈS intégrée au bouton (pilotée par --p)
   → unifie : barre = ::before, badge % = ::after
   ============================================================================ */
.chapter-btn, .chapters-btn{
  position:relative;
  overflow:hidden; 
  isolation:isolate;
}

/* Barre derrière le texte, largeur = var(--p) */
.chapter-btn::before,
.chapters-btn::before{
  content:"";
  position:absolute; left:0; top:0; bottom:0;
  width:var(--p, 0%);
  background:rgba(34,197,94,.22);     /* vert pastel (même rendu qu’avant) */
  border-radius:inherit; pointer-events:none; z-index:0;
  transition: width .2s ease;
}

/* État terminé (100%) */
.chapter-btn.completed,
.chapters-btn.completed{
  background-color:#b9f6c1;
  color:#111;
  font-weight:700;
  border-color:#39a464;
}

/* Badge % à droite si data-progress est présent */
.chapter-btn[data-progress]::after,
.chapters-btn[data-progress]::after{
  content:attr(data-progress);
  position:absolute;
  right:12px;
  top:50%;
  transform:translateY(-50%);
  font-size:.85rem;
  opacity:.7;
  z-index:1;
}

/* ✅ réserve un peu d’espace pour le badge % afin d’éviter le chevauchement */
.chapter-btn[data-progress],
.chapters-btn[data-progress]{
  padding-right: calc(1em + 3ch);
}

/* (Option) masquer numéro leçon s’il existe dans tes templates WWB */
.lesson-btn .lesson-num{ display:none !important; width:0 !important; margin:0 !important; padding:0 !important; }
.lesson-title{ flex:1 1 auto; word-break:break-word; }

/* ============================================================================
   ✅ PAYWALL MODAL — compat id (#) ET class (.)
   ============================================================================ */

/* Backdrop */
#paywall-backdrop,
.paywall-backdrop{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
#paywall-backdrop.show,
.paywall-backdrop.show{ display:flex; }

/* Modal */
#paywall-modal,
.paywall-modal{
  background:#fff; color:#111;
  width:min(520px, calc(100vw - 32px));
  border:1px solid #000;            /* même style que les boutons */
  border-radius:12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  padding:18px 18px 14px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
#paywall-modal h3,
.paywall-modal h3{
  margin:0 0 6px; font-size:1.15rem; color:#000;
}
#paywall-modal p,
.paywall-modal p{
  margin:0 0 14px; line-height:1.45;
}

/* Actions */
#paywall-actions,
.paywall-actions{
  display:flex; gap:10px; justify-content:flex-end;
}
#paywall-actions button,
.paywall-btn{
  border:1px solid #000; background:#fff; color:#111;
  padding:.55em 1.0em; border-radius:8px; cursor:pointer;
  font-size:.98rem; font-weight:600;
}
#paywall-actions .primary,
.paywall-btn.primary{
  background:#000; color:#fff; border-color:#000;
}
#paywall-actions button:active,
.paywall-btn:active{ transform:translateY(1px); }

/* ============================================================================
✅ RESTORE MODAL — CSS minimal
============================================================================ */
#restore-backdrop{
  position: fixed; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.5); z-index: 1000;
}
#restore-modal{
  max-width: 420px; width: 92%;
  background: #111827; color: #e5e7eb;
  border-radius: 16px; padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
#restore-modal h3{ margin: 0 0 8px 0; font-size: 1.2rem; }
#restore-modal form{ display: grid; gap: 10px; }
#restore-modal label{ display: grid; gap: 6px; font-size: .95rem; }
#restore-modal input{
  padding: 10px; border-radius: 10px; border: 1px solid #374151;
  background:#0f172a; color:#e5e7eb;
}
#restore-modal .actions{ display:flex; gap:10px; justify-content:flex-end; margin-top: 6px; }
#restore-modal button{
  padding: 8px 12px; border-radius: 10px; border:1px solid #374151; background:#1f2937; color:#e5e7eb;
}
.restore-btn{ margin: 12px 0; font-size: .95rem; }
#restore-msg{ font-size: .9rem; color:#9ca3af; min-height: 1.2em; }

/* ============================================================================
✅ Restore modal — respecter l'attribut hidden
============================================================================ */
#restore-backdrop[hidden] { display: none !important; }

/* ============================================================================
✅ Restore / Transfer license button — style discret
============================================================================ */
.license-btn {
  background: transparent;
  color: #1e3a8a;        /* bleu foncé (même esprit que ton titre) */
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid #1e3a8a;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.license-btn:hover,
.license-btn:focus {
  background: #1e3a8a;
  color: #fff;
  outline: none;
}

.license-btn:active {
  transform: scale(0.97);
}

/* --- Restore modal: aligné en haut, fond scrollable, safe-areas --- */
#restore-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);          /* assombrir l’arrière-plan */
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  overflow: auto;                            /* permet de scroller si clavier */
  display: none;                             /* sera remplacé quand [hidden] est retiré */
  align-items: flex-start;                   /* <<< clé: coller en haut */
  justify-content: center;
}
#restore-backdrop:not([hidden]) { display: flex; }

#restore-modal {
  width: min(640px, 100%);
  background: #0b1220;                      /* même thème que votre UI */
  color: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
  /* pas de margin-top: on est déjà aligné en haut par flex-start */
}

/* un peu d’air pour les champs */
#restore-form label { display:block; margin: 12px 0 6px; }
#restore-form input { width:100%; padding:12px; border-radius:10px; border:1px solid #334155; background:#0f172a; color:#fff; }
#restore-form .actions { display:flex; gap:10px; margin-top:14px; }
#restore-form button { padding:10px 14px; border-radius:10px; border:1px solid #334155; background:#1e293b; color:#fff; }
#restore-form #restore-submit { background:#334155; }

#restore-title {
  color: #60a5fa; /* blue-400 Tailwind → bleu pale lumineux */
  margin-top: 0;
}

/* Champs de saisie uniformes */
#restore-form input {
  width: 100%;
  padding: 10px 12px;   /* même écart gauche/droite */
  border-radius: 6px;
  border: 1px solid #334155; /* gris foncé */
  background: #0f172a;       /* fond sombre */
  color: #e5e7eb;            /* texte clair */
  box-sizing: border-box;    /* important pour aligner */
}

/* Bloc actions boutons */
#restore-form .actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;   /* réduit */
  margin-bottom: 5px; /* réduit l’espace en dessous */
}

/* Message (moins d’espace quand vide) */
#restore-msg {
  margin: 5px 0 0;
  font-size: 0.9rem;
  color: #60a5fa; /* bleu pale pour cohérence */
  min-height: 1.2em; /* garde une petite place sans énorme trou */
}

  /* ============================================================================
     ✅ TITRE CENTRÉ + ORANGE VIF
     ========================================================================== */
  #paywall-modal .paywall-title {
    font-size: 1.8em;
    font-weight: 800;
    text-align: center !important;
    margin: 0.5em 0;
    color: #ff5722 !important;
  }

  /* ============================================================================
     ✅ SÉPARATEUR STYLÉ
     ========================================================================== */
  .paywall-divider {
    width: 80px;
    height: 5px;
    margin: 0.8em auto 1.2em auto;
    border-radius: 3px;
    background: linear-gradient(90deg, #ff9800, #ff5722);
  }

  /* ============================================================================
     ✅ TEXTE BÉNÉFICES (2 LIGNES)
     ========================================================================== */
  .paywall-benefits {
    font-size: 1.05em;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 1em;
  }

  /* ============================================================================
     ✅ IMAGE CEINTURE
     ========================================================================== */
  .paywall-belt {
    display: block;
    margin: 1em auto;
    max-width: 160px;
    height: auto;
  }

  /* ============================================================================
     ✅ PRIX CENTRÉ
     ========================================================================== */
.paywall-price {
  text-align: center;
  margin: 1em 0;
}
.paywall-sub {
  font-size: 0.95em;
  color: #374151;
}

  /* ============================================================================
     ✅ NOTE LICENCE (NOUVEAU)
     ========================================================================== */
  .paywall-note {
    text-align: center;
    font-size: 0.92em;
    line-height: 1.3;
    color: #444;
    margin: 0 0 0.8em 0;
  }

  /* ============================================================================
     ✅ BOUTON YES — MISE EN AVANT
     ========================================================================== */
  #paywall-yes.primary {
    background: linear-gradient(90deg, #ff9800, #ff5722);
    color: #fff;
    border: none;
    padding: 0.6em 1.4em;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  #paywall-yes.primary:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  }

  /* ============================================================================
     ✅ BOUTON NO — DISCRET
     ========================================================================== */
  #paywall-no {
    background: #f5f5f5;
    border: 1px solid #ccc;
    padding: 0.6em 1.4em;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 8px;
  }
