/* Avi Support Assistant – chat widget styles. */

.avca-root {
	--avca-color: #0b63ce;
	--avca-bg: #fff;
	--avca-text: #1f2937;
	--avca-muted: #6b7280;
	--avca-bot-bg: #f2f3f5;
	--avca-border: #e5e7eb;
	--avca-chip-border: #c9ced6;
	--avca-chip-text: #374151;
	--avca-field-bg: #fff;
	font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--avca-text);
	text-align: left;
}

.avca-root.avca-theme-dark {
	--avca-bg: #111827;
	--avca-text: #f3f4f6;
	--avca-muted: #9ca3af;
	--avca-bot-bg: #1f2937;
	--avca-border: #374151;
	--avca-chip-border: #4b5563;
	--avca-chip-text: #e5e7eb;
	--avca-field-bg: #1f2937;
}

.avca-root *,
.avca-root *::before,
.avca-root *::after {
	box-sizing: border-box;
}

.avca-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.avca-root button:focus-visible,
.avca-root a:focus-visible,
.avca-root input:focus-visible,
.avca-root textarea:focus-visible {
	outline: 3px solid var(--avca-color);
	outline-offset: 2px;
}

/* Floating container ------------------------------------------------------ */

.avca-root--floating {
	position: fixed;
	bottom: 20px;
	z-index: 99999;
}

.avca-pos-left {
	left: 20px;
}

.avca-pos-right {
	right: 20px;
}

/* Launcher ---------------------------------------------------------------- */

.avca-button {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	box-shadow: none;
	font: inherit;
	line-height: 1;
}

.avca-button:hover,
.avca-button:focus {
	background: transparent;
}

.avca-pos-right .avca-button {
	margin-left: auto;
}

.avca-launch-open {
	display: flex;
	align-items: center;
}

.avca-root.is-open .avca-launch-open {
	display: none;
}

.avca-launch-bot {
	display: block;
	width: 84px;
	height: 84px;
	filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.25));
	animation: avca-float 3s ease-in-out infinite;
	transition: transform 0.2s ease;
}

.avca-launch-bot img,
.avca-launch-bot svg {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.avca-button:hover .avca-launch-bot {
	transform: scale(1.06);
}

@keyframes avca-float {
	0%,
	100% {
		translate: 0 0;
	}

	50% {
		translate: 0 -6px;
	}
}

.avca-launch-bubble {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--avca-color);
	color: #fff;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
	transition: transform 0.2s ease;
}

.avca-launch-bubble svg {
	width: 30px;
	height: 30px;
}

.avca-button:hover .avca-launch-bubble {
	transform: scale(1.06);
}

.avca-launcher-pill .avca-launch-open {
	gap: 8px;
	padding: 6px 20px 6px 6px;
	border-radius: 32px;
	background: var(--avca-color);
	color: #fff;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.avca-launcher-pill .avca-launch-bubble {
	width: 44px;
	height: 44px;
	background: rgba(255, 255, 255, 0.18);
	box-shadow: none;
}

.avca-launcher-pill .avca-launch-bubble svg {
	width: 24px;
	height: 24px;
}

.avca-launch-text {
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
}

.avca-launch-close {
	display: none;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--avca-color);
	color: #fff;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.avca-launch-close svg {
	width: 24px;
	height: 24px;
	stroke: currentColor;
	stroke-width: 2.6;
	stroke-linecap: round;
	fill: none;
}

.avca-root.is-open .avca-launch-close {
	display: flex;
}

.avca-tooltip {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	padding: 8px 14px;
	white-space: nowrap;
	background: #fff;
	color: #1f2937;
	font-size: 14px;
	font-weight: 600;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease;
	pointer-events: none;
}

.avca-pos-left .avca-tooltip {
	left: calc(100% + 10px);
	border-radius: 18px 18px 18px 4px;
}

.avca-pos-right .avca-tooltip {
	right: calc(100% + 10px);
	border-radius: 18px 18px 4px 18px;
}

.avca-root:not(.is-open) .avca-button:hover .avca-tooltip,
.avca-root:not(.is-open) .avca-button:focus .avca-tooltip {
	opacity: 1;
	visibility: visible;
}

/* Panel ------------------------------------------------------------------- */

.avca-panel {
	display: flex;
	flex-direction: column;
	background: var(--avca-bg);
	color: var(--avca-text);
	border-radius: 18px;
	overflow: hidden;
}

.avca-panel[hidden] {
	display: none;
}

