@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Public+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root{
  --bg:#0B1826;
  --surface:#122236;
  --surface-2:#1A3049;
  --line:rgba(198,161,91,0.22);
  --line-strong:rgba(198,161,91,0.45);
  --gold:#C6A15B;
  --gold-soft:rgba(198,161,91,0.14);
  --ivory:#F3EEE4;
  --slate:#8CA0B6;
  --slate-dim:#5C7086;
  --success:#5E9C82;
  --danger:#C0715A;
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family:'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(1200px 800px at 85% -10%, #16283F 0%, var(--bg) 55%);
  background-color: var(--bg);
  color: var(--ivory);
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
}
::selection{ background: var(--gold-soft); color: var(--ivory); }

.serif{ font-family:'Fraunces', Georgia, serif; }
.mono{ font-family:'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }
.gold{ color: var(--gold); }
.muted{ color: var(--slate); }

/* ---- buttons & inputs ---- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:10px 18px; border-radius:6px; font-size:13.5px; font-weight:600;
  letter-spacing:.01em; cursor:pointer; border:1px solid transparent;
  transition: all .15s ease; font-family:inherit;
}
.btn-gold{ background: var(--gold); color:#16202C; }
.btn-gold:hover{ background:#D4B274; }
.btn-ghost{ background:transparent; border-color: var(--line-strong); color: var(--ivory); }
.btn-ghost:hover{ background: var(--surface-2); }
.btn-block{ width:100%; margin-bottom:8px; justify-content:space-between; }
.btn-tiny{ padding:3px 7px; font-size:10.5px; font-weight:500; }
.chevron{ color: var(--gold); }

.input{
  background: var(--surface-2);
  border:1px solid var(--line);
  color: var(--ivory);
  border-radius:6px;
  padding:9px 11px;
  font-size:13.5px;
  width:100%;
  font-family:inherit;
}
.input:focus{ border-color: var(--gold); outline:2px solid var(--gold); outline-offset:1px; }
textarea.input{ resize:vertical; }

/* ---- cards & structure ---- */
.card{ background: var(--surface); border:1px solid var(--line); border-radius:10px; }
.hairline{ border-top:1px solid var(--line); }
.hairline-row{ display:flex; justify-content:space-between; padding:8px 2px; font-size:12.5px; border-top:1px solid var(--line); }
.hairline-row:first-child{ border-top:none; }

@keyframes fadeUp{ from{ opacity:0; transform:translateY(6px);} to{ opacity:1; transform:none; } }
.fade{ animation: fadeUp .35s ease both; }

/* ---- landing ---- */
.landing-wrap{ max-width:480px; margin:0 auto; padding:60px 20px; }
.brand-center{ text-align:center; margin-bottom:34px; }
.brand-title{ font-size:28px; font-weight:600; font-family:'Fraunces', serif; }
.brand-sub{ font-size:13px; color:var(--slate); margin-top:6px; }
.eyebrow{ font-size:11px; text-transform:uppercase; letter-spacing:.1em; color:var(--gold); margin-bottom:12px; font-weight:600; }
.landing-footnote{ text-align:center; font-size:11.5px; color:var(--slate-dim); margin-top:16px; }

/* ---- topbar / layout ---- */
.topbar{ display:flex; align-items:center; justify-content:space-between; padding:18px 28px; border-bottom:1px solid var(--line); }
.topbar-left{ display:flex; align-items:center; gap:10px; }
.topbar-right{ display:flex; align-items:center; gap:14px; }
.brand-small{ font-size:19px; font-weight:600; }
.vsep{ height:20px; border-left:1px solid var(--line); margin:0 4px; }

.app-layout{ display:grid; grid-template-columns:260px 1fr; max-width:1320px; margin:0 auto; }
.sidebar{ padding:24px 18px; border-right:1px solid var(--line); height:calc(100vh - 65px); overflow-y:auto; position:sticky; top:0; }
.content{ padding:30px 40px; height:calc(100vh - 65px); overflow-y:auto; }

/* ---- nav ---- */
.nav-pole-label{ font-size:11px; text-transform:uppercase; letter-spacing:.1em; margin-bottom:10px; font-weight:600; }
.nav-item{ display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:7px; margin-bottom:3px; border:1px solid transparent; }
.nav-item-active{ background: var(--surface-2); border-color: var(--line-strong); }
.badge{ font-family:'IBM Plex Mono', monospace; font-size:10.5px; font-weight:600; color:var(--gold); border:1px solid var(--line-strong); border-radius:4px; padding:1px 5px; min-width:24px; text-align:center; }
.nav-item-title{ flex:1; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nav-item-status{ font-size:12px; color: var(--slate-dim); }

/* ---- sections / fields ---- */
.section-label{ margin-bottom:18px; }
.section-label h3{ font-size:21px; margin:4px 0 0 0; font-weight:600; }
.module-title{ font-size:27px; margin:0 0 4px 0; font-weight:600; }
.module-sub{ font-size:13.5px; margin-bottom:24px; }
.prose{ font-size:14.5px; line-height:1.75; color:#D9D3C6; }
.prose ul, .prose ol{ padding-left:18px; }
.prose li{ margin-bottom:4px; }
.prose h4{ font-family:'Fraunces', Georgia, serif; font-size:16px; font-weight:600; color:var(--ivory); margin:22px 0 8px 0; }
.prose h4:first-child{ margin-top:0; }
.prose strong{ color:var(--ivory); }
.prose em{ color:var(--gold); font-style:normal; }

.sim-grid{ display:grid; grid-template-columns:340px 1fr; gap:22px; }
.field{ display:block; margin-bottom:12px; }
.field-label{ font-size:12px; color:var(--slate); margin-bottom:5px; }
.field-input-wrap{ position:relative; }
.field-suffix{ position:absolute; right:11px; top:9px; font-size:12px; color:var(--slate-dim); font-family:'IBM Plex Mono', monospace; }

.stat-row{ display:flex; flex-wrap:wrap; gap:10px; margin-bottom:16px; }
.stat{ padding:14px 16px; min-width:150px; flex:1 1 150px; }
.stat-label{ font-size:11px; color:var(--slate); text-transform:uppercase; letter-spacing:.06em; margin-bottom:6px; }
.stat-value{ font-size:20px; font-weight:600; }

.chart-box{ margin:8px 0 16px 0; }
.save-bar{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:14px; }
.save-bar .input{ max-width:260px; }

.exercice-box{ padding:18px; margin-top:18px; }
.exercice-box textarea{ margin-top:10px; }
.exo-item{ margin-bottom:18px; padding-bottom:18px; border-bottom:1px solid var(--line); }
.exo-item:last-of-type{ border-bottom:none; margin-bottom:0; padding-bottom:0; }
.exo-level{ font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--gold); font-weight:600; }

/* ---- quiz interactif ---- */
.quiz-box{ padding:18px; margin-top:18px; }
.quiz-question{ margin-bottom:20px; padding-bottom:20px; border-bottom:1px solid var(--line); }
.quiz-question:last-of-type{ border-bottom:none; margin-bottom:0; padding-bottom:0; }
.quiz-q-text{ font-size:14px; font-weight:600; margin-bottom:10px; color:var(--ivory); }
.quiz-options{ display:flex; flex-direction:column; gap:8px; }
.quiz-option{
  text-align:left; background:var(--surface-2); border:1px solid var(--line); color:var(--ivory);
  border-radius:6px; padding:10px 12px; font-size:13px; cursor:pointer; font-family:inherit; transition:all .15s ease;
}
.quiz-option:hover:not(:disabled){ border-color:var(--gold); }
.quiz-option:disabled{ cursor:default; opacity:0.65; }
.quiz-correct{ border-color:var(--success) !important; background:var(--success-soft) !important; opacity:1 !important; color:var(--ivory) !important; }
.quiz-wrong{ border-color:var(--danger) !important; background:var(--danger-soft) !important; opacity:1 !important; color:var(--ivory) !important; }
.quiz-feedback{ margin-top:10px; font-size:12.5px; line-height:1.6; color:#D9D3C6; }

/* ---- glossaire interactif (accordéon natif) ---- */
.glossary-item{ border:1px solid var(--line); border-radius:6px; margin-bottom:6px; overflow:hidden; }
.glossary-item summary{
  padding:10px 14px; cursor:pointer; font-size:13.5px; font-weight:600; color:var(--gold);
  list-style:none; display:flex; align-items:center; justify-content:space-between;
}
.glossary-item summary::-webkit-details-marker{ display:none; }
.glossary-item summary::after{ content:"+"; font-family:'IBM Plex Mono', monospace; color:var(--slate); }
.glossary-item[open] summary::after{ content:"−"; }
.glossary-item[open] summary{ border-bottom:1px solid var(--line); }
.glossary-item div{ padding:10px 14px; font-size:13px; color:#D9D3C6; line-height:1.6; }

.mini-table{ width:100%; border-collapse:collapse; margin-top:10px; font-size:13px; }
.mini-table th{ text-align:left; padding:6px 8px; border-bottom:1px solid var(--line); color:var(--gold); }
.mini-table td{ padding:8px; font-family:'IBM Plex Mono', monospace; color:#D9D3C6; }

.placement-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(240px,1fr)); gap:12px; margin-top:14px; }
.tag-good{ font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--success); margin-bottom:4px; }
.tag-bad{ font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--danger); margin-bottom:4px; margin-top:8px; }
.tight{ padding-left:16px; margin:0; font-size:12.5px; color:#D9D3C6; }
.tight li{ margin-bottom:3px; }

.donut-row{ display:flex; gap:20px; align-items:center; }
.legend-row{ display:flex; justify-content:space-between; padding:6px 0; font-size:13px; }
.dot{ width:9px; height:9px; border-radius:50%; display:inline-block; margin-right:8px; }

/* ---- Q&A ---- */
.qa-scroll{ max-height:300px; overflow-y:auto; display:flex; flex-direction:column; gap:10px; margin-bottom:14px; }
.qa-bubble{ max-width:80%; border-radius:8px; padding:9px 12px; border:1px solid var(--line); }
.qa-left{ align-self:flex-start; background: var(--surface-2); }
.qa-right{ align-self:flex-end; background: var(--gold-soft); border-color: var(--line-strong); }
.qa-meta{ font-size:10.5px; color:var(--slate); margin-bottom:4px; text-transform:uppercase; letter-spacing:.05em; }
.qa-text{ font-size:13.5px; line-height:1.5; }
.qa-input-row{ display:flex; gap:8px; flex-wrap:wrap; }

/* ---- formateur ---- */
.client-row{ padding:12px 14px; cursor:pointer; margin-bottom:0; }
.client-row-active{ border-color: var(--gold); }
.admin-header{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:22px; flex-wrap:wrap; gap:14px; }
.admin-header-actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.admin-body-grid{ display:grid; grid-template-columns:230px 1fr; gap:22px; }

/* ---- scrollbars ---- */
::-webkit-scrollbar{ width:8px; }
::-webkit-scrollbar-thumb{ background: var(--line-strong); border-radius:4px; }

/* ---- boot / loading / toast ---- */
.boot-screen{ min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.boot-spinner{ width:28px; height:28px; border-radius:50%; border:2.5px solid var(--line); border-top-color: var(--gold); animation: spin .8s linear infinite; }
.boot-spinner-sm{ width:16px; height:16px; border-width:2px; }
@keyframes spin{ to{ transform: rotate(360deg); } }
.loading-inline{ display:flex; align-items:center; gap:10px; padding:30px 0; }
code{ background: var(--surface-2); border:1px solid var(--line); border-radius:4px; padding:1px 5px; font-family:'IBM Plex Mono', monospace; font-size:12px; }

.toast{ position:fixed; bottom:20px; right:20px; background: var(--surface); border:1px solid var(--line-strong); color: var(--ivory); padding:12px 16px; border-radius:8px; font-size:13px; max-width:320px; opacity:0; transform:translateY(8px); pointer-events:none; transition: all .2s ease; z-index:1000; }
.toast-show{ opacity:1; transform:none; }
.toast-error{ border-color: var(--danger); color:#F3D9D0; }

/* ---- responsive ---- */
@media (max-width: 900px){
  .app-layout, .admin-body-grid, .sim-grid{ grid-template-columns:1fr; }
  .sidebar{ position:relative; height:auto; border-right:none; border-bottom:1px solid var(--line); }
  .content, .sidebar{ height:auto; }
}
