/* ==========================================================================
   Voir une démo (16/10/2026 ; page du portail depuis le 17/10/2026, pour ne
   pas dérouter les élèves du module). La page d'origine et la même fiche dans
   l'application, côte à côte sur ordinateur, l'une après l'autre sur
   téléphone. Les titres prennent la police du livret (Fredoka).
   ========================================================================== */
.demo main { max-width: 1240px; }
.demo h1, .demo h2, .demo h3, .d-etape-num { font-family: "Fredoka", "Nunito", system-ui, sans-serif; }

/* ---------- En-tête de la démo ---------- */
/* « Publier un cours » : le même bouton que dans la barre de l'accueil
   (portail/index.html), toujours visible ici ; il ouvre la fenêtre « Vous êtes… » (choix-profil.js). */
.bouton-publier-entete {
  display: inline-flex; flex: 0 0 auto; align-items: center; white-space: nowrap; margin-left: auto;
  padding: .5rem 1rem; border-radius: 999px; background: #DB2777; color: #fff !important;
  font-size: .88rem; font-weight: 750; text-decoration: none;
  box-shadow: 0 8px 18px -10px rgba(219, 39, 119, .9);
  transition: background .2s, transform .2s;
}
.bouton-publier-entete:hover { background: #BE185D; transform: translateY(-1px); }
.bouton-publier-entete:focus-visible { outline: 3px solid #F9A8D4; outline-offset: 2px; }
@media (max-width: 640px) { .bouton-publier-entete { padding: .42rem .8rem; font-size: .8rem; } }
/* Collé au menu ☰, comme sur l'accueil : le menu ne reprend pas sa marge automatique. */
.demo .bandeau .groupe-compte-menu { margin-left: 0; }
.d-hero { text-align: center; padding: 1.5rem 0 2.5rem; }
.d-surtitre { display: inline-block; margin: 0 0 .9rem; padding: .25rem .8rem; border-radius: 999px; background: color-mix(in srgb, #6366F1 14%, transparent); color: #4338CA; font-weight: 750; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
:root[data-theme="dark"] .d-surtitre { color: #A5B4FC; }
.d-hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); line-height: 1.05; margin: 0 0 1rem; font-weight: 650; }
.d-hero .d-chapo { max-width: 46rem; margin: 0 auto; font-size: clamp(1.02rem, 2.1vw, 1.2rem); line-height: 1.6; color: var(--encre-2); }
.d-chapo strong { color: var(--encre); }

.d-etapes { list-style: none; margin: 2rem auto 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem; max-width: 60rem; }
.d-etapes li { position: relative; display: flex; align-items: flex-start; gap: .75rem; text-align: left; padding: 1rem 1.1rem; background: var(--carte); border: 1px solid var(--trait); border-radius: 14px; }
.d-etapes li + li::before { content: "→"; position: absolute; left: -1.3rem; top: 50%; transform: translateY(-50%); color: var(--encre-3); font-size: 1.1rem; }
.d-etapes strong { display: block; font-size: 1rem; }
.d-etapes small { display: block; color: var(--encre-2); font-size: .86rem; margin-top: .15rem; }
.d-etape-num { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: #3d7a33; color: #fff; font-weight: 700; }
.d-etapes li:nth-child(2) .d-etape-num { background: #a55d06; }
.d-etapes li:nth-child(3) .d-etape-num { background: #4338CA; }
.d-fleche { display: inline-flex; gap: .4rem; margin-top: 1.8rem; padding: .7rem 1.3rem; border-radius: 999px; background: var(--encre); color: var(--fond) !important; font-weight: 700; text-decoration: none; }
.d-fleche:hover { transform: translateY(-1px); }
.d-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .6rem 1.2rem; margin-top: 1.8rem; }
.d-actions .d-fleche { margin-top: 0; }
/* « Voir le module créé à partir de ce cours PDF » : le bouton vers le vrai module. */
.d-module { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .7rem 1.3rem; border-radius: 999px; background: linear-gradient(135deg, #6366F1, #4338CA); color: #fff !important; font-weight: 700; text-decoration: none; text-align: center; box-shadow: 0 6px 18px -6px rgb(99 102 241 / .7); }
.d-module:hover { transform: translateY(-1px); box-shadow: 0 8px 22px -6px rgb(99 102 241 / .85); }
.d-court { display: none; }
/* Sous la fiche d'essai : l'appel, au moment où le visiteur vient d'essayer. */
.d-suite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; margin: 1.5rem 0 0; padding: 1.1rem 1.3rem; border-radius: 16px; background: color-mix(in srgb, #6366F1 12%, var(--carte)); border: 1px solid color-mix(in srgb, #6366F1 35%, transparent); }
.d-suite p { margin: 0; color: var(--encre-2); }
.d-suite strong { color: var(--encre); }

/* ---------- Comparer ---------- */
.d-titre { font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 600; margin: 0 0 1rem; }
.d-comparer { scroll-margin-top: 1rem; margin-top: 4rem; }
.d-barre { display: none; justify-content: center; margin-bottom: 1.1rem; }

.d-bascule { display: none; padding: 3px; border-radius: 999px; background: var(--carte-2); border: 1px solid var(--trait); }
.d-bascule button { min-height: 38px; padding: 0 1rem; border: 0; border-radius: 999px; background: none; color: var(--encre-2); font: inherit; font-weight: 700; cursor: pointer; }
.d-bascule button[aria-pressed="true"] { background: var(--carte); color: var(--encre); box-shadow: 0 1px 4px rgb(0 0 0 / .12); }

.d-cote { display: grid; grid-template-columns: minmax(300px, 410px) minmax(0, 1fr); gap: 2.25rem; align-items: start; }
.d-avant { margin: 0; position: sticky; top: 1rem; }
.d-avant figcaption, .d-legende { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: 0 0 .7rem; font-weight: 600; color: var(--encre-2); }
.d-pastille { padding: .2rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #fff; }
.d-pastille.avant { background: #52525B; }
.d-pastille.apres { background: #4338CA; }
.d-papier { background: #fff; border-radius: 6px; box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 12px 32px -12px rgb(0 0 0 / .3); overflow: hidden; transform: rotate(-.6deg); }
.d-papier img { display: block; width: 100%; height: auto; }
.d-absent { margin: 0; padding: 3rem 1.5rem; text-align: center; color: #52525B; }
.d-source { display: block; margin-top: .9rem; font-size: .9rem; text-align: center; }
.d-apres { min-width: 0; }
.d-astuce { margin: 0 0 1rem; padding: .75rem 1rem; border-radius: 12px; background: var(--carte); background: color-mix(in srgb, #6366F1 10%, var(--carte)); border: 1px dashed #A5B4FC; color: var(--encre); font-size: .93rem; line-height: 1.5; }
.d-apres .manuel { max-width: none; }
.d-reveler { display: none; }

@media (max-width: 1179px) {
  .d-barre { display: flex; }
  .d-bascule { display: inline-flex; }
  .d-reveler { position: sticky; bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 2; box-shadow: 0 8px 24px -6px rgb(0 0 0 / .45); display: flex; justify-content: center; gap: .4rem; width: 100%; margin-top: 1rem; min-height: 48px; border: 0; border-radius: 999px; background: #4338CA; color: #fff; font: inherit; font-weight: 700; font-size: 1.02rem; cursor: pointer; }
  .d-cote { grid-template-columns: minmax(0, 1fr); }
  .d-avant { position: static; max-width: 520px; margin: 0 auto; width: 100%; }
  .d-papier { transform: none; }
  .d-cote[data-voir="apres"] .d-avant, .d-cote[data-voir="avant"] .d-apres { display: none; }
}

/* ---------- Maintenant, avec l'appli du cours, vous pouvez ---------- */
.d-bloc { margin-top: 4rem; }
.d-hero + .d-bloc { margin-top: 1rem; }
.d-atouts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.d-atouts li { padding: 1.1rem 1.2rem 1.2rem; background: var(--carte); border: 1px solid var(--trait); border-top: 4px solid var(--c); border-radius: 14px; color: var(--encre-2); line-height: 1.55; font-size: .95rem; }
.d-atouts strong { display: block; margin-bottom: .3rem; color: var(--encre); font-size: 1.05rem; }

/* Carrousel des atouts sous 1180 px : la carte suivante dépasse pour inviter à glisser ;
   points et flèches remplis par demo.js, affichés seulement si ça déborde. */
:root { --bord: 1.25rem; }
@media (max-width: 640px) { :root { --bord: 1rem; } }
@media (max-width: 1179px) {
  .d-atouts { display: flex; gap: .75rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--bord); margin-inline: calc(-1 * var(--bord)); padding: 0 var(--bord) .6rem; scrollbar-width: none; overscroll-behavior-x: contain; }
  .d-atouts li { flex: 0 0 min(42%, 340px); scroll-snap-align: start; }
}
.d-atouts::-webkit-scrollbar, .d-voies::-webkit-scrollbar { display: none; }
.d-carrousel-nav { display: flex; align-items: center; justify-content: center; gap: .9rem; margin-top: .6rem; }
.d-carrousel-nav[hidden] { display: none; }
.d-points { display: flex; gap: .2rem; }
.d-points button { width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.d-points button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--encre-3); opacity: .5; transition: width .2s, background .2s; }
.d-points button[aria-current="true"]::before { width: 22px; border-radius: 999px; background: #6366F1; opacity: 1; }
.d-carrousel-nav .d-fl { display: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--trait); background: var(--carte); color: var(--encre); font: inherit; font-size: 1.1rem; cursor: pointer; }
.d-carrousel-nav .d-fl:disabled { opacity: .35; cursor: default; }
@media (min-width: 761px) { .d-carrousel-nav .d-fl { display: grid; place-items: center; } }

/* ---------- Deux chemins ---------- */
.d-intro { margin: -.25rem 0 1.25rem; color: var(--encre-2); font-size: 1.05rem; max-width: 46rem; }
.d-intro strong { color: var(--encre); }
.d-voies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.d-voie { display: grid; grid-template-rows: auto 1fr; overflow: hidden; background: var(--carte); border: 1px solid var(--trait); border-radius: 16px; }
.d-voie img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; object-position: center; display: block; background: var(--carte-2); border-bottom: 4px solid var(--c); }
.d-voie > div { padding: 1.1rem 1.3rem 1.3rem; display: flex; flex-direction: column; }
.d-voie-tag { margin: 0 0 .3rem; color: var(--c-texte); font-weight: 800; font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; }
.d-voie h3 { margin: 0 0 .5rem; font-size: 1.35rem; font-weight: 600; }
.d-voie p { margin: 0 0 .6rem; color: var(--encre-2); line-height: 1.55; }
.d-exemple strong { color: var(--encre); }
.d-lien { margin-top: auto; font-weight: 700; text-decoration: none; color: var(--c-texte) !important; }
.d-lien:hover { text-decoration: underline; }
:root[data-theme="dark"] .d-voie-tag, :root[data-theme="dark"] .d-lien { color: var(--c) !important; }

/* ---------- Appel ---------- */
.d-appel { margin: 4rem 0 1rem; padding: 2.5rem 1.5rem; text-align: center; border-radius: 20px; background: linear-gradient(135deg, #17766c, #4338CA); color: #fff; scroll-margin-top: 1rem; }
.d-appel h2 { margin: 0 0 .6rem; font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 650; color: #fff; }
.d-appel p { margin: 0 auto; max-width: 40rem; line-height: 1.6; }
.d-appel-boutons { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 1.5rem; }
.d-btn { display: inline-flex; align-items: center; gap: .45rem; min-height: 46px; padding: 0 1.3rem; border-radius: 999px; border: 2px solid rgb(255 255 255 / .75); color: #fff !important; font-weight: 700; text-decoration: none; }
.d-btn.principal { background: #fff; border-color: #fff; color: #1e1b4b !important; }
.d-btn:hover { transform: translateY(-1px); }

@media (max-width: 760px) {
  .d-hero { padding-top: .5rem; }
  .d-atouts li { flex-basis: min(80%, 300px); }
  /* Les deux chemins aussi, en plus courts. */
  .d-voies { display: flex; gap: .75rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--bord); margin-inline: calc(-1 * var(--bord)); padding: 0 var(--bord) .6rem; scrollbar-width: none; overscroll-behavior-x: contain; }
  .d-voie { flex: 0 0 min(85%, 340px); scroll-snap-align: start; }
  .d-voie img { aspect-ratio: 16 / 6; }
  /* Les trois étapes sur une seule ligne compacte. */
  .d-etapes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; margin-top: 1.4rem; }
  .d-etapes li { flex-direction: column; align-items: center; gap: .35rem; padding: .7rem .4rem; text-align: center; }
  .d-etapes li + li::before { content: "→"; left: -.85rem; font-size: .85rem; }
  .d-etapes strong { font-size: .84rem; line-height: 1.25; }
  .d-etapes small { display: none; }
  .d-etape-num { width: 1.6rem; height: 1.6rem; font-size: .85rem; }
  .d-long { display: none; }
  .d-court { display: inline; }
  .d-suite { justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .d-fleche:hover, .d-module:hover, .d-btn:hover, .bouton-publier-entete:hover { transform: none; }
  .d-points button::before { transition: none; } }
