/* mharzi.ma — feuille de style commune (pages publiques, espace élèves, administration).
   Polices système uniquement ; mathématiques en serif. Palette : marine #1e2761 / #141c4a, or #fcd34d → #d4a017, cyan #38bdf8. */
:root {
  --marine: #1e2761;
  --marine-fonce: #141c4a;
  --marine-clair: #26357f;
  --or: #d4a017;
  --or-clair: #fcd34d;
  --or-texte: #8a6a0a;        /* or lisible sur fond clair (contraste ≥ 4.5) */
  --or-pale: #e9c46a;
  --cyan: #38bdf8;
  --cyan-fonce: #0369a1;
  --fond: #fbfaf6;
  --carte: #ffffff;
  --texte: #1f2433;
  --texte-doux: #4b5368;
  --bord: #e3e1d8;
  --vert: #15803d;
  --vert-pale: #e7f6ec;
  --rouge: #b42318;
  --rouge-pale: #fdecea;
  --orange: #b45309;
  --orange-pale: #fff4e0;
  --rayon: 14px;
  --ombre: 0 10px 30px rgba(20, 28, 74, .08);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Cambria Math", "STIX Two Math", "Latin Modern Math", Cambria, Georgia, "Times New Roman", serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.6; color: var(--texte); background: var(--fond); }
img, svg { max-width: 100%; }
a { color: var(--marine-clair); }
a:hover { color: var(--marine); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; color: var(--marine); margin: 0 0 .6em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.math { font-family: var(--serif); font-style: italic; }
.cache { display: none !important; }
.visuel-masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.conteneur { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.lien-evitement { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.lien-evitement:focus { left: 8px; }

/* ---------- en-tête ---------- */
.entete { position: sticky; top: 0; z-index: 50; background: rgba(251, 250, 246, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--bord); }
.entete .conteneur { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.logo img { height: 44px; width: auto; display: block; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { text-decoration: none; color: var(--marine); font-weight: 600; padding: 8px 10px; border-radius: 10px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { background: #efeee6; }
/* le bouton « Espace élèves » du menu garde son style de bouton (texte blanc sur bleu nuit) */
.nav a.btn-marine, .nav a.btn-marine:hover { color: #fff; }
.nav a.btn-marine:hover { background: #2a3a8f; }
.nav .btn { margin-left: 6px; }
.menu-bouton { display: none; background: none; border: 1px solid var(--bord); border-radius: 10px; padding: 8px 12px; font-size: 1rem; color: var(--marine); }
@media (max-width: 820px) {
  .menu-bouton { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--fond); border-bottom: 1px solid var(--bord); padding: 8px 16px 16px; }
  .nav.ouvert { display: flex; }
  .nav .btn { margin: 6px 0 0; }
  .logo img { height: 38px; }
}

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 2px solid transparent;
  font: 700 1rem var(--sans); text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn-or { background: linear-gradient(180deg, var(--or-clair), var(--or)); color: var(--marine-fonce); box-shadow: 0 6px 16px rgba(212, 160, 23, .35); }
.btn-or:hover { color: var(--marine-fonce); box-shadow: 0 8px 22px rgba(212, 160, 23, .45); }
.btn-marine { background: var(--marine); color: #fff; }
.btn-marine:hover { background: var(--marine-fonce); color: #fff; }
.btn-contour { background: transparent; color: var(--marine); border-color: var(--marine); }
.btn-contour-clair { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .7); }
.btn-contour-clair:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.btn-discret { background: #efeee6; color: var(--marine); }
.btn-danger { background: var(--rouge); color: #fff; }
.btn-petit { min-height: 36px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- héros ---------- */
.heros { position: relative; overflow: hidden; color: #fff; background: radial-gradient(1200px 500px at 80% -10%, #2c3c8f 0%, transparent 60%), linear-gradient(160deg, var(--marine-clair), var(--marine) 45%, var(--marine-fonce)); }
.heros .conteneur { position: relative; z-index: 2; padding-top: clamp(48px, 10vw, 110px); padding-bottom: clamp(56px, 10vw, 120px); }
.heros-logo { height: 64px; width: auto; margin-bottom: 26px; }
.heros h1 { color: #fff; font-family: var(--serif); font-weight: 700; font-size: clamp(2rem, 6.4vw, 3.6rem); max-width: 15ch; margin-bottom: .35em; }
.heros h1 em { color: var(--or-clair); font-style: italic; }
.heros p { font-size: clamp(1.05rem, 2.4vw, 1.25rem); color: #dfe4ff; max-width: 40ch; }
.heros .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.heros-formule { margin-top: 36px; font-family: var(--serif); color: var(--or-pale); font-size: 1.15rem; opacity: .9; }
.decor { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.decor svg.courbes { position: absolute; inset: 0; width: 100%; height: 100%; }
.courbes path { fill: none; stroke-width: 2; stroke-linecap: round; }
.courbes .c1 { stroke: var(--cyan); stroke-opacity: .28; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: tracer 9s ease-out forwards; }
.courbes .c2 { stroke: var(--or-clair); stroke-opacity: .22; stroke-dasharray: 1600; stroke-dashoffset: 1600; animation: tracer 12s 1s ease-out forwards; }
.courbes .grille { stroke: #fff; stroke-opacity: .05; stroke-width: 1; }
.sym { position: absolute; font-family: var(--serif); color: #fff; opacity: .08; user-select: none; animation: flotter 14s ease-in-out infinite alternate; }
.sym:nth-child(2) { top: 12%; left: 62%; font-size: 92px; }
.sym:nth-child(3) { top: 58%; left: 84%; font-size: 120px; animation-delay: -3s; }
.sym:nth-child(4) { top: 72%; left: 52%; font-size: 64px; animation-delay: -6s; }
.sym:nth-child(5) { top: 22%; left: 88%; font-size: 54px; animation-delay: -2s; }
.sym:nth-child(6) { top: 6%; left: 40%; font-size: 48px; animation-delay: -8s; }
.sym:nth-child(7) { top: 80%; left: 8%; font-size: 70px; animation-delay: -5s; }
.sym:nth-child(8) { top: 40%; left: 72%; font-size: 40px; color: var(--or-clair); opacity: .16; }
.sym:nth-child(9) { top: 86%; left: 74%; font-size: 44px; color: var(--cyan); opacity: .18; animation-delay: -4s; }
@keyframes tracer { to { stroke-dashoffset: 0; } }
@keyframes flotter { from { transform: translateY(0) rotate(0); } to { transform: translateY(-18px) rotate(4deg); } }
@media (max-width: 640px) { .sym:nth-child(2), .sym:nth-child(6), .sym:nth-child(8) { display: none; } }
@media (prefers-reduced-motion: reduce) { .sym, .courbes path { animation: none; stroke-dashoffset: 0; } html { scroll-behavior: auto; } }

/* ---------- sections ---------- */
.section { position: relative; padding: clamp(48px, 8vw, 88px) 0; }
.section-alt { background: #f3f1e8; }
.surtitre { display: inline-block; font-size: .8rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--or-texte); margin-bottom: 8px; }
.filigrane { position: absolute; right: 4%; top: 18px; font-family: var(--serif); font-size: clamp(80px, 16vw, 180px); color: var(--marine); opacity: .04; pointer-events: none; user-select: none; }
.grille-2 { display: grid; gap: 28px; grid-template-columns: 1fr; }
.grille-3 { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grille-2 { grid-template-columns: 1.1fr .9fr; align-items: start; } .grille-3 { grid-template-columns: repeat(3, 1fr); } }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 22px; box-shadow: var(--ombre); }
.carte h3 { display: flex; align-items: center; gap: 10px; }
.puce-math { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--marine); color: var(--or-clair); font-family: var(--serif); font-size: 1.3rem; flex: none; }
.texte-bio p { font-size: 1.06rem; }
.citation { border-left: 4px solid var(--or); padding: 6px 0 6px 16px; font-family: var(--serif); font-style: italic; color: var(--texte-doux); font-size: 1.1rem; }
.niveaux { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 22px; padding: 0; list-style: none; }
.niveaux li { background: #fff; border: 1px solid var(--bord); border-radius: 999px; padding: 6px 14px; font-weight: 700; color: var(--marine); }
.etapes { counter-reset: etape; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.etapes li { counter-increment: etape; position: relative; padding: 14px 16px 14px 58px; background: #fff; border: 1px solid var(--bord); border-radius: 12px; }
.etapes li::before { content: counter(etape); position: absolute; left: 14px; top: 12px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--marine); color: var(--or-clair); font-weight: 800; }

/* ---------- tableaux ---------- */
.tableau-defile { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--bord); border-radius: 12px; background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--bord); vertical-align: top; }
th { background: #f6f5ef; color: var(--marine); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.vide { color: var(--texte-doux); font-style: italic; padding: 14px; }

/* ---------- formulaires ---------- */
.formulaire { display: grid; gap: 14px; }
.champ label, .champ legend { display: block; font-weight: 700; font-size: .92rem; color: var(--marine); margin-bottom: 4px; }
.champ .aide { font-size: .85rem; color: var(--texte-doux); margin-top: 4px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], input[type="date"], input[type="time"],
input[type="datetime-local"], select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--texte); background: #fff; border: 2px solid #d4d2c8; border-radius: 10px; padding: 10px 12px; min-height: 46px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--marine-clair); outline: none; box-shadow: 0 0 0 3px rgba(56, 189, 248, .25); }
fieldset { border: 0; padding: 0; margin: 0; }
.case { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.case input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--marine); }
.choix-ligne { display: flex; flex-wrap: wrap; gap: 10px; }
.choix-ligne label { display: flex; gap: 8px; align-items: center; background: #fff; border: 2px solid #d4d2c8; border-radius: 10px; padding: 8px 12px; font-weight: 600; color: var(--texte); }
.ligne-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .ligne-2 { grid-template-columns: 1fr 1fr; } }
.pot-de-miel { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.message { border-radius: 10px; padding: 12px 14px; font-weight: 600; }
.message:empty { display: none; }
.message.ok { background: var(--vert-pale); color: var(--vert); }
.message.erreur { background: var(--rouge-pale); color: var(--rouge); }
.message.info { background: #e8f4fd; color: var(--cyan-fonce); }

/* ---------- pied de page ---------- */
.pied { background: var(--marine-fonce); color: #c9d0f0; padding: 36px 0 28px; font-size: .92rem; }
.pied .conteneur { display: grid; gap: 18px; }
.pied img { height: 40px; width: auto; }
.pied a { color: var(--or-pale); }
.pied nav { display: flex; flex-wrap: wrap; gap: 14px; }
.pied .droits { border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 14px; color: #aab3dc; }
@media (min-width: 760px) { .pied .conteneur { grid-template-columns: 1fr auto; align-items: center; } .pied .droits { grid-column: 1 / -1; } }

/* ---------- pages simples ---------- */
.page-texte { max-width: 780px; }
.page-texte h2 { font-size: 1.35rem; margin-top: 1.6em; }
.page-texte li { margin-bottom: .4em; }
.badge { display: inline-block; font-size: .78rem; font-weight: 800; border-radius: 999px; padding: 2px 10px; background: #efeee6; color: var(--marine); white-space: nowrap; }
.badge.vert { background: var(--vert-pale); color: var(--vert); }
.badge.rouge { background: var(--rouge-pale); color: var(--rouge); }
.badge.orange { background: var(--orange-pale); color: var(--orange); }
.badge.bleu { background: #e8f4fd; color: var(--cyan-fonce); }
.badge.or { background: #fbf1cf; color: var(--or-texte); }

/* ---------- compléments de l'accueil ---------- */
@media (min-width: 760px) { .grille-3.grille-1col { grid-template-columns: 1fr; } }
.coordonnees { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.coordonnees li { display: flex; gap: 10px; align-items: center; }
.coordonnees .puce-math { width: 32px; height: 32px; font-size: 1rem; border-radius: 10px; }
.actions-soutien { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.edt-groupe { margin-bottom: 14px; }
.edt-groupe h4 { margin: 0 0 6px; color: var(--marine); font-size: 1rem; }

.filigrane-404 { font-size: clamp(2rem, 8vw, 4rem); color: var(--marine); opacity: .25; margin: 0; }
