/* ACADÉMIE CUNY — charte graphique CUNY / EXIM
   Rouge EXIM : #C93A30 (primaire), #A82E24 (foncé), #F9E5E3 (clair rosé)
   Bleu nuit CUNY : #1A294A */

:root {
  --rouge: #C93A30;
  --rouge-fonce: #A82E24;
  --rose-clair: #F9E5E3;
  --bleu-nuit: #1A294A;
  --texte: #212529;
  --gris-fond: #f4f5f7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--texte);
  background: var(--gris-fond);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Bandeau */
.banniere {
  background: linear-gradient(135deg, var(--bleu-nuit) 0%, #223a63 100%);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.banniere img { height: 44px; }
.banniere .titre { flex: 1 1 auto; }
.banniere .titre h1 { margin: 0; font-size: 1.3rem; letter-spacing: .3px; }
.banniere .titre .soustitre { margin: 2px 0 0; font-size: .8rem; opacity: .85; }
.banniere .accent { color: #f2b0ac; }

/* Navigation */
.nav {
  background: var(--rouge);
  display: flex;
  gap: 4px;
  padding: 0 16px;
  flex-wrap: wrap;
}
.nav a {
  color: #fff;
  text-decoration: none;
  padding: 11px 16px;
  font-size: .9rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
}
.nav a:hover, .nav a.actif {
  background: var(--rouge-fonce);
  border-bottom-color: #fff;
}
.nav .droite { margin-left: auto; display: flex; }

/* Conteneur */
.contenu { width: 100%; max-width: 1080px; margin: 0 auto; padding: 24px; flex: 1; }

/* Cartes */
.carte {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  padding: 20px;
  margin-bottom: 18px;
}
.carte h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: var(--bleu-nuit);
  border-left: 4px solid var(--rouge);
  padding-left: 10px;
}
.carte-titre {
  background: var(--rose-clair);
  border-left: 4px solid var(--rouge);
  padding: 10px 14px;
  border-radius: 4px;
  font-weight: 700;
  color: var(--rouge-fonce);
}

/* Statistiques */
.grille-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat {
  background: #fff;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  text-align: center;
  border-top: 4px solid var(--rouge);
}
.stat .valeur { font-size: 2rem; font-weight: 800; color: var(--rouge-fonce); }
.stat .label { font-size: .82rem; color: #666; margin-top: 4px; }

/* Tableaux */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: .9rem;
  background: #fff;
}
th, td { border: 1px solid #e2e6ea; padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--bleu-nuit); color: #fff; font-weight: 600; }
tr:nth-child(even) td { background: #fafbfc; }

/* Listes de fiches / modules */
.liste-item {
  display: block;
  background: #fff;
  border: 1px solid #e2e6ea;
  border-left: 4px solid var(--rouge);
  border-radius: 6px;
  padding: 13px 16px;
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--texte);
}
.liste-item:hover { border-left-color: var(--bleu-nuit); box-shadow: 0 1px 5px rgba(0,0,0,.1); }
.liste-item .nom { font-weight: 700; color: var(--bleu-nuit); }
.liste-item .detail { font-size: .82rem; color: #777; margin-top: 2px; }
.liste-item .badge {
  float: right;
  background: var(--rose-clair);
  color: var(--rouge-fonce);
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
}

/* Fiche rendue (markdown) */
.fiche-rendue h1 { color: var(--bleu-nuit); font-size: 1.5rem; }
.fiche-rendue h2 {
  color: var(--rouge-fonce);
  font-size: 1.15rem;
  margin-top: 1.6em;
  border-bottom: 2px solid var(--rose-clair);
  padding-bottom: 4px;
}
.fiche-rendue h3 { color: var(--bleu-nuit); font-size: 1rem; }
.fiche-rendue a { color: var(--rouge-fonce); }
.fiche-rendue blockquote {
  border-left: 4px solid var(--rouge);
  background: var(--rose-clair);
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: 4px;
}
.fiche-rendue code {
  background: #f1f3f5;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: .85em;
}

/* Alertes flash */
.flash {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 14px;
  font-weight: 600;
}
.flash.error { background: #f8d7da; color: #842029; }
.flash.ok { background: #d1e7dd; color: #0f5132; }

/* Login */
.login-wrap {
  max-width: 400px;
  margin: 60px auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  overflow: hidden;
}
.login-head {
  background: linear-gradient(135deg, var(--rouge) 0%, var(--rouge-fonce) 100%);
  color: #fff;
  padding: 24px;
  text-align: center;
}
.login-head img { height: 48px; }
.login-head h1 { margin: 10px 0 2px; font-size: 1.2rem; }
.login-head p { margin: 0; font-size: .82rem; opacity: .9; }
.login-body { padding: 24px; }
.login-body label { display: block; font-size: .85rem; font-weight: 600; margin: 12px 0 4px; }
.login-body input[type=text], .login-body input[type=password] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: .95rem;
}
.btn {
  display: inline-block;
  background: var(--rouge);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 11px 20px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--rouge-fonce); }
.btn.plein { width: 100%; margin-top: 18px; }

.pied {
  background: var(--bleu-nuit);
  color: #cfd8e6;
  text-align: center;
  padding: 14px;
  font-size: .78rem;
}
.pied .accent { color: #f2b0ac; }

/* --- Phase 2 : modules / quiz / certificat --- */
.ligne-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.ligne-actions .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.vert { background: #1B6B42; }
.btn.vert:hover { background: #14532d; }
.lien { color: var(--rouge-fonce); font-weight: 600; text-decoration: none; }
.lien:hover { text-decoration: underline; }

.tag {
  display: inline-block;
  background: var(--rose-clair);
  color: var(--rouge-fonce);
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
}
.tag.ok { background: #d1e7dd; color: #0f5132; }
.tag.ko { background: #f8d7da; color: #842029; }

.badge-score {
  display: inline-block;
  background: #e9ecef;
  color: #333;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  margin: 2px;
}
.badge-score.ok { background: #d1e7dd; color: #0f5132; }
.badge-score.ko { background: #f8d7da; color: #842029; }

.section { margin-top: 16px; border-top: 1px dashed #e2e6ea; padding-top: 8px; }
.section h3 { color: var(--bleu-nuit); font-size: 1rem; }

.question .enonce { font-size: 1rem; font-weight: 600; color: var(--bleu-nuit); }
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #e2e6ea;
  border-radius: 6px;
  margin: 8px 0;
  cursor: pointer;
}
.option:hover { border-color: var(--rouge); background: var(--rose-clair); }
.option input { accent-color: var(--rouge); }

.centre { text-align: center; }
.score-grand { font-size: 3rem; font-weight: 800; color: var(--rouge-fonce); }
.scores-cell { font-size: .82rem; }

/* --- Phase 3 : veille + habilitations --- */
.badge-veille {
  display: inline-block;
  background: #fff;
  color: var(--rouge-fonce);
  font-size: .68rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 4px;
  vertical-align: 1px;
}
.badge-score.echeance-ok { background: #d1e7dd; color: #0f5132; }
.badge-score.echeance-bientot { background: #fff3cd; color: #664d03; }
.badge-score.echeance-expiree { background: #f8d7da; color: #842029; }
.badge-score.echeance-sans-date { background: #e9ecef; color: #555; }

.habilitations select, .habilitations input[type=text], .habilitations input[type=date] {
  padding: 8px 10px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: .9rem;
}


