@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  --primary: #6C5CE7;
  --primary-light: #a29bfe;
  --primary-dark: #4834d4;
  --coral: #FF6B6B;
  --teal: #00B894;
  --yellow: #FDCB6E;
  --blue: #74B9FF;
  --bg: #F8F6FF;
  --card: #FFFFFF;
  --text: #2D3436;
  --text-light: #636e72;
  --border: #e0d9ff;
  --shadow: 0 4px 20px rgba(108, 92, 231, 0.12);
  --shadow-lg: 0 8px 40px rgba(108, 92, 231, 0.2);
  --radius: 20px;
  --radius-sm: 12px;
}

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

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ============================================================
   ACCUEIL — Sélection de profil
   ============================================================ */

.accueil-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  background:
    radial-gradient(circle at 15% 10%, rgba(162,155,254,0.20), transparent 45%),
    radial-gradient(circle at 85% 6%, rgba(255,154,158,0.18), transparent 42%),
    linear-gradient(160deg, #f3f0ff 0%, #fbeef3 50%, #e8f8f1 100%);
}

.logo-elyo {
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -1px;
  margin-bottom: 6px;
}

.logo-elyo span { color: var(--coral); }

.tagline {
  color: var(--text-light);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 40px;
}

.profils-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  max-width: 700px;
  margin-bottom: 40px;
}

.profil-card {
  width: 160px;
  height: 190px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
  background: white;
  border: 3px solid transparent;
}

.profil-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: var(--shadow-lg);
}

.profil-card:active { transform: scale(0.97); }

.profil-card-add {
  background: #faf8ff;
  border: 3px dashed #c9bdf2;
  box-shadow: none;
}
.profil-card-add:hover {
  background: #f1ecff;
  border-color: #6C5CE7;
}
.profil-add-plus {
  font-size: 3.4rem;
  font-weight: 800;
  line-height: 1;
  color: #6C5CE7;
  margin-bottom: 8px;
}
.profil-add-label {
  font-size: 1rem;
  font-weight: 800;
  color: #6C5CE7;
  text-align: center;
  padding: 0 10px;
}

.profil-emoji {
  font-size: 3.5rem;
  margin-bottom: 10px;
}

.profil-nom {
  font-size: 1.2rem;
  font-weight: 800;
  color: white;
  text-align: center;
  padding: 0 10px;
}

.profil-badge {
  margin-top: 6px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.8);
  font-weight: 600;
}

.btn-admin {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: white;
  color: var(--text-light);
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 10px 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.btn-admin:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ============================================================
   ENFANT HOME — Tableau de bord enfant
   ============================================================ */

.enfant-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;     /* autant de lignes que nécessaire — défilement si besoin */
  /* Fond pastel doux multi-teintes (inspiré Pictoly) */
  background:
    radial-gradient(circle at 12% 8%, rgba(162,155,254,0.18), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(255,154,158,0.16), transparent 40%),
    linear-gradient(160deg, #f3f0ff 0%, #fbeef3 50%, #e8f8f1 100%);
}

.enfant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 16px rgba(108,92,231,0.08);
}

/* Halo doux derrière l'avatar / emoji du header */
.header-profil .header-emoji,
.header-profil > img {
  position: relative;
  background: radial-gradient(circle at 50% 45%, #ffffff 0%, #efe9ff 70%, rgba(239,233,255,0) 100%);
  border-radius: 50%;
  padding: 4px;
}

.header-profil {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-emoji { font-size: 2rem; }

.header-bonjour {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 600;
}

.header-prenom {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
}

.btn-retour {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 8px 16px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-light);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-retour:hover { border-color: var(--primary); color: var(--primary); }

.modules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 30px 24px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.module-card {
  border-radius: 24px;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
  min-height: 170px;
  text-align: center;
  color: white;
}

.module-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.module-card:active { transform: scale(0.96); }

.module-icon { font-size: 3.5rem; margin-bottom: 12px; }

.module-picto {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.35) 65%, rgba(255,255,255,0) 100%);
  margin-bottom: 12px;
  padding: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}

