/* Direction B — connexion, structure de l'application, barre laterale, barre d'enregistrement (ile). */

/* Connexion */
.login { display: grid; place-items: center; padding: 16px; }
.login-card {
  border-radius: 28px; padding: 36px; display: flex; flex-direction: column; gap: 12px;
  width: min(380px, 100%);
}
.login-card h1 {
  font-size: 28px; font-weight: 700; letter-spacing: -.025em; display: flex; align-items: center; gap: 12px;
}
.login-card h1::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%; flex: none;
  background: var(--accent-brand); box-shadow: 0 0 14px var(--glow);
}
.login-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.login-card button { margin-top: 4px; }

/* Structure */
.app { display: flex; flex-direction: column; height: 100vh; padding: 16px; gap: 16px; }
.app-body { display: flex; flex: 1; min-height: 0; gap: 16px; }
main { flex: 1; overflow-y: auto; padding: 4px 8px 40px 4px; }
#content h2 { font-size: 30px; font-weight: 700; letter-spacing: -.025em; margin-bottom: 18px; }
#content .fiche h2, #content .perf-header h2 { margin-bottom: 6px; }

/* Barre laterale en verre */
.sidebar {
  width: 232px; border-radius: var(--radius-tile); padding: 16px 12px;
  display: flex; flex-direction: column; gap: 4px; flex: none;
}
.sidebar .who { font-size: 13px; color: var(--muted); padding: 6px 12px 16px; line-height: 1.4; }
.sidebar button {
  position: relative; background: none; border: 1px solid transparent; color: var(--text);
  text-align: left; min-height: var(--target); padding: 0 14px 0 34px; border-radius: 16px;
  font-size: 14px; font-weight: 500;
  transition: background-color .15s ease-out, transform .15s var(--ease-out);
}
.sidebar button::before {
  content: ''; position: absolute; left: 14px; top: 50%; width: 8px; height: 8px;
  margin-top: -4px; border-radius: 50%; background: rgba(255,255,255,.22);
}
.sidebar button:hover { background: rgba(255,255,255,.07); transform: translateX(2px); }
/* Element actif : fond plein, graisse, pastille de marque et trait — lisible sans la couleur seule */
.sidebar button.active {
  background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.16); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent-brand);
}
.sidebar button.active::before { background: var(--accent-brand); box-shadow: 0 0 10px var(--glow); }
.sidebar .spacer { flex: 1; }
.sidebar .ghost { color: var(--muted); }
.sidebar .ghost::before { background: transparent; border: 1.5px solid var(--muted); }

/* ===== Barre d'enregistrement : « ile » =====
   Repos : barre de verre compacte avec tous les reglages.
   En cours : pastille noire centree, chrono orange, arret rouge, VU-metre, lueur qui respire. */
.record-bar { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.island {
  position: relative; isolation: isolate; width: 100%; border-radius: 30px; padding: 12px 14px 12px 18px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
}
.island select#brand { width: 180px; }
.island select#callType { width: 160px; }
.island input#clientName { flex: 1 1 200px; min-width: 140px; }
.island .mic-select { width: 190px; color: var(--muted); font-size: 13px; }
.island .mic-select:disabled { opacity: .5; cursor: not-allowed; }
.queue {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; font-size: 13px;
  color: var(--call); background: rgba(255,159,10,.12); border-radius: var(--radius-pill);
}
/* Chrono et VU-metre : ne servent qu'en cours d'enregistrement */
#timer, .vu { display: none; }
#timer {
  font-variant-numeric: tabular-nums; font-size: 34px; font-weight: 700; letter-spacing: -.02em;
  color: var(--call); line-height: 1;
}
.vu {
  width: 96px; height: 8px; border-radius: var(--radius-pill); flex: none; overflow: hidden;
  background: rgba(255,255,255,.12);
}
.vu-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--muted); }
.vu-fill.vu-live { background-image: linear-gradient(90deg, var(--ok), var(--call)); }

.record {
  width: 52px; height: 52px; border-radius: 50%; border: 0; flex: none; margin-left: auto;
  background: var(--rose); color: #fff; font-size: 22px; line-height: 1;
  box-shadow: 0 0 0 5px var(--glow), 0 8px 20px rgba(0,0,0,.4);
  transition: transform .15s var(--ease-out);
}
.record:hover:not(:disabled) { transform: scale(1.06); }
.record:disabled { opacity: .5; cursor: not-allowed; }
.record.recording { background: var(--stop); box-shadow: 0 0 0 4px rgba(255,69,58,.3); font-size: 20px; }

/* Etat « en cours » : la barre devient une pastille noire centree */
.record-bar.recording-live .island {
  background: #000; border-color: rgba(255,159,10,.3); max-width: 680px; border-radius: 34px;
  box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; flex-wrap: nowrap;
}
.record-bar.recording-live .island::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; opacity: .85;
  box-shadow: 0 0 0 1px rgba(255,159,10,.4), 0 10px 44px rgba(255,159,10,.3);
  animation: breathe 3s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: .5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.012); } }
.record-bar.recording-live #callType, .record-bar.recording-live #micSelect { display: none; }
.record-bar.recording-live #timer, .record-bar.recording-live .vu { display: block; }
.record-bar.recording-live select#brand {
  width: auto; max-width: 150px; background: transparent; border-color: transparent; color: var(--muted);
  font-size: 13px; padding: 0 6px;
}
.record-bar.recording-live input#clientName {
  background: transparent; border-color: transparent; font-size: 16px; font-weight: 600; flex: 1 1 0; min-width: 0;
}
.record-bar.recording-live .record { margin-left: 0; }

/* Messages sous l'ile : alerte micro, mention legale, statut d'envoi */
.rec-notes { width: 100%; max-width: 680px; display: flex; flex-direction: column; gap: 8px; }
.rec-notes:empty { display: none; }
.mic-warning {
  font-size: 13px; line-height: 1.45; color: var(--call); background: rgba(255,159,10,.1);
  border: 1px solid rgba(255,159,10,.4); border-radius: 18px; padding: 10px 16px;
}
.legal {
  display: none; font-size: 13px; line-height: 1.45; color: var(--muted); padding: 10px 16px;
  background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 18px;
}
.legal.show { display: block; color: #f5e27a; }
.legal.error { display: block; color: var(--rose); }
.legal.ok { display: block; color: var(--ok); }
