/* ═══════════════════════════════════════════════════════════════
   LA TABLE DES NÉGOCIATIONS — design sobre, premium, lisible
   Palette : noir bois + or chaud + ivoire
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #14100c;
  --bg-soft: #1a1410;
  --bg-card: #1f1812;
  --bg-elev: #261d16;
  --line: #3a2d22;
  --text: #f1ead9;
  --text-soft: #c9bda4;
  --muted: #8e8474;
  --gold: #c8a55b;
  --gold-bright: #e8c97a;
  --gold-dim: #8b6914;
  --red: #c5563b;
  --green: #8ab07a;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --max: 1180px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
}

body {
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(200,165,91,.10), transparent 70%),
    radial-gradient(ellipse 70% 40% at 50% 110%, rgba(200,165,91,.06), transparent 70%),
    var(--bg);
}

/* ─── Topbar ─── */
.topbar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 24px 14px;
  display: flex;
  justify-content: flex-start;
  background: transparent;
  border-bottom: 0;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  font-size: 26px;
  color: var(--gold-bright);
  text-shadow: 0 0 16px rgba(232,201,122,.35);
}
.brand-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: .6px;
  color: var(--text);
}

/* ─── Layout ─── */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 24px 80px;
}
.screen { display: none; }
.screen.active { display: block; animation: fadeIn .4s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Mode plein écran sur l'intake ─── */
body.on-intake { overflow: hidden; height: 100vh; }
body.on-intake .topbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 10;
  max-width: none;
  background: transparent;
  border: 0;
  padding: 18px 24px;
  pointer-events: none;
}
body.on-intake .topbar .brand-title {
  color: #f5ecd4;
  text-shadow:
    0 1px 0 rgba(0,0,0,.9),
    0 2px 4px rgba(0,0,0,.9),
    0 4px 14px rgba(0,0,0,.85),
    0 0 32px rgba(0,0,0,.7);
}
body.on-intake .topbar .brand-mark {
  color: #e8c97a;
  text-shadow:
    0 1px 0 rgba(0,0,0,.9),
    0 2px 8px rgba(0,0,0,.9),
    0 0 22px rgba(232,201,122,.5),
    0 0 40px rgba(0,0,0,.6);
}
body.on-intake main {
  max-width: none;
  margin: 0;
  padding: 0;
  height: 100vh;
}
body.on-intake .bottom {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 10;
  max-width: none;
  background: transparent;
  border: 0;
  padding: 14px 24px;
  color: rgba(232,201,122,.55);
  text-shadow: 0 1px 8px rgba(0,0,0,.7);
  pointer-events: none;
}

