* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Trirong, Poppins, Arial, sans-serif;
    font-size: 20px;
    line-height: 1.5;
    background: linear-gradient(180deg, #f5f7fb 0%, #eef3fb 100%);
    color: #162033;
}

.hero {
    width: 90%;
    max-width: 1100px;
    margin: 30px auto 18px auto;
    text-align: center;
}

h1 {
    font-family: Audiowide, Poppins, sans-serif;
    color: #0b56c3;
    margin-bottom: 10px;
    text-shadow: 2px 2px 0 rgba(255,255,255,0.8);
}

.hero-text {
    max-width: 900px;
    margin: auto;
}

.carousel-section {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto 30px auto;
}

.carousel {
    position: relative;
    width: 100%;
    height: 430px;
    border-radius: 24px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(0,0,0,0.10);
}

.carousel-track {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(10, 28, 61, 0.62);
    color: white;
    font-size: 26px;
    cursor: pointer;
}

.carousel-btn:hover { background: rgba(10, 28, 61, 0.85); }
.carousel-btn.prev { left: 14px; }
.carousel-btn.next { right: 14px; }

.carousel-dots {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 5;
}

.dot {
    width: 12px;
    height: 12px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
    cursor: pointer;
}

.dot.active { background: white; }

.grand_cadre_du_chat {
    width: 90%;
    max-width: 1100px;
    margin: auto auto 30px auto;
}

.container {
    width: 100%;
    background: #fff;
    padding: 18px;
    border-radius: 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.intro-card h2 {
    color: #0b56c3;
    margin-top: 0;
}

.toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.filter-box {
    width: 100%;
    max-width: 430px;
}

.poster_un_chat, .le_chat {
    width: 100%;
}

.chat-form .row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

input[type="text"], textarea, select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d6def0;
    border-radius: 12px;
    font-size: 17px;
    background: white;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

button {
    padding: 11px 16px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: #1465df;
    color: #fff;
    font-size: 16px;
}

button:hover { opacity: 0.95; }

.le_chat {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-line {
    padding: 12px 14px;
    background: #fff7bd;
    border: 1px solid #f0e18f;
    border-radius: 12px;
}

.chat-school {
    margin: 6px 0 8px 0;
    font-size: 15px;
    color: #0b56c3;
    font-weight: bold;
}

.empty {
    color: #777;
    font-style: italic;
}

.status {
    margin-left: 10px;
    font-size: 15px;
    color: #444;
}

.hidden {
    display: none;
}

footer {
    background: #061222;
    color: white;
    padding: 22px;
    font-size: 13px;
    text-align: justify;
}

#vision_et_mission {
  width : 100%;
  height : 30%;
  object-fit: cover;
}

/*  MUSIQUE  */
.music_box {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
}

.music_box label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}

.music_box select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid black;
  margin-bottom: 5px;
}

