/* =========================================================
   Teranga Lecture — Design system
   Indigo de nuit · Lac Rose · Safran · Baobab
   Bricolage Grotesque (interface) + Literata (lecture)
   ========================================================= */

:root {
  --paper: #F7F6FB;
  --surface: #FFFFFF;
  --surface-2: #EFEDF7;
  --ink: #16163F;
  --ink-2: #55557A;
  --ink-3: #8786A6;
  --line: #E3E0EF;
  --rose: #E0607E;
  --rose-ink: #B7385A;
  --safran: #F4B23E;
  --baobab: #2E6E55;
  --night: #16163F;
  --night-2: #232456;
  --on-night: #F4F2FF;
  --on-night-2: #B9B7DD;
  --focus: #6C5CE7;
  --ok: #2E8B62;
  --err: #C93C4F;

  --f-ui: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-read: "Literata", Georgia, "Times New Roman", serif;

  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
  --shadow-book: 0 1px 1px rgba(22, 22, 63, .08), 0 10px 24px -10px rgba(22, 22, 63, .35);
  --wrap: 1200px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #0F1029;
  --surface: #17183A;
  --surface-2: #202250;
  --ink: #EEEDF8;
  --ink-2: #ABAAD0;
  --ink-3: #7D7CA6;
  --line: #2B2D5A;
  --rose-ink: #F07F99;
  --night: #0A0B22;
  --night-2: #17183F;
  --shadow-book: 0 1px 1px rgba(0, 0, 0, .3), 0 12px 26px -10px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f-ui); font-size: 16px; line-height: 1.55;
  font-optical-sizing: auto; -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.ic { width: 1.15em; height: 1.15em; flex: none; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }

/* ---------- typographie ---------- */
h1, h2, h3, h4 { margin: 0; line-height: 1.1; letter-spacing: -.02em; font-weight: 700; }
.h-display { font-size: clamp(2.5rem, 5.6vw, 4.7rem); font-weight: 800; letter-spacing: -.045em; line-height: .96; }
.h-1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 750; letter-spacing: -.035em; }
.h-2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 720; letter-spacing: -.03em; }
.h-3 { font-size: 1.2rem; font-weight: 680; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-2); max-width: 56ch; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 0; border-radius: 999px; padding: .8em 1.35em; font-weight: 650; font-size: .98rem;
  cursor: pointer; transition: transform .15s ease, background .2s, box-shadow .2s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--rose); color: #fff; box-shadow: 0 6px 18px -8px rgba(224, 96, 126, .9); }
