/* Versicherungs-Chatbot – Frontend */
.vcb-root {
	--vcb-primary: #0b5394;
	--vcb-bg: #ffffff;
	--vcb-bot-bg: #f1f4f8;
	--vcb-text: #1d2733;
	--vcb-muted: #5d6b7a;
	--vcb-border: #dde3ea;
	--vcb-radius: 16px;
	--vcb-shadow: 0 12px 40px rgba(16, 32, 56, .22);
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--vcb-text);
}
.vcb-root.vcb-left { right: auto; left: 20px; }
.vcb-root *, .vcb-root *::before, .vcb-root *::after { box-sizing: border-box; }

/* Launcher */
.vcb-launcher {
	width: 60px; height: 60px; border-radius: 50%;
	border: 0; cursor: pointer; padding: 0;
	background: var(--vcb-primary); color: #fff;
	box-shadow: var(--vcb-shadow);
	display: flex; align-items: center; justify-content: center;
	transition: transform .2s ease;
}
.vcb-launcher:hover { transform: scale(1.06); }
.vcb-launcher:focus-visible { outline: 3px solid #fff; box-shadow: 0 0 0 6px var(--vcb-primary); }
.vcb-launcher svg { width: 28px; height: 28px; fill: currentColor; }

.vcb-teaser {
	position: absolute; bottom: 72px; right: 0;
	background: #fff; color: var(--vcb-text);
	padding: 10px 34px 10px 14px; border-radius: 12px;
	box-shadow: var(--vcb-shadow); width: max-content; max-width: 240px;
	font-size: 14px; cursor: pointer;
	animation: vcb-pop .3s ease;
}
.vcb-left .vcb-teaser { right: auto; left: 0; }
.vcb-teaser-close {
	position: absolute; top: 4px; right: 6px; border: 0; background: none;
	font-size: 18px; line-height: 1; cursor: pointer; color: var(--vcb-muted); padding: 4px;
}

/* Panel */
.vcb-panel {
	position: absolute; bottom: 76px; right: 0;
	width: 380px; max-width: calc(100vw - 40px);
	height: 620px; max-height: calc(100vh - 120px);
	background: var(--vcb-bg); border-radius: var(--vcb-radius);
	box-shadow: var(--vcb-shadow);
	display: flex; flex-direction: column; overflow: hidden;
	animation: vcb-pop .2s ease;
}
.vcb-left .vcb-panel { right: auto; left: 0; }
.vcb-panel[hidden] { display: none; }

.vcb-header {
	background: var(--vcb-primary); color: #fff;
	padding: 14px 16px; display: flex; align-items: center; gap: 10px;
}
.vcb-avatar {
	width: 36px; height: 36px; border-radius: 50%;
	background: rgba(255, 255, 255, .2);
	display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none;
}
.vcb-header-text { flex: 1; min-width: 0; }
.vcb-title { font-weight: 600; font-size: 15px; margin: 0; color: #fff; }
.vcb-subtitle { font-size: 12px; opacity: .85; }
.vcb-icon-btn {
	background: transparent; border: 0; color: #fff; cursor: pointer;
	width: 32px; height: 32px; border-radius: 8px; font-size: 18px; line-height: 1;
	display: flex; align-items: center; justify-content: center;
}
.vcb-icon-btn:hover, .vcb-icon-btn:focus-visible { background: rgba(255, 255, 255, .18); outline: none; }

.vcb-messages {
	flex: 1; overflow-y: auto; padding: 16px 14px;
	display: flex; flex-direction: column; gap: 10px;
	scroll-behavior: smooth; background: #fafbfc;
}

.vcb-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; word-wrap: break-word; animation: vcb-in .2s ease; }
.vcb-msg p { margin: 0 0 8px; }
.vcb-msg p:last-child { margin-bottom: 0; }
.vcb-msg ul { margin: 4px 0 8px 18px; padding: 0; }
.vcb-msg li { margin: 2px 0; }
.vcb-msg a { color: var(--vcb-primary); text-decoration: underline; }
.vcb-bot { align-self: flex-start; background: var(--vcb-bot-bg); border-bottom-left-radius: 4px; }
.vcb-user { align-self: flex-end; background: var(--vcb-primary); color: #fff; border-bottom-right-radius: 4px; }

.vcb-chips { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 100%; }
.vcb-chip {
	border: 1px solid var(--vcb-primary); background: #fff; color: var(--vcb-primary);
	border-radius: 18px; padding: 7px 12px; font-size: 13.5px; cursor: pointer;
	text-align: left; line-height: 1.3; font-family: inherit;
	transition: background .15s, color .15s;
}
.vcb-chip:hover, .vcb-chip:focus-visible { background: var(--vcb-primary); color: #fff; outline: none; }
.vcb-chip.vcb-action { background: var(--vcb-primary); color: #fff; }
.vcb-chip.vcb-action:hover, .vcb-chip.vcb-action:focus-visible { filter: brightness(1.12); }
.vcb-chip.vcb-nav { border-color: var(--vcb-border); color: var(--vcb-muted); }
.vcb-chip.vcb-nav:hover, .vcb-chip.vcb-nav:focus-visible { background: var(--vcb-bot-bg); color: var(--vcb-text); }

.vcb-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.vcb-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--vcb-muted); animation: vcb-blink 1.2s infinite; }
.vcb-typing span:nth-child(2) { animation-delay: .2s; }
.vcb-typing span:nth-child(3) { animation-delay: .4s; }

/* Kontaktkarte */
.vcb-card { display: grid; gap: 4px; margin-top: 4px; }
.vcb-card div { display: flex; gap: 8px; }

/* Formular */
.vcb-form { width: 100%; max-width: 100%; display: grid; gap: 8px; }
.vcb-form-title { font-weight: 600; }
.vcb-form label { font-size: 13px; color: var(--vcb-muted); display: grid; gap: 3px; }
.vcb-form input[type=text], .vcb-form input[type=email], .vcb-form input[type=tel], .vcb-form textarea {
	width: 100%; border: 1px solid var(--vcb-border); border-radius: 8px;
	padding: 8px 10px; font: inherit; font-size: 14px; color: var(--vcb-text); background: #fff;
}
.vcb-form textarea { min-height: 72px; resize: vertical; }
.vcb-form input:focus, .vcb-form textarea:focus { outline: 2px solid var(--vcb-primary); outline-offset: 0; border-color: transparent; }
.vcb-form .vcb-check { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--vcb-text); }
.vcb-form .vcb-check input { margin-top: 3px; flex: none; }
.vcb-form .vcb-hint { font-size: 12px; color: var(--vcb-muted); background: #fff6e0; border-radius: 8px; padding: 7px 9px; }
.vcb-form .vcb-error { font-size: 13px; color: #b42318; }
.vcb-form .vcb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.vcb-btn {
	background: var(--vcb-primary); color: #fff; border: 0; border-radius: 8px;
	padding: 10px 14px; font: inherit; font-weight: 600; cursor: pointer;
}
.vcb-btn[disabled] { opacity: .6; cursor: wait; }
.vcb-form-wrap { width: 100%; max-width: 100%; }

/* Eingabe */
.vcb-input-bar { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--vcb-border); background: #fff; }
.vcb-input {
	flex: 1; border: 1px solid var(--vcb-border); border-radius: 22px; padding: 10px 14px;
	font: inherit; font-size: 14.5px; color: var(--vcb-text); background: #fff; min-width: 0;
}
.vcb-input:focus { outline: 2px solid var(--vcb-primary); border-color: transparent; }
.vcb-send {
	width: 42px; height: 42px; border-radius: 50%; border: 0; flex: none;
	background: var(--vcb-primary); color: #fff; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
}
.vcb-send svg { width: 18px; height: 18px; fill: currentColor; }
.vcb-footer-note { font-size: 11px; color: var(--vcb-muted); text-align: center; padding: 0 10px 8px; background: #fff; }

/* Shortcode-Button */
.vcb-open-inline {
	background: var(--vcb-primary, #0b5394); color: #fff; border: 0; border-radius: 8px;
	padding: 12px 20px; font-weight: 600; cursor: pointer; font-size: 16px;
}

.vcb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@keyframes vcb-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes vcb-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes vcb-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

@media (max-width: 480px) {
	.vcb-root { bottom: 14px; right: 14px; }
	.vcb-root.vcb-left { left: 14px; }
	.vcb-root.vcb-open .vcb-panel {
		position: fixed; inset: 0; width: 100%; max-width: 100%;
		height: 100%; max-height: 100%; border-radius: 0;
		padding-bottom: env(safe-area-inset-bottom, 0);
	}
	.vcb-root.vcb-open .vcb-launcher { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.vcb-root * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