/* ─── Intake : hero plein écran avec form en overlay ─── */
.intake-hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  margin: 0;
  overflow: hidden;
}
.intake-hero > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 35%;
  display: block;
  z-index: 0;
}
.intake-hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,16,12,0) 70%, rgba(20,16,12,.65) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Cadre de saisie premium — verre doré ciselé */
.intake-input {
  position: absolute;
  left: 50%;
  bottom: 6vh;
  transform: translateX(-50%);
  z-index: 3;
  width: min(560px, 88vw);
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 2px;
  background:
    linear-gradient(135deg, rgba(245,230,179,.55) 0%, rgba(200,165,91,.2) 30%, rgba(168,133,61,.25) 70%, rgba(245,230,179,.5) 100%);
  border-radius: 18px;
  box-shadow:
    0 32px 80px rgba(0,0,0,.65),
    0 12px 32px rgba(0,0,0,.4),
    0 0 0 1px rgba(0,0,0,.4),
    inset 0 1px 0 rgba(255,235,180,.4);
  transition: box-shadow .35s ease, transform .35s ease;
}
.intake-input::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(28,22,16,.92) 0%, rgba(18,14,10,.95) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 0;
  pointer-events: none;
}
.intake-input::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px; right: 2px;
  height: 50%;
  border-radius: 16px 16px 60% 60% / 16px 16px 100% 100%;
  background: linear-gradient(180deg, rgba(255,235,180,.08) 0%, rgba(255,235,180,0) 100%);
  z-index: 1;
  pointer-events: none;
}
.intake-input:focus-within {
  box-shadow:
    0 38px 100px rgba(0,0,0,.7),
    0 18px 40px rgba(0,0,0,.45),
    0 0 0 1px rgba(232,201,122,.5),
    0 0 60px rgba(232,201,122,.18),
    inset 0 1px 0 rgba(255,235,180,.55);
  transform: translateX(-50%) translateY(-3px);
}
.intake-input textarea {
  position: relative;
  z-index: 2;
  flex: 1;
  background: transparent;
  border: 0;
  color: #f5e6b3;
  padding: 18px 18px 18px 22px;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.45;
  letter-spacing: .2px;
  resize: none;
  outline: none;
  box-sizing: border-box;
  min-height: 64px;
  max-height: 30vh;
  caret-color: #e8c97a;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.intake-input textarea::-webkit-scrollbar { width: 0; height: 0; display: none; }
.intake-input textarea::placeholder {
  color: rgba(232,201,122,.45);
  font-style: italic;
  font-weight: 400;
}
.intake-input .btn-primary {
  position: relative;
  z-index: 2;
  border: 0;
  border-radius: 0 16px 16px 0;
  padding: 0 24px;
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1;
  min-width: 70px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(232,201,122,.18) 0%, rgba(168,133,61,.12) 100%);
  color: #f5e6b3;
  text-shadow: 0 0 12px rgba(232,201,122,.6), 0 2px 4px rgba(0,0,0,.5);
  border-left: 1px solid rgba(232,201,122,.22);
  transition: background .25s, text-shadow .25s, transform .15s;
}
.intake-input .btn-primary:hover {
  background: linear-gradient(180deg, rgba(232,201,122,.32) 0%, rgba(168,133,61,.22) 100%);
  text-shadow: 0 0 18px rgba(255,235,180,.9), 0 2px 6px rgba(0,0,0,.6);
}
.intake-input .btn-primary:active { transform: scale(.97); }
@media (max-height: 720px) {
  .intake-input { bottom: 3vh; }
}

/* ─── Scène du débat (image en bandeau au-dessus du transcript) ─── */
.debate-scene {
  margin: 0 0 24px;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-card);
  aspect-ratio: 32/9;
  box-shadow: 0 14px 32px rgba(0,0,0,.4);
}
.debate-scene img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
  animation: sceneBreath 9s ease-in-out infinite;
}
@keyframes sceneBreath {
  0%, 100% { transform: scale(1); filter: brightness(1) saturate(1); }
  50%      { transform: scale(1.025); filter: brightness(1.06) saturate(1.08); }
}
.debate-scene figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px 22px;
  background: linear-gradient(180deg, transparent, rgba(20,16,12,.85) 70%);
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  color: var(--gold-bright);
  letter-spacing: .4px;
  text-align: center;
}
@media (max-width: 720px) {
  .debate-scene { aspect-ratio: 16/9; }
  .debate-scene figcaption { font-size: 14px; padding: 12px 16px; }
}

.intake-form h1 {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: .3px;
  line-height: 1.15;
}
.intake-form .sub {
  color: var(--text-soft);
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  margin: 0 0 28px;
}
.intake-form label {
  display: block;
  margin: 16px 0 6px;
  color: var(--gold);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.intake-form .req { color: var(--red); }
.intake-form .opt { color: var(--muted); text-transform: none; letter-spacing: 0; font-size: 12px; }
.intake-form textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 14px 16px;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.intake-form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,165,91,.15);
}

.actions {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.hint { color: var(--muted); font-size: 13px; }

/* ─── Boutons ─── */
.btn-primary, .btn-secondary {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  letter-spacing: .3px;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #1a1410;
  border-color: var(--gold-dim);
  box-shadow: 0 6px 20px rgba(200,165,91,.25), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(200,165,91,.35), inset 0 1px 0 rgba(255,255,255,.3);
}
.btn-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.btn-secondary {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--line);
}
.btn-secondary:hover {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--gold-dim);
}

