/* AI Chat & Lead Capture - front-end widget styles | Chatter Creative */

.aiclb {
	--aiclb-accent: #0b4d8f;
	--aiclb-radius: 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
}

/* ------------------------------------------------------------- launcher */

.aiclb__launcher {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 999998;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 18px;
	border: 0;
	border-radius: 999px;
	background: var(--aiclb-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
	transition: transform .15s ease, box-shadow .15s ease;
}

.aiclb__launcher:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0, 0, 0, .28); }
.aiclb__launcher.is-active .aiclb__launcher-txt { display: none; }

/* ---------------------------------------------------------------- panel */

.aiclb__panel {
	position: fixed;
	right: 20px;
	bottom: 84px;
	z-index: 999999;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 580px;
	max-height: calc(100vh - 120px);
	display: none;
	flex-direction: column;
	overflow: hidden;
	background: #fff;
	border-radius: var(--aiclb-radius);
	box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}

.aiclb__panel.is-open { display: flex; animation: aiclbin .18s ease-out; }

@keyframes aiclbin {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: none; }
}

.aiclb--inline .aiclb__panel {
	position: relative;
	right: auto;
	bottom: auto;
	width: 100%;
	max-width: 520px;
	height: 620px;
	max-height: none;
	margin: 0 auto;
	border: 1px solid #e3e7ee;
	box-shadow: 0 6px 24px rgba(0, 0, 0, .08);
}

/* ----------------------------------------------------------------- head */

.aiclb__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	background: var(--aiclb-accent);
	color: #fff;
	flex: 0 0 auto;
}

.aiclb__avatar {
	width: 36px;
	height: 36px;
	flex: 0 0 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, .18);
	font-weight: 700;
	font-size: 13px;
	letter-spacing: .5px;
}

.aiclb__headtxt { display: flex; flex-direction: column; line-height: 1.25; flex: 1 1 auto; }
.aiclb__headtxt strong { font-size: 15px; }
.aiclb__status { font-size: 12px; opacity: .85; }

.aiclb__close {
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	opacity: .85;
}
.aiclb__close:hover { opacity: 1; }

/* ----------------------------------------------------------------- body */

.aiclb__body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
	background: #f6f8fb;
}

/* ------------------------------------------------------------ lead form */

.aiclb__intro { padding: 18px 16px 22px; overflow-y: auto; }
.aiclb__intro h3 { margin: 0 0 6px; font-size: 17px; color: #16233a; }
.aiclb__intro > p { margin: 0 0 14px; font-size: 13.5px; color: #5a6577; }

.aiclb__form { display: flex; flex-direction: column; gap: 10px; }

.aiclb__field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-width: 0; }
.aiclb__field > span { font-size: 12px; font-weight: 600; color: #46536a; }

.aiclb__field input,
.aiclb__field select {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #d6dde7;
	border-radius: 10px;
	background: #fff;
	font-size: 14px;
	color: #16233a;
	font-family: inherit;
}

.aiclb__field input:focus,
.aiclb__field select:focus {
	outline: none;
	border-color: var(--aiclb-accent);
	box-shadow: 0 0 0 3px rgba(11, 77, 143, .12);
}

.aiclb__row { display: flex; gap: 10px; }

.aiclb__consent {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	font-size: 12px;
	color: #5a6577;
	margin-top: 2px;
}
.aiclb__consent input { margin-top: 2px; }

.aiclb__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; }

.aiclb__err { color: #b3261e; font-size: 13px; min-height: 0; }
.aiclb__err:empty { display: none; }

.aiclb__btn {
	margin-top: 4px;
	padding: 12px 16px;
	border: 0;
	border-radius: 10px;
	background: var(--aiclb-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
}
.aiclb__btn:disabled { opacity: .6; cursor: default; }

.aiclb__fine { margin: 2px 0 0; font-size: 11px; color: #8a94a6; text-align: center; }

/* ----------------------------------------------------------------- chat */

.aiclb__banner {
	flex: 0 0 auto;
	padding: 8px 14px;
	background: #e7f4ea;
	color: #1c6b32;
	font-size: 12.5px;
	font-weight: 600;
	border-bottom: 1px solid #d3e8d9;
}

.aiclb__log {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 0;
}

.aiclb__msg { display: flex; }
.aiclb__msg--user { justify-content: flex-end; }

.aiclb__bubble {
	max-width: 84%;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 14px;
	white-space: normal;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	background: #fff;
	color: #1d2839;
	border: 1px solid #e6ebf2;
	border-bottom-left-radius: 4px;
}

.aiclb__msg--user .aiclb__bubble {
	background: var(--aiclb-accent);
	color: #fff;
	border-color: transparent;
	border-bottom-left-radius: 14px;
	border-bottom-right-radius: 4px;
}

.aiclb__typing { display: flex; gap: 4px; align-items: center; padding: 13px; }
.aiclb__typing span {
	width: 6px; height: 6px; border-radius: 50%;
	background: #9aa6b8;
	animation: aiclbblink 1.2s infinite ease-in-out;
}
.aiclb__typing span:nth-child(2) { animation-delay: .18s; }
.aiclb__typing span:nth-child(3) { animation-delay: .36s; }

@keyframes aiclbblink {
	0%, 80%, 100% { opacity: .25; transform: translateY(0); }
	40% { opacity: 1; transform: translateY(-3px); }
}

/* ------------------------------------------------------------ input bar */

.aiclb__bar {
	flex: 0 0 auto;
	display: flex;
	gap: 8px;
	align-items: flex-end;
	padding: 10px;
	background: #fff;
	border-top: 1px solid #e6ebf2;
}

.aiclb__input {
	flex: 1 1 auto;
	resize: none;
	max-height: 96px;
	padding: 10px 12px;
	border: 1px solid #d6dde7;
	border-radius: 12px;
	font-size: 14px;
	font-family: inherit;
	line-height: 1.4;
	color: #16233a;
}
.aiclb__input:focus { outline: none; border-color: var(--aiclb-accent); }

.aiclb__send {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: var(--aiclb-accent);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.aiclb__turnstile { margin: 4px 0; }
.aiclb__tzhint { margin: -4px 0 0; font-size: 12px; color: #5a6577; }
.aiclb__tzhint:empty { display: none; }
.aiclb__banner-local { font-weight: 400; opacity: .85; }
.aiclb__bar.is-locked { opacity: .55; }
.aiclb__bar.is-locked .aiclb__input,
.aiclb__bar.is-locked .aiclb__send { cursor: not-allowed; }

/* ------------------------------------------------------------ a11y */

.aiclb__launcher:focus-visible,
.aiclb__close:focus-visible,
.aiclb__send:focus-visible,
.aiclb__btn:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 2px;
}

.aiclb__panel :focus-visible {
	outline: 2px solid var(--aiclb-accent);
	outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
	.aiclb__panel.is-open { animation: none; }
	.aiclb__launcher { transition: none; }
	.aiclb__launcher:hover { transform: none; }
	.aiclb__typing span { animation: none; opacity: .6; }
}

/* --------------------------------------------------------------- mobile */

@media (max-width: 480px) {
	.aiclb__panel {
		right: 0;
		bottom: 0;
		width: 100vw;
		max-width: 100vw;
		height: 100dvh;
		max-height: 100dvh;
		border-radius: 0;
	}
	.aiclb__launcher { right: 14px; bottom: 14px; }
	.aiclb__row { flex-direction: column; }
}
