/* ============================
   VARIABLES — palette reprise du logo MathsMDE (identique au reste du site)
============================ */
:root {
  --bleu-clair: #d0e4ff;
  --bleu-accent: #7fb3ff;
  --bleu-primaire: #0050a0;
  --bleu-fonce: #003a80;
  --bleu-marine: #002a60;
  --bleu-nuit: #001a40;

  --bg: #f4f8ff;
  --text: #1c2b3a;
  --text-muted: #5b6b7d;
  --card-bg: #fff;
  --shadow: rgba(0, 42, 96, 0.10);
  --shadow-strong: rgba(0, 42, 96, 0.18);
  --radius: 18px;
  --danger: #dc2626;
}

/* ============================
   RESET & BASE
============================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: hidden; width: 100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(circle at 15% 0%, var(--bleu-clair) 0%, transparent 45%),
    radial-gradient(circle at 100% 20%, #eaf2ff 0%, transparent 40%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
}

img, svg { max-width: 100%; height: auto; }
h1, h2, h3, .brand-text { font-family: 'Lexend', 'Inter', sans-serif; color: var(--bleu-fonce); }
a { color: var(--bleu-primaire); }
a:hover { color: var(--bleu-fonce); }

/* ============================
   HEADER (identique au reste du site)
============================ */
header {
  position: fixed; top: 0; left: 0; right: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border-bottom: 1px solid rgba(0, 58, 128, 0.08);
  box-shadow: 0 2px 20px rgba(0, 42, 96, 0.06);
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; z-index: 100;
}
header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
  background: linear-gradient(90deg, var(--bleu-fonce), var(--bleu-accent), var(--bleu-clair));
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-text {
  font-size: 20px; font-weight: 700; color: var(--bleu-fonce);
  display: flex; flex-direction: column; line-height: 1.15;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand-text small {
  font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 500;
  color: var(--text-muted); letter-spacing: 0.02em;
}
.logo img { height: 52px; width: auto; filter: drop-shadow(0 3px 8px rgba(0, 58, 128, 0.25)); }
.badge-ens {
  background: linear-gradient(135deg, var(--bleu-primaire), var(--bleu-fonce));
  color: #fff; padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; box-shadow: 0 4px 12px var(--shadow-strong);
  letter-spacing: 0.02em;
}

/* ============================
   MENU BOUTON + LATERAL (identique au reste du site)
============================ */
.menu-button {
  width: 44px; height: 44px; border-radius: 999px; border: none;
  background: linear-gradient(135deg, var(--bleu-primaire), var(--bleu-fonce));
  color: #fff; font-size: 20px; cursor: pointer;
  box-shadow: 0 6px 16px var(--shadow-strong); transition: transform 0.15s ease;
}
.menu-button:hover { transform: scale(1.06); }

#side-menu-overlay {
  position: fixed; inset: 0; background: rgba(0, 26, 64, 0.35);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease; z-index: 98;
}
#side-menu-overlay.visible { opacity: 1; pointer-events: auto; }

#side-menu {
  position: fixed; top: 0; right: -300px; width: 280px; height: 100vh;
  background: #fff; box-shadow: -8px 0 30px var(--shadow-strong);
  transition: right 0.3s cubic-bezier(.25,.8,.25,1);
  padding: 100px 20px 24px; z-index: 99;
}
#side-menu.open { right: 0; }
#side-menu nav a {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; margin-bottom: 4px;
  text-decoration: none; color: var(--text); font-size: 15px; font-weight: 500;
  border-radius: 12px; transition: background 0.15s ease, color 0.15s ease;
}
#side-menu nav a .ic { font-size: 18px; }
#side-menu nav a:hover { background: var(--bleu-clair); color: var(--bleu-fonce); }
.side-menu-sep { height: 1px; background: #e6edf7; margin: 12px 4px; }

/* ============================
   MAIN / LAYOUT
============================ */
.wrap { flex: 1; padding: 130px 20px 40px; max-width: 960px; width: 100%; margin: 0 auto; }

.hero { text-align: center; padding: 20px 1rem 40px; }
.hero h1 { font-size: 2.2rem; margin-bottom: 10px; }
.lead { color: var(--text-muted); font-size: 1.05rem; text-align: center; margin-bottom: 10px; }

h1 { font-size: 28px; font-weight: 800; margin-bottom: 14px; }
h2 { font-size: 19px; font-weight: 700; margin: 4px 0 10px; }
h3 { font-size: 16px; font-weight: 700; }
.muted { color: var(--text-muted); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* ============================
   CARTES
============================ */
.card {
  background: var(--card-bg);
  border: 1px solid rgba(0, 58, 128, 0.06);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: 0 10px 28px var(--shadow);
}

/* ============================
   FORMULAIRES
============================ */
.form label { display: block; margin: 14px 0 0; font-weight: 600; font-size: 14px; color: var(--text); }
.form label:first-of-type { margin-top: 4px; }
.form input, .form textarea, .form select {
  width: 100%; padding: 11px 14px; margin-top: 6px;
  border: 1.5px solid #dde6f3; border-radius: 12px;
  font: inherit; background: #fff; color: var(--text);
  transition: border-color 0.15s ease;
}
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-color: var(--bleu-primaire); }
.form textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.95rem; }

/* ============================
   BOUTONS
============================ */
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 999px;
  border: 1.5px solid var(--bleu-primaire); background: #fff; color: var(--bleu-primaire);
  cursor: pointer; text-decoration: none; font: inherit; font-weight: 600; font-size: 14px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--bleu-clair); }
.btn-primary {
  background: linear-gradient(135deg, var(--bleu-primaire), var(--bleu-fonce));
  color: #fff; border: none; box-shadow: 0 8px 20px var(--shadow-strong);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px var(--shadow-strong); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; }

/* ============================
   MESSAGES FLASH
============================ */
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; }
.flash.success { background: #dcfce7; border: 1px solid #86efac; color: #15803d; }
.flash.error { background: #fee2e2; border: 1px solid #fca5a5; color: #b91c1c; }

/* ============================
   BADGES / RESUME / MESSAGES ELEVE-PROF
============================ */
.badge {
  background: var(--bleu-clair); color: var(--bleu-fonce);
  padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.resume {
  background: #f7faff; border: 1px solid #e6edf7; border-radius: 14px;
  padding: 16px 18px; min-height: 2.5rem;
}
.msg { padding: 14px 16px; border-radius: 14px; margin: 10px 0; }
.msg-eleve { background: #f4f6fa; border-left: 4px solid #9ca3af; }
.msg-prof { background: var(--bleu-clair); border-left: 4px solid var(--bleu-primaire); }
.msg-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; font-size: 14px; }
.msg-body { white-space: normal; }

/* ============================
   TABLEAU (espace prof)
============================ */
.table {
  width: 100%; border-collapse: collapse;
  background: #fff; border: 1px solid rgba(0, 58, 128, 0.06);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 6px 18px var(--shadow);
}
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #eef2f8; vertical-align: top; }
.table thead { background: var(--bleu-clair); color: var(--bleu-fonce); }
.table thead th { font-weight: 700; }

.preview-block { margin-top: 18px; padding-top: 18px; border-top: 1px dashed #dde6f3; }

/* ============================
   FOOTER
============================ */
.foot { border-top: 1px solid #e6edf7; padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
.foot p { margin-bottom: 4px; }

code { background: var(--bleu-clair); color: var(--bleu-fonce); padding: 2px 6px; border-radius: 6px; font-size: 0.9em; }

@media (max-width: 600px) {
  .wrap { padding: 120px 14px 30px; }
  .table { display: block; overflow-x: auto; }
}
