/* =======================================================================
   style.css — feuille générique (partagée) — MAJ
   Sommaire
   01) Base / Reset
   02) Layout généraux
   03) Branding (logo / header / footer)
   04) Composants : box / inputs / boutons
   05) Widgets génériques (progress-bar étendue)
   06) Profils / rôles / formulaires
   07) Admin (dernières visites)
   08) Messages (erreur / succès)
   09) Liens utilitaires (retour / journal / profil)
   10) [projets.php] — styles spécifiques (grid, cartes, modal, progress scoping)
   11) [choix.php] — cartes & liens (visuel comme le screen)
   ======================================================================= */

/* == 01) Base / Reset =================================================== */
:root {
    color-scheme: dark;
    --bg: #2b2b2b;
    --panel: #333;
    --panel-2: #444;
    --text: #ffffff;
    --muted: #bbb;
    --muted-2: #aaa;
    --border: rgba(255,255,255,.12);
    --shadow: rgba(0,0,0,.5);
    --primary: #0d6efd; /* ancien #007BFF harmonisé */
    --primary-2: #0056b3;
    --danger: #dc3545;
    --warning: #ffc107;
    --ok: #28a745;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
}

a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Focus visible (a11y) */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Motion reduce */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation-duration: .01ms !important; }
}

/* == 02) Layout généraux =============================================== */
.container {
    text-align: center;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 50px 16px 0;
}

/* == 03) Branding (logo / header / footer) ============================= */
.logo-container { text-align: center; margin-bottom: 30px; }
.logo {
    width: 350px;
    height: auto;
    display: block;
    margin: 0 auto;
    max-width: 90%;
}

.header p {
    font-size: 18px;
    color: #bbb;
    margin-top: 10px;
}

.footer {
    margin-top: 50px;
    font-size: 14px;
    color: var(--muted-2);
    text-shadow: 1px 1px 2px black;
}

/* == 04) Composants : box / inputs / boutons =========================== */
.box {
    background: var(--panel);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px var(--shadow);
}
.box h2 {
    color: #eee;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px black;
}
.box label {
    display: block;
    text-align: left;
    margin-bottom: 8px;
    font-weight: bold;
    color: #ddd;
}
.box input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #555;
    border-radius: 5px;
    background: var(--panel-2);
    color: var(--text);
    font-size: 14px;
}
.box button {
    width: 100%;
    padding: 10px;
    background-color: var(--primary);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,.3);
    transition: background-color .3s ease, box-shadow .3s ease, transform .2s ease;
}
.box button:hover {
    background-color: var(--primary-2);
    box-shadow: 0 6px 12px rgba(0,0,0,.5);
    transform: translateY(-1px);
}

/* Boutons principaux (génériques) */
.question-button,
.register-button,
.login-button .button,
.button {
    display: inline-block;
    background-color: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color .3s ease, transform .2s ease, filter .2s ease;
    border: none;
    cursor: pointer;
}
.question-button { padding: 15px 30px; font-size: 18px; font-weight: bold; }
.question-button:hover { background-color: var(--primary-2); transform: scale(1.05); }

.register-button { padding: 10px 20px; margin-top: 10px; font-size: 16px; text-align: center; }
.register-button:hover { background-color: var(--primary-2); transform: scale(1.05); }

/* Bouton Login (en haut à droite) */
.login-button { position: fixed; top: 20px; right: 20px; z-index: 50; }
.login-button .button { padding: 10px 15px; font-size: 14px; }
.login-button .button:hover { background-color: var(--primary-2); }

/* Etats & disabled */
.button[disabled],
button[disabled] { opacity: .6; cursor: not-allowed; }

/* == 05) Widgets génériques (progress-bar étendue) ===================== */
.progress-bar {
    width: 100%;
    background-color: var(--panel-2);
    border-radius: 5px;
    margin-bottom: 20px;
    height: 20px;
    overflow: hidden;
}
.progress {
    height: 100%;
    background-color: var(--primary);
    width: 0;
    transition: width .3s ease;
}
.progress-text {
    text-align: center;
    font-size: 14px;
    color: #fff;
    margin-top: 5px;
}

