/* ==========================================================================
   M07 — COMPTE RENDU DE CONSULTATION
   ========================================================================== */

.report-screen {
  height: 100%;
  min-height: 0;
}

.report-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: flex-start;
}

/* ---------- DOCUMENT ---------- */

.report-document {
  background: #FFFFFF;
  border: 1px solid #E4E6E2;
  border-radius: 12px;
  padding: 32px 40px;
  position: relative;
  overflow: hidden;
}

/* En-tête cabinet */
.report-letterhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid #1A2332;
  margin-bottom: 20px;
}

.report-letterhead__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.report-letterhead__logo {
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.report-letterhead__logo img {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}

.report-letterhead__name {
  font-family: 'Prompt', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #1A2332;
  line-height: 1.2;
}

.report-letterhead__address {
  font-size: 11px;
  color: #64695F;
  margin-top: 2px;
}

.report-letterhead__doctor {
  text-align: right;
}

.report-letterhead__doctor-name {
  font-family: 'Prompt', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #1A2332;
}

.report-letterhead__doctor-meta {
  font-size: 11px;
  color: #64695F;
  margin-top: 2px;
}

/* Métadonnées */
.report-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 14px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid #F2F2F2;
}

.report-meta__label {
  font-size: 10px;
  color: #9CA09A;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  margin-bottom: 4px;
}

.report-meta__value {
  font-size: 14px;
  font-weight: 600;
  color: #3A3E38;
  line-height: 1.3;
}

.report-meta__sub {
  font-size: 12px;
  color: #64695F;
  margin-top: 2px;
}

.report-title {
  font-family: 'Prompt', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #1A2332;
  margin: 0 0 24px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* Sections */
.report-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 280px;
}

.report-section__title {
  font-family: 'Prompt', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #1A5DA0;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #E4E6E2;
}

.report-section__text {
  font-size: 13.5px;
  line-height: 1.7;
  color: #3A3E38;
  margin: 0;
  text-align: justify;
  min-height: 1.7em;
}

/* Mots qui apparaissent */
.report-word {
  display: inline;
  animation: report-word-in 200ms ease-out;
}

@keyframes report-word-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Curseur clignotant à la fin de la section en cours */
.report-section__text::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 14px;
  background: #4A90E2;
  margin-left: 2px;
  animation: report-cursor 1s steps(2) infinite;
  vertical-align: middle;
  opacity: 0;
}

.report-section:has(.report-word:last-child) .report-section__text::after {
  opacity: 1;
}

@keyframes report-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Signature */
.report-signature {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #F2F2F2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.report-signature__doctor {
  font-family: 'Prompt', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #3A3E38;
  margin-bottom: 4px;
}

.report-signature__svg {
  width: 180px;
  height: 50px;
  margin-bottom: 8px;
}

.report-signature__svg svg {
  width: 100%;
  height: 100%;
}

.report-signature__cert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #2D8A4E;
  font-weight: 500;
  background: #E3F4E8;
  padding: 4px 10px;
  border-radius: 999px;
}

/* ==========================================================================
   SIDEBAR ACTIONS
   ========================================================================== */

.report-actions {
  background: #FFFFFF;
  border: 1px solid #E4E6E2;
  border-radius: 12px;
  padding: 16px;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-actions__status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: linear-gradient(135deg, #E8F1FB 0%, #F0F7FE 100%);
  border-radius: 10px;
}

.report-actions__status-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #4A90E2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #4A90E2;
  transition: all 300ms ease;
}

.report-actions__status-icon.is-done {
  background: #2D8A4E;
  border-color: #2D8A4E;
  color: #FFFFFF;
}

.report-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(74, 144, 226, 0.2);
  border-top-color: #4A90E2;
  border-radius: 50%;
  animation: report-spin 700ms linear infinite;
}

@keyframes report-spin {
  to { transform: rotate(360deg); }
}

.report-actions__status-text {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
  min-width: 0;
}

.report-actions__status-text strong {
  font-weight: 600;
  color: #1A5DA0;
}

.report-actions__status-text span {
  color: #64695F;
}

/* Progress */
.report-actions__progress-bar {
  height: 4px;
  background: #F2F2F2;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.report-actions__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4A90E2, #2D8A4E);
  border-radius: 999px;
  transition: width 200ms ease;
  width: 0%;
}

.report-actions__progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #64695F;
  font-weight: 500;
}

.report-actions__divider {
  height: 1px;
  background: #F2F2F2;
  margin: 4px 0;
}

/* Boutons d'action */
.report-actions__buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  color: #64695F;
  transition: all 150ms ease;
  width: 100%;
}

.report-action-btn:not(:disabled):hover {
  background: #F8F9FA;
  border-color: #E4E6E2;
  color: #3A3E38;
}

.report-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.report-action-btn svg {
  flex-shrink: 0;
  color: #4A90E2;
}

.report-action-btn div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.report-action-btn strong {
  font-size: 12px;
  font-weight: 600;
  color: #3A3E38;
  line-height: 1.2;
}

.report-action-btn span {
  font-size: 11px;
  color: #9CA09A;
  line-height: 1.3;
}

.report-actions__cta {
  width: 100%;
  margin-top: 4px;
}

/* ---------- SECTION NOTES DU MEDECIN ---------- */

.report-section--medecin {
  border-left: 3px solid #2D8A4E;
  padding-left: 14px;
  animation: report-section-in 300ms ease-out forwards;
}

@keyframes report-section-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.report-section--medecin .report-section__title {
  color: #2D8A4E;
  border-bottom-color: rgba(45, 138, 78, 0.2);
}

.report-note-editable {
  min-height: 64px;
  border: 1.5px dashed #4A90E2;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #3A3E38;
  font-family: inherit;
  background: #F8FBFF;
  outline: none;
  cursor: text;
  text-align: justify;
}

.report-note-editable:empty::before {
  content: 'Saisissez vos observations ici...';
  color: #9CA09A;
  font-style: italic;
}

.report-note-editable:focus {
  border-color: #1A5DA0;
  background: #FFFFFF;
}

.report-note-editable[contenteditable="false"] {
  border: none;
  padding: 0;
  background: transparent;
  cursor: default;
  min-height: auto;
}

.report-note-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

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

.frame--tablet .report-layout {
  grid-template-columns: 1fr;
}

.frame--tablet .report-document {
  padding: 24px;
}

.frame--tablet .report-letterhead {
  flex-direction: column;
  gap: 12px;
}

.frame--tablet .report-letterhead__doctor {
  text-align: left;
}

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

.frame--tablet .report-actions {
  position: relative;
  top: auto;
}
