/* ============================================
   TABLEAU DE BORD PERSONNEL — style.css
   Palette : bleu-indigo + orange accent
   ============================================ */

/* --- Variables de couleurs --- */
:root {
  --bg-page:       #F1F5F9;
  --bg-module:     #FFFFFF;
  --couleur-titre: #1E293B;
  --couleur-texte: #334155;
  --accent:        #4F46E5;
  --accent-hover:  #4338CA;
  --orange:        #F97316;
  --orange-hover:  #EA6C0A;
  --vert:          #10B981;
  --rouge:         #EF4444;
  --gris-clair:    #E2E8F0;
  --gris-texte:    #94A3B8;
  --ombre:         0 2px 12px rgba(0, 0, 0, 0.08);
}

/* --- Reset de base --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-page);
  color: var(--couleur-texte);
  padding: 20px;
  transition: background-color 0.4s, color 0.4s;
}

/* --- Bouton mode sombre (coin haut-droit) --- */
#btnTheme {
  position: fixed;
  top: 16px;
  right: 16px;
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85em;
  z-index: 100;
  transition: background-color 0.3s, transform 0.2s;
}

#btnTheme:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

/* --- Header --- */
header {
  text-align: center;
  padding: 30px 0 20px 0;
}

header h1 {
  color: var(--accent);
  font-size: 2em;
  letter-spacing: 1px;
}

/* --- Grille principale --- */
main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

/* --- Modules (cartes) --- */
.module {
  background: var(--bg-module);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--ombre);
  transition: transform 0.25s, box-shadow 0.25s;
}

.module:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.module h2 {
  color: var(--accent);
  margin-bottom: 16px;
  font-size: 1.1em;
  border-bottom: 2px solid var(--gris-clair);
  padding-bottom: 8px;
}

/* --- Boutons généraux --- */
button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.25s, transform 0.15s;
}

button:hover {
  background: var(--accent-hover);
  transform: scale(1.03);
}

/* --- Inputs --- */
input[type="text"],
input[type="number"] {
  border: 2px solid var(--gris-clair);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.9em;
  width: 100%;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
}

/* ============================================
   MODULE A — Carte de profil
   ============================================ */
#carteProfil {
  background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}

#carteProfil p {
  margin: 5px 0;
  font-size: 0.95em;
}

#zonePrenom {
  font-weight: bold;
  font-size: 1.15em !important;
  color: var(--accent);
}

#formulaireProfil {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}

#formulaireProfil input {
  flex: 1;
  margin-bottom: 0;
}

#btnModifierProfil {
  background: var(--orange);
  white-space: nowrap;
}

#btnModifierProfil:hover {
  background: var(--orange-hover);
}

/* ============================================
   MODULE B — Liste de tâches
   ============================================ */
#ajoutTache {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

#ajoutTache input {
  flex: 1;
  margin-bottom: 0;
}

#btnAjouterTache {
  background: var(--vert);
  white-space: nowrap;
}

#btnAjouterTache:hover {
  background: #0EA271;
}

#compteurTaches {
  font-size: 0.85em;
  color: var(--gris-texte);
  margin-bottom: 10px;
}

#nombreTaches {
  font-weight: bold;
  color: var(--orange);
}

#listeTaches {
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
}

#listeTaches li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--bg-page);
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  animation: apparitionTache 0.3s ease;
}

@keyframes apparitionTache {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

#listeTaches li.terminee {
  text-decoration: line-through;
  color: var(--gris-texte);
  border-left-color: var(--gris-clair);
  opacity: 0.6;
}

.btnTerminer {
  background: var(--vert);
  padding: 5px 10px;
  font-size: 0.8em;
  margin-right: 6px;
}

.btnTerminer:hover {
  background: #0EA271;
}

.btnSupprimer {
  background: var(--rouge);
  padding: 5px 10px;
  font-size: 0.8em;
}

.btnSupprimer:hover {
  background: #DC2626;
}

/* ============================================
   MODULE C — Quiz
   ============================================ */
#zoneQuestion {
  background: #EEF2FF;
  border-radius: 10px;
  padding: 16px;
  font-size: 1em;
  font-weight: bold;
  margin-bottom: 14px;
  min-height: 54px;
}

#progressionQuiz {
  font-size: 0.82em;
  color: var(--gris-texte);
  margin-bottom: 8px;
}

#zoneReponses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

#zoneReponses button {
  background: white;
  color: var(--couleur-texte);
  border: 2px solid var(--gris-clair);
  padding: 12px;
  font-size: 0.85em;
}

#zoneReponses button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: white;
}

#scoreQuiz {
  font-weight: bold;
  color: var(--vert);
}

#btnDemarrerQuiz {
  background: var(--orange);
  width: 100%;
  margin-top: 8px;
}

#btnDemarrerQuiz:hover {
  background: var(--orange-hover);
}

#zoneResultat {
  text-align: center;
  padding: 8px 0;
}

.bonne-reponse {
  background: var(--vert) !important;
  color: white !important;
  border-color: var(--vert) !important;
  animation: pulse 0.5s 1;
}

.mauvaise-reponse {
  background: var(--rouge) !important;
  color: white !important;
  border-color: var(--rouge) !important;
}

@keyframes pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ============================================
   MODULE D — Générateur de mot de passe
   ============================================ */
#optionsPassword label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9em;
}

input[type="range"] {
  width: 100%;
  margin: 8px 0 14px 0;
  accent-color: var(--accent);
}

#checkboxes {
  margin-bottom: 14px;
}

#checkboxes label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 0.88em;
}

#btnGenerer {
  background: var(--orange);
  width: 100%;
}

#btnGenerer:hover {
  background: var(--orange-hover);
}

#resultatPassword {
  margin-top: 14px;
  text-align: center;
}

#motDePasse {
  background: var(--bg-page);
  border-radius: 8px;
  padding: 12px;
  font-family: monospace;
  font-size: 1em;
  word-break: break-all;
  border: 2px solid var(--gris-clair);
  min-height: 44px;
}

#indicateurForce {
  margin-top: 8px;
  font-weight: bold;
  font-size: 0.9em;
}

/* ============================================
   MODE SOMBRE
   ============================================ */
body.sombre {
  --bg-page:    #0F172A;
  --bg-module:  #1E293B;
  --couleur-titre: #F1F5F9;
  --couleur-texte: #CBD5E1;
  --gris-clair: #334155;
  --gris-texte: #64748B;
}

body.sombre #carteProfil {
  background: linear-gradient(135deg, #1E1B4B, #312E81);
}

body.sombre #zoneQuestion {
  background: #1E1B4B;
  color: #E0E7FF;
}

body.sombre #zoneReponses button {
  background: #334155;
  color: #CBD5E1;
  border-color: #475569;
}

body.sombre #zoneReponses button:hover {
  border-color: var(--accent);
  background: #334155;
}

body.sombre #motDePasse {
  background: #0F172A;
  color: #CBD5E1;
}

/* ============================================
   RESPONSIVITÉ
   ============================================ */
@media (max-width: 700px) {
  main {
    grid-template-columns: 1fr;
  }

  header h1 {
    font-size: 1.5em;
    padding-right: 80px;
  }

  #zoneReponses {
    grid-template-columns: 1fr;
  }
}
