/* SL Médias — onboarding chat front-end. Brand: SL Médias (bleus + or). */

@font-face {
  font-family: "Overused Grotesk";
  src: url("fonts/OverusedGrotesk-Roman.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Overused Grotesk";
  src: url("fonts/OverusedGrotesk-SemiBold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Overused Grotesk";
  src: url("fonts/OverusedGrotesk-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Swear Display";
  src: url("fonts/SwearDisplay-Bold.otf") format("opentype");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --navy: #1a2c5e;        /* logo blue, deep */
  --blue: #5f89e8;        /* primary brand blue */
  --blue-deep: #2a5acb;   /* button blue */
  --blue-soft: #d1e3ff;   /* user bubble */
  --signal: #ffd166;      /* warm gold accent */
  --ink: #0a1226;         /* near-black type */
  --bg: #f4f6fb;          /* whisper-blue paper */
  --card: #ffffff;
  --muted: #5b6577;
  --border: #e1e7f4;
  --radius: 16px;
  --font-body: "Overused Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Swear Display", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
}

.chat {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
}

.chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 5;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand__logo { height: 30px; width: auto; display: block; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -0.3px; color: var(--navy); }

.start, .done { padding: 40px 28px; }
.start h1 { font-family: var(--font-display); font-weight: 700; font-size: 28px; margin: 0 0 12px; color: var(--navy); letter-spacing: -0.3px; }
.start p { color: var(--muted); line-height: 1.6; }
.field { display: block; margin: 24px 0 8px; }
.field span { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.field select {
  width: 100%; padding: 13px 14px; border: 1px solid var(--border); border-radius: 12px;
  font-size: 15px; font-family: inherit; background: #fff; appearance: none; color: var(--ink);
}
.consent { font-size: 13px; color: var(--muted); margin-top: 18px; }

.btn { cursor: pointer; border: none; border-radius: 12px; font-size: 15px; font-weight: 600; font-family: var(--font-body); }
.btn--primary { background: var(--blue-deep); color: #fff; padding: 14px 22px; width: 100%; margin-top: 12px; transition: background .15s ease; }
.btn--primary:hover { background: var(--navy); }
.btn--primary:disabled { opacity: .5; cursor: default; }

.thread { flex: 1; padding: 24px 22px 12px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.msg { max-width: 82%; padding: 12px 16px; border-radius: var(--radius); line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg--bot { align-self: flex-start; background: #eef2fb; color: var(--ink); border-bottom-left-radius: 4px; white-space: normal; }
.msg--user { align-self: flex-end; background: var(--blue-soft); color: var(--ink); border-bottom-right-radius: 4px; }
.msg--typing { color: var(--muted); font-style: italic; }
.msg--bot ul { margin: 6px 0 2px; padding-left: 18px; }
.msg--bot li { margin: 2px 0; }
.msg--bot strong { font-weight: 700; }

.composer {
  display: flex; gap: 10px; align-items: flex-end;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--card);
}
.composer textarea {
  flex: 1; resize: none; border: 1px solid var(--border); border-radius: 18px;
  padding: 12px 16px; font-size: 15px; font-family: var(--font-body); max-height: 140px; line-height: 1.4; color: var(--ink);
}
.composer textarea:focus { outline: none; border-color: var(--blue); }

.btn--send {
  width: 44px; height: 44px; border-radius: 50%; background: var(--blue-deep); color: #fff;
  font-size: 20px; flex-shrink: 0; display: grid; place-items: center; transition: background .15s ease;
}
.btn--send:hover { background: var(--navy); }
.btn--send:disabled { opacity: .4; cursor: default; }

.btn--mic {
  width: 44px; height: 44px; border-radius: 50%; background: #eef2fb; color: var(--navy);
  font-size: 18px; flex-shrink: 0; display: grid; place-items: center; border: 1px solid var(--border);
}
.btn--mic:disabled { opacity: .4; cursor: default; }
.btn--mic.is-listening {
  background: var(--blue-deep); color: #fff; border-color: var(--blue-deep);
  animation: micpulse 1.2s ease-in-out infinite;
}
@keyframes micpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(42, 90, 203, .45); }
  50% { box-shadow: 0 0 0 8px rgba(42, 90, 203, 0); }
}

.done { text-align: center; }
.done h2 { font-family: var(--font-display); font-weight: 700; color: var(--navy); }
.done__check {
  width: 64px; height: 64px; border-radius: 50%; background: var(--blue-deep); color: #fff;
  font-size: 34px; display: grid; place-items: center; margin: 0 auto 18px;
}

.error-banner {
  background: #fde6e6; color: #b23b3b; padding: 10px 16px; font-size: 14px;
  text-align: center; border-bottom: 1px solid #f6cccc;
}
