/* ==========================================================================
   M04 — CONSULTATION ACTIVE (transcription vocale + onde sonore)
   ========================================================================== */

.cons-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  min-height: 0;
}

/* ---------- HEADER consultation ---------- */

.cons-header {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 24px;
  padding: 16px 20px;
  background: #FFFFFF;
  border: 1px solid #E4E6E2;
  border-radius: 12px;
}

.cons-header__patient {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cons-header__name {
  font-family: 'Prompt', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #3A3E38;
  line-height: 1.2;
}

.cons-header__meta {
  font-size: 12px;
  color: #64695F;
  margin-top: 3px;
}

.cons-header__motif {
  border-left: 1px solid #E4E6E2;
  padding-left: 24px;
}

.cons-header__motif-label,
.cons-header__timer-label {
  font-size: 10px;
  color: #9CA09A;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 3px;
}

.cons-header__motif-value {
  font-size: 13px;
  color: #3A3E38;
  font-weight: 500;
}

.cons-header__timer {
  text-align: center;
  border-left: 1px solid #E4E6E2;
  padding-left: 24px;
}

.cons-header__timer-value {
  font-family: 'Prompt', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #4A90E2;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.cons-header__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #F0F2EF;
  color: #64695F;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 250ms ease, color 250ms ease;
}

.cons-header__status-dot {
  width: 8px;
  height: 8px;
  background: #9CA09A;
  border-radius: 50%;
  transition: background 250ms ease;
}

.cons-header__status[data-rec-status="recording"] {
  background: #FBE9E1;
  color: #BB3A0A;
}
.cons-header__status[data-rec-status="recording"] .cons-header__status-dot {
  background: #BB3A0A;
  animation: cons-rec-pulse 1.4s ease-in-out infinite;
}

.cons-header__status[data-rec-status="paused"] {
  background: #FBF1DD;
  color: #8B6914;
}
.cons-header__status[data-rec-status="paused"] .cons-header__status-dot {
  background: #D99A2B;
}

.cons-header__status[data-rec-status="done"] {
  background: #E3F4E8;
  color: #2D8A4E;
}
.cons-header__status[data-rec-status="done"] .cons-header__status-dot {
  background: #2D8A4E;
}

@keyframes cons-rec-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ---------- BODY 2 colonnes ---------- */

.cons-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  min-height: 0;
}

/* ---------- TRANSCRIPTION ---------- */

.cons-transcript {
  background: #FFFFFF;
  border: 1px solid #E4E6E2;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.cons-transcript__top {
  padding: 14px 18px;
  border-bottom: 1px solid #F2F2F2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.cons-transcript__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Prompt', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #3A3E38;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cons-transcript__live-dot {
  width: 8px;
  height: 8px;
  background: #BB3A0A;
  border-radius: 50%;
  animation: cons-rec-pulse 1.4s ease-in-out infinite;
}

.cons-transcript__live-dot.is-paused {
  animation-play-state: paused;
  opacity: 0.35;
}

.cons-transcript__lang {
  margin-left: auto;
  font-size: 10px;
  color: #9CA09A;
  font-weight: 500;
  letter-spacing: 0.5px;
  background: #F8F9FA;
  padding: 3px 8px;
  border-radius: 5px;
  text-transform: none;
}

/* Onde sonore SVG animée */
.cons-transcript__wave {
  height: 40px;
  display: flex;
  align-items: center;
}

.cons-wave {
  width: 100%;
  height: 40px;
}

.cons-wave__bar {
  fill: #4A90E2;
  transform-origin: center;
  animation: cons-wave-bounce 1s ease-in-out infinite;
}

.cons-wave.is-paused .cons-wave__bar {
  animation-play-state: paused;
  opacity: 0.3;
}

