/* ============================================================
   BiblioSmart — Design system (charte Dorée / Nuit)
   Tokens, thèmes clair & sombre, composants de base.
   ============================================================ */

/* ---------- Tokens : thème CLAIR (défaut) ---------- */
:root {
  /* Marque — Or & Ambre */
  --brand:            #8A6A1A;
  --brand-deep:       #5A4010;
  --brand-soft:       rgba(138,106,26,0.12);
  --accent:           #C9A84C;
  --accent-ink:       #7A5A10;

  /* Distinction ouvrages */
  --physical:         #8A6A1A;
  --digital:          #2A6030;

  /* Sémantiques */
  --ok:               #2A6030;
  --warn:             #A06010;
  --err:              #882020;
  --info:             #2A4A7A;

  /* Fonds & encre — crème doré */
  --ground:           #FAF7F0;
  --surface:          #FFFFFF;
  --surface-2:        #F2EDE0;
  --line:             #E8E0CC;
  --ink:              #1C1508;
  --muted:            #6A5A3A;
  --faint:            #9A8A6A;

  /* Sur fond de marque */
  --on-brand:         #FAF7F0;
  --on-brand-muted:   rgba(250,247,240,0.72);

  /* Élévation */
  --shadow-sm: 0 1px 2px rgba(28,21,8,.07), 0 2px 8px rgba(28,21,8,.05);
  --shadow-md: 0 8px 24px rgba(28,21,8,.11), 0 2px 6px rgba(28,21,8,.06);
  --shadow-lg: 0 24px 60px rgba(28,21,8,.16), 0 6px 18px rgba(28,21,8,.08);
  --ring:      0 0 0 3px rgba(138,106,26,0.28);

  /* Rayons & typo */
  --r-sm: 8px;  --r-md: 12px;  --r-lg: 18px;  --r-pill: 999px;
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body:    'Jost', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---------- Tokens : thème SOMBRE ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand:        #C9A84C;
    --brand-deep:   #8A6A1A;
    --brand-soft:   rgba(201,168,76,.14);
    --accent:       #C9A84C;
    --accent-ink:   #C9A84C;
    --physical:     #C9A84C;
    --digital:      #6A9A6A;
    --ok:           #6A9A6A;
    --warn:         #E8A030;
    --err:          #9A6A6A;
    --info:         #6A8A9A;

    --ground:       #0E0B08;
    --surface:      #1A1612;
    --surface-2:    #221E18;
    --line:         rgba(201,168,76,0.15);
    --ink:          #F5F0E8;
    --muted:        #8A8070;
    --faint:        #5A5248;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
    --shadow-md: 0 10px 28px rgba(0,0,0,.50);
    --shadow-lg: 0 28px 64px rgba(0,0,0,.60);
    --ring:      0 0 0 3px rgba(201,168,76,.35);
  }
}

/* ---------- Override explicite par toggle ---------- */
:root[data-theme="dark"] {
  --brand:        #C9A84C;
  --brand-deep:   #8A6A1A;
  --brand-soft:   rgba(201,168,76,.14);
  --accent:       #C9A84C;
  --accent-ink:   #C9A84C;
  --physical:     #C9A84C;
  --digital:      #6A9A6A;
  --ok:           #6A9A6A;
  --warn:         #E8A030;
  --err:          #9A6A6A;
  --info:         #6A8A9A;

  --ground:       #0E0B08;
  --surface:      #1A1612;
  --surface-2:    #221E18;
  --line:         rgba(201,168,76,0.15);
  --ink:          #F5F0E8;
  --muted:        #8A8070;
  --faint:        #5A5248;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --shadow-md: 0 10px 28px rgba(0,0,0,.50);
  --shadow-lg: 0 28px 64px rgba(0,0,0,.60);
  --ring:      0 0 0 3px rgba(201,168,76,.35);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--ground);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}
a { color: inherit; }
::selection { background: var(--brand-soft); color: var(--brand-deep); }

/* ---------- Utilitaires ---------- */
.eyebrow {
  font-size: .7rem; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--brand);
}
.display {
  font-family: var(--font-display);
  font-weight: 400; line-height: 1.08; letter-spacing: -.01em;
  text-wrap: balance; margin: 0;
}