/* == 06) Profils / rôles / formulaires ================================ */
.profile-form {
    display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem;
}
.profile-form label { font-weight: bold; color: #fff; }
.profile-form input, .profile-form textarea {
    padding: 10px; font-size: 16px; border: 1px solid #ccc; border-radius: 5px;
    background: var(--panel-2); color: var(--text);
}
.avatar-preview { width: 100px; height: 100px; border-radius: 50%; margin-top: 10px; object-fit: cover; }

.role-badge {
    display: inline-block; margin-top: 10px; padding: 5px 10px;
    font-size: 14px; font-weight: bold; color: #000; background-color: var(--warning); border-radius: 5px;
}
.role-badge.vip  { background-color: var(--warning); color: #000; }
.role-badge.admin{ background-color: var(--danger); color: #fff; }

/* Sélecteur de date (DOB) */
#dob-container {
    display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 10px;
}
#dob-container select {
    background-color: var(--panel-2); color: #fff; border: 1px solid #555; border-radius: 5px;
    padding: 8px; font-size: 14px; text-align: center; appearance: none; cursor: pointer;
}
#dob-container select:hover { background-color: #555; }
#dob-container button {
    background-color: var(--primary); color: #fff; border: none; padding: 10px 20px;
    border-radius: 5px; cursor: pointer; font-size: 14px; transition: background-color .3s ease, transform .2s ease;
}
#dob-container button:hover { background-color: var(--primary-2); transform: translateY(-1px); }

/* == 07) Admin (dernières visites) ===================================== */
.admin-last-visits {
    margin-top: 30px; background: var(--panel); padding: 20px; border-radius: 10px;
    box-shadow: 0 4px 10px var(--shadow); color: #fff; font-size: 16px;
}
.admin-last-visits h2 {
    font-size: 18px; margin-bottom: 10px; color: #bbb; text-align: center;
}
.admin-last-visits ul { list-style: none; padding: 0; }
.admin-last-visits ul li {
    margin-bottom: 10px; font-size: 14px; color: #ddd; text-align: left;
    border-bottom: 1px solid #444; padding-bottom: 5px;
}
.admin-last-visits ul li:last-child { border-bottom: none; }

/* Tableau “Utilisateur / Dernière visite / Record” */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(0,0,0,.18);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    font-size: 14px;
}
.admin-table th, .admin-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.admin-table thead th {
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-size: 12px;
    color: #cfcfcf;
    background: rgba(255,255,255,.04);
}
.admin-table tbody tr:hover { background: rgba(255,255,255,.04); }
.admin-table .col-user { width: 40%; }
.admin-table .col-last { width: 30%; }
.admin-table .col-record { width: 30%; }

/* == 08) Messages (erreur / succès) ==================================== */
.error-message   { color: red; font-weight: bold; text-align: center; margin-top: 20px; font-size: 18px; }
.success-message { color: var(--ok); font-weight: bold; margin-bottom: 1rem; }

/* == 09) Liens utilitaires (retour / journal / profil) ================= */
.back-button {
    background-color: #6c757d; color: #fff; padding: 10px 20px; text-decoration: none;
    border-radius: 5px; font-size: 16px; display: inline-block; margin-top: 15px;
    text-align: center; transition: background-color .3s ease, transform .2s ease;
}
.back-button:hover { background-color: #5a6268; transform: scale(1.05); }

.journal-button {
    display: block; margin: 20px auto; padding: 15px 30px;
    background-color: #333; color: #fff; font-size: 18px; font-weight: bold; text-align: center;
    text-decoration: none; border-radius: 10px; box-shadow: 0 4px 10px var(--shadow);
    transition: background-color .3s ease, transform .2s ease, box-shadow .3s ease;
}
.journal-button:hover { transform: scale(1.05); box-shadow: 0 6px 15px rgba(0,0,0,.7); }

/* Bouton Profil (utilisé notamment sur projets.php) */
.profile-button-container { position: fixed; top: 15px; right: 20px; z-index: 50; }
.profile-button {
    display: inline-block; padding: 10px 20px; background-color: var(--primary); color: #fff;
    font-size: 16px; font-weight: bold; text-align: center; text-decoration: none; border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,.3); transition: background-color .3s ease, transform .2s ease;
}
.profile-button:hover { background-color: var(--primary-2); transform: scale(1.05); }

