/* ── Couleurs principales ─────────────────────────────────────── */
:root {
  --bleu-sombre: #1B4F72;
  --bleu-moyen: #2E86C1;
  --vert:        #27AE60;
  --fond:        #F0F4F8;

  /* Arrondis globaux — surcharge Bootstrap */
  --bs-border-radius:      0.7rem;
  --bs-border-radius-sm:   0.45rem;
  --bs-border-radius-lg:   1.1rem;
  --bs-border-radius-xl:   1.5rem;
  --bs-border-radius-xxl:  2rem;
}

body {
  background-color: var(--fond);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1; }

/* ── Couleurs personnalisées Bootstrap ──────────────────────────── */
.bg-primary-custom  { background-color: var(--bleu-sombre) !important; }
.text-primary-custom { color: var(--bleu-sombre) !important; }
.btn-primary-custom {
  background-color: var(--bleu-moyen);
  border-color: var(--bleu-moyen);
  color: white;
}
.btn-primary-custom:hover {
  background-color: var(--bleu-sombre);
  border-color: var(--bleu-sombre);
  color: white;
}
.bg-primary-light { background-color: #D6EAF8; }
.bg-success-light { background-color: #D5F5E3; }
.bg-secondary-light { background-color: #EAECEE; }

/* ── Navbar ───────────────────────────────────────────────────── */
.navbar { box-shadow: 0 2px 8px rgba(0,0,0,0.15); }

/* ── Icônes portails ─────────────────────────────────────────── */
.portail-icone {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
}
.portail-icone-lg {
  width: 100px; height: 100px;
  font-size: 2.5rem;
}
.portail-icone-lg i { font-size: 2.5rem; }

/* ── Portail cards accueil ───────────────────────────────────── */
.portail-card { transition: transform 0.18s, box-shadow 0.18s; }
.portail-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important; }

/* ── Accès admin discret ─────────────────────────────────────── */
.acces-admin-discret {
  color: rgba(0,0,0,0.12);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.3s;
}
.acces-admin-discret:hover { color: rgba(0,0,0,0.35); }

/* ── Page de consultation ─────────────────────────────────────── */
body:has(.chat-header) main { height: 100vh; }

.chat-header {
  background-color: var(--bleu-sombre);
  flex-shrink: 0;
}
.chat-input-bar {
  background-color: white;
  border-top: 1px solid #dee2e6;
  flex-shrink: 0;
}

/* Zone principale */
.consultation-zone {
  background: linear-gradient(160deg, #EBF5FB 0%, #E8F8F5 100%);
  min-height: 0;
  padding: 2rem 1rem;
  gap: 0;
}

/* Avatar patient */
.patient-avatar {
  width: 90px; height: 90px;
  border-radius: 50%;
  background-color: var(--bleu-sombre);
  color: white;
  font-size: 2.8rem;
  display: flex; align-items: center; justify-content: center;
  transition: box-shadow 0.4s;
  flex-shrink: 0;
}
.patient-avatar.parle {
  animation: avatar-parle 1.2s ease-in-out infinite;
}
@keyframes avatar-parle {
  0%,100% { box-shadow: 0 0 0 0 rgba(39,174,96,0.5), 0 0 0 0 rgba(39,174,96,0.2); }
  50%     { box-shadow: 0 0 0 12px rgba(39,174,96,0.3), 0 0 0 24px rgba(39,174,96,0.08); }
}

/* Canvas oscilloscope */
.waveform-canvas {
  display: block;
  height: 80px;
  border-radius: 10px;
  background: rgba(255,255,255,0.6);
}

/* Label d'état */
.etat-label {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--bleu-sombre);
  min-height: 1.6em;
  text-align: center;
}

/* Sous-titres patient */
.sous-titres {
  max-width: min(580px, 88vw);
  min-height: 3.5em;
  text-align: center;
  color: #444;
  font-size: 1rem;
  line-height: 1.6;
  font-style: italic;
  padding: 0.6rem 1.2rem;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.sous-titres.visible { opacity: 1; }

/* Message système flottant */
.msg-systeme {
  position: fixed;
  bottom: 80px;
  left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.72);
  color: white;
  padding: 0.45rem 1.1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  max-width: 80vw;
  text-align: center;
  z-index: 1000;
}

/* ── Page d'évaluation ────────────────────────────────────────── */
.score-total-cercle {
  width: 110px; height: 110px;
  border-radius: 50%;
  border: 6px solid var(--bleu-moyen);
  display: flex; align-items: center; justify-content: center;
}

/* ── Indicateur d'état (conversation orale) ──────────────────── */
.indicateur-etat {
  width: 16px; height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background-color 0.3s;
}
.etat-init       { background-color: #90A4AE; }
.etat-ecoute     { background-color: var(--vert);
                   animation: pulse-vert 2s ease-in-out infinite; }
.etat-parole     { background-color: #e74c3c;
                   animation: pulse-rouge 0.6s ease-in-out infinite; }
.etat-traitement { background-color: #f39c12;
                   animation: pulse-orange 1s ease-in-out infinite; }
.etat-lecture    { background-color: var(--bleu-moyen);
                   animation: pulse-bleu 1.4s ease-in-out infinite; }
.etat-pause      { background-color: #f1c40f; }
.etat-fin        { background-color: #90A4AE; }

@keyframes pulse-vert   { 0%,100%{box-shadow:0 0 0 0 rgba(39,174,96,.5)}  50%{box-shadow:0 0 0 8px rgba(39,174,96,0)} }
@keyframes pulse-rouge  { 0%,100%{box-shadow:0 0 0 0 rgba(231,76,60,.6)}  50%{box-shadow:0 0 0 8px rgba(231,76,60,0)} }
@keyframes pulse-orange { 0%,100%{box-shadow:0 0 0 0 rgba(243,156,18,.5)} 50%{box-shadow:0 0 0 8px rgba(243,156,18,0)} }
@keyframes pulse-bleu   { 0%,100%{box-shadow:0 0 0 0 rgba(46,134,193,.5)} 50%{box-shadow:0 0 0 8px rgba(46,134,193,0)} }

.transcription-preview {
  min-height: 1.4em;
  font-style: italic;
  color: #666;
  font-size: 0.88em;
}

/* ── Overlay de démarrage ────────────────────────────────────── */
.overlay-start {
  position: fixed;
  inset: 0;
  background: rgba(27, 79, 114, 0.92);
  z-index: 500;
  color: white;
}

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
  background-color: var(--bleu-sombre);
  color: rgba(255,255,255,0.55);
  font-size: 0.8rem;
}
.footer-brand { font-weight: 500; }
.footer-link {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
}
.footer-link:hover { color: white; text-decoration: underline; }

/* ── Divers ───────────────────────────────────────────────────── */
.letter-spacing { letter-spacing: 0.08em; }
.font-monospace { font-family: "Courier New", monospace; }
code { color: var(--bleu-moyen); }
