:root {
  --bg: #ffffff;
  --text: #333333;
  --muted: #6b6b6b;
  --primary: #6c63ff;
  --primary-600: #574fd6;
  --pink: #f4dfe6;
  --hero: #bee5e8;
  --radius: 12px;
  --glass: rgba(255, 255, 255, 0.7);
  --shadow: 0 8px 20px rgba(16, 24, 40, 0.06);
  --container-max: 1100px;
}

/* Reset + base */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
}

.container {
  width: calc(100% - 40px);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: linear-gradient(180deg, rgba(244, 223, 230, 0.98) 0%, rgba(244, 223, 230, 0.95) 100%);
  padding: 18px 0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}
header .container {
  display: flex;
  align-items: center;
  gap: 20px;
}
header a img {
  display: block;
  max-height: 120px;
  height: auto;
  width: auto;
  object-fit: contain;
}
header .site-logo {
  max-height: 120px;
  height: auto;
  width: auto;
  display: block;
  object-fit: contain;
}

nav {
  flex: 1;
}
nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}
nav li {
  display: flex;
  align-items: center;
}
nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
}
nav a:hover,
nav a:focus {
  background: var(--glass);
  outline: none;
}
nav input[type="text"] {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  width: 180px;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--hero) 0%, #c7eef1 100%);
  color: #fff;
  padding: 64px 20px;
  text-align: center;
}
.hero .container {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: center;
}
.hero img {
  max-width: 260px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.hero h1 {
  font-size: 2rem;
  margin: 0 0 12px;
}

.quizz-section {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.quizz-box {
  background: #fff;
  color: var(--text);
  padding: 22px;
  border-radius: var(--radius);
  width: 260px;
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease;
}
.quizz-box:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(16, 24, 40, 0.12);
}
.quizz-box h2 {
  font-size: 1.05rem;
  margin: 0 0 8px;
}
.quizz-box p {
  color: var(--muted);
  margin: 0 0 12px;
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: transform .12s ease, background .12s ease;
  box-shadow: 0 6px 18px rgba(108, 99, 255, 0.12);
}
.btn:hover {
  background: var(--primary-600);
  transform: translateY(-2px);
}
.btn:focus {
  outline: 3px solid rgba(108, 99, 255, 0.18);
  outline-offset: 3px;
}

/* Sections */
.citation,
.safeplace,
.presentation {
  padding: 48px 20px;
}
.citation blockquote {
  font-style: italic;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 12px auto;
  max-width: 800px;
}

.safeplace p {
  max-width: 880px;
  margin: 12px auto;
  color: var(--text);
}

.presentation ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  max-width: 1000px;
  margin: 18px auto;
}
.presentation li {
  background: linear-gradient(180deg, rgba(108, 99, 255, 0.06), rgba(108, 99, 255, 0.02));
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
}

/* Footer */
footer {
    background-color: rgba(244, 223, 230, 0.95); /* Couleur de fond */
    color: white;
    width: 100%; /* Prend toute la largeur */
    padding: 40px 0;
    margin-top: 50px;
}
footer .container {
    /* Le contenu reste centré, mais le fond est large */
    max-width: 1100px; 
    margin: 0 auto;
    padding: 0 20px;
}
footer p {
  margin: 0;
  font-weight: 700;
}
footer .newsletter {
  display: flex;
  align-items: center;
  gap: 8px;
}
footer input[type="email"] {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  width: 240px;
}
footer .social-icons {
  display: flex;
  align-items: center;
  gap: 12px;
}
footer .social-icons a {
  color: var(--text);
  font-size: 1.2rem;
}

/* Ajout des styles pour la modal de connexion */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fff;
  margin: 100px auto;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.2);
}

.close {
  color: #6b6b6b;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #333;
}

.modal-content h2 {
  margin-top: 0;
  color: var(--text);
}

.modal-content input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  font-family: "Poppins", sans-serif;
}

