:root {
  --navy: #16305c;
  --navy-dark: #0e2044;
  --red: #c8203a;
  --red-dark: #a11830;
  --green: #0f7a4d;
  --gold: #a3690a;
  --purple: #6b3fa0;
  --teal: #0f8a8a;
  --orange: #d9762b;
  --bg: #f4f6fb;
  --card-bg: #ffffff;
  --text: #202b3d;
  --text-soft: #5c6579;
  --border: #e2e6f0;
  --graph-bg: #ffffff;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(20, 30, 60, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.site-header { background: #fff; color: var(--text); position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-mark { font-size: 22px; font-weight: 800; letter-spacing: 0.5px; }
.brand-accent { color: var(--red); }
.brand-sub { font-size: 10px; opacity: 0.75; letter-spacing: 1px; text-transform: uppercase; }
.main-nav { display: flex; gap: 20px; flex-wrap: wrap; }
.main-nav a { color: var(--navy); opacity: 0.85; font-weight: 600; font-size: 14.5px; padding: 8px 2px; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { opacity: 1; color: var(--red); border-color: var(--red); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 40px; height: 40px; padding: 0; background: none; border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; flex-shrink: 0; }
.nav-toggle:hover { background: var(--bg); }
.nav-toggle-bar { display: block; width: 18px; height: 2px; background: var(--navy); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-icon-btn { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border); font-size: 15px; color: var(--navy); }
.nav-icon-btn:hover { background: #eef1f9; }
.points-pill { background: rgba(255,255,255,0.12); padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #ffd479; }
.user-name { font-size: 14px; color: var(--text-soft); }

.btn { display: inline-block; padding: 9px 18px; border-radius: 8px; font-weight: 600; font-size: 14px; border: none; cursor: pointer; transition: transform .08s ease, opacity .15s; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.25); }
.btn-ghost:hover { background: rgba(255,255,255,0.18); }
.btn-outline { background: transparent; border: 1.5px solid var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { display: block; width: 100%; text-align: center; }

main { min-height: 70vh; padding: 32px 0 60px; }

.hero { position: relative; background: var(--bg); color: var(--text); padding: 64px 0 96px; overflow: hidden; }
.hero-slides { position: absolute; inset: 0; z-index: 0; }
.hero-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center; opacity: 0; transition: opacity 1.2s ease-in-out; }
.hero-slide.active { opacity: 1; }
.hero-overlay { position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(244,246,251,0.97) 0%, rgba(244,246,251,0.92) 32%, rgba(244,246,251,0.55) 52%, rgba(244,246,251,0.1) 70%); pointer-events: none; }
.hero-dots { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 3; }
.hero-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(22,48,92,0.25); cursor: pointer; transition: background 0.2s; border: none; padding: 0; }
.hero-dot.active { background: var(--navy); }
.hero .btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.hero .btn-ghost:hover { background: var(--navy); color: #fff; }
.hero .hero-search { border: 1px solid var(--border); }
.hero-text .label { color: var(--text); }
@media (max-width: 900px) { .hero { min-height: 0; } .hero-overlay { background: linear-gradient(180deg, rgba(244,246,251,0.97) 0%, rgba(244,246,251,0.94) 55%, rgba(244,246,251,0.75) 100%); } }
.hero::before {
  content: ""; position: absolute; top: -20%; right: -10%; width: 60%; height: 140%;
  background: radial-gradient(circle at 30% 50%, rgba(200,32,58,0.55), rgba(200,32,58,0) 70%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; bottom: -30%; right: 8%; width: 46%; height: 90%;
  background: conic-gradient(from 200deg at 50% 50%, var(--red) 0deg, var(--red-dark) 60deg, transparent 140deg);
  opacity: 0.35; border-radius: 50%; filter: blur(6px); pointer-events: none;
}
.hero .container { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 40px; }
.hero-text { flex: 1 1 420px; }
.hero-text-slide { display: none; animation: heroTextIn 0.5s ease; }
.hero-text-slide.active { display: block; }
@keyframes heroTextIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.hero-eyebrow { display: block; color: var(--red); font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 10px; }
.hero-text h1 { font-size: 38px; margin: 0 0 14px; line-height: 1.2; font-weight: 800; }
.hero-text .accent { color: var(--red); }
.hero-text p { font-size: 17px; opacity: 0.92; max-width: 560px; }
.hero-actions { display: flex; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.hero-visual { position: relative; flex: 1 1 340px; min-height: 320px; align-self: stretch; }

/* Barre de recherche intégrée au hero */
.hero-search { display: flex; gap: 8px; flex-wrap: wrap; background: rgba(255,255,255,0.97); border-radius: 12px; padding: 8px; margin-top: 22px; max-width: 560px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.hero-search input[type=text] { flex: 2 1 200px; padding: 10px 12px; border: none; border-radius: 8px; font-size: 14.5px; }
.hero-search input[type=text]:focus { outline: none; }
.hero-search select { flex: 1 1 110px; padding: 10px 10px; border: none; border-left: 1px solid var(--border); border-radius: 0; font-size: 13.5px; color: var(--text); background: transparent; }
.hero-search button { flex: 0 0 auto; }
.popular-tags { margin-top: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.popular-tags .label { opacity: 0.75; }
.popular-tags a { background: rgba(255,255,255,0.85); border: 1px solid var(--border); color: var(--navy); padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.popular-tags a:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Visuel hero : couvertures flottantes + badge de comptage réel */
.hero-books { position: relative; height: 320px; }
.hero-book { position: absolute; width: 120px; aspect-ratio: 3/4; border-radius: 8px; box-shadow: 0 18px 34px rgba(0,0,0,0.35); padding: 12px 10px; color: #fff; font-weight: 800; font-size: 12.5px; line-height: 1.3; text-transform: uppercase; }
.hero-book.b1 { top: 6%; left: 6%; transform: rotate(-9deg); z-index: 2; }
.hero-book.b2 { top: 2%; left: 40%; transform: rotate(4deg); z-index: 3; }
.hero-book.b3 { top: 22%; left: 68%; transform: rotate(-4deg); z-index: 2; }
.hero-book.b4 { top: 46%; left: 20%; transform: rotate(7deg); z-index: 1; }
.hero-count-badge { position: absolute; bottom: 4%; right: 8%; width: 130px; height: 130px; border-radius: 50%; background: #fff; color: var(--navy); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; box-shadow: 0 16px 34px rgba(0,0,0,0.3); z-index: 4; }
.hero-count-badge .num { font-size: 26px; font-weight: 800; color: var(--red); line-height: 1; }
.hero-count-badge .label { font-size: 11px; font-weight: 600; margin-top: 4px; padding: 0 10px; }
.hero-badges { position: absolute; display: flex; flex-direction: column; gap: 10px; }
.hero-badges.top-left { top: 0; left: 0; z-index: 4; }
.hero-float-badge { background: #fff; color: var(--navy); font-size: 12.5px; font-weight: 700; padding: 8px 14px; border-radius: 10px; box-shadow: 0 8px 20px rgba(0,0,0,0.18); white-space: nowrap; }

/* Aperçu "écran" (réutilisé dans la section Comment ça fonctionne) */
.hero-mock { background: #fff; border-radius: 16px; padding: 16px; box-shadow: 0 24px 60px rgba(0,0,0,0.35); transform: perspective(900px) rotateY(-6deg) rotateX(2deg); }
.hero-mock-bar { display: flex; gap: 6px; margin-bottom: 12px; }
.hero-mock-bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.hero-mock-search { height: 30px; border-radius: 8px; background: var(--bg); margin-bottom: 14px; }
.hero-mock-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hero-mock-grid .mini-cover { aspect-ratio: 3/4; border-radius: 6px; }

/* Bande de fonctionnalités sous le hero */
.feature-strip { background: #fff; border-bottom: 1px solid var(--border); padding: 26px 0; }
.feature-strip .container { display: flex; gap: 30px; flex-wrap: wrap; }
.feature-item { flex: 1 1 220px; display: flex; align-items: center; gap: 14px; }
.feature-icon { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 10px; background: #eef1f9; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.feature-item h4 { margin: 0 0 3px; font-size: 14.5px; color: var(--navy); }
.feature-item p { margin: 0; font-size: 12.5px; color: var(--text-soft); }

@media (max-width: 900px) { .hero-books { height: 240px; } .hero-book { width: 90px; padding: 8px; font-size: 10.5px; } .hero-count-badge { width: 100px; height: 100px; } }

.section-title { font-size: 24px; margin: 0 0 6px; color: var(--navy); }
.section-sub { color: var(--text-soft); margin: 0 0 24px; }

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); padding: 22px; }
.card h3 { margin-top: 0; color: var(--navy); }
.card-icon { font-size: 26px; margin-bottom: 10px; }

.container.page { padding-top: 6px; }

.simulator-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 22px; align-items: start; }
@media (max-width: 900px) { .simulator-layout { grid-template-columns: 1fr; } }

.input-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.input-row input[type=text] { flex: 1 1 260px; padding: 12px 14px; font-size: 16px; border-radius: 8px; border: 1.5px solid var(--border); font-family: "Cambria Math", Georgia, serif; }
.input-row input[type=text]:focus { outline: none; border-color: var(--navy); }
.examples { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.example-chip { background: #eef1f9; border: 1px solid var(--border); padding: 5px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; color: var(--navy); }
.example-chip:hover { background: #e2e7f5; }

.graph-card { padding: 12px; }
.graph-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.graph-toolbar .hint { font-size: 12px; color: var(--text-soft); }
canvas#graphCanvas { display: block; width: 100%; height: 420px; border-radius: 8px; background: #fff; cursor: grab; touch-action: none; }

.analysis-panel { display: flex; flex-direction: column; gap: 12px; max-height: 720px; overflow-y: auto; }
.analysis-item { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.analysis-item h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--red); }
.analysis-item .value { font-size: 15px; font-weight: 600; color: var(--navy); }
.analysis-item .explain { font-size: 13px; color: var(--text-soft); margin-top: 4px; }

.mode-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.mode-tab { padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--border); background: #fff; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text-soft); }
.mode-tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.steps-list { counter-reset: step; }
.step-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.step-item:last-child { border-bottom: none; }
.step-num { flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.step-body h4 { margin: 0 0 4px; }

table.dash-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
table.dash-table th, table.dash-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
table.dash-table th { background: #eef1f9; color: var(--navy); font-size: 12px; text-transform: uppercase; }

.stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.stat-box { flex: 1 1 160px; background: #fff; border-radius: 10px; padding: 16px 18px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.stat-box .num { font-size: 26px; font-weight: 800; color: var(--navy); }
.stat-box .label { font-size: 12px; color: var(--text-soft); text-transform: uppercase; }

.badge-row { display: flex; gap: 10px; flex-wrap: wrap; }
.badge-chip { background: linear-gradient(135deg, #fff6e0, #ffe6b0); border: 1px solid #f0cf85; color: var(--gold); padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 700; }

.auth-card { max-width: 420px; margin: 20px auto; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--navy); }
.form-group input, .form-group select { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--navy); }
.alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.alert-error { background: #fde5e8; color: var(--red-dark); border: 1px solid #f5b9c2; }
.alert-success { background: #e2f5ea; color: var(--green); border: 1px solid #b7e4cb; }

.exercise-list { display: flex; flex-direction: column; gap: 12px; }
.exercise-row { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; flex-wrap: wrap; gap: 10px; }
.exercise-row .meta { font-size: 12px; color: var(--text-soft); }
.diff-dots span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--border); margin-right: 3px; }
.diff-dots span.on { background: var(--red); }

.hint-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.hint-box { background: #fff7e6; border: 1px solid #f0d9a0; border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; font-size: 14px; }
.answer-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.answer-row input { flex: 1 1 200px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 15px; }

.chapter-group h3 { color: var(--navy); border-left: 4px solid var(--red); padding-left: 10px; margin-top: 30px; }

@media (max-width: 860px) {
  .nav-toggle { display: flex; order: 2; margin-left: auto; }
  .main-nav, .header-actions { flex-basis: 100%; display: none; order: 3; }
  .main-nav.open, .header-actions.open { display: flex; }
  .main-nav { flex-direction: column; gap: 2px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
  .main-nav a { width: 100%; padding: 10px 4px; border-bottom: 1px solid var(--border); }
  .header-actions { flex-direction: column; align-items: stretch; gap: 8px; padding-bottom: 4px; }
  .header-actions .user-name { text-align: center; }
}
@media (max-width: 600px) {
  .hero-text h1 { font-size: 27px; }
}

/* ============================================================
   EDUTECH CONGO LIVRES — composants spécifiques bibliothèque
   ============================================================ */

.brand-logo { height: 42px; display: block; }

.cat-card { text-align: center; transition: transform .12s ease, box-shadow .12s ease; }
.cat-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(20,30,60,0.12); }

/* Rangée de catégories façon icônes rondes (page d'accueil) */
.cat-icon-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.cat-icon-item { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease; }
.cat-icon-item:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(20,30,60,0.12); }
.cat-icon-badge { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; }
.cat-icon-item .cat-icon-label { font-size: 14.5px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.cat-icon-item .cat-icon-sub { font-size: 12px; color: var(--text-soft); }
.cat-icon-item.more { justify-content: center; text-align: center; color: var(--red); font-weight: 700; }
.cat-icon-item.more .cat-icon-badge { background: #fde5e8; color: var(--red); }

.section-header-row { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.section-header-row .section-title, .section-header-row .section-sub { margin: 0; }
.section-link { font-size: 14px; font-weight: 700; color: var(--red); }
.section-link:hover { color: var(--red-dark); }

/* Carrousel horizontal (Nouveautés) */
.carousel-wrap { position: relative; }
.carousel-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 2px 14px; scrollbar-width: thin; }
.carousel-track .book-card { flex: 0 0 170px; scroll-snap-align: start; }
.carousel-arrow { position: absolute; top: 42%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 16px; color: var(--navy); cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center; }
.carousel-arrow:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.carousel-arrow.prev { left: -6px; }
.carousel-arrow.next { right: -6px; }
@media (max-width: 700px) { .carousel-arrow { display: none; } }

/* Couverture générée (placeholder coloré) quand aucune image n'est fournie */
.cover-placeholder { width: 100%; height: 100%; display: flex; align-items: flex-start; padding: 14px; color: #fff; font-weight: 800; font-size: 14px; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.3px; }
.ribbon-new { position: absolute; top: 10px; left: 10px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: 0.4px; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; box-shadow: 0 3px 8px rgba(0,0,0,0.25); }

.grid-books { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.book-card { background: var(--card-bg); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .12s ease, box-shadow .12s ease; }
.book-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(20,30,60,0.14); }
.book-cover { position: relative; aspect-ratio: 3/4; background: #eef1f9; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.access-badge { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.badge-libre { background: #e2f5ea; color: var(--green); }
.badge-reserve { background: #fff2e0; color: var(--gold); }
.book-info { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.book-info h4 { margin: 0; font-size: 14px; color: var(--navy); line-height: 1.3; }
.book-author { margin: 0; font-size: 12px; color: var(--text-soft); }
.book-category { font-size: 11px; color: var(--navy); background: #eef1f9; padding: 2px 8px; border-radius: 999px; align-self: flex-start; }

.catalogue-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.catalogue-filters input[type=text] { flex: 1 1 220px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; }
.catalogue-filters select { padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; }

.pagination { display: flex; gap: 8px; margin-top: 26px; flex-wrap: wrap; }
.page-link { padding: 8px 14px; border-radius: 8px; border: 1.5px solid var(--border); background: #fff; color: var(--navy); font-weight: 600; font-size: 14px; }
.page-link.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.book-detail { display: grid; grid-template-columns: 260px 1fr; gap: 30px; }
.book-detail-cover img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.book-detail-info { position: relative; }
.book-meta { font-size: 14px; color: var(--text-soft); line-height: 1.8; margin: 14px 0; }
.book-description { font-size: 15px; line-height: 1.7; margin-bottom: 20px; }
@media (max-width: 700px) { .book-detail { grid-template-columns: 1fr; } .book-detail-cover { max-width: 220px; } }

/* Lecteur sécurisé */
.reader-topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.reader-topbar h2 { font-size: 17px; color: var(--navy); margin: 0; flex: 1 1 auto; text-align: center; }
.reader-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reader-controls span { font-size: 13px; color: var(--text-soft); min-width: 100px; text-align: center; }
.reader-container { background: #2b2f3a; border-radius: var(--radius); padding: 24px; display: flex; align-items: center; justify-content: center; min-height: 60vh; position: relative; user-select: none; }
.reader-container canvas { max-width: 100%; box-shadow: 0 4px 24px rgba(0,0,0,0.4); background: #fff; }
.reader-loading { position: absolute; color: #fff; font-size: 15px; }

/* Espace administrateur */
.admin-body { background: #eef1f9; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: var(--navy-dark); color: #fff; display: flex; flex-direction: column; flex-shrink: 0; }
.admin-brand { padding: 20px 18px; }
.admin-brand img { max-width: 100%; }
.admin-nav { display: flex; flex-direction: column; padding: 10px; gap: 2px; flex: 1; }
.admin-nav a { color: rgba(255,255,255,0.8); padding: 11px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.admin-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.admin-nav a.active { background: var(--red); color: #fff; }
.admin-sidebar-footer { padding: 14px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid rgba(255,255,255,0.1); }
.admin-sidebar-footer a { font-size: 13px; color: rgba(255,255,255,0.65); }
.admin-main { flex: 1; min-width: 0; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 16px 28px; display: flex; justify-content: space-between; align-items: center; }
.admin-topbar h1 { font-size: 20px; margin: 0; color: var(--navy); }
.admin-user { font-size: 14px; color: var(--text-soft); }
.admin-content { padding: 26px 28px 60px; }

@media (max-width: 820px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; flex-direction: row; overflow-x: auto; }
  .admin-nav { flex-direction: row; }
  .admin-sidebar-footer { display: none; }
}

/* ============================================================
   Section "Comment ça fonctionne" — bandeau dégradé, étapes reliées
   ============================================================ */
.how-it-works { background: linear-gradient(120deg, var(--navy-dark), var(--purple) 130%); color: #fff; padding: 46px 0; margin: 50px 0; border-radius: var(--radius); }
.how-it-works .section-title, .how-it-works .section-sub { color: #fff; }
.how-it-works .section-sub { opacity: 0.85; }
.how-inner { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; }
.how-steps { flex: 2 1 480px; display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.how-step { flex: 1 1 110px; text-align: center; min-width: 110px; }
.how-step-circle { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,0.14); border: 1.5px solid rgba(255,255,255,0.35); display: flex; align-items: center; justify-content: center; font-size: 20px; margin: 0 auto 10px; }
.how-step h4 { margin: 0 0 4px; font-size: 13.5px; }
.how-step p { margin: 0; font-size: 11.5px; opacity: 0.8; line-height: 1.4; }
.how-arrow { flex: 0 0 auto; align-self: flex-start; margin-top: 16px; font-size: 20px; opacity: 0.5; }
.how-visual { flex: 1 1 220px; display: flex; justify-content: center; }
.how-visual .hero-mock { transform: perspective(700px) rotateY(-6deg) scale(0.85); }
@media (max-width: 760px) { .how-arrow { display: none; } }

/* ============================================================
   Tarifs
   ============================================================ */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; align-items: stretch; }
.price-card { position: relative; background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 26px 22px; display: flex; flex-direction: column; }
.price-card.featured { border-color: var(--red); box-shadow: 0 14px 34px rgba(200,32,58,0.16); transform: translateY(-6px); }
.price-card .price-ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; padding: 5px 14px; border-radius: 999px; white-space: nowrap; }
.price-card h3 { margin: 4px 0 2px; color: var(--navy); }
.price-amount { font-size: 30px; font-weight: 800; color: var(--navy); margin: 6px 0 2px; }
.price-amount span { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.price-duration { font-size: 12.5px; color: var(--text-soft); margin-bottom: 16px; }
.price-features { list-style: none; padding: 0; margin: 0 0 22px; flex: 1; display: flex; flex-direction: column; gap: 9px; }
.price-features li { font-size: 13.5px; color: var(--text); padding-left: 22px; position: relative; }
.price-features li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.price-card-institution { background: linear-gradient(135deg, var(--navy), var(--navy-dark)); color: #fff; border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.price-card-institution h3 { margin: 0; color: #fff; }
.price-card-institution p { margin: 0; font-size: 13.5px; opacity: 0.85; }

/* ============================================================
   Newsletter
   ============================================================ */
.newsletter-bar { background: linear-gradient(120deg, var(--navy-dark), var(--purple) 140%); color: #fff; border-radius: var(--radius); padding: 28px 30px; margin: 50px 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.newsletter-text { display: flex; align-items: center; gap: 14px; }
.newsletter-text .icon { font-size: 26px; }
.newsletter-text h3 { margin: 0 0 2px; font-size: 16.5px; }
.newsletter-text p { margin: 0; font-size: 12.5px; opacity: 0.85; }
.newsletter-form { display: flex; gap: 8px; flex-wrap: wrap; }
.newsletter-form input[type=email] { padding: 11px 14px; border-radius: 8px; border: none; min-width: 220px; font-size: 14px; }
.newsletter-form input[type=email]:focus { outline: none; }

/* ============================================================
   Footer élargi (4 colonnes)
   ============================================================ */
.site-footer { background: var(--navy-dark); color: rgba(255,255,255,0.75); padding: 0; font-size: 13px; }
.footer-top { padding: 46px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
.footer-brand img { height: 34px; margin-bottom: 10px; }
.footer-brand p { font-size: 12.5px; line-height: 1.6; opacity: 0.75; max-width: 260px; }
.footer-col h5 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: 0.4px; margin: 0 0 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-col a { opacity: 0.78; font-size: 13px; }
.footer-col a:hover { opacity: 1; color: #fff; }
.footer-contact-item { display: flex; gap: 8px; align-items: flex-start; opacity: 0.85; margin-bottom: 9px; font-size: 13px; }
.footer-social { display: flex; gap: 10px; margin-top: 14px; }
.footer-social a { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.footer-social a:hover { background: rgba(255,255,255,0.18); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 16px 0; text-align: center; font-size: 12.5px; opacity: 0.65; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