/* == 10) [projets.php] — styles spécifiques ============================ */
header.main-header {
    padding-top: 20px; margin-bottom: 20px; text-align: center; position: relative; cursor: pointer;
}
header.main-header img { max-width: 320px; height: auto; margin: 6px auto 8px; display: block; }
header.main-header h1 { font-size: 28px; margin: 10px 0 6px; font-weight: 800; }
header.main-header p  { font-size: 14px; margin: 0; opacity: .9; }

.content-narrow { width: 90%; margin: 0 auto; padding: 8px 0 24px; }

/* Statistiques */
.stats-row {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 0 auto 18px;
}
.stat-card {
    text-align: center; padding: 20px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,.08); background: rgba(0,0,0,.18);
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.stat-card .label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.stat-card .num   { font-weight: 800; font-size: 32px; margin-top: 6px; color: #1e90ff; }

/* Toolbar */
.toolbar { display: flex; justify-content: center; margin: 10px 0 18px; gap: 10px; }

/* Boutons spécifiques projets */
.btn-core,
.button { /* compat global */
    display: inline-block; padding: 10px 18px; border-radius: 10px; background: var(--primary);
    color: #fff; text-decoration: none; font-weight: 700; border: none; cursor: pointer;
    box-shadow: 0 6px 16px rgba(13,110,253,.35);
}
.btn-core:hover,
.button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-sm { padding: 7px 10px; border-radius: 8px; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { filter: brightness(1.08); }

/* Grille projets + cartes */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 18px; }
.project-card {
    position: relative; border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px; background: rgba(0,0,0,.18);
    padding: 18px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.project-card::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: var(--project-color, var(--primary));
    box-shadow: 0 0 14px var(--project-color, var(--primary));
    border-radius: 12px 12px 0 0;
}
.project-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.project-title  { margin: 0; font-size: 18px; font-weight: 800; }
.project-actions{ display: flex; gap: 8px; }
.project-description { opacity: .85; font-size: 14px; margin: 6px 0 12px; }

/* Progress dans les cartes (SCOPÉ pour éviter les conflits avec la progress générique) */
.project-card .progress {
    height: 8px; border-radius: 999px; overflow: hidden;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
    margin-bottom: 6px;
}
.project-card .progress > span { display: block; height: 100%; background: var(--project-color, var(--primary)); }
.project-card .progress-text { font-size: 12px; opacity: .85; margin-bottom: 10px; }

/* Liste des tâches */
.task-list  { max-height: 260px; overflow: auto; margin: 6px 0 12px; padding-right: 6px; }
.task-item  { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.task-item:last-child { border-bottom: none; }
.task-checkbox { width: 18px; height: 18px; accent-color: var(--primary); }
.task-text.completed { opacity: .55; text-decoration: line-through; }

/* Auteur (discret, à droite) */
.task-author { margin-left: auto; font-size: 12px; opacity: .6; }

/* Actions d’édition (affichées en mode edition) */
.task-actions { display: none; gap: 8px; }
.task-action  { cursor: pointer; opacity: .75; font-weight: 800; }
.task-action:hover { opacity: 1; }
.task-item.is-editing .task-actions { display: inline-flex; }

/* Ajout tâche & édition inline */
.add-task-form { display: flex; gap: 8px; }
.add-task-input,
.task-edit-input {
    flex: 1; border-radius: 10px; border: 1px solid rgba(255,255,255,.14);
    background: rgba(0,0,0,.25); color: #fff; padding: 10px 12px; font-size: 14px;
}
.task-edit-input { padding: 6px 10px; }

/* Footer local (texte seul) */
.page-footer p { background: transparent; border: none; border-radius: 0; box-shadow: none; padding: 0; color: #cfcfcf; }

/* Modal projets */
.pj-modal {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.85);
    z-index: 2000; align-items: center; justify-content: center;
}
.pj-modal.is-open { display: flex; }
.pj-modal .modal-content {
    background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px; padding: 22px; width: min(520px, 92vw);
    max-height: 85vh; overflow: auto; box-shadow: 0 12px 40px rgba(0,0,0,.55);
}
.pj-modal .modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pj-modal .modal-title  { margin: 0; font-size: 20px; font-weight: 800; }
.pj-modal .modal-close  { cursor: pointer; font-size: 28px; opacity: .7; }
.pj-modal .modal-close:hover { opacity: 1; }
.pj-modal .form-group  { margin-bottom: 14px; }
.pj-modal .form-label  { font-size: 13px; opacity: .85; margin-bottom: 6px; display: block; }
.pj-modal .form-input,
.pj-modal .form-textarea {
    width: 100%; border-radius: 10px; border: 1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.25); color: #fff; padding: 10px 12px; font-size: 14px;
}
.pj-modal .form-textarea { min-height: 120px; resize: vertical; }
.pj-modal .color-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.pj-modal .color-option { width: 36px; height: 36px; border-radius: 8px; border: 3px solid transparent; cursor: pointer; }
.pj-modal .color-option.selected { border-color: #fff; }

/* Utils */
.hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* == Responsivité ======================================================= */
@media (max-width: 992px) {
    .stats-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .projects-grid { grid-template-columns: 1fr; }
    .profile-button-container, .login-button { top: 12px; right: 12px; }
    header.main-header img { max-width: 260px; }
}
@media (max-width: 480px) {
    .logo { width: 260px; }
    header.main-header h1 { font-size: 22px; }
    .question-button { width: 100%; }
    .toolbar { flex-wrap: wrap; }
}

/* == 11) [choix.php] — Cartes & liens (visuel du screen) =============== */
/* Grille */
.choices-box {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;              /* comme avant */
    list-style: none;
    padding: 0;
    margin: 30px 0 0;
}

/* Carte (exactement comme avant) */
.choice-item {
    width: 200px;           /* comme avant */
    text-align: center;
    background: #333;       /* comme avant */
    border: none;           /* pas de liseré */
    border-radius: 10px;    /* comme avant */
    padding: 15px;          /* comme avant */
    box-shadow: 0 4px 10px rgba(0,0,0,.5);
    transition: transform .2s ease, box-shadow .3s ease;
}
.choice-item:hover {
    transform: scale(1.05);                             /* comme avant */
    box-shadow: 0 6px 15px rgba(0,0,0,.7);              /* comme avant */
}

/* Lien */
.choice-item a,
.choice-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;              /* comme avant */
    text-decoration: none;
    color: #fff;
}

/* Anti-violet (au cas où) */
.choices-box a:link,
.choices-box a:visited,
.choices-box a:hover,
.choices-box a:active { color: #fff; text-decoration: none; }

/* Pastille ronde */
.choice-image {
    width: 100px; height: 100px;        /* comme avant */
    object-fit: cover;
    border-radius: 50%;
    background-color: #444;
    padding: 10px;
    border: 6px solid rgba(255,255,255,.08);
    box-shadow: inset 0 0 0 4px rgba(0,0,0,.25);
}

/* Titre sous l’image */
.choice-link span {
    font-size: 16px;
    font-weight: bold;      /* comme avant */
    color: #ddd;            /* comme avant */
    text-shadow: 0 1px 0 rgba(0,0,0,.25);
}
