
:root {
  --bg-start: #120a04;
  --bg-mid: #0a0502;
  --bg-end: #000000;
  --bg-card: rgba(251,146,60,0.04);
  --bg-card-hover: rgba(251,146,60,0.08);
  --bg-surface: rgba(251,146,60,0.05);
  --border-color: rgba(251,146,60,0.18);
  --border-glow: rgba(251,146,60,0.35);
  --text-primary: #fdf6ef;
  --text-secondary: #f4d4b5;
  --text-muted: #a88a6c;
  --accent-violet: #fb923c;
  --accent-blue: #f97316;
  --accent-purple: #f4d4b5;
  --accent-green: #34d399;
  --accent-red: #f87171;
  --accent-orange: #fbbf24;
  --shadow: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.7);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: all 0.25s ease;
  --gradient-primary: linear-gradient(135deg, #fb923c, #f97316, #fbbf24);
  --gradient-glow: 0 0 20px rgba(251,146,60,0.12);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, #fb923c 20%, #f97316 50%, #fbbf24 80%, transparent 100%);
  z-index: 1001;
  box-shadow: 0 0 20px rgba(251,146,60,0.3);
}
body {
  font-family: 'Inter', sans-serif;
  background: #000000;
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
.bg-logo {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 50vw;
  font-weight: 900;
  color: rgba(251,146,60,0.025);
  pointer-events: none;
  z-index: 0;
  line-height: 1;
  user-select: none;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
header {
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(251,146,60,0.15);
  box-shadow: 0 4px 30px rgba(251,146,60,0.05);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-primary); }
.logo-icon {
  width: 32px; height: 32px;
  background: var(--gradient-primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: white;
  box-shadow: 0 0 20px rgba(251,146,60,0.25);
}
.logo span { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; gap: 8px; }
.nav-links a {
  color: var(--text-secondary); text-decoration: none;
  padding: 8px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}
.nav-links a:hover {
  background: rgba(251,146,60,0.1);
  border-color: var(--border-color);
  color: var(--text-primary);
}
.nav-links a.active {
  background: var(--gradient-primary) !important;
  color: white !important;
  border-color: transparent !important;
  box-shadow: var(--gradient-glow);
}
.nav-support-btn { font-size: 13px !important; padding: 6px 14px !important; color: #fb923c !important; }
.nav-support-btn:hover { background: rgba(251,146,60,0.1) !important; border-color: rgba(251,146,60,0.3) !important; color: #fbbf24 !important; }
.lang-btn { font-size: 12px !important; padding: 4px 10px !important; letter-spacing: 0.5px; }
.lang-btn.active { background: var(--gradient-primary) !important; color: white !important; border-color: transparent !important; box-shadow: var(--gradient-glow); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; border: none;
  cursor: pointer; transition: var(--transition); text-decoration: none;
}
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 0 20px rgba(249,115,22,0.15);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(249,115,22,0.3);
}
.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--border-glow);
}
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 30px; font-size: 16px; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.suggestion-bar {
  display: flex; gap: 8px; padding: 8px 16px;
  border-top: 1px solid var(--border-color);
  background: rgba(255,255,255,0.02); flex-wrap: wrap;
}
.suggestion-btn {
  padding: 8px 18px; border-radius: 20px;
  font-size: 13px; font-weight: 600; border: none;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.suggestion-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.suggestion-btn.primary { background: var(--gradient-primary); color: white; box-shadow: 0 0 15px rgba(249,115,22,0.1); }
.suggestion-btn.primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(249,115,22,0.3);
}
.suggestion-btn.secondary { background: rgba(255,255,255,0.06); color: var(--text-primary); border: 1px solid var(--border-color); }
.suggestion-btn.secondary:hover:not(:disabled) { background: rgba(255,255,255,0.1); border-color: var(--border-glow); }
.welcome-inner { text-align: center; padding: 50px 20px; }
.welcome-logo {
  width: 72px; height: 72px; border-radius: 20px;
  background: var(--gradient-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800; color: white;
  margin: 0 auto 20px;
  box-shadow: 0 0 40px rgba(251,146,60,0.25);
}
.welcome-title { font-size: 26px; font-weight: 700; margin-bottom: 10px; color: var(--text-primary); }
.welcome-text { color: var(--text-secondary); font-size: 14px; max-width: 420px; margin: 0 auto 28px; }
.welcome-actions {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  margin-top: 36px; padding-top: 28px;
  border-top: 1px solid rgba(251,146,60,0.15);
  position: relative;
}
.welcome-actions::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
}
.welcome-support { margin-top: 14px; font-size: 12px; color: var(--text-muted); }
.welcome-support a { color: var(--accent-purple); transition: var(--transition); }
.welcome-support a:hover { color: var(--accent-violet); text-decoration: underline; }
.welcome-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  padding: 6px 12px;
  background: rgba(251,146,60,0.06);
  border-radius: 8px;
  border-left: 2px solid rgba(251,146,60,0.15);
  display: inline-block;
}
.welcome-about {
  margin: 28px auto 0;
  max-width: 520px;
  padding: 20px 22px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  text-align: left;
}
.welcome-about h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--accent-purple);
}
.welcome-about p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.welcome-about strong { color: var(--accent-violet); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-blue { background: rgba(249,115,22,0.15); color: var(--accent-blue); }
.badge-green { background: rgba(52,211,153,0.15); color: var(--accent-green); }
.badge-orange { background: rgba(251,146,60,0.15); color: var(--accent-orange); }
.badge-red { background: rgba(248,113,113,0.15); color: var(--accent-red); }
.badge-purple { background: rgba(251,146,60,0.15); color: var(--accent-purple); }
.form-input {
  width: 100%; padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px; font-family: inherit; transition: var(--transition);
}
.form-input:focus { outline: none; border-color: var(--accent-violet); box-shadow: 0 0 0 3px rgba(251,146,60,0.15); }
.tool-section { padding: 40px 0; }
.chat-layout { display: flex; gap: 4px; min-height: 70vh; align-items: flex-start; }
.chat-main {
  flex: 1; display: flex; flex-direction: column;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; min-height: 400px; max-height: 65vh; }
.chat-message { display: flex; gap: 12px; margin-bottom: 16px; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.chat-user { flex-direction: row-reverse; }
.chat-agent .chat-bubble { background: rgba(255,255,255,0.06); border-bottom-left-radius: 4px; border: 1px solid rgba(255,255,255,0.04); }
.chat-user .chat-bubble { background: var(--gradient-primary); color: white; border-bottom-right-radius: 4px; }
.chat-bubble { max-width: 75%; padding: 12px 18px; border-radius: 16px; line-height: 1.5; font-size: 14px; }
.chat-content { word-break: break-word; }
.chat-content strong { color: var(--accent-purple); }
.chat-content code { background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.chat-content pre code { display: block; padding: 12px; overflow-x: auto; font-size: 13px; background: rgba(0,0,0,0.3); }
.chat-content em { color: var(--text-secondary); }
.chat-choices-wrapper { padding-top: 0 !important; }
.chat-choices { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px 56px; background: none; }
.chat-choices .suggestion-btn { font-size: 12px; padding: 6px 14px; }
.chat-input-area {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: rgba(255,255,255,0.02);
}
.chat-upload-btn {
  padding: 8px 18px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  cursor: pointer; font-size: 13px; font-weight: 500;
  transition: var(--transition); flex-shrink: 0;
  color: var(--text-secondary);
}
.chat-upload-btn:hover { border-color: var(--accent-violet); color: var(--accent-purple); }
.file-status { flex: 1; font-size: 13px; color: var(--text-muted); padding: 0 8px; }
.chat-sidebar {
  width: 420px; flex-shrink: 0; max-height: 75vh;
  display: flex; flex-direction: column; gap: 16px;
  border-left: 1px solid rgba(251,146,60,0.1);
  padding-left: 16px;
  margin-left: 4px;
  overflow: hidden;
}
.chat-sidebar > #type-help-container { flex-shrink: 0; }
.chat-sidebar > #dashboard-section { overflow-y: auto; flex: 1; min-height: 0; }
.chat-sidebar > #results-container { flex-shrink: 0; }
.dashboard-section {
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; color: var(--text-primary); }
.col-row { display: flex; align-items: baseline; gap: 8px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 14px; }
.col-name { font-weight: 600; }
.col-sep { color: var(--text-muted); }
.col-type { font-weight: 600; color: var(--accent-purple); }
.col-others { color: var(--text-muted); font-size: 12px; }
.col-examples { padding: 4px 0 8px 26px; font-size: 12px; }
.col-example-item { padding: 2px 0; }
.col-type-name { color: var(--text-muted); }
.col-example-value { font-family: monospace; color: var(--accent-blue); }
.col-mixed-rows { padding: 2px 0 6px 26px; font-size: 12px; color: var(--text-muted); }
.dot-green { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-green); box-shadow: 0 0 8px rgba(52,211,153,0.4); }
.dot-red { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-red); box-shadow: 0 0 8px rgba(248,113,113,0.4); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.avatar-user { background: rgba(255,255,255,0.08); color: var(--text-secondary); }
.avatar-agent-novice { background: rgba(249,115,22,0.2); color: var(--accent-blue); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: var(--text-muted);
  margin: 0 auto 10px;
}
.empty-state-text { font-size: 13px; color: var(--text-muted); }
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); z-index: 999; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal-content {
  background: rgba(26,14,5,0.95);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 36px; max-width: 400px; width: 90%; text-align: center;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}
.modal-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, #FF813F, #fb923c);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: white;
  margin: 0 auto 14px;
  box-shadow: 0 0 25px rgba(251,146,60,0.2);
}
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.modal-text { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.modal-btn-row { display: flex; gap: 8px; margin-top: 14px; justify-content: center; }
.type-help-section { position: relative; }
.modal-input-row { display: flex; gap: 8px; }
.modal-cgu { max-width: 500px; text-align: left; }
.cgu-intro { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }
.cgu-list { list-style: none; padding: 0; margin: 0 0 16px; }
.cgu-list li {
  font-size: 13px; color: var(--text-secondary); line-height: 1.5;
  padding: 8px 12px; margin-bottom: 6px;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid var(--border-color);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.cgu-list li strong { color: var(--accent-violet); }
.cgu-read-more { font-size: 12px; text-align: center; margin-bottom: 8px; }
.cgu-read-more a { color: var(--text-muted); text-decoration: none; }
.cgu-read-more a:hover { color: var(--accent-purple); text-decoration: underline; }
.modal-icon-cgu {
  background: var(--gradient-primary) !important;
  box-shadow: 0 0 25px rgba(249,115,22,0.2) !important;
}
.modal-icon-refused {
  background: linear-gradient(135deg, #f87171, #ef4444) !important;
  box-shadow: 0 0 25px rgba(248,113,113,0.2) !important;
}
.cgu-modal-refused { text-align: center; }
.loading-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); z-index: 999; align-items: center; justify-content: center; }
.loading-overlay.active { display: flex; }
.loading-box {
  background: rgba(26,14,5,0.95);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 36px 52px; text-align: center;
  box-shadow: var(--shadow-lg);
}
.spinner { width: 32px; height: 32px; border: 3px solid rgba(255,255,255,0.08); border-top-color: var(--accent-violet); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.premium-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  background: rgba(251,146,60,0.08);
  border: 1px solid rgba(251,146,60,0.2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
}
.pattern-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 500; margin: 2px; }
.pattern-tag.email { background: rgba(249,115,22,0.15); color: var(--accent-blue); }
.pattern-tag.phone { background: rgba(52,211,153,0.15); color: var(--accent-green); }
.pattern-tag.url { background: rgba(251,146,60,0.15); color: var(--accent-purple); }
footer { text-align: center; padding: 32px; color: var(--text-muted); font-size: 12px; border-top: 1px solid rgba(255,255,255,0.04); margin-top: 40px; }
footer .container { display: flex; align-items: center; justify-content: center; gap: 16px; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: var(--transition); }
.footer-links a:hover { color: var(--accent-purple); text-decoration: underline; }
.type-help-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 6px 10px;
  background: rgba(251,146,60,0.06);
  border-radius: 8px;
  border-left: 2px solid rgba(251,146,60,0.2);
  line-height: 1.4;
}
.type-help-section {
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.type-help-input-wrap { position: relative; display: flex; align-items: center; }
.type-help-input { padding-right: 32px !important; }
.type-help-clear {
  position: absolute;
  right: 10px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  display: none;
  transition: var(--transition);
}
.type-help-clear:hover { color: var(--accent-purple); }
.type-help-results { margin-top: 10px; max-height: 280px; overflow-y: auto; }
.type-help-item {
  padding: 8px 10px;
  border-radius: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: var(--transition);
  cursor: default;
}
.type-help-item:hover { background: rgba(255,255,255,0.04); }
.type-help-item:last-child { border-bottom: none; }
.type-help-name { font-weight: 600; font-size: 13px; color: var(--accent-purple); margin-bottom: 2px; }
.type-help-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.type-help-code { font-size: 11px; font-family: monospace; color: var(--text-muted); margin-top: 3px; }
.type-help-empty { padding: 12px; text-align: center; font-size: 12px; color: var(--text-muted); }
.hidden { display: none !important; }
.pdf-report { font-family:Arial,sans-serif; color:#0f172a; font-size:12px; line-height:1.5; padding:20px; width:100%; }
.pdf-report h1 { font-size:22px; font-weight:800; margin-bottom:4px; color:#0f172a; }
.pdf-report .sub { color:#64748b; font-size:13px; margin-bottom:20px; }
.pdf-report .section { margin-bottom:16px; }
.pdf-report h2 { font-size:16px; font-weight:700; margin:20px 0 10px; border-bottom:2px solid #3b82f6; padding-bottom:4px; color:#0f172a; }
.pdf-report table { width:100%; border-collapse:collapse; margin-bottom:16px; }
.pdf-report th { background:#f1f5f9; padding:8px 10px; border:1px solid #e2e8f0; text-align:left; font-size:10px; text-transform:uppercase; color:#475569; }
.pdf-report td { padding:6px 10px; border:1px solid #e2e8f0; }
.pdf-report tr:nth-child(even) { background:#fafbfc; }
.pdf-report .foot { margin-top:24px; padding-top:12px; border-top:1px solid #e2e8f0; font-size:10px; color:#94a3b8; text-align:center; }
@media (max-width: 900px) {
  .chat-layout { flex-direction: column; align-items: stretch; }
  .chat-main { width: 100%; }
  .chat-sidebar { width: 100%; max-height: none; }
  .bg-logo { font-size: 80vw; }
}

.pipeline-wrap {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 14px 0;
}
.pipeline-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-align: center;
}
.pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 4px 0;
}
.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 56px;
  flex-shrink: 0;
}
.pipeline-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  border: 2px solid transparent;
  transition: var(--transition);
  cursor: default;
}
.pipeline-box.auto { background: rgba(52,211,153,0.2); border-color: rgba(52,211,153,0.3); color: var(--accent-green); }
.pipeline-box.optional { background: rgba(251,146,60,0.15); border-color: rgba(251,146,60,0.3); color: var(--accent-orange); }
.pipeline-box.smart { background: rgba(251,146,60,0.2); border-color: rgba(251,146,60,0.3); color: var(--accent-purple); }
.pipeline-box.manual { background: rgba(249,115,22,0.2); border-color: rgba(249,115,22,0.3); color: var(--accent-blue); }
.pipeline-box:hover { transform: translateY(-2px); box-shadow: 0 0 16px rgba(249,115,22,0.2); }
.pipeline-label { font-size: 9px; color: var(--text-muted); text-align: center; white-space: nowrap; font-weight: 500; }
.pipeline-arrow { color: rgba(255,255,255,0.15); font-size: 14px; flex-shrink: 0; margin-bottom: 16px; }
.pipeline-legend { display: flex; gap: 14px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.pipeline-legend-item { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--text-muted); }
.pipeline-legend-dot { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }
.pipeline-legend-dot.auto { background: var(--accent-green); }
.pipeline-legend-dot.optional { background: var(--accent-orange); }
.pipeline-legend-dot.smart { background: var(--accent-purple); }
.pipeline-legend-dot.manual { background: var(--accent-blue); }
  


:root {
  --bg-start: #120a04;
  --bg-mid: #0a0502;
  --bg-end: #000000;
  --bg-card: rgba(251,146,60,0.04);
  --bg-card-hover: rgba(251,146,60,0.08);
  --bg-surface: rgba(251,146,60,0.05);
  --border-color: rgba(251,146,60,0.18);
  --border-glow: rgba(251,146,60,0.4);
  --text-primary: #fdf6ef;
  --text-secondary: #f4d4b5;
  --text-muted: #a88a6c;
  --accent-violet: #fb923c;
  --accent-blue: #fbbf24;
  --accent-purple: #fdba74;
  --accent-green: #34d399;
  --accent-red: #f87171;
  --accent-orange: #fb923c;
  --shadow: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.7);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: all 0.25s ease;
  --gradient-primary: linear-gradient(135deg, #fb923c, #f97316);
  --gradient-glow: 0 0 20px rgba(251,146,60,0.15);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, #fbbf24 20%, #fb923c 50%, #fbbf24 80%, transparent 100%);
  z-index: 1001;
  box-shadow: 0 0 20px rgba(251,146,60,0.3);
}
body {
  font-family: 'Inter', sans-serif;
  background: #000000;
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
.bg-logo {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 50vw;
  font-weight: 900;
  color: rgba(251,146,60,0.025);
  pointer-events: none;
  z-index: 0;
  line-height: 1;
  user-select: none;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
header {
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(251,146,60,0.15);
  box-shadow: 0 4px 30px rgba(251,146,60,0.05);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-primary); }
.logo-icon {
  width: 32px; height: 32px;
  background: var(--gradient-primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: white;
  box-shadow: 0 0 20px rgba(251,146,60,0.25);
}
.logo span { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; gap: 8px; }
.nav-links a {
  color: var(--text-secondary); text-decoration: none;
  padding: 8px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}
.nav-links a:hover { background: rgba(251,146,60,0.1); border-color: var(--border-color); color: var(--text-primary); }
.nav-links a.active {
  background: var(--gradient-primary) !important;
  color: white !important;
  border-color: transparent !important;
  box-shadow: var(--gradient-glow);
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; border: none;
  cursor: pointer; transition: var(--transition); text-decoration: none;
}
.btn-primary { background: var(--gradient-primary); color: white; box-shadow: 0 0 20px rgba(249,115,22,0.15); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(249,115,22,0.3); }
.hidden { display: none !important; }
footer { text-align: center; padding: 32px; color: var(--text-muted); font-size: 12px; border-top: 1px solid rgba(255,255,255,0.04); margin-top: 40px; }
footer .container { display: flex; align-items: center; justify-content: center; gap: 16px; }
footer a { color: var(--text-muted); text-decoration: none; transition: var(--transition); }
footer a:hover { color: var(--accent-purple); text-decoration: underline; }

/* CGU specific */
.legal-page { padding: 40px 0; max-width: 800px; margin: 0 auto; }
.legal-page h1 { font-size: 28px; font-weight: 800; margin-bottom: 6px; color: var(--text-primary); }
.legal-page .last-updated { font-size: 12px; color: var(--text-muted); margin-bottom: 24px; }
.legal-page h2 { font-size: 18px; font-weight: 700; margin: 28px 0 10px; color: var(--accent-purple); }
.legal-page p, .legal-page li { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }
.legal-page ul { padding-left: 20px; margin: 8px 0; }
.legal-page li { margin-bottom: 6px; }
.legal-page a { color: var(--accent-violet); }
.legal-page .back-link { display: inline-block; margin-bottom: 20px; font-size: 13px; color: var(--text-muted); text-decoration: none; }
.legal-page .back-link:hover { color: var(--accent-purple); }
.legal-page .lang-switch { float: right; font-size: 12px; }
.legal-page .lang-switch a { color: var(--text-muted); text-decoration: none; padding: 4px 10px; border: 1px solid var(--border-color); border-radius: 6px; }
.legal-page .lang-switch a:hover { color: var(--accent-purple); border-color: var(--border-glow); }
.legal-page .lang-switch a.active { background: var(--gradient-primary); color: white; border-color: transparent; }
[lang="en"] .lang-fr { display: none; }
[lang="fr"] .lang-en { display: none; }

.fa-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: middle;
  fill: currentColor;
}
.fa-icon-sm { width: 0.75em; height: 0.75em; }
.fa-icon-lg { width: 1.25em; height: 1.25em; }
.fa-icon-flip-x { transform: scaleX(-1); }

.describe-section {
  margin-top: 16px;
}
.describe-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.describe-row-count {
  font-size: 13px;
  color: var(--text-muted);
}
.describe-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}
.describe-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.describe-table th {
  text-align: left;
  padding: 10px 8px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  background: var(--bg-surface);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.describe-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}
.describe-table tr:last-child td {
  border-bottom: none;
}
.describe-table tr:hover {
  background: var(--bg-card-hover);
}
.desc-th-check, .desc-td-check {
  width: 36px;
  text-align: center;
}
.desc-col-cb, #desc-select-all {
  accent-color: var(--accent-violet);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.desc-col-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
}
.desc-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(251,146,60,0.12);
  color: var(--accent-violet);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.desc-null-pct {
  font-size: 11px;
  color: var(--accent-red);
  opacity: 0.8;
}
.desc-stat {
  display: inline-block;
  padding: 1px 4px;
  background: var(--bg-surface);
  border-radius: 3px;
  font-size: 11px;
  font-family: monospace;
  color: var(--accent-green);
}
.desc-stat::before {
  content: attr(title) ": ";
  color: var(--text-muted);
  font-weight: 600;
}
.desc-stat[title=""],
.desc-stat:not([title])::before {
  content: none;
}
.desc-non-numeric {
  display: inline-block;
  padding: 1px 6px;
  background: var(--bg-surface);
  border-radius: 3px;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}
.desc-top-val {
  display: inline-block;
  padding: 1px 6px;
  margin: 1px;
  background: var(--bg-surface);
  border-radius: 3px;
  font-size: 11px;
  font-family: monospace;
  color: var(--accent-green);
}
.desc-top-pct {
  color: var(--accent-blue);
  font-size: 10px;
}
.desc-no-repeat {
  display: inline-block;
  padding: 1px 6px;
  background: var(--bg-surface);
  border-radius: 3px;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}
.describe-stats-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 6px 10px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-muted);
}
.describe-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.impute-panel {
  max-width: 100%;
  padding: 14px 16px;
}
.impute-panel select.form-input {
  color: var(--text-primary);
  background-color: #1c1208;
}
.impute-panel select.form-input option {
  color: var(--text-primary);
  background-color: #1c1208;
}
.impute-panel select.form-input:focus option:checked {
  background-color: var(--accent-violet);
  color: #ffffff;
}
.preview-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.preview-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.preview-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.preview-form label {
  font-size: 13px;
  color: var(--text-secondary);
}
.preview-lines-input {
  width: 90px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
}
.preview-result {
  padding: 16px 4px;
}
.preview-table-wrap {
  overflow-x: auto;
}
.preview-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.preview-table th {
  background: var(--bg-surface);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  border: 1px solid var(--border);
  position: sticky;
  top: 0;
  white-space: nowrap;
}
.preview-table td {
  padding: 6px 12px;
  border: 1px solid var(--border);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-table tr:nth-child(even) {
  background: var(--bg-card-hover);
}
  

/* ============================================================
   Responsive - desktop-first + clamp() + 3 breakpoints
   ============================================================ */

.container { padding: 0 clamp(16px, 3vw, 24px); }

.chat-bubble { max-width: min(85%, 640px); }

.chat-sidebar { width: clamp(300px, 32vw, 420px); }

.welcome-title { font-size: clamp(22px, 3.2vw, 26px); }
.modal-title { font-size: clamp(18px, 3vw, 20px); }
.welcome-logo { width: clamp(64px, 8vw, 72px); height: clamp(64px, 8vw, 72px); font-size: clamp(28px, 4vw, 32px); }

@media (max-width: 900px) {
  .chat-layout { flex-direction: column; align-items: stretch; }
  .chat-main { width: 100%; }
  .chat-sidebar {
    width: 100%;
    max-height: none;
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    gap: 20px;
    margin-top: 24px;
  }
  .chat-sidebar > #dashboard-section {
    overflow: visible;
    flex: none;
    min-height: 0;
  }
  .chat-message { margin-bottom: 22px; }
  .bg-logo { font-size: 80vw; }
}

@media (max-width: 640px) {
  header { padding: 10px 0; }
  .logo { font-size: 17px; gap: 8px; }
  .logo-icon { width: 28px; height: 28px; font-size: 14px; }
  .nav-links { gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
  .nav-links a { padding: 6px 12px; font-size: 13px; }
  .chat-messages { padding: 14px 12px; min-height: 300px; max-height: 55vh; }
  .chat-bubble { max-width: 92%; padding: 10px 14px; font-size: 13px; }
  .chat-choices { padding-left: 12px; }
  .chat-input-area { flex-wrap: wrap; gap: 8px; }
  .file-status { flex-basis: 100%; padding: 0; }
  .suggestion-bar { padding: 6px 12px; }
  .suggestion-btn { font-size: 12px; padding: 6px 12px; }
  footer { padding: 24px 16px; }
  footer .container { flex-direction: column; gap: 10px; }
  .welcome-inner { padding: 30px 12px; }
  .modal-content { padding: 24px; width: 94%; }
  .preview-form { flex-direction: column; align-items: stretch; }
  .preview-lines-input { width: 100%; }
  .describe-actions { flex-direction: column; }
  .describe-actions .btn { width: 100%; justify-content: center; }
}

@media (max-width: 400px) {
  .container { padding: 0 12px; }
  .header-inner { flex-wrap: wrap; gap: 8px; }
  .welcome-actions .btn { width: 100%; }
  .modal-btn-row { flex-direction: column; }
  .modal-btn-row .btn { width: 100%; justify-content: center; }
  .chat-bubble { max-width: 96%; }
  .avatar { width: 28px; height: 28px; font-size: 11px; }
  .chat-message { gap: 8px; }
  .pipeline { justify-content: flex-start; }
}
