/* ============================================
   EduLink Learning — Design system de l'espace admin et de l'espace étudiant
   Harmonisé avec assets/site.css (pages publiques) : violet profond #35234F,
   violet principal #6338C4, corail #D07B71, lavande #F3EEFC. Typographie : Inter (comme la page d'accueil).
   ============================================ */
/* V14.6 : Inter hébergée sur le site (assets/fonts, licence OFL) au lieu de Google Fonts : aucun appel externe bloquant. */
@font-face { font-family:'Inter'; font-style:normal; font-weight:100 900; font-display:swap;
  src:url('fonts/Inter-latin-var.woff2') format('woff2');
  unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:100 900; font-display:swap;
  src:url('fonts/Inter-latinext-var.woff2') format('woff2');
  unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --mauve:#4B3B63; --navy:#35234F; --ink:#29213D; --mut:#6E6784;
  --blue:#6338C4; --blue-dark:#4A2A9E;
  --gold:#C0675C; --coral:#E5534B; --mint:#17A882;
  --bg:#F7F5FB; --card:#FFFFFF; --line:#E9E4F2; --lav:#F3EEFC;
  --radius:16px;
  --sidebar-w:264px;
  --ease:cubic-bezier(.16,1,.3,1);
}
* { box-sizing:border-box; }
body {
  font-family:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif; background:var(--bg); color:var(--ink);
  margin:0; -webkit-font-smoothing:antialiased; font-variant-numeric:tabular-nums;
}
:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
h1,h2,h3,h4 { font-family:'Inter',system-ui,sans-serif; color:var(--navy); font-weight:700; margin:0; }
a { color:var(--blue); }
code, .mono { font-family:'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.edulink-logo-img { height:72px; width:auto; display:block; }
.admin-menu .brand .edulink-logo-img,
.topbar .brand .edulink-logo-img { height:52px; }

/* ---------- Buttons ---------- */
.btn, .btn-primary, .btn-secondary, button {
  font-family:'Inter',system-ui,sans-serif; font-weight:700; font-size:13.5px; letter-spacing:.01em;
  border-radius:10px; border:none; padding:11px 22px; cursor:pointer; text-decoration:none;
  display:inline-block; position:relative; overflow:hidden; isolation:isolate;
  transition:transform .15s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease;
}
.btn::before, .btn-primary::before, .btn-secondary::before, button::before {
  content:""; position:absolute; inset:0; z-index:-1;
  background:linear-gradient(115deg, transparent 30%, rgba(255,255,255,.35) 48%, rgba(255,255,255,.35) 52%, transparent 70%);
  transform:translateX(-120%); transition:transform .55s ease;
}
.btn:hover::before, .btn-primary:hover::before, .btn-secondary:hover::before, button:hover::before { transform:translateX(120%); }
.btn:active, .btn-primary:active, .btn-secondary:active, button:active { transform:scale(.97); }

.btn-primary, button[type="submit"] {
  background:linear-gradient(135deg, var(--blue), var(--blue-dark)); color:#fff;
  box-shadow:0 6px 16px -6px rgba(99,56,196,.55), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-primary:hover, button[type="submit"]:hover { transform:translateY(-2px); box-shadow:0 12px 24px -8px rgba(99,56,196,.55), inset 0 1px 0 rgba(255,255,255,.2); }
.btn-primary:active, button[type="submit"]:active { transform:translateY(0) scale(.97); box-shadow:0 3px 10px rgba(124,79,160,.35); }

.btn-secondary {
  background:#fff; color:var(--navy); border:1.5px solid var(--line); box-shadow:0 2px 8px rgba(91,74,114,.05);
}
.btn-secondary:hover { transform:translateY(-2px); border-color:var(--blue); box-shadow:0 6px 16px rgba(91,74,114,.12); color:var(--blue); }

.btn-block { width:100%; text-align:center; }
.del-btn, .del-link {
  background:none; border:1.5px solid rgba(255,93,93,.4); color:var(--coral);
  padding:5px 12px; border-radius:9px; font-size:12px; cursor:pointer; font-weight:700;
  transition:background .15s, transform .15s;
}
.del-btn:hover, .del-link:hover { background:rgba(255,93,93,.08); transform:translateY(-1px); }
.link-btn, .edit-link, .preview-link {
  font-size:12px; color:var(--blue); text-decoration:none; font-weight:600; background:none; border:none; cursor:pointer;
}
.archive-btn { border:1px solid rgba(255,93,93,.4); color:var(--coral); background:#fff; }

/* ---------- Cards ---------- */
.card {
  background:var(--card); border:1.5px solid var(--line); border-radius:var(--radius);
  padding:20px 22px; box-shadow:0 4px 16px rgba(91,74,114,.06);
}
.card h3 { margin-top:0; margin-bottom:12px; font-size:16px; }

/* ---------- Stat cards ---------- */
.stat-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px,1fr)); gap:14px; margin-bottom:22px; }
.stat, .stat-card {
  background:#fff; border:1px solid var(--line);
  border-radius:var(--radius); padding:16px 18px; box-shadow:0 1px 2px rgba(91,74,114,.04);
}
.stat .label, .stat-card .label { font-size:13px; color:var(--mut); font-weight:500; }
.stat .val, .stat-card .val { font-weight:700; font-size:1.75rem; line-height:1.2; color:var(--navy); margin-top:4px; letter-spacing:-.01em; }
.stat.green .val { color:#1D7650; }
.stat.red .val { color:#B8323D; }
.stat.orange .val { color:#8A5A00; }

/* ---------- Forms ---------- */
label { display:block; font-size:12px; color:var(--mut); font-weight:600; margin:10px 0 4px; }
input, textarea, select {
  width:100%; padding:9px 11px; border:1.5px solid var(--line); border-radius:12px;
  font-size:13.5px; font-family:'Inter',system-ui,sans-serif; background:#fff; color:var(--ink);
}
input[type="checkbox"], input[type="radio"] { width:auto; }
input:focus, textarea:focus, select:focus { outline:none; border-color:var(--blue); box-shadow:0 0 0 3px rgba(99,56,196,.16); }
/* Chrome colore les champs déjà remplis en jaune — on force notre propre fond */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px #fff inset;
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  transition: background-color 9999s ease-in-out 0s;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:translateY(0); } }
.card { animation: fadeInUp .5s cubic-bezier(.16,1,.3,1) both; }
.stat, .stat-card { animation: fadeInUp .5s cubic-bezier(.16,1,.3,1) both; }
.stat-grid .stat:nth-child(1), .stat-grid .stat-card:nth-child(1) { animation-delay:.02s; }
.stat-grid .stat:nth-child(2), .stat-grid .stat-card:nth-child(2) { animation-delay:.07s; }
.stat-grid .stat:nth-child(3), .stat-grid .stat-card:nth-child(3) { animation-delay:.12s; }
.stat-grid .stat:nth-child(4), .stat-grid .stat-card:nth-child(4) { animation-delay:.17s; }
.stat-grid .stat:nth-child(5), .stat-grid .stat-card:nth-child(5) { animation-delay:.22s; }
.stat-grid .stat:nth-child(6), .stat-grid .stat-card:nth-child(6) { animation-delay:.27s; }

/* Les cartes empilées apparaissent l'une après l'autre */
.card:nth-of-type(1) { animation-delay:.04s; }
.card:nth-of-type(2) { animation-delay:.10s; }
.card:nth-of-type(3) { animation-delay:.16s; }
.card:nth-of-type(4) { animation-delay:.22s; }
.card:nth-of-type(5) { animation-delay:.28s; }

/* Cartes : léger soulèvement au survol */
.card { transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s ease; }
.card:hover { transform:translateY(-3px); box-shadow:0 14px 32px rgba(75,59,99,.12); }
.stat, .stat-card { transition: transform .2s cubic-bezier(.16,1,.3,1), box-shadow .2s ease; }
.stat:hover, .stat-card:hover { transform:translateY(-3px); box-shadow:0 12px 26px rgba(75,59,99,.14); }

/* Barres de progression : remplissage fluide + reflet qui balaie */
.bar-bg { position:relative; overflow:hidden; }
.bar-fill { transition: width 1s cubic-bezier(.16,1,.3,1); position:relative; overflow:hidden; }
.bar-fill::after {
  content:""; position:absolute; inset:0;
  background:linear-gradient(100deg, transparent 20%, rgba(255,255,255,.45) 50%, transparent 80%);
  transform:translateX(-100%); animation: barShimmer 2.6s ease-in-out .4s 2;   /* V7.5 : deux passages, plus de boucle permanente */
}
@keyframes barShimmer { 0% { transform:translateX(-100%); } 60%, 100% { transform:translateX(200%); } }

tr { transition: background-color .12s; }
.cours-item, .sidebar-item, .msg { transition: transform .18s cubic-bezier(.16,1,.3,1), border-color .2s, box-shadow .2s; }
.cours-item:hover:not(.locked) { transform:translateY(-2px); box-shadow:0 8px 22px rgba(75,59,99,.12); }

/* Titres de section : petit trait animé au survol de la carte */
.card h3 { position:relative; display:inline-block; padding-bottom:3px; }
.card h3::after {
  content:""; position:absolute; left:0; bottom:0; height:2px; width:0;
  background:linear-gradient(90deg, var(--blue), var(--gold)); border-radius:2px;
  transition: width .4s cubic-bezier(.16,1,.3,1);
}
.card:hover h3::after { width:100%; }

@keyframes ctaPulse {
  0%, 100% { box-shadow:0 4px 14px rgba(124,79,160,.3); }
  50% { box-shadow:0 4px 22px rgba(124,79,160,.55); }
}
.auth-card button[type="submit"] { animation: ctaPulse 2.4s ease-in-out 2; }   /* V7.5 : deux pulsations puis repos */
.auth-card button[type="submit"]:hover { animation:none; }

/* Respecte le réglage système "réduire les animations" */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}

