/* ============================================================
   Académie commerciale Easy Contact Solution
   Feuille de style unique — pas de framework, pas de CDN.
   L'application est destinée à tourner derrière Traefik sans
   dépendance externe : tout doit être servi par le conteneur.
   ============================================================ */

:root {
  --indigo: #4f46e5;
  --indigo-clair: #eef2ff;
  --indigo-fonce: #3730a3;
  --vert: #10b981;
  --vert-clair: #ecfdf5;
  --orange: #f59e0b;
  --orange-clair: #fffbeb;
  --rouge: #ef4444;
  --rouge-clair: #fef2f2;
  --encre: #111827;
  --gris: #6b7280;
  --gris-clair: #9ca3af;
  --bord: #e5e7eb;
  --fond: #f6f7fb;
  --blanc: #ffffff;
  --ombre: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --ombre-forte: 0 8px 32px rgba(16, 24, 40, .12);
  --radius: 16px;
  --radius-s: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--fond);
  color: var(--encre);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.015em; }
h1 { font-size: 1.9rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 650; }

/* ---------- Structure ---------- */

.entete {
  background: var(--blanc);
  border-bottom: 1px solid var(--bord);
  position: sticky; top: 0; z-index: 50;
}
.entete-int {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 26px; height: 62px;
}
.marque { display: flex; align-items: center; gap: 10px; font-weight: 750; color: var(--encre); font-size: 1.02rem; }
.marque:hover { text-decoration: none; }
.marque-logo {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--indigo), #7c3aed);
  color: #fff; display: grid; place-items: center; font-size: .82rem; font-weight: 800;
}
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a {
  padding: 8px 13px; border-radius: 9px; color: var(--gris);
  font-size: .93rem; font-weight: 550;
}
.nav a:hover { background: var(--fond); color: var(--encre); text-decoration: none; }
.nav a.actif { background: var(--indigo-clair); color: var(--indigo-fonce); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--indigo-clair); color: var(--indigo-fonce);
  display: grid; place-items: center; font-weight: 700; font-size: .8rem;
}
.avatar.gd { width: 52px; height: 52px; font-size: 1.05rem; }

.page { max-width: 1180px; margin: 0 auto; padding: 28px 20px 80px; }
.page-etroite { max-width: 860px; }

/* ---------- Cartes ---------- */