.module-label {
  font-size: 1.15rem;
  font-weight: 900;
  color: white;
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Bannière de bienvenue chaleureuse (accueil enfant) */
/* La question, sans encadré : posée directement sur le fond pastel
   (demande Monia — la page était trop chargée avec la carte blanche) */
.bienvenue-enfant {
  display: flex; align-items: center; gap: 14px;
  margin: 4px auto 0; width: calc(100% - 32px); max-width: 844px;
  padding: 10px 16px; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent; cursor: pointer;
}
.bienvenue-halo {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
  background: radial-gradient(circle at 50% 42%, #ffffff 0%, #efe9ff 65%, rgba(239,233,255,0) 100%);
  animation: ob-float 3s ease-in-out infinite;
}
@keyframes ob-float { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-6px);} }
.bienvenue-texte { font-size: 1.25rem; font-weight: 900; color: #4834d4; line-height: 1.2; }

.module-caa { background: linear-gradient(135deg, #6C5CE7, #a29bfe); }
.module-tla { background: linear-gradient(135deg, #e84393, #fd79a8); }
.module-routines { background: linear-gradient(135deg, #00B894, #55efc4); }
.module-exercices { background: linear-gradient(135deg, #FF6B6B, #fab1a0); }
.module-histoires { background: linear-gradient(135deg, #FDCB6E, #e17055); }
.module-parametres { background: linear-gradient(135deg, #636e72, #b2bec3); }

/* ============================================================
   PARAMÈTRES
   ============================================================ */

.param-section {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.param-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 6px;
}

.param-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 14px;
}

.param-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  color: var(--text);
  background: white;
  cursor: pointer;
}

.param-select:focus { outline: none; border-color: var(--primary); }

.param-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.param-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
}

.param-slider {
  flex: 1;
  height: 6px;
  accent-color: var(--primary);
  cursor: pointer;
}

.param-value {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--primary);
}

.btn-test {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.btn-test:active { transform: scale(0.95); }

.btn-sauvegarder {
  width: 100%;
  background: linear-gradient(135deg, #00B894, #55efc4);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 18px;
  font-size: 1.2rem;
  font-weight: 900;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: var(--shadow);
}

.btn-sauvegarder:active { transform: scale(0.97); }

/* ============================================================
   CAA — Tableau de communication
   ============================================================ */

.caa-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.caa-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  flex-shrink: 0;
}

.caa-header .btn-retour { margin-right: auto; }

.caa-header-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
}

/* Barre de phrase */
.phrase-zone {
  background: white;
  border-bottom: 3px solid var(--primary-light);
  padding: 10px 16px;
  flex-shrink: 0;
}

.phrase-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 110px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.phrase-bar:empty::before {
  content: "👆 Touche les images pour parler...";
  color: var(--text-light);
  font-size: 1.05rem;
  font-weight: 700;
  font-style: italic;
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: center;
}

.phrase-picto {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s;
}

.phrase-picto:active { transform: scale(0.9); }

.phrase-picto img {
  width: 86px;
  height: 86px;
  object-fit: contain;
  border-radius: 12px;
  border: 2px solid var(--primary-light);
  background: white;
}

.phrase-picto .picto-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  max-width: 86px;
  margin-top: 3px;
}

.phrase-picto .remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--coral);
  color: white;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(255,107,107,0.5);
}

/* Boutons d'action phrase */
.phrase-actions {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: white;
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
}

.btn-parler {
  flex: 2;
  background: linear-gradient(135deg, #00B894, #00cec9);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 18px 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(0,184,148,0.4);
  min-height: 64px;
  touch-action: manipulation;
}

.btn-parler:active { transform: scale(0.95); box-shadow: none; }
.btn-parler.speaking { animation: pulse-speak 0.6s ease-in-out infinite alternate; }
@keyframes pulse-speak {
  from { box-shadow: 0 4px 16px rgba(0,184,148,0.4); }
  to   { box-shadow: 0 4px 32px rgba(0,184,148,0.9); transform: scale(1.03); }
}

.btn-effacer {
  flex: 1;
  background: #dfe6e9;
  color: var(--text);
  border: none;
  border-radius: 20px;
  padding: 18px 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
  min-height: 64px;
  touch-action: manipulation;
}

.btn-effacer:active { background: var(--coral); color: white; transform: scale(0.95); }

.btn-backspace {
  flex: 1;
  background: #ffeaa7;
  color: var(--text);
  border: none;
  border-radius: 20px;
  padding: 18px 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
  min-height: 64px;
  touch-action: manipulation;
}

.btn-backspace:active { background: #fdcb6e; transform: scale(0.95); }

/* Recherche */
.search-zone {
  padding: 10px 16px;
  background: white;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  gap: 8px;
}

.search-input {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 10px 18px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--primary); }

.btn-search {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-search:hover { background: var(--primary-dark); }

/* Catégories */
.categories-bar {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  background: white;
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
}

.categories-bar::-webkit-scrollbar { height: 3px; }
.categories-bar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 10px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text-light);
  transition: all 0.15s;
  min-height: 56px;
  touch-action: manipulation;
}

.cat-btn .cat-icon { font-size: 1.6rem; line-height: 1; }

.cat-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 3px 12px rgba(108,92,231,0.35);
}
.cat-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Grille de pictogrammes */
.picto-grid-zone {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.picto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
}

.picto-card {
  background: white;
  border-radius: 18px;
  padding: 14px 10px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
  position: relative;
  touch-action: manipulation;
  user-select: none;
}

.picto-card:active {
  transform: scale(0.91);
  box-shadow: none;
  border-color: var(--primary);
}

@keyframes picto-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); }
  70%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}
.picto-card.pop { animation: picto-pop 0.35s ease-out; }

.picto-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 10px;
  max-width: 100px;
}

.picto-card .picto-mot {
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
  color: var(--text);
  margin-top: 7px;
  line-height: 1.2;
}

.picto-card .fav-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s, transform 0.15s;
  background: none;
  border: none;
  padding: 4px;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.picto-card .fav-btn:active { transform: scale(1.4); }
.picto-card .fav-btn.is-fav { opacity: 1; color: #f9ca24; }

/* Loading state */
.loading-pictos {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--text-light);
  font-weight: 600;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   ROUTINES
   ============================================================ */

.page-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 20px;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary);
}

.routines-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.routine-card {
  background: white;
  border-radius: 20px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: all 0.2s;
  box-shadow: var(--shadow);
  text-align: center;
}

