/* Quinn — Qognio Sales-Concierge Widget
 * Standalone vanilla CSS, no framework, no external assets except self-hosted Inter.
 */

@import url('/fonts/inter.css');


:root {
  --bg: #0a0a0f;
  --bg-elev: #13131a;
  --bg-elev-2: #1a1a24;
  --bg-elev-3: #22222e;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f1f0f5;
  --text-dim: #a9a8b6;
  --text-mute: #6b6a78;
  --accent: #7c3aed;
  --accent-2: #a855f7;
  --accent-dark: #6d28d9;
  --accent-soft: rgba(124, 58, 237, 0.15);
  --accent-strong: rgba(124, 58, 237, 0.45);
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
  --glow: 0 0 60px rgba(124, 58, 237, 0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  /* Inter Variable Font (self-hosted, DSGVO-konform), fallback auf system-ui */
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 800px 600px at 50% -10%, rgba(124,58,237,0.08), transparent 60%),
    radial-gradient(ellipse 600px 400px at 100% 100%, rgba(168,85,247,0.05), transparent 70%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  font-feature-settings: "cv11", "ss03";
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }

/* ===== Layout ===== */
.app {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  height: 100vh;
  max-width: 880px;
  margin: 0 auto;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* ===== Header ===== */
.topbar {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(10, 10, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1rem;
}
.brand-icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: 9px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 2px 8px rgba(124,58,237,0.4);
}
.brand-name { font-weight: 700; }
.brand-name small {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-left: 0.15rem;
}
.spacer { flex: 1; }

.reset-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.18s ease;
}
.reset-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255,255,255,0.03);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  font-size: 0.7rem;
  font-weight: 500;
  border: 1px solid rgba(16, 185, 129, 0.28);
}
.status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ===== Main ===== */
.main {
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* ===== Hero ===== */
.hero {
  padding: 2.5rem 1.5rem 1.5rem;
  display: grid;
  place-items: center;
  min-height: 100%;
}
.hero-inner {
  width: 100%;
  max-width: 640px;
  text-align: center;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid rgba(124,58,237,0.3);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1.4rem;
}
.hero-title {
  font-size: clamp(1.75rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.85rem;
}
.hero-title .accent {
  background: linear-gradient(120deg, var(--accent-2) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.55;
  max-width: 540px;
  margin: 0 auto 2rem;
}
.hero-sub strong {
  color: var(--text);
  font-weight: 600;
}

.hero-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.65rem;
  margin: 0 auto 2rem;
  max-width: 580px;
}
.chip {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  transition: all 0.18s ease;
}
.chip:hover, .chip:focus-visible {
  border-color: var(--accent-strong);
  background: var(--bg-elev-2);
  transform: translateY(-1px);
  outline: none;
}
.chip:focus-visible { box-shadow: 0 0 0 3px rgba(124,58,237,0.25); }
.chip-ic {
  font-size: 1.15rem;
  line-height: 1.2;
  flex-shrink: 0;
}
.chip-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.chip-text strong {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.chip-text small {
  font-size: 0.74rem;
  color: var(--text-mute);
  line-height: 1.4;
}
.hero-foot {
  font-size: 0.78rem;
  color: var(--text-mute);
  line-height: 1.6;
}

/* ===== Chat View ===== */
.chat-view { padding: 1rem 1.25rem 1.5rem; }
.chat-box {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.msg {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  animation: msgIn 0.25s ease-out;
  max-width: 100%;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.msg-bot .msg-avatar {
  background: linear-gradient(140deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
}
.msg-user .msg-avatar {
  background: var(--bg-elev-3);
  color: var(--text-dim);
}
.msg-user { flex-direction: row-reverse; }
.msg-content {
  background: var(--bg-elev);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  line-height: 1.55;
  font-size: 0.94rem;
  max-width: 85%;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.msg-user .msg-content {
  background: var(--accent-soft);
  border-color: var(--accent-strong);
  color: var(--text);
}
.msg-bot .msg-content {
  background: var(--bg-elev);
}

/* Markdown styles within messages */
.msg-content p { margin: 0 0 0.5em; }
.msg-content p:last-child { margin-bottom: 0; }
.msg-content strong { color: #ddd6fe; font-weight: 600; }
.msg-content em { font-style: italic; }
.msg-content ul, .msg-content ol { padding-left: 1.4em; margin: 0.4em 0 0.6em; }
.msg-content li { margin-bottom: 0.25em; }
.msg-content code {
  background: rgba(255,255,255,0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.86em;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.msg-content a {
  color: var(--accent-2);
  text-decoration: underline;
  text-decoration-color: rgba(168,85,247,0.4);
  text-underline-offset: 2px;
}
.msg-content a:hover { text-decoration-color: var(--accent-2); }

/* Typing indicator */
.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-mute);
  animation: typing 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* ===== Bot Recommendation Cards ===== */
.bot-cards {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.75rem;
  margin-left: calc(30px + 0.65rem); /* align with msg-content */
  max-width: 85%;
}
.bot-card {
  background: linear-gradient(135deg, var(--bg-elev-2) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.95rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: border-color 0.18s ease;
}
.bot-card:hover { border-color: var(--accent-strong); }
.bot-card-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.bot-card-emoji {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  font-size: 1.1rem;
  background: var(--bg-elev-3);
  border-radius: 8px;
  flex-shrink: 0;
}
.bot-card-title {
  font-weight: 700;
  font-size: 0.97rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.bot-card-tag {
  font-size: 0.7rem;
  color: var(--text-mute);
  background: rgba(255,255,255,0.04);
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.bot-card-tag.cat { color: var(--accent-2); border-color: rgba(168,85,247,0.3); background: var(--accent-soft); }
.bot-card-tag.paused { color: #f59e0b; border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.1); }
.bot-card-paused { opacity: 0.7; border-style: dashed; }
.bot-card-reason {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
  font-style: italic;
}
.bot-card-tagline {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.bot-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}
.bot-action {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: inherit;
  transition: all 0.18s ease;
}
.bot-action:hover, .bot-action:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
  outline: none;
}
.bot-action-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.bot-action-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

/* ===== Journey Cards ===== */
.journey-card {
  background: linear-gradient(135deg, rgba(8,145,178,0.08) 0%, var(--bg-elev) 100%);
  border-color: rgba(8,145,178,0.35);
}
.journey-card .bot-card-tag.cat {
  color: #67e8f9;
  border-color: rgba(8,145,178,0.4);
  background: rgba(8,145,178,0.15);
}
.journey-steps {
  font-size: 0.8rem;
  color: var(--text-mute);
  line-height: 1.5;
  margin-top: 0.15rem;
}
.journey-steps strong { color: var(--text-dim); font-weight: 500; }

/* ===== Lead Form ===== */
.lead-form-wrap {
  margin-top: 0.75rem;
  margin-left: calc(30px + 0.65rem);
  max-width: 85%;
}
.lead-form {
  background: var(--bg-elev-2);
  border: 1px solid var(--accent-strong);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.lead-form-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.1rem;
}
.lead-form-sub {
  font-size: 0.8rem;
  color: var(--text-mute);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}
.lead-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.lead-form input, .lead-form textarea, .lead-form select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease;
}
.lead-form input:focus, .lead-form textarea:focus, .lead-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.18);
}
.lead-form input::placeholder, .lead-form textarea::placeholder {
  color: var(--text-mute);
}
.lead-form textarea { resize: vertical; min-height: 60px; }
.lead-form .honey { display: none !important; }
.lead-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.5;
  cursor: pointer;
}
.lead-consent input[type="checkbox"] {
  width: auto;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.lead-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.3rem;
}
.lead-submit {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.lead-submit:hover { background: var(--accent-dark); }
.lead-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.lead-cancel {
  background: transparent;
  color: var(--text-mute);
  border: 1px solid var(--border);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.lead-cancel:hover { color: var(--text); border-color: var(--border-strong); }
.lead-success {
  padding: 0.85rem 1rem;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-sm);
  color: #6ee7b7;
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ===== Composer ===== */
.composer {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem 0.95rem;
  border-top: 1px solid var(--border);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#composer {
  flex: 1;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  resize: none;
  outline: none;
  line-height: 1.45;
  max-height: 140px;
  transition: border-color 0.15s ease;
}
#composer:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
#composer::placeholder { color: var(--text-mute); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0 1.2rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

/* ===== Footer ===== */
.footer {
  padding: 0.6rem 1.25rem 0.7rem;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-mute);
  text-align: center;
  background: var(--bg);
}
.footer a { color: var(--text-dim); }

/* ===== Toast ===== */
.toast-stack {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 100;
  pointer-events: none;
}
.toast {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text);
  pointer-events: auto;
  animation: toastIn 0.25s ease;
  max-width: 340px;
}
.toast.error { border-color: rgba(239,68,68,0.4); }
.toast.success { border-color: rgba(16,185,129,0.4); color: #6ee7b7; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .app { border: none; }
  .hero { padding: 1.75rem 1rem 1rem; }
  .hero-title { font-size: 1.75rem; }
  .hero-chips { grid-template-columns: 1fr; }
  .reset-label { display: none; }
  .topbar { padding: 0.7rem 1rem; }
  .composer { padding: 0.7rem 1rem 0.85rem; }
  .chat-view { padding: 0.85rem 1rem 1rem; }
  .msg-content { max-width: 88%; }
  .bot-cards, .lead-form-wrap { margin-left: 0; max-width: 100%; }
  .lead-row { grid-template-columns: 1fr; }
  .footer { font-size: 0.65rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