@keyframes cons-wave-bounce {
  0%, 100% {
    transform: scaleY(0.18);
    opacity: 0.5;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

/* Lignes de transcription */
.cons-transcript__lines {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.cons-line {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: cons-line-in 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cons-line-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.cons-line__speaker {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.cons-line.is-doctor .cons-line__speaker {
  color: #4A90E2;
}

.cons-line.is-patient .cons-line__speaker {
  color: #2D8A4E;
}

.cons-line__text {
  background: #F8F9FA;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.55;
  color: #3A3E38;
}

.cons-line.is-doctor .cons-line__text {
  background: #E8F1FB;
  color: #1A5DA0;
  align-self: flex-start;
  max-width: 90%;
}

.cons-line.is-patient .cons-line__text {
  background: #E3F4E8;
  color: #1F5C36;
  align-self: flex-start;
  max-width: 90%;
}

.cons-word {
  display: inline;
  animation: cons-word-fade 200ms ease-out;
}

@keyframes cons-word-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- COLONNE CONTEXTE PATIENT ---------- */

.cons-context {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  min-height: 0;
}

.cons-context-card {
  background: #FFFFFF;
  border: 1px solid #E4E6E2;
  border-radius: 10px;
  padding: 14px 16px;
}

.cons-context-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #64695F;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.cons-context-card__title svg {
  color: #4A90E2;
}

.cons-context-card__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cons-context-card__list li {
  font-size: 13px;
  color: #3A3E38;
  line-height: 1.4;
  padding-left: 12px;
  position: relative;
}

.cons-context-card__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 4px;
  height: 4px;
  background: #4A90E2;
  border-radius: 50%;
}

.cons-context-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cons-context-card__chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  background: #F8F9FA;
  color: #3A3E38;
}

.cons-context-card__chip--alert {
  background: #FBE9E1;
  color: #BB3A0A;
}

.cons-context-card__empty {
  font-size: 12px;
  color: #9CA09A;
  font-style: italic;
}

.cons-context-card--meta {
  background: #F8F9FA;
  border: none;
}

.cons-context-card__meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px dashed #E4E6E2;
}

.cons-context-card__meta-row:last-child {
  border-bottom: none;
}

.cons-context-card__meta-row span {
  color: #64695F;
}

.cons-context-card__meta-row strong {
  color: #3A3E38;
  font-weight: 600;
}

/* ---------- FOOTER ACTIONS ---------- */

.cons-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #FFFFFF;
  border: 1px solid #E4E6E2;
  border-radius: 12px;
  gap: 16px;
  flex-shrink: 0;
}

.cons-footer__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cons-mic-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #4A90E2;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.35);
  transition: background 250ms ease, box-shadow 250ms ease, transform 150ms ease;
}

.cons-mic-btn:hover {
  transform: scale(1.06);
}

.cons-mic-btn[data-mic-state="recording"] {
  background: #BB3A0A;
  box-shadow: 0 4px 12px rgba(187, 58, 10, 0.35);
}

.cons-mic-btn[data-mic-state="paused"] {
  background: #D99A2B;
  box-shadow: 0 4px 8px rgba(217, 154, 43, 0.3);
}

.cons-mic-btn[data-mic-state="done"] {
  background: #2D8A4E;
  box-shadow: 0 4px 12px rgba(45, 138, 78, 0.3);
}

.cons-mic-btn__pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #BB3A0A;
  opacity: 0;
  pointer-events: none;
}

.cons-mic-btn[data-mic-state="recording"] .cons-mic-btn__pulse {
  opacity: 0.4;
  animation: cons-mic-pulse 1.6s ease-out infinite;
}

@keyframes cons-mic-pulse {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ==========================================================================
   ADAPTATION TABLETTE
   ========================================================================== */

.frame--tablet .cons-header {
  grid-template-columns: 1fr;
  gap: 12px;
}

.frame--tablet .cons-header__motif,
.frame--tablet .cons-header__timer {
  border-left: none;
  padding-left: 0;
  border-top: 1px solid #F2F2F2;
  padding-top: 12px;
}

.frame--tablet .cons-body {
  grid-template-columns: 1fr;
}

.frame--tablet .cons-context {
  max-height: none;
}

.frame--tablet .cons-footer {
  flex-direction: column;
  gap: 12px;
}

.frame--tablet .cons-footer__left {
  width: 100%;
  justify-content: center;
}