.modal-content button {
  width: 100%;
  margin-top: 10px;
}
/* </CHANGE> */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .hero .container {
    flex-direction: column;
  }
  nav ul {
    justify-content: center;
  }
  nav input[type="text"] {
    display: none;
  }
  footer .container {
    flex-direction: column;
    align-items: center;
  }
  header .site-logo {
    max-height: 90px;
    height: auto;
  }
}

@media (max-width: 520px) {
  .quizz-box {
    width: 100%;
  }
  .hero h1 {
    font-size: 1.5rem;
  }
  header .site-logo {
    max-height: 72px;
    height: auto;
  }
}

a.btn-ghost {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--text);
}

:focus {
  outline-offset: 3px;
}
/* =======================================================
   ADMINISTRATION (Coller tout en bas de style.css)
   ======================================================= */

/* Force le fond gris sur toute la page Admin */
body.admin-page {
    background-color: #f4f4f9 !important;
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
}

/* Conteneur principal centré */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* En-tête noir de l'admin */
.admin-header {
    background-color: #2d3436;
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.admin-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: white;
}

.admin-header a {
    color: #dfe6e9;
    text-decoration: none;
    font-size: 0.9rem;
    margin-left: 15px;
    font-weight: 500;
}

.admin-header a:hover {
    color: white;
    text-decoration: underline;
}

/* Grille des cartes */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

/* Les cartes (modules) */
.card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05); /* Ombre douce */
    text-align: center;
    border: 1px solid #f0f0f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.card h3 {
    margin-top: 0;
    color: #6c63ff;
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.card p {
    color: #636e72;
    font-size: 0.95rem;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Boutons */
.btn-admin {
    display: inline-block;
    padding: 12px 25px;
    background-color: #6c63ff;
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
}

.btn-admin:hover {
    background-color: #574fd6;
}

.btn-logout {
    background-color: #ff7675;
    padding: 8px 16px;
    border-radius: 6px;
    color: white !important;
    font-weight: bold;
}

.btn-logout:hover {
    background-color: #d63031;
}

/* --- TABLEAUX et FORMULAIRES (Captcha) --- */
.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.admin-table th {
    background-color: #f1f2f6;
    color: #2d3436;
    font-weight: 700;
    padding: 15px;
    text-align: left;
}

.admin-table td {
    padding: 15px;
    border-bottom: 1px solid #f1f2f6;
    color: #2d3436;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
}
.alert.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 15px;
    font-family: inherit;
}
.form-input:focus {
    border-color: #6c63ff;
    outline: none;
}
/* =========================================
   STYLES DU FRONT-END (QUIZZ, FORUM, PROFIL)
   ========================================= */

/* --- MENU PROFIL (Bouton arrondi) --- */
.btn-profil-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0f0f0;
    padding: 5px 15px;
    border-radius: 30px;
    font-weight: 600;
    color: #333 !important;
    transition: background 0.3s;
}
.btn-profil-menu:hover {
    background: #e0e0e0;
}
.avatar-mini {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

/* --- PAGE QUIZZ (Grille de tests) --- */
.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}
.test-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.test-card h3 {
    color: #6c63ff;
    margin-top: 0;
}
.test-card p {
    color: #555;
    line-height: 1.6;
}

/* --- PAGE PASSER TEST (Questionnaire) --- */
.question-card {
    background: white;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border-left: 5px solid #6c63ff;
}
.question-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}
.reponse-option {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s;
    border: 1px solid #eee;
}
.reponse-option:hover {
    background-color: #f0f0ff;
    border-color: #6c63ff;
}
input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
}