.routine-card:hover {
  border-color: var(--teal);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.routine-icon { font-size: 3rem; margin-bottom: 10px; }

.routine-titre {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

/* Routine detail */
.etapes-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.etape-item {
  background: white;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

.etape-item.fait {
  border-color: var(--teal);
  background: #f0fff8;
}

.etape-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.etape-item.fait .etape-num { background: var(--teal); }

.etape-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 10px;
  border: 2px solid var(--border);
}

.etape-mot {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  flex: 1;
}

.etape-check {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.etape-check:hover { border-color: var(--teal); }
.etape-item.fait .etape-check { background: var(--teal); border-color: var(--teal); color: white; }

/* ============================================================
   EXERCICES
   ============================================================ */

.exercices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.exo-card {
  background: white;
  border-radius: 20px;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
}

.exo-card:hover {
  border-color: var(--coral);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.exo-icon { font-size: 3rem; margin-bottom: 10px; }

.exo-nom { font-size: 1rem; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.30); }
.exo-desc { font-size: 0.8rem; color: rgba(255,255,255,0.94); text-shadow: 0 1px 3px rgba(0,0,0,0.28); margin-top: 4px; font-weight: 600; }

/* Exercice appariement */
.appariement-zone {
  margin-top: 20px;
}

.appariement-consigne {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
  padding: 16px;
  background: white;
  border-radius: 16px;
  border: 2px solid var(--border);
}

.appariement-target {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.target-picto {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border-radius: 20px;
  border: 3px solid var(--primary);
  padding: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.choix-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.choix-card {
  background: white;
  border-radius: 16px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  border: 3px solid var(--border);
  transition: all 0.2s;
}

.choix-card:hover { border-color: var(--primary); }
.choix-card.correct { border-color: var(--teal); background: #f0fff8; }
.choix-card.incorrect { border-color: var(--coral); background: #fff0f0; animation: shake 0.3s; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.choix-card img { width: 80px; height: 80px; object-fit: contain; border-radius: 8px; }
.choix-card .choix-mot { font-size: 0.75rem; font-weight: 700; margin-top: 6px; color: var(--text); }

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--yellow);
  color: var(--text);
  border-radius: 50px;
  padding: 8px 20px;
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 16px;
}

/* Jeu Ordonner */
.choix-card.seq-used { opacity: 0.35; pointer-events: none; }

/* Jeu Mémoriser */
.mem-card {
  aspect-ratio: 1;
  border-radius: 14px;
  cursor: pointer;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s;
  box-shadow: var(--shadow);
}
.mem-card:active { transform: scale(0.93); }
.mem-card .mem-front {
  font-size: 1.8rem;
  color: white;
  font-weight: 900;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  border-radius: 14px;
  transition: opacity 0.2s;
}
.mem-card .mem-back {
  text-align: center;
  padding: 6px;
  opacity: 0;
  transition: opacity 0.2s;
}
.mem-card .mem-back img { width: 70%; height: auto; border-radius: 8px; }
.mem-card.retournee .mem-front { opacity: 0; pointer-events: none; }
.mem-card.retournee .mem-back { opacity: 1; }
.mem-card.trouvee { background: #d4edda; border: 3px solid var(--teal); }
.mem-card.trouvee .mem-front { opacity: 0; }
.mem-card.trouvee .mem-back { opacity: 1; }

/* ============================================================
   HISTOIRES
   ============================================================ */

.histoires-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.histoire-card {
  background: white;
  border-radius: 20px;
  padding: 20px;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.histoire-card:hover {
  border-color: var(--yellow);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.histoire-titre {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.histoire-extrait {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 600;
  line-height: 1.5;
}

.btn-audio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--yellow);
  color: var(--text);
  border: none;
  border-radius: 50px;
  padding: 10px 24px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.2s;
}

.btn-audio:hover { background: #f6b800; }

/* ============================================================
   ADMIN
   ============================================================ */

/* ============================================================
   ESPACE ADULTE — interface sobre & professionnelle
   ============================================================ */
.admin-page {
  min-height: 100vh;
  background: #f4f5f9;
  font-family: 'Nunito', sans-serif;
  color: #1f2433;
}

.admin-header {
  background: #ffffff;
  color: #1f2433;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e6e8f0;
  box-shadow: 0 1px 3px rgba(20,24,40,0.04);
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-header h1 { font-size: 1.12rem; font-weight: 800; letter-spacing: -0.2px; color: #2a2150; }

.admin-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.admin-nav a {
  color: #5b6172;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 7px 13px;
  border-radius: 8px;
  transition: all 0.15s;
}

.admin-nav a:hover { background: #f0f1f7; color: #2a2150; }

/* Déconnexion = action mutante → formulaire POST dont le bouton garde l'allure d'un lien de nav */
.form-deconnexion { display: inline; margin: 0; }
.btn-lien {
  background: none;
  border: none;
  cursor: pointer;
  color: #5b6172;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 7px 13px;
  border-radius: 8px;
  transition: all 0.15s;
}
.btn-lien:hover { background: #f0f1f7; color: #2a2150; }

.admin-content { max-width: 920px; margin: 0 auto; padding: 28px 20px 60px; }

/* ── Super-admin : mise en page avec barre latérale ── */
.admin-shell {
  display: flex;
  align-items: flex-start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  gap: 26px;
}

.admin-sidebar {
  flex: none;
  width: 208px;
  position: sticky;
  top: 64px; /* aligné sous le header (~54px) — 78px laissait un flottement au scroll */
  background: white;
  border-radius: 14px;
  border: 1px solid #e8eaf2;
  box-shadow: 0 1px 3px rgba(20,24,40,0.04);
  padding: 12px;
}

.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  color: #5b6172;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  margin-bottom: 4px;
  transition: all 0.15s;
}

.admin-sidebar a:hover { background: #f0f1f7; color: #2a2150; }
.admin-sidebar a.active { background: #6C5CE7; color: #fff; }

.admin-main { flex: 1; min-width: 0; }
.admin-main .admin-content { max-width: none; margin: 0; padding: 0; }

@media (max-width: 760px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    position: static;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 10px;
  }
  .admin-sidebar a { margin-bottom: 0; white-space: nowrap; }
}

.admin-card {
  background: white;
  border-radius: 14px;
  padding: 22px 24px;
  border: 1px solid #e8eaf2;
  box-shadow: 0 1px 3px rgba(20,24,40,0.04);
  margin-bottom: 20px;
}

.admin-card h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #2a2150;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Carte enfant (admin) ── */
.enfant-admin-card {
  border: 1px solid #e8eaf2;
  border-radius: 12px;
  padding: 15px 16px;
  margin-bottom: 12px;
  background: #fcfcfe;
  transition: border-color .15s, box-shadow .15s;
}
.enfant-admin-card:hover { border-color: #d7d9ea; box-shadow: 0 4px 14px rgba(20,24,40,0.05); }

.enfant-admin-top { display: flex; align-items: center; gap: 14px; }
.enfant-admin-avatar {
  width: 46px; height: 46px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.45rem; overflow: hidden; border: 1px solid #e8eaf2;
}
.enfant-admin-avatar img { width: 100%; height: 100%; object-fit: cover; }
.enfant-admin-meta { flex: 1; min-width: 0; }
.enfant-admin-meta .nom { font-weight: 800; font-size: 1.05rem; color: #2a2150; }
.enfant-admin-meta .stats { font-size: 0.8rem; color: #8a8fa3; font-weight: 600; margin-top: 1px; }
.enfant-admin-icons { display: flex; gap: 6px; flex-shrink: 0; }

.actions-bar { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.actions-bar .sep { flex-basis: 100%; height: 0; }

/* ── Boutons admin : sobres, rectangulaires, uniformes ── */
.abtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border-radius: 9px;
  font-family: 'Nunito', sans-serif; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; border: 1px solid #e0e2ee; background: #fff; color: #4a5060;
  text-decoration: none; transition: all 0.15s; white-space: nowrap;
}
.abtn:hover { border-color: #b9bcd4; background: #f7f7fc; color: #2a2150; }
.abtn-primary { background: #6C5CE7; border-color: #6C5CE7; color: #fff; }
.abtn-primary:hover { background: #5a4ad1; border-color: #5a4ad1; color: #fff; }
.abtn-icon { padding: 8px 10px; font-size: 0.95rem; }
.abtn-danger { color: #cf4259; border-color: #f0d3d8; }
.abtn-danger:hover { background: #fdeef1; border-color: #e6a6b1; color: #b8324a; }

/* Anciens boutons (autres pages admin) — dé-« pilulés », plus sobres */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 15px;
  border-radius: 9px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-success { background: var(--teal); color: white; }
.btn-success:hover { background: #00a381; }

.btn-danger { background: var(--coral); color: white; }
.btn-danger:hover { background: #e05555; }

.btn-outline { background: #fff; border-color: #e0e2ee; color: #4a5060; }
.btn-outline:hover { border-color: #b9bcd4; color: #2a2150; background: #f7f7fc; }

/* Profil-row (compat anciennes pages) */
.profil-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid #eceef5; }
.profil-row:last-child { border-bottom: none; }
.profil-avatar { width: 46px; height: 46px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.45rem; }
.profil-info { flex: 1; }
.profil-info .nom { font-weight: 800; font-size: 1rem; color: #2a2150; }
.profil-info .stats { font-size: 0.8rem; color: #8a8fa3; font-weight: 600; }
.profil-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus { border-color: var(--primary); }

.emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.emoji-opt {
  font-size: 1.8rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 10px;
  border: 2px solid transparent;
  transition: all 0.15s;
}

.emoji-opt:hover, .emoji-opt.selected { border-color: var(--primary); background: var(--bg); }

/* PIN login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F8F6FF, #EDE7FF);
}

.login-card {
  background: white;
  border-radius: 28px;
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
  max-width: 380px;
  width: 100%;
  text-align: center;
}

.login-icon { font-size: 3.5rem; margin-bottom: 12px; }
.login-title { font-size: 1.6rem; font-weight: 900; color: var(--primary); margin-bottom: 6px; }
.login-sub { font-size: 0.9rem; color: var(--text-light); font-weight: 600; margin-bottom: 28px; }

.pin-input {
  width: 100%;
  text-align: center;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 8px;
  border: 3px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  outline: none;
  font-family: 'Nunito', sans-serif;
  color: var(--primary);
  transition: border-color 0.2s;
  margin-bottom: 16px;
}

.pin-input:focus { border-color: var(--primary); }

.btn-login {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-login:hover { background: var(--primary-dark); }

.error-msg {
  color: var(--coral);
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 10px;
}

/* Favori pictos admin grid */
.fav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.fav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--bg);
  border-radius: 14px;
  border: 2px solid var(--border);
  position: relative;
}

.fav-item img { width: 60px; height: 60px; object-fit: contain; }

.fav-item .fav-mot { font-size: 0.72rem; font-weight: 700; text-align: center; color: var(--text); }

.fav-item .remove-fav {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--coral);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--primary);
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.3s;
  z-index: 9999;
  pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* Responsive tablette */
@media (min-width: 600px) {
  .picto-grid { grid-template-columns: repeat(5, 1fr); }
  .modules-grid { max-width: 500px; }
}

@media (min-width: 900px) {
  .picto-grid { grid-template-columns: repeat(6, 1fr); }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-light);
}

.empty-icon { font-size: 4rem; margin-bottom: 12px; }
.empty-text { font-size: 1.1rem; font-weight: 700; }
.empty-sub { font-size: 0.9rem; margin-top: 6px; }

/* ═══════════════════════════════════════════════════════════
   TIMER FLOTTANT
═══════════════════════════════════════════════════════════ */
.timer-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 800;
  width: 58px; height: 58px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, #00b894, #55efc4);
  font-size: 1.4rem; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,184,148,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.timer-fab:active { transform: scale(0.92); box-shadow: none; }

.timer-modal {
  display: none; position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,0.5); align-items: center; justify-content: center;
}
.timer-modal.show { display: flex; }
.timer-modal-content {
  background: white; border-radius: 32px; padding: 28px 24px;
  width: 90%; max-width: 340px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2); animation: modal-in 0.25s ease;
}
@keyframes modal-in {
  from { transform: scale(0.85); opacity:0; }
  to   { transform: scale(1);    opacity:1; }
}
.timer-titre { font-size: 1.2rem; font-weight: 900; color: #2d3436; margin-bottom: 16px; }
.timer-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.timer-dur-btn {
  padding: 14px; border: 2px solid #00b894; border-radius: 16px;
  background: #e0f7f4; color: #00b894; font-weight: 800; font-size: 1rem;
  cursor: pointer; transition: all 0.15s;
}
.timer-dur-btn:active { background: #00b894; color: white; }
.timer-display {
  display: flex; align-items: center; justify-content: center;
  position: relative; width: 160px; height: 160px; margin: 0 auto 16px;
}
.timer-svg { width: 160px; height: 160px; position: absolute; }
.timer-countdown {
  font-size: 2.4rem; font-weight: 900; color: #2d3436; z-index: 1;
}
.timer-actions { display: flex; gap: 10px; justify-content: center; }
.timer-stop-btn, .timer-close-btn {
  flex: 1; padding: 12px; border: none; border-radius: 16px;
  font-weight: 800; font-size: 0.95rem; cursor: pointer;
}
.timer-stop-btn { background: #ff6b6b; color: white; }
.timer-close-btn { background: #f0f0f0; color: #636e72; }

/* ═══════════════════════════════════════════════════════════
   ACCESSIBILITÉ — TAILLES
═══════════════════════════════════════════════════════════ */
body.taille-grand { font-size: 118%; }
body.taille-grand .module-label { font-size: 1.15rem; }
body.taille-grand .picto-card .picto-label { font-size: 0.85rem; }
body.taille-grand .etape-img { width: 80px; height: 80px; }
body.taille-grand .etape-unique img { width: 240px; height: 240px; }

body.taille-tres-grand { font-size: 135%; }
body.taille-tres-grand .module-label { font-size: 1.3rem; }
body.taille-tres-grand .modules-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
body.taille-tres-grand .etape-img { width: 96px; height: 96px; }
body.taille-tres-grand .etape-unique img { width: 280px; height: 280px; }

/* ═══════════════════════════════════════════════════════════
   ACCESSIBILITÉ — HAUT CONTRASTE
═══════════════════════════════════════════════════════════ */
body.haut-contraste {
  --bg: #000000;
  --card: #1a1a1a;
  --text: #ffffff;
  --text-light: #cccccc;
  --border: #444444;
}
body.haut-contraste .module-card { border: 3px solid white; }
body.haut-contraste .etape-item { background: #1a1a1a; border: 2px solid #555; }
body.haut-contraste .etape-mot { color: white; }
body.haut-contraste .routine-card { border: 3px solid white; }
body.haut-contraste .exo-card { border: 3px solid white; }

/* ═══════════════════════════════════════════════════════════
   ACCESSIBILITÉ — MODE NUIT
═══════════════════════════════════════════════════════════ */
body.mode-nuit {
  --bg: #1e1e2e;
  --card: #2a2a3e;
  --text: #e8e8f0;
  --text-light: #9999bb;
  --border: #3a3a5a;
}
body.mode-nuit .module-card { filter: brightness(0.85); }
body.mode-nuit .etape-item { background: #2a2a3e; }
body.mode-nuit .routine-card { filter: brightness(0.85); }
body.mode-nuit .enfant-header { background: #2a2a3e; }
body.mode-nuit .caa-header { background: #2a2a3e; }

/* ═══════════════════════════════════════════════════════════
   DESIGN — ACCUEIL AMÉLIORÉ
═══════════════════════════════════════════════════════════ */
.accueil-page {
  min-height: 100vh;
  background: linear-gradient(160deg, #f8f6ff 0%, #e8f4fd 50%, #e8fff8 100%);
}
.logo-elyo {
  font-size: 3.2rem; font-weight: 900; text-align: center;
  padding-top: 32px; padding-bottom: 4px;
  background: linear-gradient(135deg, #6c5ce7, #00b894);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}
.logo-elyo span { color: #00b894; }
.tagline {
  text-align: center; color: #636e72; font-size: 0.95rem;
  margin-bottom: 28px; font-weight: 600;
}
.profils-grid {
  display: flex; flex-wrap: wrap; gap: 18px;
  justify-content: center; padding: 0 20px 40px;
}
.profil-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 20px; border-radius: 28px; text-decoration: none;
  min-width: 160px; max-width: 200px; flex: 1;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.profil-card:hover { transform: translateY(-4px); box-shadow: 0 16px 48px rgba(0,0,0,0.18); }
.profil-card:active { transform: scale(0.97); }
.profil-emoji { font-size: 4rem; margin-bottom: 12px; }
.profil-nom {
  font-size: 1.6rem; font-weight: 900; color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2); cursor: pointer;
}
.profil-badge {
  margin-top: 6px; font-size: 0.85rem; font-weight: 700;
  color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.2);
  padding: 4px 12px; border-radius: 12px;
}

/* ═══════════════════════════════════════════════════════════
   DESIGN — PAGE ENFANT AMÉLIORÉE
═══════════════════════════════════════════════════════════ */
/* Grille RÉGULIÈRE pensée pour les NON-LECTEURS : le pictogramme domine
   (grand, au centre), le mot est discret en dessous. « Je communique »
   (cœur de l'appli) = carte vedette pleine largeur. Cartes identiques,
   2 colonnes sur tablette, 3 sur grand écran. */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px; padding: 18px 18px 30px;
  max-width: 880px; margin: 0 auto; width: 100%;
}
@media (min-width: 900px) {
  .modules-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.module-caa { grid-column: 1 / -1; }
.module-caa .module-picto { width: 104px; height: 104px; }

.module-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 18px 14px; border-radius: 22px; text-decoration: none;
  min-height: 168px;
  text-align: center;
  box-shadow: 0 5px 14px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  opacity: 0; animation: card-in 0.5s cubic-bezier(.2,.8,.25,1) forwards;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.module-card:nth-child(1){ animation-delay:.04s }
.module-card:nth-child(2){ animation-delay:.10s }
.module-card:nth-child(3){ animation-delay:.16s }
.module-card:nth-child(4){ animation-delay:.22s }
.module-card:nth-child(5){ animation-delay:.28s }
.module-card:nth-child(6){ animation-delay:.34s }
.module-card:nth-child(7){ animation-delay:.40s }
.module-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.20), inset 0 1px 0 rgba(255,255,255,0.45);
  filter: saturate(1.06);
}
.module-card:active { transform: scale(0.97); }

.module-picto {
  width: 88px; height: 88px; object-fit: contain; margin-bottom: 0; flex-shrink: 0;
  padding: 10px; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #ffffff 0%, rgba(255,255,255,0.9) 62%, rgba(255,255,255,0.55) 100%);
  box-shadow: 0 4px 12px rgba(0,0,0,0.16);
}
/* Emoji des cartes Je me calme / Mes étoiles : même badge blanc que les pictos */
.module-card > div[style*="font-size:4rem"] {
  font-size: 3.2rem !important; line-height: 1 !important; flex-shrink: 0;
  width: 88px; height: 88px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #ffffff 0%, rgba(255,255,255,0.85) 62%, rgba(255,255,255,0.5) 100%);
  box-shadow: 0 4px 12px rgba(0,0,0,0.14);
}
/* Le mot reste présent (adultes, lecteurs débutants) mais discret :
   c'est le pictogramme qui porte l'information. */
.module-label {
  font-size: 0.98rem; font-weight: 800; color: #fff;
  line-height: 1.18; letter-spacing: 0.2px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.28);
}

/* Respect des enfants sensibles au mouvement (TSA) */
@media (prefers-reduced-motion: reduce) {
  .module-card { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* Bouton historique dans l'accueil enfant */
.btn-historique {
  display: flex; align-items: center; gap: 9px;
  margin: 0 16px 10px; padding: 13px 20px; flex-shrink: 0;
  background: rgba(255,255,255,0.92); border: 1px solid rgba(108,92,231,0.10);
  border-radius: 18px;
  text-decoration: none; color: #5a4ad1;
  font-weight: 800; font-size: 0.95rem;
  box-shadow: 0 4px 16px rgba(108,92,231,0.10);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn-historique:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(108,92,231,0.16); }
.btn-historique:active { transform: scale(0.98); }

/* ══ Suggestions prédictives (CAA) ══════════════════════════ */
.suggestions-zone {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 10px; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.sugg-label { font-size: 1.1rem; flex-shrink: 0; }
.sugg-btn {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  background: #f3f0ff; border: 2px solid #d6ccff; border-radius: 16px;
  padding: 6px 12px 6px 6px; cursor: pointer;
  font-weight: 800; font-size: 0.9rem; color: #4a3fa3;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s;
}
.sugg-btn:active { transform: scale(0.95); }
.sugg-btn img { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; background: white; }

/* ══ Mode balayage (accès contacteur) ═══════════════════════ */
.scan-highlight {
  outline: 5px solid #ff9f1a !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(255, 159, 26, 0.30) !important;
  border-radius: 18px;
}

/* ══ Page de garde — sections Bénéficiaires / Espace adulte ══ */
.garde-section {
  width: 100%;
  max-width: 880px;
  margin: 0 auto 20px;
}
.garde-titre {
  font-size: 1.15rem;
  font-weight: 900;
  color: #2c2150;
  margin-bottom: 12px;
  text-align: left;
  padding-left: 6px;
}
.garde-adulte {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  border: 1.5px solid #e8e4fa;
  border-radius: 22px;
  padding: 18px 18px 20px;
  box-shadow: 0 4px 18px rgba(108, 92, 231, 0.08);
}
.garde-adulte .garde-titre { margin-bottom: 4px; }
.garde-sous {
  font-size: 0.85rem;
  font-weight: 700;
  color: #8a8fa3;
  text-align: left;
  padding-left: 6px;
  margin-bottom: 14px;
}
.garde-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.garde-opt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: white;
  border: 1.5px solid #e8eaf2;
  border-radius: 14px;
  padding: 11px 16px;
  font-weight: 800;
  font-size: 0.92rem;
  color: #40456a;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(20, 24, 40, 0.05);
  transition: all 0.15s;
}
.garde-opt:hover, .garde-opt:focus-visible {
  border-color: #6C5CE7;
  color: #2a2150;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.16);
}
.garde-note {
  margin-top: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #9aa0b4;
  text-align: left;
  padding-left: 6px;
}
@media (max-width: 560px) {
  .garde-opt { flex: 1 1 44%; justify-content: center; }
}

/* Entrée unique de l'espace adulte sur la page de garde */
.garde-opt-entree {
  font-size: 1rem;
  padding: 14px 26px;
  background: linear-gradient(135deg, #7a6cf0, #a29bfe);
  color: white;
  border: none;
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.28);
}
.garde-opt-entree:hover, .garde-opt-entree:focus-visible {
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(108, 92, 231, 0.36);
}

/* Champ mot de passe avec œil afficher/masquer */
.champ-mdp { position: relative; }
.champ-mdp input { width: 100%; padding-right: 46px; margin-bottom: 0; }
.btn-oeil {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px 8px;
  line-height: 1;
  opacity: 0.65;
}
.btn-oeil:hover { opacity: 1; }

/* Badge de compteur (suggestions non lues) dans la sidebar console */
.sidebar-badge {
  display: inline-block;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 12px;
  background: #6C5CE7;
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  vertical-align: middle;
}

/* Barre des mots-pivots (je / veux) — collante : reste visible en défilant la grille CAA */
.pivots-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  gap: 10px;
  padding: 8px 16px 10px;
  background: rgba(248, 246, 255, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 2px dashed #c9bdf2;
}
.pivot-card {
  width: 140px;   /* même gabarit que les cartes de la grille (minmax 120px) */
  border-color: #6C5CE7 !important;
  border-width: 3px !important;
  background: linear-gradient(135deg, #EDE7FF, #fff) !important;
  flex-shrink: 0;
}

/* ============================================================
   CONSOLE PLATEFORME (super-admin) — aux couleurs d'Elyo :
   fond pastel de l'app + en-tête violet + pastille dorée
   « ELYO ADMIN ». Distincte de l'espace adulte (gris neutre).
   Tout est scopé sous .console-page.
   ============================================================ */
.console-page { background: linear-gradient(160deg, #f2edfd, #fdeff7 55%, #ecf9f3); }
.console-page .admin-header {
  background: linear-gradient(135deg, #6C5CE7, #8f7ff0);
  border-bottom: none;
  box-shadow: 0 2px 12px rgba(108,92,231,0.35);
}
.console-page .admin-header h1 { color: #fff; display: flex; align-items: center; gap: 10px; }
/* Pastille dorée « ELYO ADMIN » devant chaque titre : on sait où on est */
.console-page .admin-header h1::before {
  content: 'ELYO ADMIN';
  background: linear-gradient(135deg, #fdcb6e, #f39c12);
  color: #3d2c00;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 1.2px;
  padding: 4px 10px;
  border-radius: 20px;
  flex: none;
}
.console-page .admin-nav a, .console-page .btn-lien { color: #efeaff; }
.console-page .admin-nav a:hover, .console-page .btn-lien:hover { background: rgba(255,255,255,0.16); color: #fff; }
.console-page .admin-card {
  border-color: #e9e2fb;
  box-shadow: 0 2px 10px rgba(108,92,231,0.08);
}
.console-page .admin-sidebar {
  background: #fff;
  border-color: #e9e2fb;
  box-shadow: 0 2px 10px rgba(108,92,231,0.10);
}
.console-page .admin-sidebar a:hover { background: #f3effe; color: #2a2150; }
.console-page .admin-sidebar a.active { background: #6C5CE7; color: #fff; }
.sidebar-sep { border-top: 1px solid #e8eaf2; margin: 10px 6px; }
/* Raccourcis de SORTIE (Mes fiches / Page de garde) : dorés = « je quitte la console » */
.console-page .admin-sidebar a.sortie-console { color: #d68910; }
.console-page .admin-sidebar a.sortie-console:hover { background: #fdf3e0; color: #a06a00; }

/* Bloc de sortie de la console : étiqueté, doré — on SAIT qu'on quitte */
.sidebar-titre {
  font-size: 0.68rem; font-weight: 900; letter-spacing: 1px; text-transform: uppercase;
  color: #b28022; padding: 2px 14px 4px;
}

/* Inscription sur ORDINATEUR : carte large + CHAMPS SUR DEUX COLONNES —
   le formulaire tient à l'écran au lieu de défiler comme sur un téléphone.
   Les blocs famille/pro (.eclate) exposent leurs champs à la grille via
   display:contents ; le JS les masque avec display:none et rend la main
   avec '' (jamais 'block', qui casserait la grille). */
/* ══ INSCRIPTION EN 2 ÉTAPES : d'abord QUI (grandes cartes accueillantes),
   PUIS le formulaire adapté — sur le fond pastel doux d'Elyo. ══ */
.login-card-large { background: transparent; box-shadow: none; max-width: 1000px; width: 100%; }
.statut-question { font-size: 1.3rem; font-weight: 900; color: #2a2150; margin: 30px 0 16px; }
.statut-cartes { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.statut-carte {
  flex: 1; min-width: 240px; max-width: 340px; padding: 30px 22px; cursor: pointer;
  border: 3px solid #e0d9ff; border-radius: 24px; background: white;
  font-family: 'Nunito', sans-serif; display: flex; flex-direction: column; gap: 8px; align-items: center;
  transition: all 0.15s; box-shadow: 0 6px 20px rgba(108,92,231,0.10);
}
.statut-carte:hover { border-color: #6C5CE7; transform: translateY(-4px); box-shadow: 0 14px 34px rgba(108,92,231,0.22); }
.statut-carte:active { transform: scale(0.97); }
.statut-emoji { font-size: 3.2rem; line-height: 1; }
.statut-nom { font-size: 1.25rem; font-weight: 900; color: #2a2150; }
.statut-desc { font-size: 0.92rem; font-weight: 600; color: #8a8fa3; line-height: 1.45; }
.statut-chip {
  display: inline-flex; gap: 4px; align-items: center; margin: 8px auto 4px;
  background: #f1edff; border-radius: 30px; padding: 8px 18px;
  font-weight: 800; color: #4834d4; font-size: 0.95rem;
}
.statut-chip a { color: #6C5CE7; cursor: pointer; text-decoration: underline; font-weight: 700; }
/* Le formulaire vit dans sa propre carte blanche, posée sur le pastel */
.form-inscription {
  background: white; border-radius: 26px; padding: 26px 20px;
  box-shadow: 0 10px 34px rgba(108,92,231,0.14);
}
@media (min-width: 860px) {
  .login-card-large .login-title { font-size: 2rem; }
  .login-card-large .login-sub { font-size: 1.06rem; }
  .login-card-large .form-control { padding: 13px 16px; font-size: 1rem; }
  .form-inscription {
    padding: 36px 48px;
    display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; align-items: start;
  }
  .form-inscription > * { grid-column: 1 / -1; min-width: 0; }
  .form-inscription .champ { grid-column: span 1; }
  .form-inscription .eclate { display: contents; }
  .form-inscription .champ-large { grid-column: 1 / -1; }
}


/* ── Connexion harmonisée avec la nouvelle inscription ── */
.btn-secondaire {
  display: block; width: 100%; margin-top: 8px; padding: 13px 18px;
  border: 2px solid #d7d4f7; border-radius: 14px; background: #f8f6ff;
  color: #4834d4; font-weight: 800; font-size: 0.98rem; text-decoration: none;
  transition: all 0.15s; box-sizing: border-box;
}
.btn-secondaire:hover { border-color: #6C5CE7; background: #f1edff; }
@media (min-width: 860px) {
  .login-card:not(.login-card-large):not(.login-card-conn) { max-width: 470px; padding: 56px 54px; }
  .login-card:not(.login-card-large):not(.login-card-conn) .login-title { font-size: 1.75rem; }
  .login-card:not(.login-card-large):not(.login-card-conn) .login-sub { font-size: 1.02rem; }
  .login-card:not(.login-card-large):not(.login-card-conn) .form-control { padding: 13px 16px; font-size: 1rem; }
}

/* ── CONNEXION format ORDINATEUR : écran scindé — Elyo se présente à
   gauche, on se connecte à droite. Sur petit écran : carte simple. ── */
.conn-hero { display: none; }
@media (min-width: 900px) {
  .login-card-conn { background: transparent; box-shadow: none; max-width: 1120px; width: 100%; padding: 24px; }
  .login-card-conn .logo-haut { display: none; }
  .conn-split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; }
  .conn-hero { display: block; text-align: left; }
  .conn-hero .logo-elyo { margin-bottom: 14px; }
  .conn-hero-titre { font-size: 1.55rem; font-weight: 900; color: #2a2150; line-height: 1.35; margin-bottom: 22px; }
  .conn-hero-point { font-size: 1.05rem; font-weight: 700; color: #5b6172; margin-bottom: 12px; }
  .conn-forme {
    background: white; border-radius: 28px; padding: 44px 48px;
    box-shadow: 0 12px 40px rgba(108,92,231,0.16); text-align: center;
  }
  .conn-forme .login-title { font-size: 1.7rem; }
  .conn-forme .form-control { padding: 13px 16px; font-size: 1rem; }
}