.carte {
  background: var(--blanc); border: 1px solid var(--bord);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--ombre);
}
.carte + .carte { margin-top: 18px; }
.carte-titre { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.carte-titre h2, .carte-titre h3 { margin: 0; }

.grille { display: grid; gap: 18px; }
.grille-2 { grid-template-columns: repeat(2, 1fr); }
.grille-3 { grid-template-columns: repeat(3, 1fr); }
.grille-4 { grid-template-columns: repeat(4, 1fr); }
.grille-principale { grid-template-columns: 2fr 1fr; align-items: start; }

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius-s); border: 1px solid transparent;
  background: var(--indigo); color: #fff; font-size: .94rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all .15s ease; text-decoration: none;
}
.btn:hover { background: var(--indigo-fonce); text-decoration: none; color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-fantome { background: var(--blanc); color: var(--encre); border-color: var(--bord); }
.btn-fantome:hover { background: var(--fond); color: var(--encre); }
.btn-vert { background: var(--vert); }
.btn-vert:hover { background: #059669; }
.btn-rouge { background: var(--rouge); }
.btn-rouge:hover { background: #dc2626; }
.btn-gd { padding: 14px 26px; font-size: 1rem; }
.btn-bloc { width: 100%; }
.btn-petit { padding: 7px 12px; font-size: .85rem; }

/* ---------- Étiquettes ---------- */

.etiq {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 650;
  background: var(--fond); color: var(--gris); white-space: nowrap;
}
.etiq-vert { background: var(--vert-clair); color: #047857; }
.etiq-indigo { background: var(--indigo-clair); color: var(--indigo-fonce); }
.etiq-orange { background: var(--orange-clair); color: #b45309; }
.etiq-rouge { background: var(--rouge-clair); color: #b91c1c; }

/* ---------- Progression ---------- */

.barre { height: 8px; background: var(--bord); border-radius: 999px; overflow: hidden; }
.barre span { display: block; height: 100%; background: var(--indigo); border-radius: 999px; transition: width .4s ease; }
.barre.vert span { background: var(--vert); }
.barre-fine { height: 5px; }

/* Barre de lecture d'une leçon : collée sous l'en-tête, sur fond opaque pour
   que le texte ne défile pas visiblement derrière. */
.barre-collee {
  position: sticky; top: 62px; z-index: 20;
  background: var(--fond); padding: 14px 0 16px; margin-bottom: 6px;
}
@media (max-width: 720px) { .barre-collee { position: static; } }

.anneau { --pct: 0; width: 108px; height: 108px; position: relative; flex: none; }
.anneau::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--indigo) calc(var(--pct) * 1%), var(--bord) 0);
}
.anneau::after {
  content: ''; position: absolute; inset: 11px; border-radius: 50%; background: var(--blanc);
}
.anneau b {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 1.45rem; font-weight: 750; z-index: 2;
}

.stat { text-align: left; }
.stat-val { font-size: 1.85rem; font-weight: 750; line-height: 1.1; letter-spacing: -.02em; }
.stat-lib { font-size: .82rem; color: var(--gris); font-weight: 550; }
.stat-vert .stat-val { color: var(--vert); }
.stat-orange .stat-val { color: var(--orange); }
.stat-rouge .stat-val { color: var(--rouge); }

/* ---------- Parcours ---------- */

.jour-carte {
  display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px;
  background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--radius);
  transition: box-shadow .15s ease, transform .15s ease;
}
.jour-carte:hover { box-shadow: var(--ombre-forte); text-decoration: none; }
.jour-num {
  width: 46px; height: 46px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--fond); color: var(--gris); font-weight: 750; font-size: .95rem; line-height: 1;
  flex-direction: column;
}
.jour-num small { font-size: .58rem; font-weight: 600; letter-spacing: .05em; opacity: .75; }
.jour-carte.fait .jour-num { background: var(--vert-clair); color: #047857; }
.jour-carte.encours .jour-num { background: var(--indigo-clair); color: var(--indigo-fonce); }
.jour-corps { flex: 1; min-width: 0; }
.jour-corps h3 { margin: 0 0 3px; font-size: 1.02rem; }
.jour-corps p { margin: 0 0 10px; color: var(--gris); font-size: .89rem; }

.liste-activites { list-style: none; padding: 0; margin: 0; }
.liste-activites li { border-top: 1px solid var(--bord); }
.liste-activites li:first-child { border-top: 0; }
.act {
  display: flex; align-items: center; gap: 13px; padding: 13px 4px; color: var(--encre);
}
.act:hover { text-decoration: none; background: #fafbff; }
.act-ico {
  width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center;
  font-size: .95rem; background: var(--fond);
}
.act-ico.lecon { background: var(--indigo-clair); }
.act-ico.quiz { background: var(--orange-clair); }
.act-ico.appel { background: var(--vert-clair); }
.act-ico.drill { background: #fdf2f8; }
.act-txt { flex: 1; min-width: 0; }
.act-txt b { display: block; font-weight: 600; font-size: .95rem; }
.act-txt small { color: var(--gris-clair); font-size: .8rem; }
.act-fin { display: flex; align-items: center; gap: 10px; flex: none; }
.coche {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--bord); flex: none;
  display: grid; place-items: center; font-size: .7rem; color: transparent;
}
.coche.ok { background: var(--vert); border-color: var(--vert); color: #fff; }

/* ---------- Contenu de leçon ---------- */

.lecon-corps { font-size: 1.02rem; line-height: 1.75; }
.lecon-corps h3 { margin: 1.9em 0 .7em; font-size: 1.18rem; color: var(--encre); }
.lecon-corps h3:first-child { margin-top: 0; }
.lecon-corps p { margin: 0 0 1.1em; }
.lecon-corps ul, .lecon-corps ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.lecon-corps li { margin-bottom: .55em; }
.lecon-corps strong { font-weight: 650; }

.encadre {
  border-radius: var(--radius-s); padding: 15px 18px; margin: 0 0 1.4em;
  border-left: 4px solid var(--indigo); background: var(--indigo-clair); font-size: .97rem;
}
.encadre.astuce { border-color: var(--vert); background: var(--vert-clair); }
.encadre.piege { border-color: var(--rouge); background: var(--rouge-clair); }
.encadre.exemple { border-color: var(--orange); background: var(--orange-clair); }
.encadre p:last-child { margin-bottom: 0; }

.lecon-corps h3:last-of-type + ul {
  background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--radius-s);
  padding: 16px 16px 16px 36px;
}

/* ---------- Quiz ---------- */

.q-bloc { margin-bottom: 26px; }
.q-num { font-size: .78rem; font-weight: 700; color: var(--indigo); letter-spacing: .06em; text-transform: uppercase; }
.q-txt { font-size: 1.08rem; font-weight: 600; margin: 5px 0 14px; }

.prop {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; margin-bottom: 9px;
  border: 1.5px solid var(--bord); border-radius: var(--radius-s); cursor: pointer;
  background: var(--blanc); transition: all .12s ease;
}
.prop:hover { border-color: var(--indigo); background: #fafbff; }
.prop input { margin-top: 4px; accent-color: var(--indigo); flex: none; }
.prop.choisi { border-color: var(--indigo); background: var(--indigo-clair); }
.prop.juste { border-color: var(--vert); background: var(--vert-clair); }
.prop.faux { border-color: var(--rouge); background: var(--rouge-clair); }
.prop.correction { cursor: default; }

.explication {
  font-size: .92rem; color: var(--gris); background: var(--fond);
  border-radius: var(--radius-s); padding: 11px 14px; margin-top: 6px;
}

/* ---------- Simulateur d'appel ---------- */

.tel-cadre {
  background: linear-gradient(160deg, #1e1b4b, #312e81);
  border-radius: 22px; padding: 26px; color: #e0e7ff; box-shadow: var(--ombre-forte);
}
.tel-entete { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.tel-avatar {
  width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, .14);
  display: grid; place-items: center; font-size: 1.3rem; flex: none;
}
.tel-nom { font-weight: 700; font-size: 1.08rem; color: #fff; }
.tel-sous { font-size: .85rem; opacity: .75; }
.tel-chrono { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 1.05rem; opacity: .9; }

.tel-fil {
  background: rgba(0, 0, 0, .22); border-radius: 14px; padding: 16px;
  height: 330px; overflow-y: auto; margin-bottom: 18px;
}
.bulle { margin-bottom: 12px; max-width: 82%; }
.bulle p {
  margin: 0; padding: 10px 14px; border-radius: 14px; font-size: .95rem; line-height: 1.5;
}
.bulle small { font-size: .7rem; opacity: .6; padding: 0 6px; }
.bulle.prospect p { background: rgba(255, 255, 255, .14); border-bottom-left-radius: 4px; }
.bulle.eleve { margin-left: auto; }
.bulle.eleve p { background: var(--indigo); color: #fff; border-bottom-right-radius: 4px; }
.bulle.systeme { max-width: 100%; text-align: center; }
.bulle.systeme p { background: none; font-size: .84rem; opacity: .65; font-style: italic; }

/* Bandeau d'état : il remplace le bouton micro en mains libres. C'est le
   seul repère pendant l'appel, il doit se lire d'un coup d'œil. */
.tel-barre-etat { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.tel-etat {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 7px 15px; border-radius: 999px; font-size: .92rem; font-weight: 650;
  background: rgba(255, 255, 255, .14); color: #fff; transition: background .2s ease;
}
.tel-etat.ecoute { background: rgba(239, 68, 68, .3); }
.tel-etat.prospect { background: rgba(99, 102, 241, .38); }
.tel-etat.calibrage, .tel-etat.envoi { background: rgba(245, 158, 11, .28); }
.tel-vu {
  flex: 1; height: 8px; border-radius: 999px; overflow: hidden;
  background: rgba(0, 0, 0, .28);
}
.tel-vu span {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .5); transition: width .08s linear;
}

.tel-actions { display: flex; gap: 12px; align-items: center; }
.bouton-micro {
  width: 74px; height: 74px; border-radius: 50%; border: 0; flex: none;
  background: var(--vert); color: #fff; font-size: 1.6rem; cursor: pointer;
  display: grid; place-items: center; transition: all .15s ease;
  box-shadow: 0 6px 20px rgba(16, 185, 129, .4);
}
.bouton-micro:hover { transform: scale(1.05); }
.bouton-micro.enregistre {
  background: var(--rouge); box-shadow: 0 0 0 0 rgba(239, 68, 68, .7);
  animation: pulse 1.4s infinite;
}
.bouton-micro:disabled { background: #4b5563; box-shadow: none; cursor: not-allowed; transform: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .6); }
  70% { box-shadow: 0 0 0 18px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.tel-aide { flex: 1; font-size: .88rem; opacity: .8; }

/* Jauge de difficulté. Le fond des barres éteintes doit rester visible aussi
   bien sur une carte blanche que dans le combiné sombre. */
.niveau { display: flex; gap: 3px; }
.niveau i { width: 7px; height: 14px; border-radius: 2px; background: var(--bord); display: block; }
.niveau i.on { background: var(--orange); }
.tel-cadre .niveau i { background: rgba(255, 255, 255, .25); }
.tel-cadre .niveau i.on { background: var(--orange); }

/* ---------- Débrief ---------- */

.note-gd {
  display: flex; align-items: baseline; gap: 6px; font-weight: 800; letter-spacing: -.03em;
}
.note-gd b { font-size: 3.2rem; line-height: 1; }
.note-gd span { font-size: 1.1rem; color: var(--gris); font-weight: 600; }

.critere { margin-bottom: 13px; }
.critere-tete { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 5px; }
.critere-tete b { font-weight: 600; }
.critere-tete span { color: var(--gris); font-variant-numeric: tabular-nums; }

.point { display: flex; gap: 11px; padding: 12px 0; border-top: 1px solid var(--bord); }
.point:first-child { border-top: 0; }
.point-ico { flex: none; font-size: 1.05rem; }
.point-corps { flex: 1; }
.point-corps p { margin: 0 0 6px; font-size: .95rem; }
.a-dire {
  background: var(--vert-clair); border-left: 3px solid var(--vert); padding: 9px 13px;
  border-radius: 0 var(--radius-s) var(--radius-s) 0; font-size: .93rem;
}
.a-dire b { color: #047857; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; display: block; margin-bottom: 3px; }

.transcript-ligne { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--bord); font-size: .94rem; }
.transcript-ligne:first-child { border-top: 0; }
.transcript-qui { flex: none; width: 96px; font-weight: 650; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.transcript-qui.eleve { color: var(--indigo); }
.transcript-qui.prospect { color: var(--gris); }

/* ---------- Tableaux ---------- */

.tableau-scroll { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.tbl th {
  text-align: left; padding: 10px 12px; font-size: .76rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--gris); font-weight: 650; border-bottom: 1px solid var(--bord);
  white-space: nowrap;
}
table.tbl td { padding: 12px; border-bottom: 1px solid var(--bord); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: #fafbff; }
.cell-nom { display: flex; align-items: center; gap: 10px; }
.cell-nom b { font-weight: 600; display: block; }
.cell-nom small { color: var(--gris-clair); font-size: .8rem; }

/* ---------- Formulaires ---------- */

.champ { margin-bottom: 16px; }
.champ label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
.champ small { display: block; color: var(--gris); font-size: .83rem; margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], select, textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--bord); border-radius: var(--radius-s);
  font-size: .96rem; font-family: inherit; background: var(--blanc); color: var(--encre);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-clair);
}
textarea { resize: vertical; min-height: 96px; line-height: 1.6; }

/* ---------- Messages ---------- */

.msg {
  padding: 12px 16px; border-radius: var(--radius-s); margin-bottom: 14px; font-size: .93rem;
  border-left: 4px solid var(--indigo); background: var(--indigo-clair);
}
.msg.succes { border-color: var(--vert); background: var(--vert-clair); }
.msg.erreur { border-color: var(--rouge); background: var(--rouge-clair); }
.msg.info { border-color: var(--orange); background: var(--orange-clair); }

.vide { text-align: center; padding: 42px 20px; color: var(--gris); }
.vide-ico { font-size: 2.2rem; margin-bottom: 10px; opacity: .5; }

.fil { font-size: .86rem; color: var(--gris); margin-bottom: 14px; }
.fil a { color: var(--gris); }

.sep { height: 1px; background: var(--bord); margin: 20px 0; border: 0; }

.muet { color: var(--gris); }
.petit { font-size: .87rem; }
.centre { text-align: center; }
.entre { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.rangee { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Certificat ---------- */

.certificat {
  background: var(--blanc); border: 2px solid var(--indigo); border-radius: 20px;
  padding: 52px 44px; text-align: center; position: relative; overflow: hidden;
}
.certificat::before {
  content: ''; position: absolute; inset: 10px; border: 1px solid var(--indigo-clair);
  border-radius: 14px; pointer-events: none;
}
.certificat h1 { font-size: 2rem; margin-bottom: 4px; }
.certificat .nom-eleve {
  font-size: 2.3rem; font-weight: 750; color: var(--indigo); margin: 22px 0 8px;
  letter-spacing: -.02em;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .grille-principale, .grille-3, .grille-4 { grid-template-columns: 1fr 1fr; }
  .grille-principale { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .entete-int { height: auto; padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  .nav { width: 100%; overflow-x: auto; margin-left: 0; padding-bottom: 4px; }
  .nav a { white-space: nowrap; }
  .page { padding: 18px 14px 60px; }
  .grille-2, .grille-3, .grille-4 { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
  .carte { padding: 17px; }
  .tel-fil { height: 260px; }
  .anneau { width: 88px; height: 88px; }
  .anneau b { font-size: 1.2rem; }
  .certificat { padding: 30px 20px; }
  .certificat .nom-eleve { font-size: 1.6rem; }
  .transcript-qui { width: 70px; font-size: .74rem; }
}

@media print {
  .entete, .nav, .btn, .no-print { display: none !important; }
  body { background: #fff; }
  .certificat { box-shadow: none; }
}
