/* Savoir en Poche — page publique.
   Palette reprise telle quelle de lib/core/app_theme.dart (AppColors) : le site
   et l'app doivent se ressembler. Pensé d'abord pour le téléphone (min-width). */

:root {
  --primary: #6C3BFF;
  --primary-dark: #4B1FAF;
  --night: #24104F;
  --accent: #FFB840;
  --success: #22C55E;
  --text: #171321;
  --muted: #5F6672;          /* #6B7280 de l'app, légèrement assombri : contraste AA sur le fond lavande */
  --bg: #F7F5FF;
  --tint: #EFE9FF;
  --surface: #FFFFFF;
  --border: #E8E2F5;
  --radius: 22px;
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; -webkit-text-size-adjust: 100%; }
img { max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 800; line-height: 1.15; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding-inline: 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 12px; }

/* ── Boutons ─────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 13px 24px; border-radius: 14px; font: 700 15px/1.2 var(--font); text-align: center; border: 1.5px solid transparent; }
.btn svg { flex: none; }
.btn-accent { background: var(--accent); color: var(--text); }
.btn-accent:hover { background: #ffc766; color: var(--text); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-light { background: #fff; color: var(--text); border-color: var(--border); }
.btn-light:hover { background: var(--tint); color: var(--text); }

/* ── Hero sombre ─────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(160deg, var(--night) 0%, var(--primary-dark) 58%, var(--primary) 100%); padding-bottom: 96px; }
.hero::before { content: ""; position: absolute; right: -140px; top: -160px; width: 460px; height: 460px; border-radius: 50%; background: rgba(255,255,255,.05); }
.hero::after { content: ""; position: absolute; left: -100px; bottom: 40px; width: 300px; height: 300px; border-radius: 50%; background: rgba(255,184,64,.07); }
.hero .wrap { position: relative; z-index: 1; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 16px; }
.brand:hover { color: #fff; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.top nav { display: flex; align-items: center; gap: 26px; }
.top nav a:not(.btn) { display: none; color: rgba(255,255,255,.85); font-weight: 600; font-size: 14px; }
.top nav a:not(.btn):hover { color: #fff; }
.top .btn { min-height: 42px; padding: 9px 18px; font-size: 13.5px; background: #fff; color: var(--primary-dark); }

.hero-grid { display: grid; gap: 40px; padding-top: 30px; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); font-size: 12px; font-weight: 600; margin-bottom: 22px; }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.hero h1 { font-size: clamp(38px, 9vw, 58px); letter-spacing: -1px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { margin-top: 20px; font-size: 17px; line-height: 1.65; color: rgba(255,255,255,.82); max-width: 480px; }
.cta { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; }
.note-plateforme { margin-top: 16px; font-size: 13px; color: rgba(255,255,255,.65); }

/* Téléphones : de vraies captures de l'app dans un cadre CSS. */
.phones { position: relative; width: 100%; max-width: 420px; height: 500px; margin: 0 auto; }
.phone { position: absolute; background: #0E0B18; padding: 8px; border-radius: 34px; box-shadow: 0 30px 60px -18px rgba(0,0,0,.5); }
.phone img { display: block; width: 100%; height: auto; border-radius: 27px; }
.phone-front { left: 0; top: 0; width: 236px; transform: rotate(-3deg); z-index: 2; }
.phone-back { right: 0; top: 44px; width: 214px; transform: rotate(5deg); }

/* ── Cartes qui chevauchent le héro ──────────────────────────────────── */
.promesses { position: relative; z-index: 2; margin-top: -60px; }
.promesses ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.promesses .card { box-shadow: 0 24px 48px -24px rgba(36,16,79,.3); }
.ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(108,59,255,.1); }
.ico.amb { background: rgba(255,184,64,.2); }
.ico.vert { background: rgba(34,197,94,.13); }
.card h3 { font-size: 15.5px; margin-top: 16px; }
.card p { margin-top: 6px; font-size: 13.5px; color: var(--muted); line-height: 1.55; }

/* ── Sections ────────────────────────────────────────────────────────── */
section { padding-top: 84px; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--primary); }
.titre { max-width: 620px; margin: 0 auto; text-align: center; }
.titre h2 { font-size: clamp(27px, 6vw, 36px); margin-top: 10px; }
.titre p { margin-top: 14px; color: var(--muted); }

.niveaux { margin-top: 40px; display: grid; gap: 16px; }
.niveaux .card { padding: 26px; }
.niveaux h3 { font-size: 19px; margin-top: 14px; }

