/* ============================================================
   ald-chat.css — ALD ALADIN TOKEN Chat-Widget Styling
   Version: 1.0 — 29.05.2026
   Marken-Farben: Blau #001E5C, #003BB3 / Gelb #FDD200
   ============================================================ */

:root {
  --ald-blue:       #003BB3;
  --ald-blue-deep:  #002E8A;
  --ald-blue-ink:   #001E5C;
  --ald-yellow:     #FDD200;
  --ald-bg-panel:   #FFFFFF;
  --ald-bg-soft:    #F6F4EC;
  --ald-border:     rgba(0,59,179,.18);
  --ald-text:       #001E5C;
  --ald-muted:      #4B5B8A;
}

/* ---------- Launcher (rechts unten) ---------- */
.ald-chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 18px;
  background: var(--ald-blue-ink);
  color: #fff;
  border: 2px solid var(--ald-yellow);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  box-shadow: 0 12px 28px -10px rgba(0,30,92,.55);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ald-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -10px rgba(0,30,92,.65);
}
.ald-chat-launcher img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
  padding: 4px;
  flex: none;
}
.ald-chat-bubble {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 520px) {
  .ald-chat-launcher { padding: 6px; }
  .ald-chat-bubble { display: none; }
}
.ald-chat-launcher.is-hidden { display: none; }

/* ---------- Panel ---------- */
.ald-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  width: min(380px, calc(100vw - 40px));
  height: min(560px, calc(100vh - 40px));
  background: var(--ald-bg-panel);
  border: 1px solid var(--ald-border);
  border-radius: 18px;
  box-shadow: 0 30px 60px -20px rgba(0,30,92,.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font: 14px/1.55 -apple-system, "Inter", system-ui, sans-serif;
  color: var(--ald-text);
}
.ald-chat-panel[hidden] { display: none; }

/* Header */
.ald-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--ald-blue-deep), var(--ald-blue-ink));
  color: #fff;
  flex: none;
}
.ald-chat-headlogo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
  padding: 3px;
  flex: none;
}
.ald-chat-title {
  flex: 1;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ald-chat-badge {
  font-size: 11px;
  font-weight: 500;
  background: var(--ald-yellow);
  color: var(--ald-blue-ink);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: .03em;
}
.ald-chat-x {
  background: rgba(255,255,255,.18);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background .15s;
}
.ald-chat-x:hover { background: rgba(255,255,255,.3); }

/* Log */
.ald-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: var(--ald-bg-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
}
.ald-chat-log::-webkit-scrollbar { width: 6px; }
.ald-chat-log::-webkit-scrollbar-thumb { background: var(--ald-border); border-radius: 3px; }

.ald-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  word-wrap: break-word;
  white-space: pre-wrap;
  font-size: 13.5px;
  line-height: 1.5;
}
.ald-chat-bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--ald-border);
  border-bottom-left-radius: 4px;
  color: var(--ald-text);
}
.ald-chat-user {
  align-self: flex-end;
  background: var(--ald-blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ald-chat-msg.is-thinking {
  color: var(--ald-muted);
  font-style: italic;
}

/* Consent-Block */
.ald-chat-consent {
  padding: 14px;
  border-top: 1px solid var(--ald-border);
  background: #FFFCE6;
  flex: none;
}
.ald-chat-consent[hidden] { display: none; }
.ald-chat-consent p {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--ald-blue-ink);
  line-height: 1.45;
}
.ald-chat-consent-btn {
  display: inline-block;
  background: var(--ald-yellow);
  color: var(--ald-blue-ink);
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.ald-chat-consent-btn:hover {
  background: #FFE34D;
  transform: translateY(-1px);
}

/* Form */
.ald-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--ald-border);
  background: #fff;
  flex: none;
}
.ald-chat-form[hidden] { display: none; }
.ald-chat-input {
  flex: 1;
  border: 1.5px solid var(--ald-border);
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ald-text);
  background: var(--ald-bg-soft);
  transition: border-color .15s, background .15s;
}
.ald-chat-input:focus {
  outline: none;
  border-color: var(--ald-blue);
  background: #fff;
}
.ald-chat-send {
  background: var(--ald-blue-ink);
  color: var(--ald-yellow);
  border: none;
  border-radius: 10px;
  padding: 0 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s, transform .1s;
}
.ald-chat-send:hover {
  background: var(--ald-blue);
  transform: translateY(-1px);
}
.ald-chat-send svg { stroke: var(--ald-yellow); fill: none; }

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .ald-chat-launcher, .ald-chat-consent-btn, .ald-chat-send {
    transition: none;
  }
}