/* ---------- Boutons ---------- */
.btn {
  --btn-bg: var(--brand);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-body); font-size: .9rem; font-weight: 600;
  color: #0a0806; background: var(--btn-bg);
  border: 1.5px solid transparent; border-radius: var(--r-md);
  padding: .6rem 1.25rem; cursor: pointer; text-decoration: none;
  transition: opacity .18s, background .18s, border-color .18s, box-shadow .18s;
  white-space: nowrap; letter-spacing: .01em;
}
.btn:hover { opacity: .88; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn--sm { font-size: .8rem; padding: .4rem .85rem; border-radius: var(--r-sm); }
.btn--lg { font-size: 1rem; padding: .75rem 1.6rem; }
.btn--block { width: 100%; }
.btn--outline {
  --btn-bg: transparent; color: var(--brand); border-color: var(--line);
}
.btn--outline:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); opacity: 1; }
.btn--ghost { --btn-bg: transparent; color: var(--muted); border-color: transparent; }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); opacity: 1; }
.btn--accent { --btn-bg: var(--accent); color: #0a0806; }
.btn--danger { --btn-bg: var(--err); color: #f5f0e8; }
.btn.is-disabled, .btn[disabled] { opacity: .4; pointer-events: none; }

/* ---------- Champs de saisie ---------- */
.input, .select, .textarea {
  font-family: var(--font-body); font-size: .9rem;
  background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: .6rem .8rem; width: 100%;
  transition: border-color .16s, box-shadow .16s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: var(--ring);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input-wrap { position: relative; }
.has-toggle { padding-right: 2.8rem; }
.input-toggle {
  position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--muted); padding: .3rem;
}
.input-toggle:hover { color: var(--ink); }

/* ---------- Champ de recherche ---------- */
.search-field { position: relative; }
.search-field svg {
  position: absolute; left: .8rem; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--faint); pointer-events: none;
}
.search-field .input { padding-left: 2.5rem; }

/* ---------- Champs form ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; }
.label { font-size: .78rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.help { font-size: .76rem; color: var(--faint); }
.check { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .9rem; }
.check input { accent-color: var(--brand); width: 15px; height: 15px; }

/* ---------- Cartes ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}
.panel {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 1rem 1.1rem;
}

/* ---------- Alertes & bandeaux ---------- */
.alert {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .75rem .9rem; border-radius: var(--r-md);
  font-size: .88rem; border: 1px solid var(--line);
}
.alert--info    { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-deep); }
.alert--success { background: rgba(42,96,48,.1); border-color: rgba(42,96,48,.3); color: var(--ok); }
.alert--warning { background: rgba(160,96,16,.1); border-color: rgba(160,96,16,.3); color: var(--warn); }
.alert--error   { background: rgba(136,32,32,.1); border-color: rgba(136,32,32,.3); color: var(--err); }
.alert svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; font-size: .66rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  padding: .2rem .55rem; border-radius: var(--r-pill);
}
.badge--ok       { background: rgba(42,96,48,.12); color: var(--ok); }
.badge--out      { background: rgba(160,96,16,.12); color: var(--warn); }
.badge--digital  { background: rgba(42,96,48,.12); color: var(--digital); }
.badge--physical { background: rgba(201,168,76,.12); color: var(--physical); }
.badge--neutral  { background: var(--surface-2); color: var(--muted); }
.badge--brand    { background: var(--brand-soft); color: var(--brand); }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--ground) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  height: 64px;
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; max-width: 1200px; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem);
}
.nav__logo {
  display: flex; align-items: center; gap: .55rem;
  text-decoration: none; font-family: var(--font-display); font-size: 1.35rem; color: var(--ink);
}
.nav__word b { color: var(--brand); font-weight: 600; }
.nav__links { display: flex; align-items: center; gap: .2rem; }
.nav__link {
  text-decoration: none; color: var(--muted); font-size: .88rem; font-weight: 500;
  padding: .45rem .6rem; border-radius: var(--r-sm);
  transition: color .15s, background .15s;
}
.nav__link:hover { color: var(--ink); background: var(--surface-2); }
.nav__link.is-active { color: var(--brand); background: var(--brand-soft); }
.nav__cta {
  background: var(--brand); color: #0a0806 !important;
  border-radius: var(--r-md); padding: .42rem .9rem; font-weight: 600;
}
.nav__cta:hover { opacity: .88; background: var(--brand) !important; }
.nav__avatar { position: relative; }
.nav__avatar-btn {
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--brand-soft); border: 1.5px solid var(--brand);
  color: var(--brand); font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.nav__dropdown {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 160px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-md); padding: .4rem; z-index: 200;
}
.nav__avatar:hover .nav__dropdown,
.nav__avatar:focus-within .nav__dropdown { display: flex; flex-direction: column; }
.nav__dropdown a, .nav__dropdown button {
  display: block; padding: .55rem .7rem; border-radius: var(--r-sm);
  text-decoration: none; color: var(--muted); font-size: .86rem;
  transition: background .14s, color .14s;
  background: none; border: none; cursor: pointer; font-family: inherit; width: 100%; text-align: left;
}
.nav__dropdown a:hover, .nav__dropdown button:hover { background: var(--surface-2); color: var(--ink); }
.nav__dropdown .danger { color: var(--err); }