.parcours { margin-top: 56px; display: grid; gap: 72px; }
.row { display: grid; gap: 28px; align-items: center; }
.visual { position: relative; overflow: hidden; border-radius: 30px; background: var(--tint); min-height: 340px; display: flex; justify-content: center; align-items: flex-end; padding-top: 40px; }
.visual.chaud { background: #FFF4DC; }
.visual.frais { background: #E7F8EE; }
.visual::before { content: ""; position: absolute; left: -36px; top: -36px; width: 150px; height: 150px; border-radius: 50%; background: rgba(108,59,255,.08); }
.visual.chaud::before { background: rgba(255,184,64,.25); }
.visual.frais::before { background: rgba(34,197,94,.14); }
.cut { position: relative; width: 236px; background: #0E0B18; padding: 8px 8px 0; border-radius: 32px 32px 0 0; }
.cut img { display: block; width: 100%; height: auto; border-radius: 25px 25px 0 0; }
.float { position: relative; width: min(84%, 330px); margin: 8px auto 40px; border-radius: 22px; overflow: hidden; box-shadow: 0 24px 50px -22px rgba(23,19,33,.4); background: #fff; }
.float img { display: block; width: 100%; height: auto; }
.num { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; }
.row h3 { font-size: clamp(23px, 5vw, 28px); margin-top: 16px; }
.row p { margin-top: 12px; color: var(--muted); font-size: 15.5px; }
.checks { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.checks svg { flex: none; margin-top: 3px; }

/* ── Confiance ───────────────────────────────────────────────────────── */
.confiance { display: grid; gap: 22px; padding: 30px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 26px; }
.confiance h3 { font-size: 14.5px; }
.confiance p { margin-top: 5px; font-size: 13px; color: var(--muted); }

/* ── Enseignants ─────────────────────────────────────────────────────── */
.ens { position: relative; overflow: hidden; border-radius: 32px; padding: 40px 26px; color: #fff; background: linear-gradient(135deg, var(--night), var(--primary-dark)); }
.ens::after { content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,184,64,.12); }
.ens > * { position: relative; z-index: 1; }
.ens .kicker { color: var(--accent); }
.ens h2 { font-size: clamp(27px, 6vw, 36px); margin-top: 10px; max-width: 560px; }
.ens p { margin-top: 14px; color: rgba(255,255,255,.82); max-width: 520px; }
.etapes { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; max-width: 700px; }
.etapes li { padding: 16px 18px; border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); font-weight: 700; }
.etapes b { display: block; font-size: 11px; color: var(--accent); }
.ens .btn { margin-top: 28px; }

/* ── Téléchargement ──────────────────────────────────────────────────── */
.dl { text-align: center; padding-bottom: 96px; }
.dl h2 { font-size: clamp(28px, 6.5vw, 38px); }
.dl > p { margin-top: 12px; color: var(--muted); }
.dl .cta { justify-content: center; margin-top: 28px; }
.install { list-style: none; counter-reset: e; margin: 34px auto 0; padding: 0; max-width: 520px; text-align: left; display: grid; gap: 10px; }
.install li { counter-increment: e; display: flex; gap: 12px; font-size: 14px; color: var(--muted); }
.install li::before { content: counter(e); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--tint); color: var(--primary-dark); font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.bientot { margin-top: 26px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.bientot span { font-size: 11.5px; font-weight: 700; color: var(--muted); border: 1px dashed #cfc6e6; padding: 7px 14px; border-radius: 999px; }

/* ── Pied de page ────────────────────────────────────────────────────── */
footer { background: var(--night); color: rgba(255,255,255,.75); }
footer .wrap { display: grid; gap: 18px; padding-top: 34px; padding-bottom: 34px; font-size: 13px; }
footer .brand { font-size: 15px; }
footer .devise { margin-top: 4px; font-weight: 400; font-size: 12.5px; color: rgba(255,255,255,.6); display: block; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
footer a { color: rgba(255,255,255,.8); }
footer a:hover { color: #fff; }

/* Barre de téléchargement fixe sur téléphone : le geste le plus utile. */
.barre { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(247,245,255,.94); backdrop-filter: blur(8px); border-top: 1px solid var(--border); }
.barre .btn { width: 100%; }
body { padding-bottom: 72px; }

/* ── Pages légales ───────────────────────────────────────────────────── */
.legal { padding: 36px 0 84px; }
.legal .wrap { max-width: 780px; }
.legal h1 { font-size: clamp(28px, 6vw, 38px); }
.legal .maj { margin-top: 8px; font-size: 13px; color: var(--muted); }
.legal h2 { font-size: 20px; margin-top: 40px; }
.legal p, .legal li { margin-top: 12px; font-size: 15px; color: #2b2738; }
.legal ul { padding-left: 20px; }
.legal .encart { margin-top: 24px; padding: 16px 18px; border-radius: 16px; background: var(--tint); border: 1px solid var(--border); font-size: 14px; }
.legal-top { border-bottom: 1px solid var(--border); background: #fff; }
.legal-top .wrap { max-width: 780px; display: flex; justify-content: space-between; align-items: center; padding-top: 14px; padding-bottom: 14px; }
.legal-top .brand { color: var(--text); }

/* ── Écrans plus larges ──────────────────────────────────────────────── */
@media (min-width: 640px) {
  .promesses ul, .niveaux { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .confiance { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .etapes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  footer .wrap { grid-template-columns: 1fr auto; align-items: center; }
  footer .copy { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .wrap { padding-inline: 28px; }
  .top nav a:not(.btn) { display: inline; }
  .hero { padding-bottom: 130px; }
  .hero-grid { grid-template-columns: 1.05fr .95fr; align-items: center; gap: 56px; padding-top: 56px; }
  .phones { height: 560px; }
  .phone-front { width: 262px; }
  .phone-back { width: 238px; top: 50px; }
  .promesses { margin-top: -78px; }
  .row { grid-template-columns: 1fr 1fr; gap: 64px; }
  .row.rev .visual { order: 2; }
  .visual { min-height: 380px; }
  .ens { padding: 60px; }
  .barre { display: none; }
  body { padding-bottom: 0; }
}
@media (max-width: 420px) {
  .phones { transform: scale(.9); transform-origin: top center; height: 460px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
