*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0010;
  --surface: #110020;
  --border: #2d1a4a;
  --purple: #6b21a8;
  --purple-light: #9333ea;
  --purple-bright: #a855f7;
  --yellow: #fbbf24;
  --text: #f0e8ff;
  --muted: #9d8ab5;
  --bot-bg: #1a0035;
  --user-bg: linear-gradient(135deg, #6b21a8, #a855f7);
  --success: #22c55e;
}

body {
  background: var(--bg);
  font-family: 'Sora', sans-serif;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.chat-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #0a001099;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-back {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color .2s;
}

.nav-back:hover { color: var(--text); }
.nav-logo { font-weight: 700; font-size: 0.9rem; color: var(--purple-bright); }
.nav-secure { font-size: 0.78rem; color: var(--muted); }

.chat-wrapper {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 0 16px;
}

.chat-avatar-big {
  width: 48px; height: 48px;
  background: var(--user-bg);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.chat-header h2 { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.chat-header p  { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

.status-dot {
  width: 9px; height: 9px;
  background: var(--success);
  border-radius: 50%;
  margin-left: auto;
  box-shadow: 0 0 10px var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

#chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding-bottom: 16px;
}

.message {
  display: flex;
  gap: 10px;
  animation: fadeUp .3s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message.user { flex-direction: row-reverse; }

.avatar {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

.bot .avatar  { background: var(--bot-bg); border: 1px solid var(--border); }
.user .avatar { background: var(--user-bg); }

.bubble {
  max-width: 72%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.6;
}

.bot .bubble {
  background: var(--bot-bg);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}

.user .bubble {
  background: var(--user-bg);
  border-top-right-radius: 4px;
  color: #fff;
}

.file-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.typing {
  display: flex; gap: 5px; padding: 14px 16px;
  align-items: center;
}

.typing span {
  width: 7px; height: 7px;
  background: var(--muted);
  border-radius: 50%;
  animation: bounce .9s infinite;
}

.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .30s; }

@keyframes bounce {
  0%,60%,100% { transform: translateY(0); }
  30%          { transform: translateY(-6px); }
}

.lead-banner {
  background: linear-gradient(135deg, #14532d, #166534);
  border: 1px solid #22c55e44;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.82rem;
  color: #86efac;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-footer {
  position: sticky;
  bottom: 0;
  padding: 8px 0 24px;
  background: linear-gradient(to top, var(--bg) 80%, transparent);
}

.upload-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .2s, color .2s;
  font-family: 'Sora', sans-serif;
}

.upload-btn:hover { border-color: var(--purple-bright); color: var(--purple-bright); }

.rgpd-notice {
  font-size: 0.72rem;
  color: #5a4a70;
  margin-bottom: 8px;
  padding: 0 4px;
}

.rgpd-notice a { color: var(--purple-bright); text-decoration: none; }

.input-wrap {
  display: flex;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 12px;
  transition: border-color .2s;
}

.input-wrap:focus-within { border-color: var(--purple-bright); }

#user-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 0.88rem;
  resize: none;
  min-height: 24px;
  max-height: 120px;
}

#user-input::placeholder { color: var(--muted); }

#send-btn {
  background: var(--user-bg);
  border: none;
  border-radius: 10px;
  width: 38px; height: 38px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity .2s, transform .1s;
}

#send-btn:hover  { opacity: .85; }
#send-btn:active { transform: scale(.93); }
#send-btn svg { fill: #fff; width: 17px; height: 17px; }
