:root {
  --font-title: 'Baloo 2', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bg: #fff7ec;
  --ink: #2b2240;
  --ink-soft: #5f5675;
  --white: #ffffff;
  --wa: #25d366;
  --wa-dark: #128c4a;
  --accent: #ff7a59;
  --radius: 22px;
  --shadow: 0 10px 30px -12px rgba(73, 45, 20, 0.22);
  --shadow-hover: 0 18px 40px -14px rgba(73, 45, 20, 0.32);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

/* Décor : taches de couleur douces */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.55; }
.b1 { width: 420px; height: 420px; background: #ffd27a; top: -140px; left: -120px; }
.b2 { width: 380px; height: 380px; background: #b9e8ff; top: 10%; right: -140px; }
.b3 { width: 460px; height: 460px; background: #ffc9de; bottom: -200px; left: 30%; opacity: 0.4; }

.container { max-width: 1100px; margin: 0 auto; padding: 2.5rem 1.25rem 3rem; }

/* En-tête */
.hero { text-align: center; padding: 1rem 0 2rem; }

.hero-badge {
  display: inline-block;
  background: var(--white);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  margin-bottom: 0.9rem;
}

.hero-school {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(1.15rem, 3.5vw, 1.4rem);
  color: var(--ink);
  margin-bottom: 0.6rem;
}

.hero h1 {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: clamp(2.3rem, 7vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, #ff7a59, #f5468e 45%, #7b5cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead { max-width: 640px; margin: 0 auto 1.75rem; font-size: 1.1rem; color: var(--ink-soft); }

.hero-cta {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  background: var(--ink);
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease);
}
.hero-cta:hover { transform: translateY(-2px); }

/* Étapes */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0 3rem;
}
.step {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  font-weight: 600;
}
.step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--white);
  background: var(--accent);
}
.step:nth-child(2) .step-num { background: #f5468e; }
.step:nth-child(3) .step-num { background: #7b5cff; }

/* Niveaux */
.level { margin-bottom: 3rem; }
.level-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.25rem; }
.level-emoji {
  font-size: 1.9rem;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  background: var(--white);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.level-head h2 { font-family: var(--font-title); font-size: 1.9rem; line-height: 1.1; }
.level-head p { color: var(--ink-soft); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; }

/* Cartes de classe */
.card {
  --tint: #ffe3ec;
  --deep: #d6336c;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.3rem 1.3rem 1.2rem;
  box-shadow: var(--shadow);
  border-top: 6px solid var(--deep);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.c-pink   { --tint: #ffe3ec; --deep: #e64980; }
.c-orange { --tint: #ffe8d6; --deep: #f76707; }
.c-yellow { --tint: #fff3bf; --deep: #e0a800; }
.c-green  { --tint: #d3f9d8; --deep: #2f9e44; }
.c-teal   { --tint: #c3fae8; --deep: #0ca678; }
.c-sky    { --tint: #d0f0ff; --deep: #1c9bd8; }
.c-blue   { --tint: #dbe4ff; --deep: #3b5bdb; }
.c-violet { --tint: #e5dbff; --deep: #7048e8; }
.c-purple { --tint: #f3d9fa; --deep: #ae3ec9; }
.c-rose   { --tint: #ffdede; --deep: #e03131; }

.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.card-emoji {
  font-size: 1.7rem;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--tint);
}
.card-label {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--deep);
}
.card-teacher { font-size: 1.05rem; }
.card-name { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 1.1rem; }

.card-actions { margin-top: auto; display: flex; flex-direction: column; gap: 0.55rem; }

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: none;
  border-radius: 14px;
  padding: 0.85rem 1.1rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s var(--ease), background 0.2s;
}
.btn:hover { transform: translateY(-1px); }

.btn-wa { background: var(--wa); color: #06361b; box-shadow: 0 8px 20px -8px rgba(37, 211, 102, 0.7); }
.btn-wa:hover { background: #2fe076; }
.btn-wa svg { width: 20px; height: 20px; fill: currentColor; }

.btn-primary { background: var(--ink); color: var(--white); width: 100%; }
.btn-light { background: var(--white); color: var(--ink); }

.mini-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.btn-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: var(--tint);
  color: var(--ink);
  border: none;
  border-radius: 12px;
  padding: 0.55rem 0.5rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.2s;
}
.btn-mini:hover { filter: brightness(0.96); }

.status {
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  font-weight: 600;
  font-size: 0.92rem;
  text-align: center;
}
.status-soon { background: var(--tint); color: var(--ink); }
.status-new { background: #f4f1ea; color: var(--ink-soft); border: 2px dashed #e2dccf; }

/* Charte */
.charter {
  background: var(--white);
  border-radius: 28px;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}
.charter h2 { font-family: var(--font-title); font-size: 1.6rem; margin-bottom: 1.25rem; text-align: center; }
.charter ul { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.charter li { display: flex; gap: 0.8rem; align-items: flex-start; background: #fffaf2; border-radius: 16px; padding: 1rem; }
.charter li span { font-size: 1.5rem; line-height: 1; }
.charter li p { color: var(--ink-soft); font-size: 0.95rem; }
.charter li strong { color: var(--ink); }

/* Partage */
.share {
  text-align: center;
  border-radius: 28px;
  padding: 2.25rem 1.5rem;
  color: var(--white);
  background: linear-gradient(135deg, #ff7a59, #f5468e 55%, #7b5cff);
  box-shadow: var(--shadow);
}
.share h2 { font-family: var(--font-title); font-size: 1.9rem; margin-bottom: 0.4rem; }
.share p { max-width: 560px; margin: 0 auto 1.4rem; opacity: 0.95; }
.share-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem; }

.site-footer { text-align: center; margin-top: 2.5rem; color: var(--ink-soft); font-size: 0.9rem; }
.site-footer a { font-weight: 600; }

.load-error { text-align: center; background: var(--white); border-radius: var(--radius); padding: 2rem; }

/* Fenêtre QR code */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 34, 64, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s;
  z-index: 50;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-box {
  background: var(--white);
  border-radius: 26px;
  padding: 1.75rem;
  width: 100%;
  max-width: 340px;
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.3s var(--ease);
}
.modal-overlay.open .modal-box { transform: scale(1); }
.modal-title { font-family: var(--font-title); font-size: 1.5rem; }
.modal-desc { color: var(--ink-soft); font-size: 0.92rem; margin: 0.3rem 0 1.2rem; }
.qr-display { display: flex; justify-content: center; padding: 0.75rem; background: #fffaf2; border-radius: 18px; margin-bottom: 1.2rem; }
.qr-display img, .qr-display canvas { border-radius: 6px; }

/* Notifications */
.toast-container { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  background: var(--ink);
  color: var(--white);
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s var(--ease);
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 720px) {
  .container { padding-top: 1.75rem; }
  .steps { grid-template-columns: 1fr; gap: 0.6rem; margin-bottom: 2.25rem; }
  .charter ul { grid-template-columns: 1fr; }
  .charter { padding: 1.5rem 1.1rem; }
  .share-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Parents délégués */
.delegates {
  background: var(--white);
  border-radius: 28px;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  text-align: center;
}
.delegates h2 { font-family: var(--font-title); font-size: 1.8rem; margin-bottom: 0.4rem; }
.delegates-lead { color: var(--ink-soft); max-width: 600px; margin: 0 auto 1.4rem; }

.tabs { display: inline-flex; background: #f4f1ea; border-radius: 999px; padding: 0.3rem; gap: 0.25rem; margin-bottom: 1.5rem; }
.tab {
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink-soft);
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.tab.active { background: var(--white); color: var(--ink); box-shadow: 0 4px 12px -6px rgba(73, 45, 20, 0.3); }

.people-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 0.5rem 0 1rem;
}
.people {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem 0.75rem;
  margin-bottom: 1.5rem;
}
.person { width: 135px; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--white);
  box-shadow: 0 0 0 4px var(--white), 0 8px 18px -8px rgba(73, 45, 20, 0.45);
}
.person-name { font-weight: 700; }
.person-classes { font-size: 0.82rem; color: var(--ink-soft); background: #fffaf2; border-radius: 999px; padding: 0.15rem 0.6rem; white-space: nowrap; }

.person.is-soon .avatar { background: #f4f1ea; color: #b8af9e; border: 2px dashed #e2dccf; box-shadow: none; }
.person.is-soon .person-name { color: var(--ink-soft); font-weight: 600; }


/* Formulaires pour écrire aux délégués */
.msg-forms { margin-top: 0.5rem; }
.msg-form {
  text-align: left;
  background: #fffaf2;
  border-radius: 22px;
  padding: 1.5rem;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  border: 2px solid #ffe3c2;
}
.msg-form[data-level="maternelle"] { background: #fff5f8; border-color: #ffd3e2; }
.msg-form[hidden] { display: none; }
.msg-form h3 { font-family: var(--font-title); font-size: 1.4rem; line-height: 1.2; }
.msg-sub { color: var(--ink-soft); font-size: 0.92rem; margin-top: -0.6rem; }
.msg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.msg-form label { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; font-size: 0.9rem; }
.msg-form input, .msg-form select, .msg-form textarea {
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: var(--white);
  border: 2px solid #eee6da;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  width: 100%;
}
.msg-form textarea { resize: vertical; }
.msg-form input:focus, .msg-form select:focus, .msg-form textarea:focus { outline: none; border-color: var(--accent); }
.msg-form .btn-primary { width: auto; align-self: flex-start; }
.msg-form .btn-primary:disabled { opacity: 0.6; cursor: wait; }
.msg-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.msg-status { font-weight: 600; font-size: 0.95rem; min-height: 1.2em; }
.msg-status.is-ok { color: #2f9e44; }
.msg-status.is-error { color: #e03131; }
button.btn-help { width: 100%; }

@media (max-width: 720px) {
  .msg-grid { grid-template-columns: 1fr; }
  .msg-form { padding: 1.1rem; }
  .msg-form .btn-primary { width: 100%; }
}