.avca-root--floating .avca-panel {
	position: absolute;
	bottom: calc(100% + 14px);
	width: 390px;
	max-width: calc(100vw - 40px);
	height: 600px;
	max-height: calc(100vh - 140px);
	box-shadow: 0 12px 44px rgba(0, 0, 0, 0.28);
	animation: avca-in 0.2s ease-out;
}

.avca-pos-left .avca-panel {
	left: 0;
}

.avca-pos-right .avca-panel {
	right: 0;
}

.avca-root--inline {
	position: relative;
	margin: 1.5em 0;
}

.avca-root--inline .avca-panel {
	width: 100%;
	max-width: 640px;
	height: 520px;
	border: 1px solid var(--avca-border);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

@keyframes avca-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

.avca-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background: var(--avca-color);
	color: #fff;
}

.avca-back {
	display: flex;
	flex: 0 0 32px;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
}

.avca-back:hover,
.avca-back:focus {
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
}

.avca-back svg {
	width: 20px;
	height: 20px;
	stroke: currentColor;
	stroke-width: 2.6;
	stroke-linecap: round;
	stroke-linejoin: round;
	fill: none;
}

.avca-avatar {
	display: flex;
	flex: 0 0 48px;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 4px;
	border: 2px solid rgba(255, 255, 255, 0.85);
	border-radius: 50%;
	background: #fff;
	overflow: hidden;
}

.avca-avatar img,
.avca-avatar svg {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.avca-title {
	flex: 1;
	min-width: 0;
}

.avca-title strong {
	display: block;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.25;
}

.avca-title span {
	display: block;
	overflow: hidden;
	font-size: 13px;
	white-space: nowrap;
	text-overflow: ellipsis;
	opacity: 0.9;
}

/* Messages ---------------------------------------------------------------- */

.avca-messages {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 12px;
	padding: 18px 16px;
	overflow-y: auto;
	background: var(--avca-bg);
	scrollbar-width: thin;
}

.avca-msg {
	max-width: 88%;
	padding: 12px 16px;
	border-radius: 16px;
	white-space: pre-line;
	overflow-wrap: anywhere;
}

.avca-msg--bot {
	align-self: flex-start;
	background: var(--avca-bot-bg);
	color: var(--avca-text);
	border-top-left-radius: 4px;
}

.avca-msg--user {
	align-self: flex-end;
	background: var(--avca-color);
	color: #fff;
	border-top-right-radius: 4px;
}

.avca-time {
	display: block;
	margin-top: 4px;
	font-size: 11px;
	color: var(--avca-muted);
	text-align: right;
}

.avca-msg--user .avca-time {
	color: rgba(255, 255, 255, 0.8);
}

.avca-typing {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 20px;
}

.avca-typing i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9ca3af;
	animation: avca-dot 1.2s infinite ease-in-out;
}

.avca-typing i:nth-child(2) {
	animation-delay: 0.15s;
}

.avca-typing i:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes avca-dot {
	0%,
	80%,
	100% {
		opacity: 0.3;
		transform: translateY(0);
	}

	40% {
		opacity: 1;
		transform: translateY(-3px);
	}
}

.avca-badge {
	display: inline-block;
	margin-top: 6px;
	padding: 1px 8px;
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.06);
	color: var(--avca-muted);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.avca-theme-dark .avca-badge {
	background: rgba(255, 255, 255, 0.08);
}

/* Search results inside a bot message. */
.avca-results {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
	white-space: normal;
}

.avca-results li {
	margin: 0;
	padding: 0;
}

.avca-results a {
	display: block;
	padding: 8px 10px;
	border: 1px solid var(--avca-border);
	border-radius: 10px;
	background: var(--avca-bg);
	color: var(--avca-color);
	font-weight: 600;
	text-decoration: none;
}

.avca-results a:hover,
.avca-results a:focus {
	border-color: var(--avca-color);
	text-decoration: none;
}

.avca-results small {
	display: block;
	margin-top: 2px;
	color: var(--avca-muted);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.4;
}

/* Quick-reply chips -------------------------------------------------------- */

.avca-chiprow {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
}