.music_actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.music_actions button {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
/*  FIN DE MUSIQUE */

@media (max-width: 768px) {
    body { font-size: 18px; }
    .carousel { height: 260px; }
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
    .toolbar {
        justify-content: stretch;
    }
    .filter-box {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .hero, .carousel-section, .grand_cadre_du_chat { width: 94%; }
    .carousel { height: 220px; }
    footer { font-size: 12px; }
}

/* ===========================================================
   FORMULAIRES D'AUTHENTIFICATION
   (login, signup, verify, update_profil, account_delete)
   =========================================================== */

.auth-page {
    width: 92%;
    max-width: 520px;
    margin: 40px auto 60px auto;
}

.auth-card {
    background: #fff;
    padding: 32px 28px;
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(11, 86, 195, 0.10);
    border: 1px solid #eaf0fb;
}

.auth-card h2 {
    margin-top: 0;
    margin-bottom: 6px;
    color: #0b56c3;
    font-family: Audiowide, Poppins, sans-serif;
    font-size: 26px;
    text-align: center;
}

.auth-subtitle {
    text-align: center;
    color: #4d5b75;
    margin-top: 0;
    margin-bottom: 22px;
    font-size: 15px;
}

.form-vertical {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-vertical label {
    margin-top: 12px;
    font-weight: 600;
    color: #2a3957;
    font-size: 15px;
}

.form-vertical .label-optional {
    color: #8693ae;
    font-weight: 400;
    font-size: 13px;
    margin-left: 4px;
}

.form-vertical input[type="text"],
.form-vertical input[type="email"],
.form-vertical input[type="password"],
.form-vertical select,
.form-vertical textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d6def0;
    border-radius: 12px;
    font-size: 16px;
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-vertical input:focus,
.form-vertical select:focus,
.form-vertical textarea:focus {
    outline: none;
    border-color: #1465df;
    box-shadow: 0 0 0 3px rgba(20, 101, 223, 0.15);
}

.form-vertical .field-hint {
    font-size: 13px;
    color: #6b7891;
    margin-top: 4px;
}

.btn-primary {
    margin-top: 22px;
    width: 100%;
    padding: 13px 18px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: #1465df;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.15s, transform 0.05s;
}

.btn-primary:hover { background: #0e52b8; }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
    display: inline-block;
    margin-top: 14px;
    padding: 10px 16px;
    border: 1px solid #d6def0;
    border-radius: 12px;
    background: #fff;
    color: #2a3957;
    text-decoration: none;
    font-size: 15px;
    cursor: pointer;
}

.btn-secondary:hover { background: #f5f7fb; }

.btn-danger {
    background: #c2333a;
}
.btn-danger:hover { background: #a02a30; }

.auth-footer-links {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: #4d5b75;
}

.auth-footer-links a {
    color: #1465df;
    text-decoration: none;
    font-weight: 600;
}
.auth-footer-links a:hover { text-decoration: underline; }

/* messages flash */
.flash-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flash {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    border: 1px solid transparent;
}

.flash-success {
    background: #e8f6ec;
    border-color: #b9e1c4;
    color: #1c6b34;
}
.flash-error {
    background: #fdecec;
    border-color: #f3c0c0;
    color: #a51f1f;
}
.flash-info {
    background: #eaf2fd;
    border-color: #c4daf8;
    color: #134f9e;
}

/* form-row : 2 colonnes en grand écran, 1 col en mobile */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 520px) {
    .form-row { grid-template-columns: 1fr; }
    .auth-card { padding: 24px 20px; }
}

/* danger zone (page suppression) */
.danger-zone {
    background: #fff5f5;
    border: 1px solid #f4cfcf;
    padding: 16px;
    border-radius: 12px;
    color: #732121;
    margin: 14px 0 22px 0;
    font-size: 15px;
}

/* code de vérification : grande police */
.verify-code-input {
    text-align: center;
    letter-spacing: 14px;
    font-size: 24px !important;
    font-weight: 600;
    font-family: monospace;
}

/* mini lien "renvoyer un code" inline */
.inline-form { display: inline; }
.link-button {
    background: none;
    border: none;
    color: #1465df;
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
    padding: 0;
}
.link-button:hover { color: #0e52b8; }

/* boîte d'auth dans la page principale */
.auth_box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(11, 86, 195, 0.06);
    font-size: 15px;
}

.auth_box a {
    color: #1465df;
    text-decoration: none;
    font-weight: 600;
}
.auth_box a:hover { text-decoration: underline; }

/* Filtres compacts */
.filters-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 700px) {
    .filters-grid { grid-template-columns: 1fr; }
}

.filters-grid label {
    font-size: 14px;
    font-weight: 600;
    color: #2a3957;
    display: block;
    margin-bottom: 6px;
}

/* ===========================================================
   PAGE STATISTIQUES
   =========================================================== */

.stats-page {
    width: 92%;
    max-width: 1100px;
    margin: 30px auto 60px auto;
}

.stats-header {
    text-align: center;
    margin-bottom: 30px;
}

.stats-header h1 {
    margin-bottom: 6px;
    font-size: 32px;
}

.stats-subtitle {
    color: #4d5b75;
    margin: 0 auto 8px auto;
    max-width: 700px;
}

.stats-back {
    margin-top: 6px;
    font-size: 14px;
}

.stats-back a {
    color: #1465df;
    text-decoration: none;
    font-weight: 600;
}
.stats-back a:hover { text-decoration: underline; }

/* KPIs */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

@media (max-width: 900px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
}

.kpi-card {
    background: #fff;
    border-radius: 18px;
    padding: 20px 18px;
    box-shadow: 0 10px 25px rgba(11, 86, 195, 0.08);
    text-align: center;
    border: 1px solid #eaf0fb;
}

.kpi-value {
    font-family: Audiowide, Poppins, sans-serif;
    font-size: 38px;
    color: #0b56c3;
    line-height: 1.1;
}

.kpi-label {
    font-size: 14px;
    font-weight: 600;
    color: #2a3957;
    margin-top: 4px;
}

.kpi-sub {
    font-size: 12px;
    color: #6b7891;
    margin-top: 4px;
}

/* Sections */
.stats-section {
    background: #fff;
    border-radius: 20px;
    padding: 22px 22px 18px 22px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    margin-bottom: 22px;
    border: 1px solid #eaf0fb;
}

.stats-section h2 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #0b56c3;
    font-size: 20px;
}

.stats-empty,
.stats-empty-mini {
    color: #6b7891;
    font-style: italic;
    text-align: center;
    padding: 14px;
}

.stats-empty {
    background: #fff;
    border-radius: 14px;
    border: 1px dashed #d6def0;
}

/* Bar lists */
.bar-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    counter-reset: bar-counter;
}

.bar-list li {
    counter-increment: bar-counter;
}

.bar-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
    gap: 10px;
}