.btn-primary:hover { background: #D24D6C; }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-soft:hover { background: var(--line); }
.btn-danger { background: transparent; color: var(--err); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn-sm { padding: .55em 1em; font-size: .9rem; }
.btn-lg { padding: 1em 1.6em; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer; color: inherit;
}
.icon-btn:hover { background: var(--surface-2); }
.link { color: var(--rose-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }

/* ---------- en-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.logo-mark { width: 34px; height: 34px; }
.logo-word { font-weight: 800; font-size: 1.22rem; letter-spacing: -.035em; }
.logo-word em { font-style: normal; font-weight: 400; margin-left: .22em; color: var(--ink-2); }
.nav { display: flex; gap: 2px; margin-left: 12px; }
.nav-link {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; font-weight: 560; color: var(--ink-2); font-size: .97rem;
}
.nav-link:hover { color: var(--ink); background: var(--surface-2); }
.nav-link.is-active { color: var(--ink); background: var(--surface-2); }
.soon {
  display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 650;
  padding: 2px 8px 2px 6px; border-radius: 999px; background: color-mix(in srgb, var(--safran) 22%, transparent); color: var(--ink);
}
.soon .ic { width: 11px; height: 11px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.avatar-btn { display: inline-flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 600; font-size: .93rem; }
.avatar-btn:hover, .avatar-btn.is-active { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--safran); color: #16163F; font-weight: 800; }
.menu-btn { display: none; }
.nav-auth { display: none; }

@media (max-width: 960px) {
  .menu-btn { display: inline-grid; }
  .nav {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; gap: 4px; margin: 0;
    padding: 12px 16px 20px; background: var(--paper); border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: .2s ease;
  }
  .nav-open .nav { transform: none; opacity: 1; pointer-events: auto; }
  .nav-link { padding: 14px 16px; font-size: 1.05rem; }
  .avatar-name, .hide-sm { display: none; }
  .avatar-btn { padding: 4px; }
}
@media (max-width: 560px) {
  .header-actions .btn-ghost { display: none; }
  .nav-auth { display: flex; gap: 8px; padding: 10px 0 0; }
  .nav-auth .btn { flex: 1; }
  .logo-word { font-size: 1.1rem; }
}

/* ---------- héros (accueil) ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--on-night);
  background: var(--night);
  padding: clamp(40px, 6vw, 76px) 0 0;
}
.hero::before { /* soleil levant */
  content: ""; position: absolute; right: -8vw; top: 46%; width: min(64vw, 760px); aspect-ratio: 1;
  border-radius: 50%; background: radial-gradient(circle at 50% 50%, var(--safran) 0 52%, transparent 52.2%),
    radial-gradient(circle, rgba(244, 178, 62, .22) 0 63%, transparent 63.3%),
    radial-gradient(circle, rgba(244, 178, 62, .1) 0 75%, transparent 75.3%);
  transform: translateY(-50%);
}
.hero-inner { position: relative; display: grid; gap: 28px; }
.hero h1 { max-width: 12ch; }
.hero-inner { gap: 22px; }
.hero .lead { color: var(--on-night-2); }
.hero-search {
  display: flex; align-items: center; gap: 10px; max-width: 560px;
  background: #fff; color: #16163F; border-radius: 999px; padding: 6px 6px 6px 20px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .6);
}
.hero-search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 1.02rem; min-width: 0; padding: 10px 0; color: #16163F; }
.hero-search input::placeholder { color: #7a7a99; }
.hero-search .ic { color: #7a7a99; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--on-night-2); font-size: .95rem; }
.hero-facts b { color: var(--on-night); font-weight: 700; }

.shelf { position: relative; margin-top: clamp(36px, 6vw, 64px); }
.shelf-row {
  display: flex; align-items: flex-end; gap: clamp(10px, 1.6vw, 22px);
  padding: 0 0 0; overflow: visible;
}
.shelf-row .shelf-book { flex: none; transform-origin: bottom center; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.shelf-row .shelf-book:hover { transform: translateY(-14px) rotate(0deg) !important; }
.shelf-board { height: 18px; background: linear-gradient(#3A2A55, #241A3A); border-radius: 3px 3px 0 0; box-shadow: 0 -1px 0 rgba(255, 255, 255, .08) inset; }
:root[data-theme="dark"] .shelf-board { background: linear-gradient(#2B2150, #1B1438); }
@media (prefers-reduced-motion: no-preference) {
  .shelf-row .shelf-book { animation: rise .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 70ms + 150ms); }
  @keyframes rise { from { transform: translateY(110%); } }
}
@media (max-width: 720px) {
  .hero::before { right: -35vw; top: auto; bottom: -45vw; transform: none; width: 100vw; }
  .shelf-book .cover, .shelf-book:nth-child(3n) .cover { width: 96px; }
  .shelf-row { overflow-x: auto; scrollbar-width: none; padding-top: 18px; }
  .shelf-row::-webkit-scrollbar { display: none; }
}

/* ---------- sections ---------- */
.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-tight { padding: clamp(32px, 5vw, 56px) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head p { margin: 8px 0 0; color: var(--ink-2); max-width: 60ch; }
.see-all { display: inline-flex; align-items: center; gap: 4px; font-weight: 620; color: var(--rose-ink); }

/* ---------- couvertures ---------- */
.cover {
  position: relative; aspect-ratio: 2 / 3; border-radius: 3px 8px 8px 3px; overflow: hidden;
  background: var(--c1); box-shadow: var(--shadow-book); isolation: isolate;
  display: flex; flex-direction: column; container-type: inline-size;
}
.cover::after { /* dos du livre */
  content: ""; position: absolute; inset: 0 auto 0 0; width: 7%;
  background: linear-gradient(90deg, rgba(0, 0, 0, .28), rgba(255, 255, 255, .12) 60%, rgba(0, 0, 0, .06));
  z-index: 2;
}
.cover-motif { width: 100%; flex: 1 1 0; min-height: 0; }
.cover-band { background: var(--c2); color: var(--band-ink); padding: 9cqi 9cqi 10cqi 13cqi; display: flex; flex-direction: column; gap: 3cqi; }
.cover-title { font-weight: 760; font-size: 10.5cqi; line-height: 1.04; letter-spacing: -.03em; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cover-author { font-size: 6.4cqi; opacity: .78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cover--xs { width: 56px; }
.cover--sm { width: 96px; }
.cover--md { width: 100%; }
.cover--lg { width: 100%; }
.shelf-book .cover { width: clamp(112px, 12vw, 158px); }
.shelf-book:nth-child(3n) .cover { width: clamp(124px, 13.4vw, 172px); }

/* ---------- carte livre ---------- */
.book { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.book-cover { position: relative; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.book:hover .book-cover { transform: translateY(-4px); }
.book-progress { position: absolute; left: 7%; right: 6px; bottom: 6px; height: 4px; border-radius: 9px; background: rgba(255, 255, 255, .45); overflow: hidden; z-index: 3; }
.book-progress span { display: block; height: 100%; background: var(--safran); }
.book-meta { display: flex; flex-direction: column; gap: 2px; }
.book-title { font-weight: 680; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-author { color: var(--ink-2); font-size: .9rem; }
.book-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .8rem; color: var(--ink-3); flex-wrap: wrap; }
.book-time { display: inline-flex; align-items: center; gap: 4px; }
.book-time .ic { width: 13px; height: 13px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 650; }
.tag .ic { width: 12px; height: 12px; }
.tag--free { background: color-mix(in srgb, var(--baobab) 16%, transparent); color: var(--baobab); }
:root[data-theme="dark"] .tag--free { color: #6FD3A6; }
.tag--lock { background: var(--surface-2); color: var(--ink-2); }
.tag--new { background: color-mix(in srgb, var(--rose) 16%, transparent); color: var(--rose-ink); }
.tag--pd { background: color-mix(in srgb, #6C5CE7 16%, transparent); color: #6C5CE7; }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 34px 22px; }
.book-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 22px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.book-row > * { scroll-snap-align: start; }
@media (min-width: 1100px) { .book-row { grid-auto-columns: calc((100% - 5 * 22px) / 6); } }
@media (max-width: 560px) { .book-row { grid-auto-columns: 42%; } .book-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; } }

/* ---------- rayons ---------- */
.rayons { display: flex; flex-wrap: wrap; gap: 10px; }
.rayon-chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 999px;
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 600; cursor: pointer; border: 0;
  transition: box-shadow .2s, background .2s;
}
.rayon-chip:hover { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.rayon-chip .dot { width: 14px; height: 14px; border-radius: 4px; background: var(--c); transform: rotate(45deg); }
.rayon-chip small { color: var(--ink-3); font-weight: 500; }
.rayon-chip.is-active { background: var(--ink); color: var(--paper); box-shadow: none; }
.rayon-chip.is-active small { color: inherit; opacity: .7; }

/* ---------- mise en avant ---------- */
.feature {
  display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: clamp(24px, 5vw, 64px); align-items: center;
  background: var(--surface); border-radius: var(--r-l); padding: clamp(24px, 4vw, 48px);
  box-shadow: inset 0 0 0 1px var(--line);
}
.feature .quote { font-family: var(--f-read); font-size: clamp(1.1rem, 1.8vw, 1.3rem); line-height: 1.6; color: var(--ink); margin: 18px 0 24px; max-width: 58ch; }
.feature-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
@media (max-width: 720px) { .feature { grid-template-columns: 1fr; } .feature .cover { width: 60%; margin: 0 auto; } }

/* ---------- bande examens ---------- */
.exam-band {
  position: relative; overflow: hidden; border-radius: var(--r-l); padding: clamp(28px, 5vw, 56px);
  background: var(--night-2); color: var(--on-night); display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center;
}
.exam-band .lead { color: var(--on-night-2); }
.exam-band::after { content: ""; position: absolute; inset: auto -60px -120px auto; width: 320px; aspect-ratio: 1; border-radius: 50%; border: 40px solid rgba(244, 178, 62, .14); }
.exam-list { display: grid; gap: 10px; position: relative; z-index: 1; }
.exam-pill { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: var(--r-m); background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.exam-pill b { font-weight: 650; }
.exam-pill span { color: var(--on-night-2); font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.lock-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 999px; background: var(--safran); color: #16163F; font-weight: 700; font-size: .88rem; margin-bottom: 18px; }
@media (max-width: 820px) { .exam-band { grid-template-columns: 1fr; } }

/* ---------- démo liseuse ---------- */
.reader-demo { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.reader-demo-card { border-radius: var(--r-l); padding: clamp(24px, 4vw, 44px); box-shadow: var(--shadow-book); transition: background .3s, color .3s; }
.reader-demo-card[data-t="papier"] { background: #FFFFFF; color: #23233F; }
.reader-demo-card[data-t="sepia"] { background: #F3E7D3; color: #4A3622; }
.reader-demo-card[data-t="nuit"] { background: #12132C; color: #D8D6EE; }
.reader-demo-card h4 { font-family: var(--f-ui); font-size: .9rem; opacity: .65; font-weight: 600; margin-bottom: 14px; }
.reader-demo-card p { font-family: var(--f-read); font-size: 1.12rem; line-height: 1.75; margin: 0; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-2); gap: 2px; }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg button.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.ticks { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; }
.ticks .ic { color: var(--baobab); margin-top: 3px; }
:root[data-theme="dark"] .ticks .ic { color: #6FD3A6; }
@media (max-width: 820px) { .reader-demo { grid-template-columns: 1fr; } }

/* ---------- offres ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; align-items: stretch; }
.plan {
  position: relative; display: flex; flex-direction: column; gap: 16px; padding: 28px; border-radius: var(--r-l);
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line);
}
.plan--hi { background: var(--night); color: var(--on-night); box-shadow: none; }
.plan--hi .muted, .plan--hi .plan-per { color: var(--on-night-2); }
.plan-note { font-size: .85rem; font-weight: 650; color: var(--ink-2); }
.plan--hi .plan-note { color: var(--safran); }
.plan-price { font-size: 2.6rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.plan-price small { font-size: 1rem; font-weight: 600; letter-spacing: 0; }
.plan-per { color: var(--ink-2); font-size: .92rem; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; flex: 1; }
.plan li { display: flex; gap: 10px; }
.plan li .ic { color: var(--baobab); margin-top: 3px; }
.plan--hi li .ic { color: var(--safran); }
.plan--hi .btn-primary { box-shadow: none; }
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; } }
.pay-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pay-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.pay-chip::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.pay-chip--wave { background: rgba(29, 200, 255, .14); color: #0B8DBA; }
.pay-chip--orange { background: rgba(255, 121, 0, .13); color: #D35F00; }
:root[data-theme="dark"] .pay-chip--wave { color: #5BD8FF; }
:root[data-theme="dark"] .pay-chip--orange { color: #FF9A40; }

/* ---------- pied de page ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 48px 0 28px; }
.footer-inner { display: grid; grid-template-columns: 1.2fr 2fr; gap: 40px; }
.footer-brand p { color: var(--ink-2); max-width: 38ch; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-cols h4 { font-size: .95rem; margin-bottom: 12px; }
.footer-cols a { display: block; color: var(--ink-2); padding: 4px 0; }
.footer-cols a:hover { color: var(--ink); }
.footer-legal { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .86rem; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; } .footer-cols { grid-template-columns: repeat(2, 1fr); } }

/* ---------- page bibliothèque ---------- */
.page-head { padding: clamp(36px, 6vw, 64px) 0 24px; }
.page-head p { margin: 10px 0 0; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 22px 0 26px; }
.search-field { flex: 1 1 280px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); }
.search-field input { flex: 1; border: 0; outline: 0; background: transparent; padding: 13px 0; min-width: 0; }
.search-field:focus-within { box-shadow: inset 0 0 0 2px var(--focus); }
.select { appearance: none; border: 0; border-radius: 999px; padding: 12px 40px 12px 18px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238786A6' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center; box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 560; cursor: pointer; }
.filters-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.filters-row::-webkit-scrollbar { display: none; }
.filters-row .rayon-chip { flex: none; }
.toolbar .select { flex: 1 1 140px; min-width: 0; width: 0; }
@media (min-width: 761px) { .toolbar .select { flex: 0 0 auto; min-width: 200px; width: auto; } }
.result-count { color: var(--ink-2); margin: 0 0 18px; font-size: .95rem; }
.empty { text-align: center; padding: 64px 16px; border-radius: var(--r-l); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.empty .ic { width: 40px; height: 40px; margin: 0 auto 14px; color: var(--ink-3); }

/* ---------- fiche livre ---------- */
.book-hero { padding: clamp(32px, 6vw, 72px) 0 clamp(32px, 5vw, 56px); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 16%, var(--paper)), var(--paper)); }
.book-hero-grid { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: clamp(28px, 6vw, 80px); align-items: start; }
.crumbs { display: flex; gap: 6px; align-items: center; color: var(--ink-2); font-size: .9rem; margin-bottom: 16px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--ink); }
.crumbs .ic { width: 14px; height: 14px; }
.book-hero h1 { font-size: clamp(2rem, 4.4vw, 3.4rem); letter-spacing: -.04em; font-weight: 780; }
.book-hero .by { font-size: 1.15rem; color: var(--ink-2); margin: 10px 0 20px; }
.book-hero .summary { font-family: var(--f-read); font-size: 1.12rem; line-height: 1.7; max-width: 60ch; margin: 0 0 26px; }
.facts { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 28px; padding: 0; list-style: none; border-radius: var(--r-m); box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); width: fit-content; max-width: 100%; }
.facts li { padding: 12px 20px; border-right: 1px solid var(--line); }
.facts li:last-child { border-right: 0; }
.facts b { display: block; font-size: 1.05rem; }
.facts span { font-size: .8rem; color: var(--ink-2); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.icon-toggle { width: 50px; height: 50px; box-shadow: inset 0 0 0 1.5px var(--line); }
.icon-toggle.is-on { color: var(--rose); }
.icon-toggle.is-on svg { fill: currentColor; }
.toc { list-style: none; padding: 0; margin: 0; border-radius: var(--r-l); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.toc li + li { border-top: 1px solid var(--line); }
.toc a { display: flex; align-items: center; gap: 16px; padding: 18px 22px; }
.toc a:hover { background: var(--surface-2); }
.toc .n { font-family: var(--f-read); font-style: italic; color: var(--ink-3); width: 2.2ch; }
.toc .t { flex: 1; font-weight: 600; }
.toc .s { color: var(--ink-3); font-size: .85rem; display: inline-flex; gap: 6px; align-items: center; }
.toc .s .ic { width: 15px; height: 15px; }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; }
@media (max-width: 860px) {
  .book-hero-grid { grid-template-columns: 1fr; }
  .book-hero-grid .cover { width: 52%; margin: 0 auto; }
  .facts { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .facts li:nth-child(2n) { border-right: 0; }
  .facts li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .two-col { grid-template-columns: 1fr; }
}

/* ---------- formulaires ---------- */
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { font-weight: 620; font-size: .93rem; }
.field small { color: var(--ink-3); }
.input, .textarea, .field select {
  width: 100%; border: 0; border-radius: 12px; padding: 13px 15px; background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line); outline: 0; transition: box-shadow .15s;
}
.input:focus, .textarea:focus, .field select:focus { box-shadow: inset 0 0 0 2px var(--focus); }
.textarea { min-height: 180px; resize: vertical; font-family: var(--f-read); line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.alert { padding: 12px 16px; border-radius: 12px; font-size: .94rem; margin-bottom: 16px; display: none; }
.alert.show { display: block; }
.alert--err { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }
.alert--ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--rose); }
.check input[type="color"] { width: 34px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; }

/* ---------- authentification ---------- */
.auth { min-height: calc(100vh - 68px); display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { position: relative; background: var(--night); color: var(--on-night); padding: clamp(32px, 5vw, 64px); display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.auth-art::before { content: ""; position: absolute; left: 50%; top: 18%; width: 70%; aspect-ratio: 1; border-radius: 50%; background: var(--safran); transform: translateX(-50%); opacity: .95; }
.auth-art .stack { position: relative; display: flex; gap: 14px; align-items: flex-end; margin-bottom: 40px; }
.auth-art .stack .cover { width: 100%; }
.auth-art .stack > :nth-child(2) .cover, .auth-art .stack > :nth-child(2) { transform: translateY(-18px); }
.auth-art blockquote { position: relative; margin: 0; font-family: var(--f-read); font-size: 1.25rem; line-height: 1.55; max-width: 36ch; }
.auth-art cite { display: block; margin-top: 10px; font-family: var(--f-ui); font-style: normal; color: var(--on-night-2); font-size: .9rem; }
.auth-form { display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { margin-bottom: 8px; }
.auth-card > p { color: var(--ink-2); margin: 0 0 28px; }
.demo-hint { margin-top: 22px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); font-size: .9rem; color: var(--ink-2); }
.demo-hint button { border: 0; background: none; color: var(--rose-ink); font-weight: 650; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* ---------- modale ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 10, 30, .55); backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s; }
.modal-panel { position: relative; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--paper); border-radius: var(--r-l); padding: 32px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); transform: translateY(14px) scale(.98); opacity: 0; transition: .25s cubic-bezier(.2, .8, .2, 1); }
.modal-panel--wide { width: min(760px, 100%); }
.modal.open .modal-backdrop { opacity: 1; }
.modal.open .modal-panel { transform: none; opacity: 1; }
.modal-x { position: absolute; top: 14px; right: 14px; }

/* ---------- paiement ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps span { flex: 1; height: 4px; border-radius: 9px; background: var(--line); }
.steps span.on { background: var(--rose); }
.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.method {
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start; text-align: left;
  border: 0; cursor: pointer; padding: 18px; border-radius: var(--r-m); background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow .15s, transform .15s;
}
.method:hover { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.method.is-on { box-shadow: inset 0 0 0 2.5px var(--m); }
.method[disabled] { opacity: .45; cursor: not-allowed; }
.method-logo { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--m); color: var(--m-ink); font-weight: 800; font-size: 1.15rem; }
.method b { font-size: 1.02rem; }
.method small { color: var(--ink-2); }
.recap { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-radius: var(--r-m); background: var(--surface-2); margin-bottom: 18px; }
.recap b { font-size: 1.25rem; }
.phone-field { display: flex; align-items: center; border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--line); background: var(--surface); overflow: hidden; }
.phone-field:focus-within { box-shadow: inset 0 0 0 2px var(--focus); }
.phone-field span { padding: 0 6px 0 15px; color: var(--ink-2); font-weight: 600; }
.phone-field input { flex: 1; border: 0; outline: 0; background: transparent; padding: 13px 15px 13px 4px; font-size: 1.05rem; letter-spacing: .03em; min-width: 0; }
.waiting { text-align: center; padding: 8px 0; }
.waiting .phone-anim { width: 92px; height: 150px; margin: 6px auto 20px; border-radius: 18px; background: var(--ink); position: relative; display: grid; place-items: center; }
.waiting .phone-anim::before { content: ""; position: absolute; inset: 8px; border-radius: 12px; background: var(--m); }
.waiting .phone-anim i { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.code-input { text-align: center; letter-spacing: .5em; font-size: 1.4rem; font-weight: 700; }
.success-mark { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.success-mark .ic { width: 38px; height: 38px; stroke-width: 2.5; }
.receipt { list-style: none; padding: 0; margin: 18px 0 22px; border-radius: var(--r-m); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-align: left; }
.receipt li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; font-size: .94rem; }
.receipt li + li { border-top: 1px dashed var(--line); }
.receipt li span:first-child { color: var(--ink-2); }
.demo-note { font-size: .82rem; color: var(--ink-3); text-align: center; margin-top: 14px; }
.current-sub { display: flex; align-items: center; gap: 18px; padding: 20px 24px; border-radius: var(--r-l); background: color-mix(in srgb, var(--baobab) 12%, var(--surface)); margin-bottom: 28px; flex-wrap: wrap; }
.current-sub .ic { width: 28px; height: 28px; color: var(--baobab); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; max-width: 780px; }
.faq details { background: var(--surface); border-radius: var(--r-m); box-shadow: inset 0 0 0 1px var(--line); padding: 0 20px; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 0; font-weight: 640; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { transition: transform .2s; }
.faq details[open] summary .ic { transform: rotate(180deg); }
.faq details p { margin: 0 0 18px; color: var(--ink-2); }

/* ---------- examens ---------- */
.locked-screen { text-align: center; padding: clamp(48px, 8vw, 96px) 16px; position: relative; }
.locked-screen .lock-orb { width: 120px; height: 120px; margin: 0 auto 28px; border-radius: 50%; display: grid; place-items: center; background: var(--safran); color: #16163F; box-shadow: 0 0 0 18px color-mix(in srgb, var(--safran) 20%, transparent), 0 0 0 40px color-mix(in srgb, var(--safran) 9%, transparent); }
.locked-screen .lock-orb .ic { width: 46px; height: 46px; stroke-width: 2; }
.locked-screen p { margin-inline: auto; }
.preview-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 40px; text-align: left; }
.preview-item { padding: 18px 20px; border-radius: var(--r-m); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); filter: saturate(.6); opacity: .8; }
.preview-item b { display: block; }
.preview-item span { color: var(--ink-2); font-size: .9rem; }
.admin-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--r-m); background: color-mix(in srgb, var(--safran) 20%, var(--surface)); margin-bottom: 24px; font-size: .95rem; }
.admin-banner .btn { margin-left: auto; }
.tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-2); gap: 2px; margin-bottom: 26px; }
.tabs button { border: 0; background: transparent; padding: 10px 20px; border-radius: 999px; font-weight: 640; cursor: pointer; color: var(--ink-2); }
.tabs button.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.exam-card { display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: var(--r-l); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); position: relative; overflow: hidden; }
.exam-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--c); }
.exam-card .ex-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.exam-card h3 { font-size: 1.35rem; }
.exam-card p { margin: 0; color: var(--ink-2); flex: 1; }
.exam-card .score { font-size: .85rem; color: var(--baobab); font-weight: 650; display: inline-flex; gap: 6px; align-items: center; }
.exam-card .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.quiz-q { font-size: 1.2rem; font-weight: 680; margin: 6px 0 18px; }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opt { text-align: left; border: 0; padding: 14px 18px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; font-weight: 560; display: flex; align-items: center; gap: 12px; }
.quiz-opt:hover:not([disabled]) { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.quiz-opt .k { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-size: .85rem; font-weight: 700; flex: none; }
.quiz-opt.right { box-shadow: inset 0 0 0 2px var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.quiz-opt.wrong { box-shadow: inset 0 0 0 2px var(--err); background: color-mix(in srgb, var(--err) 8%, var(--surface)); }
.quiz-bar { height: 6px; border-radius: 9px; background: var(--surface-2); overflow: hidden; margin-bottom: 18px; }
.quiz-bar span { display: block; height: 100%; background: var(--rose); transition: width .3s; }
.quiz-result { text-align: center; }
.quiz-result .big { font-size: 3.6rem; font-weight: 800; letter-spacing: -.05em; }

/* ---------- tableau de bord ---------- */
.dash { display: grid; grid-template-columns: 250px 1fr; gap: 32px; padding: 32px 0 40px; align-items: start; }
.dash-side { position: sticky; top: 92px; display: grid; gap: 4px; }
.dash-user { display: flex; align-items: center; gap: 12px; padding: 0 8px 18px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.dash-user .avatar { width: 44px; height: 44px; font-size: 1.1rem; }
.dash-user b { display: block; line-height: 1.2; }
.dash-user small { color: var(--ink-2); }
.dash-link { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; font-weight: 580; color: var(--ink-2); cursor: pointer; border: 0; background: transparent; text-align: left; width: 100%; }
.dash-link:hover { background: var(--surface-2); color: var(--ink); }
.dash-link.is-on { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.dash-link .count { margin-left: auto; font-size: .78rem; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); }
.dash-link .state { white-space: nowrap; margin-left: auto; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.state--off { background: color-mix(in srgb, var(--safran) 25%, transparent); color: var(--ink); }
.state--on { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.dash-main { min-width: 0; }
.dash-main > header { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.dash-main > header p { margin: 6px 0 0; color: var(--ink-2); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.kpi { padding: 20px; border-radius: var(--r-m); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.kpi span { font-size: .87rem; color: var(--ink-2); display: block; }
.kpi b { font-size: 1.9rem; font-weight: 780; letter-spacing: -.04em; display: block; margin-top: 4px; }
.kpi small { color: var(--ink-3); font-size: .8rem; }
.panel { padding: 24px; border-radius: var(--r-l); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 20px; }
.panel h3 { margin-bottom: 16px; }
.split-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin: 10px 0 12px; gap: 2px; }
.split-bar span { display: block; height: 100%; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: .9rem; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.table-wrap { overflow-x: auto; border-radius: var(--r-m); box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; font-weight: 640; color: var(--ink-2); font-size: .84rem; padding: 13px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .row-book { display: flex; align-items: center; gap: 12px; min-width: 220px; }
td .row-book b { display: block; font-weight: 640; }
td .row-book small { color: var(--ink-2); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-actions .icon-btn { width: 36px; height: 36px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 650; padding: 3px 10px; border-radius: 999px; }
.status--ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.status--pending { background: color-mix(in srgb, var(--safran) 25%, transparent); color: var(--ink); }
.status--fail { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.status--muted { background: var(--surface-2); color: var(--ink-2); }
.setting { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; padding: 22px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting h4 { font-size: 1.05rem; margin-bottom: 4px; }
.setting p { margin: 0; color: var(--ink-2); font-size: .93rem; max-width: 56ch; }
.switch { position: relative; width: 54px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(24px); }
.switch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.continue-card { display: flex; gap: 18px; align-items: center; padding: 18px; border-radius: var(--r-l); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.continue-card .cover { width: 78px; flex: none; }
.continue-card .info { flex: 1; min-width: 0; }
.continue-card .info b { display: block; font-size: 1.05rem; }
.progress-line { height: 6px; border-radius: 9px; background: var(--surface-2); overflow: hidden; margin: 10px 0 6px; }
.progress-line span { display: block; height: 100%; background: var(--safran); }
.continue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; padding-top: 16px; }
  .dash-side { position: static; display: flex; overflow-x: auto; gap: 6px; scrollbar-width: none; padding-bottom: 4px; }
  .dash-user { display: none; }
  .dash-link { width: auto; flex: none; white-space: nowrap; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- notifications ---------- */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-radius: 14px; background: var(--ink); color: var(--paper); font-weight: 560; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .5); animation: toastIn .25s ease; }
.toast--err .ic { color: #FF8A9C; }
.toast--ok .ic { color: #7EE2B4; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* couverture fournie (image) */
.cover--img { background: var(--surface-2); }
.cover--img img { width: 100%; height: 100%; object-fit: cover; }
.cover--img::after { z-index: 1; }

/* informations de droits sur la fiche livre */
.rights { margin-top: 18px; font-size: .88rem; color: var(--ink-2); max-width: 60ch; }
.rights a { color: var(--rose-ink); text-decoration: underline; text-underline-offset: 2px; }
.notice { padding: 14px 18px; border-radius: var(--r-m); background: color-mix(in srgb, var(--safran) 18%, var(--surface)); font-size: .94rem; margin-bottom: 20px; }
.notice--err { background: color-mix(in srgb, var(--err) 10%, var(--surface)); color: var(--ink); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; }
.checklist .ic { flex: none; margin-top: 2px; }
.checklist .ok { color: var(--ok); }
.checklist .todo { color: var(--err); }
.legal-doc { max-width: 760px; padding-bottom: 40px; }
.legal-doc h2 { font-size: 1.3rem; margin: 32px 0 10px; }
.legal-doc p, .legal-doc li { color: var(--ink-2); }
.legal-doc dl { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 8px 16px; margin: 0; }
.legal-doc dt { font-weight: 640; }
.legal-doc dd { margin: 0; color: var(--ink-2); }
.code-box { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); word-break: break-all; }
.pdf-frame { width: 100%; height: calc(100vh - 140px); border: 0; border-radius: 12px; background: #fff; }
mark { background: color-mix(in srgb, var(--safran) 40%, transparent); color: inherit; padding: 0 4px; border-radius: 4px; }

/* ---------- administration (/admin) ---------- */
.admin-bar { position: sticky; top: 0; z-index: 50; background: var(--night); color: var(--on-night); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.admin-bar-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.admin-bar .logo-word em { color: var(--safran); }
.admin-bar-actions { margin-left: auto; display: flex; gap: 8px; }
.admin-bar .btn-ghost { color: var(--on-night); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .22); }
.admin-bar .btn-ghost:hover { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5); }
.admin-login { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 16px; }
.admin-login .auth-card > p { color: var(--ink-2); margin: 8px 0 26px; }
@media (max-width: 560px) { .admin-bar .btn-sm .ic + * , .admin-bar .btn-sm { font-size: .82rem; } }

/* ---------- période de lancement ---------- */
.launch-bar { background: var(--safran); color: #16163F; font-size: .9rem; }
.launch-inner { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.launch-inner .ic { flex: none; }
.launch-panel { position: relative; overflow: hidden; border-radius: var(--r-l); padding: clamp(28px, 5vw, 56px); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.launch-panel .gift { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: var(--safran); color: #16163F; box-shadow: 0 0 0 14px color-mix(in srgb, var(--safran) 20%, transparent); }
.launch-panel .gift .ic { width: 40px; height: 40px; stroke-width: 2; }
.launch-panel p { color: var(--ink-2); margin: 10px 0 0; max-width: 62ch; }
.launch-steps { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.launch-steps li { display: flex; gap: 10px; color: var(--ink-2); }
.launch-steps .ic { color: var(--baobab); margin-top: 3px; }
@media (max-width: 640px) { .launch-panel { grid-template-columns: 1fr; } .launch-inner { font-size: .84rem; align-items: flex-start; } }

.lb-short { display: none; }
.lb-short a { text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
@media (max-width: 640px) { .lb-long { display: none; } .lb-short { display: inline; } }

/* ---------- fenêtre des informations légales ---------- */
.modal-panel--doc { width: min(820px, 100%); padding: 0; overflow: hidden; display: flex; flex-direction: column; max-height: min(88vh, 920px); }
.modal-panel--doc .modal-x { color: var(--on-night); z-index: 2; }
.modal-panel--doc .modal-x:hover { background: rgba(255, 255, 255, .12); }
.doc-modal { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.doc-head { display: flex; align-items: center; gap: 16px; padding: 26px 70px 22px 28px; color: var(--on-night);
  background: radial-gradient(circle at 92% -40%, rgba(244, 178, 62, .55), transparent 55%), linear-gradient(135deg, var(--night), var(--night-2)); }
.doc-head small { display: block; color: var(--on-night-2); font-size: .82rem; letter-spacing: .02em; }
.doc-head h2 { margin: 2px 0 0; font-size: clamp(1.35rem, 3vw, 1.75rem); letter-spacing: -.02em; line-height: 1.15; }
.doc-ic { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--safran); color: var(--night); }
.doc-ic .ic { width: 24px; height: 24px; }
.doc-tabs { display: flex; gap: 6px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface); overflow-x: auto; }
.doc-tabs button { flex: none; border: 0; background: transparent; padding: 9px 16px; border-radius: 999px; font: inherit; font-weight: 640; color: var(--ink-2); cursor: pointer; }
.doc-tabs button:hover { background: var(--surface-2); }
.doc-tabs button.is-on { background: var(--ink); color: var(--paper); }
.doc-body { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 32px 28px; background: var(--surface); max-width: none; line-height: 1.65; }
.doc-body h2 { font-size: 1.15rem; margin: 26px 0 8px; padding-top: 4px; }
.doc-body h2::before { content: ""; display: inline-block; width: 6px; height: 1em; margin-right: 10px; vertical-align: -2px; border-radius: 3px; background: var(--rose); }
.doc-body h3 { font-size: 1rem; margin: 18px 0 6px; }
.doc-body ul { padding-left: 1.2em; }
.doc-body .notice { margin-top: 18px; }
.doc-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface); }
@media (max-width: 640px) {
  .modal:has(.modal-panel--doc) { padding: 0; }
  .modal-panel--doc { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .doc-head { padding: 20px 60px 18px 18px; }
  .doc-body { padding: 4px 18px 22px; }
  .doc-foot { padding: 12px 16px; }
  .doc-foot .btn { flex: 1; }
  .doc-foot .link { font-size: .88rem; }
}
.doc-head, .doc-tabs, .doc-foot { flex: none; }
.doc-tabs { scrollbar-width: none; }
.doc-tabs::-webkit-scrollbar { display: none; }

/* ---------- fluidité ---------- */
/* transition douce entre deux pages (navigateurs récents) ; l’en-tête reste en place */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: tl-fade-out .16s ease both; }
::view-transition-new(root) { animation: tl-fade-in .22s ease both; }
.site-header { view-transition-name: site-header; }
.admin-bar { view-transition-name: admin-bar; }
@keyframes tl-fade-out { to { opacity: 0; } }
@keyframes tl-fade-in { from { opacity: 0; transform: translateY(6px); } }
/* sections de l’administration et de « Mon espace » */
.dash-main { transition: opacity .15s ease; }
.dash-main.is-loading { opacity: .45; pointer-events: none; }
.dash-main.fade-in { animation: tl-fade-in .22s ease both; }
/* cartes fantômes pendant le chargement */
.book--skeleton { pointer-events: none; }
.sk { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: tl-shimmer 1.2s linear infinite; }
.sk-cover { aspect-ratio: 2 / 3; border-radius: 6px 12px 12px 6px; }
.sk-line { height: 12px; margin-top: 12px; }
.sk-short { width: 60%; margin-top: 8px; }
@keyframes tl-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .dash-main.fade-in, .sk { animation: none; }
}

/* ---------- administration : thème sombre ---------- */
.admin-bar .icon-btn { color: var(--on-night); }
.admin-bar .icon-btn:hover { background: rgba(255, 255, 255, .12); }
:root[data-theme="dark"] .admin-bar { background: #0B0C22; }
:root[data-theme="dark"] input[type="color"] { background: var(--surface-2); border-color: var(--line); }
:root[data-theme="dark"] select, :root[data-theme="dark"] .select { color-scheme: dark; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (max-width: 480px) { .admin-bar .hide-xs { display: none; } }