.avca-chip,
a.avca-chip {
	display: inline-block;
	margin: 0;
	padding: 9px 18px;
	border: 1px solid var(--avca-chip-border);
	border-radius: 24px;
	background: var(--avca-bg);
	color: var(--avca-chip-text);
	font: inherit;
	font-size: 15px;
	line-height: 1.3;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.avca-chip:hover,
.avca-chip:focus {
	border-color: var(--avca-color);
	background: var(--avca-bg);
	color: var(--avca-color);
	text-decoration: none;
}

.avca-chip--link::after {
	content: " ↗";
}

a.avca-chip--call::before {
	content: "📞 ";
}

a.avca-chip--whatsapp {
	border-color: #25d366;
	color: #128c7e;
}

.avca-theme-dark a.avca-chip--whatsapp {
	color: #4ade80;
}

a.avca-chip--whatsapp::before {
	content: "💬 ";
}

.avca-chip--callback::before {
	content: "🕑 ";
}

.avca-chip--primary,
.avca-chip--primary:hover,
.avca-chip--primary:focus {
	border-color: var(--avca-color);
	background: var(--avca-color);
	color: #fff;
}

/* Lead form ---------------------------------------------------------------- */

.avca-lead {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-self: stretch;
	margin: 0;
	padding: 14px;
	border: 1px solid var(--avca-border);
	border-radius: 14px;
	background: var(--avca-bot-bg);
}

.avca-lead input,
.avca-lead textarea {
	width: 100%;
	margin: 0;
	padding: 9px 12px;
	border: 1px solid var(--avca-chip-border);
	border-radius: 10px;
	background: var(--avca-field-bg);
	color: var(--avca-text);
	font: inherit;
	font-size: 14px;
	box-shadow: none;
}

.avca-lead textarea {
	min-height: 64px;
	resize: vertical;
}

.avca-lead input:focus,
.avca-lead textarea:focus {
	border-color: var(--avca-color);
	outline: none;
}

.avca-lead .avca-hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.avca-lead-submit {
	align-self: flex-end;
	margin: 0;
	padding: 9px 22px;
	border: 0;
	border-radius: 22px;
	background: var(--avca-color);
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.avca-lead-submit:hover,
.avca-lead-submit:focus {
	background: var(--avca-color);
	color: #fff;
	filter: brightness(1.08);
}

.avca-lead-submit[disabled] {
	opacity: 0.7;
	cursor: wait;
}

.avca-lead-error {
	margin: 0;
	color: #dc2626;
	font-size: 13px;
}

.avca-theme-dark .avca-lead-error {
	color: #f87171;
}

/* Input bar ---------------------------------------------------------------- */

.avca-form {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 14px 16px;
	border-top: 1px solid var(--avca-border);
	background: var(--avca-bg);
}

.avca-input,
.avca-root .avca-input[type="text"] {
	flex: 1;
	min-width: 0;
	height: 44px;
	margin: 0;
	padding: 8px 2px;
	border: 0;
	background: transparent;
	color: var(--avca-text);
	font: inherit;
	font-size: 15px;
	box-shadow: none;
}

.avca-input:focus,
.avca-root .avca-input[type="text"]:focus {
	border: 0;
	outline: none;
	box-shadow: none;
}

.avca-send {
	display: flex;
	flex: 0 0 42px;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--avca-color);
	cursor: pointer;
}

.avca-send:hover,
.avca-send:focus {
	background: var(--avca-bot-bg);
	color: var(--avca-color);
}

.avca-send svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

/* Device rules ------------------------------------------------------------- */

@media (max-width: 767px) {
	.avca-devices-desktop {
		display: none !important;
	}
}

@media (min-width: 768px) {
	.avca-devices-mobile {
		display: none !important;
	}
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 768px) {
	.avca-root--floating {
		bottom: 14px;
	}

	.avca-pos-left {
		left: 14px;
	}

	.avca-pos-right {
		right: 14px;
	}

	.avca-launch-bot {
		width: 72px;
		height: 72px;
	}

	.avca-tooltip {
		display: none;
	}
}

@media (max-width: 480px) {
	.avca-root--floating {
		bottom: 10px;
	}

	.avca-pos-left {
		left: 10px;
	}

	.avca-pos-right {
		right: 10px;
	}

	.avca-launch-bot {
		width: 64px;
		height: 64px;
	}

	.avca-launch-close,
	.avca-launch-bubble {
		width: 54px;
		height: 54px;
	}

	.avca-launcher-pill .avca-launch-text {
		display: none;
	}

	.avca-launcher-pill .avca-launch-open {
		padding: 5px;
	}

	.avca-root--floating .avca-panel {
		position: fixed;
		right: 8px;
		bottom: 80px;
		left: 8px;
		width: auto;
		max-width: none;
		height: 75vh;
		max-height: calc(100vh - 96px);
	}

	.avca-input,
	.avca-root .avca-input[type="text"],
	.avca-lead input,
	.avca-lead textarea {
		font-size: 16px;
	}

	.avca-chip,
	a.avca-chip {
		padding: 8px 14px;
		font-size: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.avca-launch-bot,
	.avca-root--floating .avca-panel,
	.avca-typing i {
		animation: none;
	}
}

@media print {
	.avca-root--floating {
		display: none;
	}
}