/* --- PAGE RESULTAT --- */
.result-header {
    /* La couleur de fond est gérée par PHP car dynamique */
    color: white;
    padding: 80px 20px;
    text-align: center;
    border-radius: 0 0 50% 50% / 20px;
    margin-bottom: 60px;
}
.result-card {
    background: white;
    max-width: 600px;
    margin: -100px auto 0;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;
}
.groupe-badge {
    /* La couleur de fond est gérée par PHP */
    color: white;
    padding: 10px 30px;
    border-radius: 30px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- PAGE PROFIL --- */
.profile-card {
    background: white; 
    padding: 30px; 
    border-radius: 12px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    margin-top: 20px;
}
.badge-groupe {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    font-size: 0.9em;
    margin-top: 5px;
}

/* --- PAGE FORUM --- */
.forum-header {
    /* Couleur dynamique via PHP */
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
}
.topic-item {
    background: white;
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}
.topic-item:hover {
    background: #f9f9f9;
}
.topic-item a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    font-size: 1.1em;
}
.topic-meta {
    font-size: 0.85em;
    color: #888;
    margin-top: 5px;
}
/* =======================================================
   STYLES COMPLETS (QUIZZ, FORUM, PROFIL, MESSAGES)
   ======================================================= */

/* --- GENERAL & MENU --- */
.btn-profil-menu {
    display: flex; align-items: center; gap: 10px;
    background: #f0f0f0; padding: 5px 15px; border-radius: 30px;
    font-weight: 600; color: #333 !important; transition: 0.3s;
}
.btn-profil-menu:hover { background: #e0e0e0; }
.avatar-mini { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }

/* --- CARTES & PROFILS --- */
.profile-card {
    background: white; padding: 30px; border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin-top: 20px;
    border: 1px solid #eee;
}
.badge-groupe {
    display: inline-block; padding: 5px 15px; border-radius: 20px;
    color: white; font-weight: bold; font-size: 0.9em; margin-top: 5px;
}

/* --- PAGE QUIZZ (GRILLE) --- */
.test-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px; margin-top: 30px;
}
.test-card {
    background: white; padding: 25px; border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid #eee;
    display: flex; flex-direction: column; justify-content: space-between;
    transition: transform 0.3s;
}
.test-card:hover { transform: translateY(-5px); }
.test-card h3 { color: #6c63ff; margin-top: 0; }
.test-card p { color: #555; line-height: 1.6; }

/* --- PAGE PASSER TEST (QUESTIONS) --- */
.question-card {
    background: white; padding: 25px; margin-bottom: 25px;
    border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border-left: 5px solid #6c63ff;
}
.question-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 15px; color: #333; }
.reponse-option {
    display: block; margin-bottom: 10px; cursor: pointer;
    padding: 10px; border-radius: 8px; border: 1px solid #eee; transition: 0.2s;
}
.reponse-option:hover { background-color: #f0f0ff; border-color: #6c63ff; }
input[type="radio"] { margin-right: 10px; transform: scale(1.2); }

/* --- FORUM : LISTE DES SUJETS --- */
.forum-hero {
    color: white; padding: 40px 0; margin-bottom: 30px; text-align: center;
}
.topic-list { background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.topic-list-header { padding: 15px; background: #f4f4f4; border-bottom: 1px solid #ddd; font-weight: bold; }
.topic-item {
    padding: 15px 20px; border-bottom: 1px solid #f0f0f0;
    display: flex; justify-content: space-between; align-items: center;
    transition: background 0.2s;
}
.topic-item:hover { background: #f9f9f9; }
.topic-link { color: #333; font-weight: 600; text-decoration: none; font-size: 1.1em; }
.topic-meta { font-size: 0.9em; color: #888; margin-top: 4px; }
.topic-badge { background: #eee; padding: 5px 12px; border-radius: 20px; font-size: 0.8em; font-weight: bold; }

/* --- FORUM : CONVERSATION (MESSAGES) --- */
.message-block {
    display: flex; gap: 20px; margin-bottom: 20px; padding: 20px;
    background: white; border-radius: 12px; border: 1px solid #eee;
}
.message-user { text-align: center; width: 100px; flex-shrink: 0; }
.message-avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; margin-bottom: 10px; }
.message-pseudo { font-weight: bold; font-size: 0.9em; color: #333; display: block; }
.message-content { flex-grow: 1; }
.message-date {
    font-size: 0.8em; color: #888; margin-bottom: 10px;
    display: block; border-bottom: 1px solid #f5f5f5; padding-bottom: 5px;
}
.message-text { color: #444; line-height: 1.6; }
.btn-back-forum { color: rgba(255,255,255,0.8); text-decoration: none; display: inline-block; margin-bottom: 10px; }

/* --- RESULTAT --- */
.result-header { color: white; padding: 80px 20px; text-align: center; border-radius: 0 0 50% 50% / 20px; margin-bottom: 60px; }
.result-card {
    background: white; max-width: 600px; margin: -100px auto 0; padding: 40px;
    border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); text-align: center; position: relative;
}
.groupe-badge-large {
    color: white; padding: 10px 30px; border-radius: 30px;
    font-weight: bold; text-transform: uppercase; letter-spacing: 1px;
}
/* BOUTON SIGNALEMENT */
.btn-report {
    background: none;
    border: none;
    color: #e74c3c; /* Rouge discret */
    cursor: pointer;
    font-size: 0.85em;
    opacity: 0.6;
    transition: opacity 0.3s;
    text-decoration: underline;
}
.btn-report:hover {
    opacity: 1;
}
/* BADGE ADMIN DANS LE FORUM */
.badge-admin-role {
    background-color: #e74c3c;
    color: white;
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
    font-weight: bold;
    vertical-align: middle;
}
/* BOUTON RÉPONDRE (CITATION) */
.btn-reply {
    background: none;
    border: none;
    color: #6c63ff; /* Violet */
    cursor: pointer;
    font-size: 0.85em;
    font-weight: bold;
    margin-right: 15px;
    text-decoration: none;
    transition: opacity 0.3s;
}
.btn-reply:hover {
    text-decoration: underline;
    opacity: 0.8;
}
/* --- JOURNAL INTIME (SAFEPLACE) --- */
.journal-entry {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border-left: 5px solid #6c63ff; /* Bordure violette */
    transition: transform 0.2s;
}
.journal-entry:hover {
    transform: translateX(5px);
}
.journal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.journal-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin: 0;
}
.journal-date {
    font-size: 0.85em;
    color: #888;
    font-style: italic;
}
.journal-content {
    line-height: 1.6;
    color: #555;
    white-space: pre-wrap; /* Conserve les sauts de ligne */
}
/* --- STYLE CITATION (LOOK IMAGE) --- */
.citation-card {
    background: linear-gradient(135deg, #6c63ff 0%, #a29bfe 100%); /* Beau dégradé violet */
    color: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(108, 99, 255, 0.3);
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}

.citation-card:hover {
    transform: scale(1.02);
}

.citation-text {
    font-size: 1.5rem;
    font-weight: bold;
    font-family: 'Georgia', serif; /* Police style littéraire */
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 20px;
}

.citation-author {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
}

/* Animation de chargement */
.loading {
    opacity: 0.5;
}
/* --- SÉLECTEUR D'AVATAR --- */
.avatar-selector {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* On cache le bouton radio moche */
.avatar-selector input[type="radio"] {
    display: none;
}

/* Style des images cliquables */
.avatar-option {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 3px solid transparent; /* Bordure invisible par défaut */
    transition: transform 0.2s, border-color 0.2s;
    background-color: #eee;
}

.avatar-option:hover {
    transform: scale(1.1); /* Grossit un peu au survol */
    border-color: #ccc;
}

/* Quand on clique (ou si c'est sélectionné via JS si on voulait pousser) */
.avatar-selector input[type="radio"]:checked + .avatar-option {
    border-color: #6c63ff; /* Bordure violette si sélectionné */
    transform: scale(1.1);
}