/* ─── Débat ─── */
.debate-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 24px;
}
.debate-head h2, .dossier-head h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  margin: 0;
}
.debate-meta { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.status { padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.status.streaming { color: var(--gold-bright); background: rgba(200,165,91,.10); border: 1px solid rgba(200,165,91,.25); }
.status.done { color: var(--green); background: rgba(138,176,122,.10); border: 1px solid rgba(138,176,122,.25); }
.status.error { color: var(--red); background: rgba(197,86,59,.10); border: 1px solid rgba(197,86,59,.25); }

.transcript {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 32px;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  min-height: 320px;
  max-height: 70vh;
  overflow-y: auto;
  color: var(--text);
}
.transcript::after {
  content: '▍';
  color: var(--gold-bright);
  animation: blink 1s steps(2) infinite;
}
.transcript.done::after { content: ''; animation: none; }
@keyframes blink { 50% { opacity: 0; } }

.debate-foot { margin-top: 16px; display: flex; justify-content: flex-end; }

/* ─── Dossier ─── */
.dossier-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--gold-dim);
  padding-bottom: 16px;
  margin-bottom: 28px;
}
.dossier-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dossier-body {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 36px 40px;
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text);
}
.dossier-body h1, .dossier-body h2, .dossier-body h3 {
  font-family: var(--serif);
  color: var(--gold-bright);
  font-weight: 600;
  letter-spacing: .3px;
  margin: 28px 0 14px;
}
.dossier-body h1 { font-size: 32px; border-bottom: 1px solid var(--gold-dim); padding-bottom: 10px; margin-top: 0; }
.dossier-body h2 { font-size: 24px; }
.dossier-body h3 { font-size: 19px; color: var(--gold); }
.dossier-body p { margin: 10px 0; }
.dossier-body ul, .dossier-body ol { padding-left: 22px; }
.dossier-body li { margin: 6px 0; }
.dossier-body code {
  background: var(--bg-elev);
  color: var(--gold-bright);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13.5px;
}
.dossier-body pre {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
}
.dossier-body pre code { background: transparent; padding: 0; }
.dossier-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14.5px;
}
.dossier-body th, .dossier-body td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.dossier-body th { color: var(--gold); font-weight: 600; background: var(--bg-elev); }
.dossier-body strong { color: var(--gold-bright); }
.dossier-body em { color: var(--text-soft); }
.dossier-body blockquote {
  border-left: 3px solid var(--gold-dim);
  margin: 14px 0;
  padding: 6px 16px;
  color: var(--text-soft);
  font-style: italic;
}

/* ─── Hotspots personnages (intake + debate) ─── */
[data-hotspots] { position: relative; }
.hotspot-area {
  position: absolute;
  cursor: help;
  border-radius: 50%;
  transition: background .2s, box-shadow .2s, transform .2s;
  z-index: 2;
}
.hotspot-area:hover {
  background: transparent;
  box-shadow: none;
}
.hotspot-badge {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: linear-gradient(180deg, var(--bg-elev), #1a1410);
  border: 1px solid var(--gold-dim);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  white-space: nowrap;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0,0,0,.45), 0 0 0 1px rgba(200,165,91,.15);
}
.hotspot-badge .hb-em { font-size: 16px; margin-right: 6px; }
.hotspot-badge .hb-name { color: var(--gold-bright); font-weight: 700; letter-spacing: .3px; }
.hotspot-badge .hb-role { color: var(--text-soft); font-style: italic; font-size: 12px; display: block; margin-top: 2px; text-align: center; }
.hotspot-badge::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--gold-dim);
}
.hotspot-area:hover .hotspot-badge {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@media (max-width: 720px) {
  .hotspot-badge { font-size: 11px; padding: 6px 10px; }
  .hotspot-badge .hb-role { font-size: 10px; }
}

/* ─── Bottom ─── */
.bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 24px 32px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
  gap: 12px;
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elev);
  border: 1px solid var(--red);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  z-index: 1000;
  max-width: 90vw;
}