.bar-label {
    font-size: 14px;
    color: #2a3957;
    flex: 1;
    word-break: break-word;
}

.bar-label::before {
    content: counter(bar-counter) ". ";
    color: #8693ae;
    font-weight: 600;
}

.bar-value {
    font-weight: 700;
    color: #0b56c3;
    font-size: 14px;
    white-space: nowrap;
}

.bar-track {
    width: 100%;
    height: 10px;
    background: #eaf0fb;
    border-radius: 6px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1465df 0%, #4f8df5 100%);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.bar-fill-alt {
    background: linear-gradient(90deg, #c2333a 0%, #e36b71 100%);
}

/* Activity */
.activity-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 700px) {
    .activity-grid { grid-template-columns: repeat(2, 1fr); }
}

.activity-tile {
    background: #f5f7fb;
    padding: 14px;
    border-radius: 12px;
    text-align: center;
}

.activity-tile strong {
    display: block;
    font-size: 24px;
    color: #0b56c3;
    font-family: Audiowide, Poppins, sans-serif;
}

.activity-tile span {
    font-size: 13px;
    color: #4d5b75;
}

.stats-footnote {
    margin-top: 12px;
    font-size: 13px;
    color: #6b7891;
    text-align: center;
}

/* Tables */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.stats-table th,
.stats-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eaf0fb;
}

.stats-table th {
    background: #f5f7fb;
    color: #2a3957;
    font-weight: 600;
    font-size: 14px;
}

.stats-table tr:last-child td {
    border-bottom: none;
}

.stats-table td:first-child {
    width: 40px;
    color: #8693ae;
    font-weight: 600;
}

/* ===========================================================
   COMMENTAIRES : DATE + ACTIONS (Modifier / Supprimer)
   =========================================================== */

