/* =====================================================================
   Mise en page : menu latéral (tiroir sur mobile, fixe sur grand écran)
   ===================================================================== */

.app { min-height: 100vh; }

/* ---------- Menu latéral ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: min(84vw, var(--sidebar-l));
  display: flex; flex-direction: column;
  background: var(--bleu-950);
  color: #c9d3e0;
  transform: translateX(-100%);
  transition: transform .22s ease;
  overflow-y: auto;
}
.sidebar.is-open { transform: none; box-shadow: var(--ombre-l); }

.sidebar__brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem 1.25rem; min-height: var(--topbar-h);
  border-bottom: 1px solid rgba(255,255,255,.07);
  color: var(--blanc);
}
.sidebar__brand:hover { text-decoration: none; }
.sidebar__brand img { width: 34px; height: 34px; }
.sidebar__brand strong { display: block; font-size: 1.05rem; letter-spacing: .14em; }
.sidebar__brand span { display: block; font-size: .72rem; color: var(--beige-300); letter-spacing: .02em; }

.nav { padding: .75rem .75rem 1.5rem; flex: 1; }
.nav__titre {
  margin: 1.1rem .75rem .4rem; font-size: .68rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: #7f8ea3;
}
.nav__lien {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .75rem; border-radius: var(--rayon-s);
  color: #c9d3e0; font-size: .9rem; font-weight: 500;
}
.nav__lien svg { width: 18px; height: 18px; opacity: .85; }
.nav__lien:hover { background: rgba(255,255,255,.06); color: var(--blanc); text-decoration: none; }
.nav__lien.is-active { background: var(--bleu-800); color: var(--blanc); box-shadow: inset 3px 0 0 var(--beige-500); }
.nav__lien.is-active svg { opacity: 1; color: var(--beige-300); }
.nav__lien.is-disabled { opacity: .45; cursor: default; }
.nav__lien.is-disabled:hover { background: none; color: #c9d3e0; }
.nav__tag {
  margin-left: auto; font-size: .62rem; padding: .1rem .4rem; border-radius: 99px;
  background: rgba(255,255,255,.08); color: #9fb0c5; text-transform: uppercase; letter-spacing: .05em;
}
.nav__compteur {
  margin-left: auto; min-width: 1.4rem; padding: .05rem .4rem; border-radius: 99px;
  background: var(--beige-500); color: var(--bleu-950); font-size: .72rem; font-weight: 700; text-align: center;
}

.sidebar__pied { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.07); font-size: .75rem; color: #7f8ea3; }

.voile {
  position: fixed; inset: 0; z-index: 40; background: rgba(8,24,43,.45);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.voile.is-visible { opacity: 1; pointer-events: auto; }

/* ---------- Barre supérieure ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: .75rem;
  height: var(--topbar-h); padding: 0 1rem;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--trait);
}
.topbar__menu {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: var(--rayon-s); background: transparent; cursor: pointer; color: var(--bleu-900);
}
.topbar__menu:hover { background: var(--beige-100); }
.topbar__titre { font-weight: 600; color: var(--bleu-950); font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__espace { flex: 1; }
.topbar__boutique {
  display: none; align-items: center; gap: .4rem;
  padding: .3rem .7rem; border-radius: 99px; background: var(--beige-100);
  color: var(--beige-700); font-size: .8rem; font-weight: 600;
}

.profil { position: relative; }
.profil__bouton {
  display: flex; align-items: center; gap: .6rem; padding: .25rem .4rem .25rem .25rem;
  border: 0; background: transparent; border-radius: 99px; cursor: pointer;
}
.profil__bouton:hover { background: var(--beige-100); }
.avatar {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--bleu-900); color: var(--beige-200); font-size: .8rem; font-weight: 700; letter-spacing: .03em;
}
.profil__nom { display: none; text-align: left; line-height: 1.2; }
.profil__nom strong { display: block; font-size: .85rem; color: var(--bleu-950); }
.profil__nom span { font-size: .72rem; color: var(--encre-pale); }
.profil__menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px;
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon);
  box-shadow: var(--ombre-l); padding: .4rem; display: none;
}
.profil__menu.is-open { display: block; }
.profil__menu a, .profil__menu button {
  display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .7rem;
  border: 0; background: none; border-radius: var(--rayon-s); color: var(--encre); font-size: .875rem; cursor: pointer; text-align: left;
}
.profil__menu a:hover, .profil__menu button:hover { background: var(--beige-50); text-decoration: none; }
.profil__menu svg { width: 16px; height: 16px; color: var(--encre-pale); }
.profil__entete { padding: .5rem .7rem .6rem; border-bottom: 1px solid var(--trait); margin-bottom: .3rem; font-size: .8rem; color: var(--encre-pale); }
.profil__entete strong { display: block; color: var(--encre); font-size: .875rem; }

/* ---------- Contenu ---------- */
.main { min-width: 0; }
.contenu { padding: 1rem; max-width: 1400px; margin: 0 auto; }

