/* Website-Assistent (chatbot.js) – nutzt die Tokens aus redesign-v4.css */

.chatbot-launcher { position: fixed; right: 20px; bottom: 20px; z-index: 110; display: inline-flex; align-items: center; gap: 10px; border: 0; padding: 14px 20px 14px 16px; background: var(--blue); color: var(--white); cursor: pointer; font: inherit; font-size: 14px; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; box-shadow: 0 14px 34px rgba(10,16,32,.22); transition: background .25s ease, transform .18s ease; }
.chatbot-launcher:hover { background: var(--ink); }
.chatbot-launcher:active { transform: translateY(1px); }
.chatbot-launcher:focus-visible, .chatbot-panel button:focus-visible, .chatbot-panel textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.chatbot-open .chatbot-launcher { background: var(--ink); }

.chatbot-panel { position: fixed; right: 20px; bottom: 84px; z-index: 110; display: flex; width: min(400px, calc(100vw - 32px)); height: min(600px, calc(100dvh - 120px)); flex-direction: column; overflow: hidden; border: 1px solid var(--line); background: var(--white); color: var(--ink); box-shadow: 0 24px 60px rgba(10,16,32,.24); }
.chatbot-panel[hidden] { display: none; }

.chatbot-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 16px; background: var(--blue); color: var(--white); }
.chatbot-eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.chatbot-eyebrow span { padding-left: 10px; border-left: 1px solid rgba(255,255,255,.4); opacity: .8; }
.chatbot-logo { display: block; width: auto; height: 22px; filter: brightness(0) invert(1); }
.chatbot-title { margin: 0; font-size: 20px; font-weight: 700; }
.chatbot-close { border: 0; padding: 0 4px; background: none; color: inherit; cursor: pointer; font-size: 28px; line-height: 1; }

.chatbot-body { display: flex; min-height: 0; flex: 1; flex-direction: column; }

.chatbot-consent { display: flex; flex: 1; flex-direction: column; justify-content: center; gap: 16px; padding: 24px; }
.chatbot-consent__lead { margin: 0; font-size: 17px; font-weight: 650; line-height: 1.4; }
.chatbot-consent__note { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.chatbot-consent__note a { color: var(--blue); }
.chatbot-start { width: 100%; }

.chatbot-log { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 10px; overflow-y: auto; padding: 18px 16px; background: var(--soft); overscroll-behavior: contain; }
.chatbot-msg { max-width: 88%; padding: 11px 14px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.chatbot-msg--assistant { align-self: flex-start; border: 1px solid var(--line); background: var(--white); }
.chatbot-msg--user { align-self: flex-end; background: var(--blue); color: var(--white); }
.chatbot-msg--error { border-color: #f0c2c2; background: #fff5f5; }
.chatbot-msg a { color: var(--blue); font-weight: 600; }

.chatbot-typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.chatbot-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: chatbot-dot 1.2s ease-in-out infinite; }
.chatbot-typing i:nth-child(2) { animation-delay: .15s; }
.chatbot-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes chatbot-dot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.chatbot-suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.chatbot-suggestions button { border: 1px solid var(--blue); padding: 8px 12px; background: var(--white); color: var(--blue); cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; text-align: left; }
.chatbot-suggestions button:hover { background: var(--blue); color: var(--white); }

/* Terminübergabe: vorbereitete Anfrage, die die Person selbst prüft und absendet */
.chatbot-handoff { align-self: stretch; display: grid; gap: 6px; padding: 14px 16px; border-left: 3px solid var(--blue); background: var(--white); box-shadow: 0 10px 24px rgba(10,16,32,.08); animation: chatbot-handoff-in .45s cubic-bezier(.2,.8,.2,1); }
.chatbot-handoff__kicker { color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.chatbot-handoff strong { font-size: 15px; }
.chatbot-handoff p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.chatbot-handoff__button { margin-top: 6px; padding: 11px 14px; border: 0; background: var(--blue); color: var(--white); cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; text-align: left; }
.chatbot-handoff__button:hover { background: var(--ink); }
.chatbot-handoff__button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.chatbot-handoff small { color: var(--muted); font-size: 11px; }
@keyframes chatbot-handoff-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .chatbot-handoff { animation: none; } }

.chatbot-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px 12px 6px; border-top: 1px solid var(--line); }
.chatbot-form textarea { min-height: 44px; max-height: 120px; flex: 1; resize: none; border: 1px solid var(--line); padding: 11px 12px; color: var(--ink); font: inherit; font-size: 15px; line-height: 1.4; }
.chatbot-send { display: grid; width: 44px; height: 44px; flex: none; place-items: center; border: 0; background: var(--blue); color: var(--white); cursor: pointer; }
.chatbot-send:disabled, .chatbot-form textarea:disabled { opacity: .55; cursor: default; }
.chatbot-hint { margin: 0; padding: 0 14px 12px; color: var(--muted); font-size: 11px; line-height: 1.4; }

@media (max-width: 560px) {
  .chatbot-launcher { right: 16px; bottom: 16px; padding: 13px 16px 13px 14px; }
  .chatbot-launcher span { display: none; }
  .chatbot-panel { inset: auto 0 0; width: 100%; height: min(86dvh, 640px); border-width: 1px 0 0; }
  .chatbot-open .chatbot-launcher { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .chatbot-typing i { animation: none; }
}