.chat-line {
    position: relative;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.chat-date {
    font-size: 12px;
    color: #8693ae;
    white-space: nowrap;
}

.chat-edited {
    color: #b3b9c8;
    font-style: italic;
}

.chat-text {
    margin-top: 4px;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-actions {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.chat-actions-right {
    display: flex;
    gap: 8px;
}

.btn-link {
    background: none;
    border: none;
    color: #1465df;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.12s;
}
.btn-link:hover {
    background: #eaf2fd;
}
.btn-link.btn-delete {
    color: #c2333a;
}
.btn-link.btn-delete:hover {
    background: #fdecec;
}

@media (max-width: 480px) {
    .chat-header { flex-direction: column; align-items: flex-start; }
    .chat-date { font-size: 11px; }
}

/* ===========================================================
   FORMULAIRE D'ÉDITION INLINE
   =========================================================== */

.edit-form {
    margin-top: 6px;
}

.edit-textarea {
    width: 100%;
    min-height: 90px;
    resize: vertical;
    padding: 10px 12px;
    border: 2px solid #1465df;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.5;
    background: #f5f8ff;
    color: #162033;
}

.edit-textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(20, 101, 223, 0.15);
}

.edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
    align-items: center;
}

.btn-save-edit {
    padding: 8px 16px;
    background: #1465df;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s;
}

.btn-save-edit:hover { background: #0e52b8; }
.btn-save-edit:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-cancel-edit {
    font-size: 14px;
    color: #6b7891;
}
.btn-cancel-edit:hover {
    background: #f5f7fb;
    color: #2a3957;
}

/* ===========================================================
   RÉPONSES AUX MESSAGES
   =========================================================== */

.chat-reply {
    margin-left: 28px;
    border-left: 3px solid #c4daf8;
    background: #f5f9ff;
    border-color: #c4daf8;
}

.btn-reply {
    color: #4d5b75;
}
.btn-reply:hover {
    background: #f0f4fb;
    color: #0b56c3;
}

.reply-form {
    margin-top: 10px;
}

.reply-textarea {
    width: 100%;
    min-height: 70px;
    resize: vertical;
    padding: 9px 12px;
    border: 2px solid #c4daf8;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.5;
    background: #f5f8ff;
    color: #162033;
}

.reply-textarea:focus {
    outline: none;
    border-color: #1465df;
    box-shadow: 0 0 0 3px rgba(20, 101, 223, 0.12);
}

.btn-send-reply {
    padding: 7px 15px;
    background: #1465df;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s;
}
.btn-send-reply:hover { background: #0e52b8; }
.btn-send-reply:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-cancel-reply {
    font-size: 14px;
    color: #6b7891;
}
.btn-cancel-reply:hover { background: #f5f7fb; color: #2a3957; }

/* ===========================================================
   PANNEAU D'ADMINISTRATION
   =========================================================== */

.mod-page {
    width: 94%;
    max-width: 1200px;
    margin: 30px auto 60px auto;
}

.mod-header {
    margin-bottom: 20px;
}

.mod-header h1 {
    margin: 0 0 4px 0;
    color: #0b56c3;
    font-family: Audiowide, Poppins, sans-serif;
}

.mod-back a {
    color: #1465df;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
}
.mod-back a:hover { text-decoration: underline; }

.mod-table-wrap {
    overflow-x: auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.07);
    border: 1px solid #eaf0fb;
}

.mod-table th, .mod-table td {
    vertical-align: top;
    padding: 12px 14px;
}

.mod-small { font-size: 13px; color: #4d5b75; }

.mod-status { font-size: 13px; white-space: nowrap; }

.row-suspended td { background: #fff8f0; }

.mod-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
}

.mod-inline-form { display: inline; }

.mod-protected { color: #8693ae; font-size: 13px; font-style: italic; }

/* Avertissement */
.warn-details { width: 100%; }

.warn-details summary { list-style: none; cursor: pointer; }
.warn-details summary::-webkit-details-marker { display: none; }

.btn-warn-toggle { color: #1465df; }
.btn-warn-toggle:hover { background: #eaf2fd; }

.warn-form {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.warn-textarea {
    width: 100%;
    min-height: 80px;
    resize: vertical;
    padding: 9px 12px;
    border: 1px solid #d6def0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
}
.warn-textarea:focus {
    outline: none;
    border-color: #1465df;
    box-shadow: 0 0 0 3px rgba(20, 101, 223, 0.12);
}

.btn-warn-send {
    align-self: flex-start;
    padding: 7px 14px;
    background: #e67e00;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.btn-warn-send:hover { background: #c46a00; }

.btn-suspend { color: #9b5a00; }
.btn-suspend:hover { background: #fff3e0; }

.btn-unsuspend { color: #1c6b34; }
.btn-unsuspend:hover { background: #e8f6ec; }

/* ---- Section visiteurs (statistiques) ---- */
.stats-visitors { border-top: 2px solid #e3e9f7; padding-top: 1rem; }

.stats-subtitle-small {
    color: #6b7a9a;
    font-size: 14px;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.kpi-solo {
    margin: 1.2rem 0 0.6rem;
    text-align: center;
    background: #f0f4ff;
    border-radius: 14px;
    padding: 18px 0;
}

.kpi-solo .kpi-value {
    font-size: 2.4rem;
    font-weight: 700;
    color: #1a3560;
}

.kpi-solo .kpi-label {
    font-size: 13px;
    color: #6b7a9a;
    margin-top: 4px;
}

.bar-fill-geo {
    background: linear-gradient(90deg, #0a7a5e 0%, #34c49e 100%);
}