/* ---------- Logo mark SVG ---------- */
.logo-mark { width: 36px; height: 36px; flex: none; }
.logo-mark--sm { width: 30px; height: 30px; }
.lm-ray { stroke: var(--brand); }
.lm-bulb { fill: var(--brand); }
.lm-b { fill: #0a0806; }
.lm-book { fill: var(--surface-2); stroke: var(--brand); stroke-width: 1.5; }

/* ---------- Toggle thème ---------- */
.theme-toggle {
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--surface-2); border: 1.5px solid var(--line);
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, color .15s;
}
.theme-toggle:hover { border-color: var(--brand); color: var(--brand); }
:root:not([data-theme="light"]) .i-sun { display: block !important; }
:root:not([data-theme="light"]) .i-moon { display: none !important; }
:root[data-theme="light"] .i-sun { display: none !important; }
:root[data-theme="light"] .i-moon { display: block !important; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 1.4rem 0; margin-top: 3rem; }
.footer__inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; font-size: .82rem; color: var(--faint);
  max-width: 1200px; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem);
}

/* ---------- Layout ---------- */
.container { max-width: 1120px; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.page { padding-block: clamp(1.5rem, 4vw, 2.5rem); }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.cluster { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }

/* ---------- Book grid & card ---------- */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.1rem; }
.book-grid--sm { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .8rem; }
.book-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; gap: .55rem; }
.book-card__cover {
  aspect-ratio: 3/4; border-radius: var(--r-md); overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line); position: relative;
  transition: box-shadow .2s, transform .2s;
}
.book-card:hover .book-card__cover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.book-card__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-cover--empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--faint); }
.book-cover--empty svg { width: 36px; height: 36px; opacity: .4; }
.book-card__badge { position: absolute; top: .45rem; left: .45rem; }
.book-card__title { font-family: var(--font-display); font-size: .95rem; font-weight: 400; line-height: 1.25; margin: 0; }
.book-card__author { font-size: .78rem; color: var(--muted); margin: 0; }
.book-card__meta { display: flex; align-items: center; gap: .4rem; font-size: .72rem; color: var(--faint); }
.book-card__stars { color: var(--accent); }