.entete-page {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem;
  margin-bottom: 1.25rem;
}
.entete-page p { margin: .15rem 0 0; color: var(--encre-douce); font-size: .9rem; }
.entete-page__actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.fil { font-size: .8rem; color: var(--encre-pale); margin-bottom: .25rem; }
.fil a { color: var(--encre-pale); }

/* ---------- Écrans larges ---------- */
@media (min-width: 640px) {
  .contenu { padding: 1.5rem; }
  .profil__nom { display: block; }
  .topbar__boutique { display: inline-flex; }
}

@media (min-width: 1024px) {
  .sidebar { transform: none; width: var(--sidebar-l); }
  .voile { display: none; }
  .main { margin-left: var(--sidebar-l); }
  .topbar { padding: 0 1.5rem; }
  .topbar__menu { display: none; }
  .contenu { padding: 1.75rem 2rem 3rem; }
}

/* ---------- Pages d'authentification ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem;
  background:
    radial-gradient(1200px 600px at 110% -10%, rgba(184,155,106,.20), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(27,68,117,.35), transparent 60%),
    var(--bleu-950);
}
.auth__carte {
  width: 100%; max-width: 410px; background: var(--surface);
  border-radius: var(--rayon-l); box-shadow: var(--ombre-l); padding: 2rem 1.5rem;
}
.auth__logo { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin-bottom: 1.5rem; text-align: center; }
.auth__logo img { width: 56px; height: 56px; }
.auth__logo strong { font-size: 1.35rem; letter-spacing: .2em; color: var(--bleu-950); }
.auth__logo span { font-size: .8rem; color: var(--beige-700); }
.auth__pied { margin-top: 1.5rem; text-align: center; font-size: .75rem; color: #8b9ab0; }
@media (min-width: 480px) { .auth__carte { padding: 2.25rem 2.25rem 2rem; } }
.auth { position: relative; }
.auth__retour {
  position: absolute; top: 1.1rem; left: 1.1rem; display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem 1rem; border-radius: 999px; font-size: .875rem; font-weight: 600; text-decoration: none;
  color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); transition: background .15s ease;
}
.auth__retour:hover { background: rgba(255, 255, 255, .18); color: #fff; text-decoration: none; }
.auth__retour span { color: var(--beige-300); }
@media (min-width: 768px) { .auth__retour { top: 1.5rem; left: 1.5rem; } }

/* ---------- Inscription (carte large) ---------- */
.auth--large { padding-top: 4.5rem; }
.auth--large .auth__carte { max-width: 760px; }
.inscription__entete { text-align: center; margin: -.5rem 0 1.25rem; }
.inscription__entete h1 { font-size: 1.3rem; margin: 0 0 .25rem; color: var(--bleu-950); }
.inscription__entete p { margin: 0; color: var(--encre-pale); font-size: .9rem; }
.inscription .form-section { border: 0; padding: 0; margin: 0 0 1.25rem; }
.inscription legend { display: flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--bleu-950); margin-bottom: .75rem; padding: 0; }
.inscription__num {
  display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--beige-100, #f3ece0); color: var(--beige-700, #8a6d3f); font-size: .85rem;
}
.inscription > .aide, .inscription .form-section > .aide { font-size: .78rem; color: var(--encre-pale); margin: 0; }
.inscription .case { margin: .25rem 0 1rem; }
.inscription__deja { text-align: center; font-size: .875rem; margin: 1rem 0 0; }

/* ---------- Espace Plateforme (CEFAC) ---------- */
.pf { background: var(--fond, #f5f6f8); min-height: 100vh; display: flex; flex-direction: column; }
.pf__barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; padding: .75rem 1rem; background: var(--bleu-950); color: #fff; }
.pf__marque { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; }
.pf__marque:hover { color: #fff; text-decoration: none; }
.pf__marque img { width: 34px; height: 34px; }
.pf__marque span { display: flex; flex-direction: column; line-height: 1.15; }
.pf__marque strong { letter-spacing: .18em; font-size: .95rem; }
.pf__marque em { font-style: normal; font-size: .72rem; color: var(--beige-300); }
.pf__nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.pf__nav a, .pf__nav button { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border-radius: 999px; color: #d6deea; font-size: .85rem; font-weight: 600; text-decoration: none; background: none; border: 0; cursor: pointer; font-family: inherit; }
.pf__nav a:hover, .pf__nav button:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.pf__nav a.is-active { background: rgba(184, 155, 106, .22); color: #fff; }
.pf__nav svg { width: 16px; height: 16px; }
.pf__contenu { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; }
.pf__pied { text-align: center; font-size: .75rem; color: var(--encre-pale); padding: 1rem; }
@media (min-width: 768px) { .pf__barre { padding: .85rem 2rem; } }
.auth--large > div { width: min(760px, 100%); }