/* ---------- Tables ---------- */
table { border-collapse:separate; border-spacing:0; width:100%; font-size:13px; background:#fff; border-radius:var(--radius); overflow:hidden; box-shadow:0 4px 16px rgba(91,74,114,.06); }
th, td { padding:11px 12px; text-align:left; border-bottom:1px solid var(--line); }
th { background:#F5F1FC; color:var(--navy); font-family:'Inter',system-ui,sans-serif; font-weight:600; font-size:12px; letter-spacing:.03em; text-transform:uppercase; }
tr:last-child td { border-bottom:none; }
tr:hover td { background:#FBF9FE; }

/* ---------- Badges / pills ---------- */
.badge, .pill { display:inline-block; padding:4px 10px; border-radius:100px; font-size:12px; font-weight:700; white-space:nowrap; }
.badge-Payé, .pill-Payé { background:rgba(23,184,144,.12); color:#0D8A6A; }
.badge-Versement, .pill-Versement { background:rgba(255,201,60,.18); color:#8A6A10; }
.badge-Non, .pill-Non { background:rgba(255,93,93,.12); color:#C23B3B; }
.badge-Formation, .pill-Formation { background:#F3E9F5; color:var(--mut); }

/* ---------- Bars ---------- */
.bar-bg { background:#EEE8F8; border-radius:100px; height:9px; overflow:hidden; }
.bar-fill { background:linear-gradient(90deg, var(--mint), #21D6A8); height:100%; }

/* ---------- Auth cards ---------- */
.auth-card, .card.auth-card { max-width:400px; margin:0 auto; }

/* ---------- Misc ---------- */
.error, .alert-error { color:var(--coral); font-size:13px; margin-top:8px; font-weight:600; }
.success, .alert-success { color:#0D8A6A; font-size:13px; margin-top:8px; font-weight:600; }


/* Espace administrateur (barre latérale, tableaux, badges de rôle, responsive) :
   voir assets/admin.css, chargé uniquement par les pages de gestion. */
.two-col > *, .grid > *, .layout > *, .grid2 > * { min-width:0; }
svg.ic { width:1.15em; height:1.15em; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