/* ---------- Section headers ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.section-head__label { font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; }
.section-head__link { font-size: .84rem; color: var(--brand); text-decoration: none; white-space: nowrap; }
.section-head__link:hover { text-decoration: underline; }
.section-head__count { font-size: .82rem; color: var(--faint); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 3rem 1rem; }
.empty__icon { width: 3rem; height: 3rem; margin: 0 auto 1rem; color: var(--faint); }
.empty__icon svg { width: 100%; height: 100%; }
.empty__title { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: .5rem; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: .4rem; margin-top: 2rem; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.1rem; height: 2.1rem; padding: 0 .5rem;
  border-radius: var(--r-sm); font-size: .84rem; text-decoration: none;
  color: var(--muted); border: 1px solid var(--line); transition: all .15s;
}
.pagination a:hover { border-color: var(--brand); color: var(--brand); }
.pagination .current { background: var(--brand); color: #0a0806; border-color: var(--brand); font-weight: 600; }

/* ---------- Auth layout ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .auth { grid-template-columns: 1fr 1fr; } }
.auth__brand {
  display: none;
  background: radial-gradient(120% 90% at 10% 10%, rgba(201,168,76,.10), transparent 45%),
    radial-gradient(90% 90% at 100% 100%, rgba(201,168,76,.16), transparent 55%),
    linear-gradient(150deg, #1A1612 0%, #0E0B08 82%);
  padding: clamp(2rem, 5vw, 3.5rem); color: var(--on-brand);
  position: relative; overflow: hidden; border-right: 1px solid var(--line);
}
@media (min-width: 900px) { .auth__brand { display: flex; flex-direction: column; } }
.brand__top { display: flex; align-items: center; gap: .6rem; margin-bottom: auto; }
.brand__word { font-family: var(--font-display); font-size: 1.4rem; color: #F5F0E8; }
.brand__word b { color: var(--brand); }
.brand__mid { padding-block: 2rem; }
.brand__eyebrow { font-size: .68rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--brand); margin-bottom: .6rem; }
.brand__title { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); font-weight: 400; line-height: 1.1; margin-bottom: .8rem; color: #F5F0E8; }
.brand__title em { color: var(--brand); font-style: italic; }
.brand__lead { color: rgba(245,240,232,0.65); font-size: .95rem; line-height: 1.7; max-width: 42ch; }
.brand__chips { display: flex; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: rgba(245,240,232,0.65); background: rgba(201,168,76,0.10); border: 1px solid rgba(201,168,76,0.20); border-radius: var(--r-pill); padding: .3rem .7rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.brand__stats { display: flex; gap: 2rem; margin-top: auto; padding-top: 1.5rem; border-top: 1px solid rgba(201,168,76,0.20); }
.brand__stat .n { font-family: var(--font-display); font-size: 1.6rem; font-weight: 400; color: var(--brand); }
.brand__stat .l { font-size: .76rem; color: rgba(245,240,232,0.55); margin-top: .1rem; }

/* FIXE — panneau formulaire ne défile pas */
.auth__panel { display: flex; flex-direction: column; background: var(--ground); height: 100vh; overflow: hidden; }
.panel__bar { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.5rem; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.homelink { display: flex; align-items: center; gap: .4rem; font-size: .84rem; color: var(--muted); text-decoration: none; }
.homelink:hover { color: var(--brand); }
.panel__body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1.5rem; overflow: hidden; }
.card.rise { width: 100%; max-width: 400px; }
.card__head { margin-bottom: 1.4rem; }
.card__title { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 400; margin: .25rem 0 .4rem; }
.card__sub { color: var(--muted); font-size: .9rem; }
.card__foot { text-align: center; font-size: .86rem; color: var(--muted); margin-top: .8rem; }
.link-accent { color: var(--brand); text-decoration: none; font-weight: 600; }
.link-accent:hover { text-decoration: underline; }
.divider { text-align: center; font-size: .8rem; color: var(--faint); position: relative; margin: 1rem 0; }
.divider::before, .divider::after { content: ''; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--line); }
.divider::before { left: 0; } .divider::after { right: 0; }
.help-note { display: flex; align-items: flex-start; gap: .5rem; font-size: .8rem; color: var(--faint); background: var(--surface-2); border-radius: var(--r-md); padding: .75rem .85rem; margin-top: 1rem; border: 1px solid var(--line); }
.help-note svg { flex: none; color: var(--brand); margin-top: 2px; }

