/* ============================================================
   MERIDIAN LANDINGPAGE CHATBOT — Widget-Styles
   Lokal, regelbasiert, kein API-Aufruf. Farb-/Font-System
   uebernommen aus index.html (Kompass-Branding).
   ============================================================ */

#mc-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0E0038, #2A0A5E);
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(14,0,56,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#mc-toggle:hover { transform: scale(1.08); box-shadow: 0 12px 40px rgba(201,168,76,0.30); }
#mc-toggle svg { width: 26px; height: 26px; stroke: #C9A84C; fill: none; stroke-width: 1.8; }
#mc-toggle .mc-icon-close { display: none; }
#mc-toggle.open .mc-icon-chat { display: none; }
#mc-toggle.open .mc-icon-close { display: block; }

#mc-toggle::before {
  content: '';
  position: absolute;
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(201,168,76,.5);
  animation: mc-pulse 2.6s ease-out infinite;
  opacity: 0;
}
@keyframes mc-pulse {
  0%   { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(1.7); opacity: 0; }
}

#mc-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  max-height: 600px;
  background: #FDFCF9;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(14,0,56,0.22);
  border: 1px solid rgba(14,0,56,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 998;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), opacity 0.25s ease;
}
#mc-window.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: all; }

.mc-header {
  background: linear-gradient(135deg, #0E0038 0%, #1E0850 100%);
  padding: 18px 20px 14px;
  color: #fff;
  flex-shrink: 0;
}
.mc-header-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.mc-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mc-avatar img { width: 26px; height: 26px; object-fit: contain; }
.mc-header h3 { font-family: 'Inter', system-ui, sans-serif; font-size: 15px; font-weight: 700; line-height: 1.25; letter-spacing: .01em; }
.mc-header p { font-size: 11.5px; opacity: 0.75; font-weight: 400; margin-top: 1px; }
.mc-badge {
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 20px;
  padding: 3px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: 5px;
  color: #E8C97A;
  width: fit-content;
}
.mc-badge::before { content: '🔒'; font-size: 10px; }

#mc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
#mc-messages::-webkit-scrollbar { width: 4px; }
#mc-messages::-webkit-scrollbar-track { background: transparent; }
#mc-messages::-webkit-scrollbar-thumb { background: #D8C9A3; border-radius: 4px; }

.mc-msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 14px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  color: #1A1030;
  animation: mc-fadeUp 0.3s ease;
}
@keyframes mc-fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.mc-msg.bot {
  background: #fff;
  border: 1px solid rgba(14,0,56,0.06);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(14,0,56,0.05);
  align-self: flex-start;
}
.mc-msg.user {
  background: linear-gradient(135deg, #0E0038, #2A0A5E);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.mc-msg a { color: #A07830; text-decoration: underline; }
.mc-msg.user a { color: #E8C97A; }

.mc-replies { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 4px 4px; animation: mc-fadeUp 0.3s ease 0.1s both; }
.mc-qr {
  background: #fff;
  border: 1.5px solid #C9A84C;
  color: #0E0038;
  border-radius: 20px;
  padding: 6px 13px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.mc-qr:hover { background: #0E0038; color: #E8C97A; border-color: #0E0038; transform: translateY(-1px); }

.mc-typing {
  display: flex; align-items: center; gap: 5px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid rgba(14,0,56,0.06);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  box-shadow: 0 2px 8px rgba(14,0,56,0.05);
  align-self: flex-start;
}
.mc-typing span { width: 7px; height: 7px; background: #C9A84C; border-radius: 50%; animation: mc-bounce 1.2s infinite; }
.mc-typing span:nth-child(2) { animation-delay: 0.2s; }
.mc-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes mc-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

.mc-input-area {
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(14,0,56,0.08);
  background: #fff;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
#mc-input {
  flex: 1;
  border: 1.5px solid rgba(201,168,76,0.35);
  border-radius: 22px;
  padding: 9px 15px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  outline: none;
  background: #F8F5EF;
  color: #1A1030;
  transition: border-color 0.2s;
}
#mc-input:focus { border-color: #C9A84C; }
#mc-input::placeholder { color: #B0A8C8; }
#mc-send {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #0E0038, #2A0A5E);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
#mc-send:hover { transform: scale(1.08); }
#mc-send svg { width: 16px; height: 16px; stroke: #C9A84C; fill: none; stroke-width: 2; }

@media (max-width: 420px) {
  #mc-window { width: calc(100vw - 16px); right: 8px; bottom: 92px; max-height: 70vh; }
  #mc-toggle  { right: 16px; bottom: 16px; }
}
