/* AFB chat widget — self-contained styles matching the site design */

#afb-chat-root {
	--afb-c-blue: #1554d6;
	--afb-c-blue-dark: #0e3ea8;
	--afb-c-navy: #0b2559;
	--afb-c-ink: #101828;
	--afb-c-gray: #475467;
	--afb-c-light: #eef4ff;
	--afb-c-border: #dbe8ff;
	--afb-c-yellow: #ffc93c;
	font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Floating button */
.afb-chat-fab {
	position: fixed; right: 18px; bottom: 18px; z-index: 100;
	width: 58px; height: 58px; border-radius: 100px;
	background: var(--afb-c-blue); border: none; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 8px 24px rgba(21, 84, 214, 0.4);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.afb-chat-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(21, 84, 214, 0.5); }
.afb-chat-fab:active { transform: scale(0.95); }
.afb-chat-fab__badge {
	position: absolute; top: -2px; right: -2px; width: 14px; height: 14px;
	border-radius: 100px; background: var(--afb-c-yellow); border: 2px solid #fff;
}

/* Panel */
.afb-chat-panel {
	position: fixed; right: 18px; bottom: 88px; z-index: 100;
	width: 372px; max-width: calc(100vw - 24px);
	height: 560px; max-height: calc(100vh - 110px);
	background: #fff; border-radius: 14px; overflow: hidden;
	display: none; flex-direction: column;
	box-shadow: 0 24px 64px rgba(6, 20, 52, 0.35);
	border: 1px solid var(--afb-c-border);
}
.afb-chat-panel.is-open { display: flex; }

/* Header */
.afb-chat-header {
	background: linear-gradient(135deg, #0b2559 0%, #1554d6 100%);
	padding: 16px 18px; display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.afb-chat-header__avatar {
	width: 38px; height: 38px; border-radius: 10px; background: rgba(255, 255, 255, 0.15);
	display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.afb-chat-header__meta { flex: 1; min-width: 0; }
.afb-chat-header__title {
	color: #fff; font-weight: 700; font-size: 15px;
	font-family: 'Poppins', 'Work Sans', sans-serif;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.afb-chat-header__sub { color: #c9d9f7; font-size: 12px; display: flex; align-items: center; gap: 5px; }
.afb-chat-header__dot { width: 7px; height: 7px; border-radius: 100px; background: #4ade80; display: inline-block; }
.afb-chat-header__close {
	background: rgba(255, 255, 255, 0.12); border: none; color: #fff; cursor: pointer;
	width: 30px; height: 30px; border-radius: 100px; font-size: 13px;
	display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.afb-chat-header__close:hover { background: rgba(255, 255, 255, 0.22); }

/* Messages */
.afb-chat-body {
	flex: 1; overflow-y: auto; padding: 16px 14px;
	background: #f4f7fc; display: flex; flex-direction: column; gap: 10px;
}
.afb-chat-msg { max-width: 84%; padding: 10px 13px; border-radius: 12px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.afb-chat-msg--bot { align-self: flex-start; background: #fff; color: var(--afb-c-ink); border: 1px solid var(--afb-c-border); border-bottom-left-radius: 4px; }
.afb-chat-msg--user { align-self: flex-end; background: var(--afb-c-blue); color: #fff; border-bottom-right-radius: 4px; }

/* Typing indicator */
.afb-chat-typing { align-self: flex-start; background: #fff; border: 1px solid var(--afb-c-border); border-radius: 12px; border-bottom-left-radius: 4px; padding: 12px 15px; display: flex; gap: 4px; }
.afb-chat-typing span {
	width: 7px; height: 7px; border-radius: 100px; background: #98a2b3;
	animation: afbTyping 1.2s infinite ease-in-out;
}
.afb-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.afb-chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes afbTyping {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
	30% { transform: translateY(-4px); opacity: 1; }
}

/* Quick reply chips */
.afb-chat-chips { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; max-width: 100%; }
.afb-chat-chip {
	background: #fff; border: 1.5px solid var(--afb-c-blue); color: var(--afb-c-blue);
	font-weight: 600; font-size: 13px; padding: 8px 14px; border-radius: 100px;
	cursor: pointer; font-family: inherit; transition: background 0.15s ease, color 0.15s ease;
}
.afb-chat-chip:hover { background: var(--afb-c-blue); color: #fff; }

/* Input row */
.afb-chat-input-row {
	display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--afb-c-border);
	background: #fff; flex-shrink: 0;
}
.afb-chat-input {
	flex: 1; border: 1px solid #d0d9e8; border-radius: 8px; padding: 11px 12px;
	font-family: inherit; font-size: 14px; resize: none; max-height: 90px; line-height: 1.4;
}
.afb-chat-input:focus { outline: 2px solid rgba(21, 84, 214, 0.25); border-color: var(--afb-c-blue); }
.afb-chat-send {
	background: var(--afb-c-blue); color: #fff; border: none; border-radius: 8px;
	width: 44px; cursor: pointer; display: flex; align-items: center; justify-content: center;
	flex-shrink: 0; transition: background 0.15s ease;
}
.afb-chat-send:hover { background: var(--afb-c-blue-dark); }
.afb-chat-send[disabled] { opacity: 0.5; cursor: default; }

.afb-chat-privacy {
	text-align: center; color: #98a2b3; font-size: 10.5px; padding: 0 12px 10px; background: #fff;
}

/* Mobile: clear the theme's sticky quote bar and go near full-width */
@media (max-width: 860px) {
	.afb-chat-fab { bottom: 78px; right: 14px; }
	.afb-chat-panel {
		right: 8px; left: 8px; width: auto; bottom: 144px;
		height: 480px; max-height: calc(100vh - 160px);
	}
}