/* Livres déco panneau auth */
.brand__art { position: absolute; right: -30px; bottom: -10px; z-index: 0; display: flex; opacity: .85; pointer-events: none; }
@media (max-width: 900px) { .brand__art { display: none; } }
.brand-book { width: 130px; aspect-ratio: 3/4; border-radius: 8px; flex: none; box-shadow: 0 18px 40px rgba(0,0,0,.45); border: 2px solid rgba(201,168,76,.25); display: flex; align-items: flex-end; padding: .6rem; }
.brand-book span { display: block; height: 6px; width: 60%; border-radius: 3px; background: rgba(201,168,76,.5); }
.brand-book:nth-child(1) { transform: rotate(-8deg) translateY(14px); margin-right: -30px; background: linear-gradient(150deg, #2A1E0A, #1A1208); }
.brand-book:nth-child(2) { transform: rotate(2deg); z-index: 2; background: linear-gradient(150deg, #C9A84C, #8A6A1A); }
.brand-book:nth-child(3) { transform: rotate(11deg) translateY(10px); margin-left: -30px; background: linear-gradient(150deg, #1A1612, #0E0B08); }
.auth__brand { position: relative; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg); color: var(--on-brand);
  background: radial-gradient(120% 90% at 10% 10%, rgba(201,168,76,.08), transparent 45%),
    radial-gradient(90% 90% at 100% 100%, rgba(201,168,76,.16), transparent 55%),
    linear-gradient(150deg, #1A1612 0%, #0E0B08 82%);
  padding: clamp(2rem, 5vw, 3.5rem); border: 1px solid rgba(201,168,76,0.15);
}
.hero__eyebrow { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--brand); font-weight: 600; }
.hero__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.03; letter-spacing: -.015em; margin: .6rem 0 1rem; max-width: 16ch; text-wrap: balance; }
.hero__title em { font-style: italic; color: var(--brand); }
.hero__lead { color: var(--on-brand-muted); font-size: 1.02rem; line-height: 1.7; max-width: 46ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }
.hero .search-field .input { background: rgba(201,168,76,.08); border-color: rgba(201,168,76,.25); color: #F5F0E8; }
.hero .search-field .input::placeholder { color: rgba(201,168,76,.5); }
.hero .search-field svg { color: rgba(201,168,76,.6); }
.hero--split { display: block; }
.hero__body { position: relative; z-index: 2; max-width: 620px; }
.hero__visual { display: none; }
@media (min-width: 960px) {
  .hero--split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2rem; align-items: center; }
  .hero__visual { display: flex; align-items: center; justify-content: center; min-height: 320px; }
}
.hero__cover { width: 158px; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; box-shadow: 0 22px 48px rgba(0,0,0,.55); border: 2px solid rgba(201,168,76,.30); background: #1A1612; flex: none; }
.hero__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero__cover-fallback { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--brand); }
.hero__cover-fallback svg { width: 40px; height: 40px; opacity: .4; }
.hero__cover:nth-child(1) { transform: rotate(-9deg) translateY(12px); margin-right: -34px; z-index: 1; }
.hero__cover:nth-child(2) { transform: rotate(0deg); z-index: 3; }
.hero__cover:nth-child(3) { transform: rotate(9deg) translateY(12px); margin-left: -34px; z-index: 1; }

/* ---------- Features & Pricing ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.4rem; box-shadow: var(--shadow-sm); }
.feature__icon { width: 2.8rem; height: 2.8rem; border-radius: var(--r-md); display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); margin-bottom: .9rem; }
.feature__icon svg { width: 22px; height: 22px; }
.feature__title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 400; margin-bottom: .35rem; }
.feature__text { color: var(--muted); font-size: .9rem; line-height: 1.6; }
.feature__tag { display: inline-block; margin-top: .7rem; font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); }

.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; align-items: stretch; }
.price-card { position: relative; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 1.6rem; display: flex; flex-direction: column; gap: .3rem; box-shadow: var(--shadow-sm); }
.price-card--featured { border-color: var(--brand); box-shadow: var(--shadow-md); }
.price-card__badge { position: absolute; top: -.7rem; left: 1.6rem; background: var(--brand); color: #0a0806; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .25rem .65rem; border-radius: var(--r-pill); }
.price-card__name { font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.price-card__amount { font-family: var(--font-display); font-size: 2.4rem; font-weight: 400; line-height: 1; margin: .3rem 0; color: var(--brand); }
.price-card__amount span { font-family: var(--font-body); font-size: .9rem; font-weight: 500; color: var(--muted); }
.price-card__period { color: var(--faint); font-size: .82rem; margin-bottom: .9rem; }
.price-card__list { list-style: none; padding: 0; margin: 0 0 1.2rem; display: flex; flex-direction: column; gap: .5rem; }
.price-card__list li { display: flex; gap: .5rem; align-items: flex-start; font-size: .86rem; color: var(--ink); }
.price-card__list svg { flex: none; width: 16px; height: 16px; color: var(--ok); margin-top: 2px; }
.price-card .btn { margin-top: auto; }

.cta-band { border-radius: var(--r-lg); padding: clamp(1.8rem, 4vw, 2.8rem); text-align: center; color: var(--on-brand);
  background: radial-gradient(90% 90% at 100% 0%, rgba(201,168,76,.18), transparent 55%), linear-gradient(150deg, #1A1612, #0E0B08);
  border: 1px solid rgba(201,168,76,0.15); }
.cta-band h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 400; margin: 0 0 .6rem; }
.cta-band p { color: var(--on-brand-muted); max-width: 52ch; margin: 0 auto 1.4rem; }

/* ---------- Reader ---------- */
.reader { max-width: 780px; margin-inline: auto; }
.reader__bar { position: sticky; top: 64px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .6rem .8rem; background: color-mix(in srgb, var(--ground) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.reader__page { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(1.5rem, 4vw, 3rem); font-size: var(--reader-fs, 1.05rem); line-height: 1.9; color: var(--ink); box-shadow: var(--shadow-sm); }
.reader__page p { margin: 0 0 1.2rem; }
.reader__nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; }
.reader__frame { margin-top: 1.2rem; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.3rem; height: 2.3rem; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- Stars ---------- */
.stars { display: inline-flex; flex-direction: row-reverse; gap: .15rem; }
.stars input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.stars label { cursor: pointer; color: var(--faint); font-size: 1.5rem; line-height: 1; transition: color .12s; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: var(--accent); }
.stars input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }

/* ---------- Onglets ---------- */
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { appearance: none; background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); font-family: var(--font-body); font-size: .88rem; font-weight: 600; padding: .7rem .9rem; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.tab:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm) var(--r-sm) 0 0; }
.tabpanel[hidden] { display: none; }

/* ---------- Shell administrateur ---------- */
.admin-shell { display: block; }
.admin-main { margin-left: 260px; min-width: 0; padding: clamp(1.2rem, 3vw, 2.2rem); }
.admin-menu {
  position: fixed; top: 64px; left: 0; bottom: 0; width: 260px; z-index: 50;
  display: flex; flex-direction: column; gap: 1.25rem; overflow-y: auto;
  background: var(--surface); border: none; border-right: 1px solid var(--line);
  padding: 1.3rem .8rem; box-shadow: none;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
/* Reader layout tweaks */
.reader { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.reader__page { max-width: 960px; margin: 0 auto; }
.reader-grid { display: grid; grid-template-columns: 1.6fr 320px; gap: 1.2rem; align-items: start; }
.reader-grid--pdf .reader__frame { grid-column: 1 / 2; }
.reader-grid--pdf > div.panel, .reader-grid--pdf > div[class*="panel"] { grid-column: 2 / 3; }

@media (max-width: 960px) {
  .reader { padding: 0 0.8rem; }
  .reader__page { max-width: 100%; padding: 1.2rem; }
  .reader-grid { grid-template-columns: 1fr; }
}
.admin-menu::-webkit-scrollbar { width: 8px; }
.admin-menu::-webkit-scrollbar-track { background: transparent; }
.admin-menu::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; border: 2px solid var(--surface); }
.admin-menu::-webkit-scrollbar-thumb:hover { background: var(--brand); }
.admin-menu__group { display: flex; flex-direction: column; gap: .12rem; }
.admin-menu__title { font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); font-weight: 700; padding: 0 .6rem .35rem; }
.admin-menu__link { display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; border-radius: var(--r-sm); text-decoration: none; color: var(--muted); font-size: .85rem; font-weight: 500; transition: background .14s, color .14s; }
.admin-menu__link svg { width: 17px; height: 17px; flex: none; }
.admin-menu__link:hover { background: var(--surface-2); color: var(--ink); }
.admin-menu__link.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.admin-menu__link .n { margin-left: auto; font-size: .72rem; color: var(--faint); background: var(--surface-2); padding: .05rem .4rem; border-radius: var(--r-pill); }
.admin-menu__link.is-active .n { color: var(--brand); background: var(--brand-soft); }
@media (max-width: 900px) {
  .admin-menu { position: static; inset: auto; width: auto; height: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .admin-main { margin-left: 0; }
}

/* ==== Admin info blocks (stats under headings) ==== */
.section-head .eyebrow { display:block; font-size:0.78rem; color:var(--muted); letter-spacing:0.12em; text-transform:uppercase; margin-bottom:0.15rem; }
.section-head .display, .section-head__label { font-family: var(--font-heading, var(--font-body)); font-size:1.3rem; margin:0; color:var(--ink); }
.section-head__count { color: var(--muted); font-size:0.95rem; margin-top:0.25rem; display:block; }

.stat-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap:0.9rem; align-items:stretch; }
.stat { background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, transparent), var(--surface)); border:1px solid var(--line); padding:0.9rem 1rem; border-radius:10px; box-shadow: 0 6px 18px rgba(0,0,0,0.04); }
.stat__l { font-size:0.78rem; color:var(--muted); margin-bottom:0.25rem; text-transform:uppercase; letter-spacing:0.12em; }
.stat__n { font-size:1.6rem; font-weight:700; color:var(--ink); line-height:1; }
.stat__hint { margin-top:0.5rem; font-size:0.82rem; color:var(--muted); }
.stat--brand { background: linear-gradient(135deg, rgba(201,168,76,0.08), rgba(201,168,76,0.03)); border-color: rgba(201,168,76,0.12); }
.stat--accent { background: linear-gradient(135deg, rgba(106,154,106,0.04), transparent); border-color: rgba(106,154,106,0.06); }
.stat--warn { background: linear-gradient(135deg, rgba(154,106,106,0.04), transparent); border-color: rgba(154,106,106,0.06); }

/* Make stat blocks more compact on small screens */
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat__n { font-size:1.2rem; }
}


/* Améliorations de présentation pour les pages administrateurs (tables, actions, espacement) */
.admin-main .section-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.table-wrap { overflow: auto; border-radius: 10px; }
.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table thead tr { background: transparent; }
.table th, .table td { padding: 0.9rem 0.8rem; vertical-align: middle; border-bottom: 1px solid rgba(0,0,0,0.04); text-align: left; font-size: 0.95rem; }
.table th { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.table td { white-space: normal; word-break: break-word; }
.table td.tnum { white-space: nowrap; }
.table td .cluster { display:flex; gap:0.4rem; align-items:center; flex-wrap:wrap; }
.table .btn--sm { padding: 0.35rem 0.6rem; font-size: 0.82rem; }
.table .btn--ghost, .table .btn--outline { height: auto; }

/* Actions: align and give breathing room */
.table td > .cluster { margin: 0; }

@media (max-width: 820px) {
  .table { min-width: 560px; }
  .table th:nth-child(3), .table td:nth-child(3) { display: none; }
}

@media (max-width: 560px) {
  .admin-main .section-head { flex-direction:column; align-items:stretch; }
  .table { min-width: 480px; }
  .table th:nth-child(4), .table td:nth-child(4) { display: none; }
}

/* Mobile: convert table rows to card-like blocks with labels */
@media (max-width: 720px) {
  .table thead { display: none; }
  .table tbody tr { display: block; margin-bottom: 0.9rem; border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem; background: var(--surface); box-shadow: var(--shadow-sm); }
  .table tbody tr td { display: flex; justify-content: space-between; padding: 0.45rem 0.4rem; border-bottom: none; }
  .table tbody tr td::before { content: attr(data-label); color: var(--muted); font-size: 0.78rem; margin-right: 0.8rem; flex: 0 0 45%; text-align:left; }
  .table tbody tr td:last-child { margin-top: 0.4rem; }
  .table tbody tr .row-toggle { margin-right: 0.6rem; border: none; background: transparent; display:inline-flex; align-items:center; justify-content:center; padding:0.15rem; cursor:pointer; color:var(--muted); }
  .table tbody tr.is-expanded { box-shadow: 0 10px 22px rgba(0,0,0,0.06); }
}

/* Accessibility helper */
.visually-hidden { position:absolute !important; height:1px; width:1px; overflow:hidden; clip:rect(1px,1px,1px,1px); white-space:nowrap; }

/* ---------- Landing ---------- */
.muted { color: var(--muted); }
.prose { line-height: 1.75; }
.prose p { margin: 0 0 1rem; }
@media (max-width: 640px) { .hide-mobile { display: none !important; } }