/**
 * HealFast web AI agent — floating overlay (does not alter page layout).
 */

.healfast-agent-root {
	--hf-agent-brand: var(--healfast-brand, #00a86b);
	--hf-agent-brand-dark: var(--healfast-brand-dark, #008f5c);
	--hf-agent-nav: var(--healfast-nav-bg, #0a2342);
	--hf-agent-font: var(--healfast-font-body, "Inter", system-ui, sans-serif);
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 99999;
	font-family: var(--hf-agent-font);
	pointer-events: none;
}

.healfast-agent-root * {
	box-sizing: border-box;
}

.healfast-agent-launcher,
.healfast-agent-panel {
	pointer-events: auto;
}

.healfast-agent-launcher {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 3rem;
	padding: 0.45rem 1rem 0.45rem 0.45rem;
	border: 2px solid var(--healfast-accent, #c8f500);
	border-radius: 999px;
	background: var(--hf-agent-nav);
	color: #fff;
	font: 600 0.95rem/1.2 var(--hf-agent-font);
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(10, 35, 66, 0.22);
	transition: background 0.2s ease, transform 0.2s ease;
}

.healfast-agent-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid var(--healfast-accent, #c8f500);
	flex: 0 0 auto;
}

.healfast-agent-avatar--lg {
	width: 44px;
	height: 44px;
}

.healfast-agent-whatsapp {
	display: block;
	margin: 0.55rem 0.85rem 0;
	padding: 0.55rem 0.75rem;
	border-radius: 12px;
	background: var(--healfast-accent, #c8f500);
	color: #0a2342 !important;
	font-weight: 700;
	font-size: 0.88rem;
	text-align: center;
	text-decoration: none !important;
}

.healfast-agent-launcher:hover,
.healfast-agent-launcher:focus-visible {
	background: var(--hf-agent-brand-dark);
	transform: translateY(-1px);
	outline: none;
}

.healfast-agent-launcher[aria-expanded="true"] {
	display: none;
}

.healfast-agent-panel {
	display: none;
	flex-direction: column;
	width: min(22.5rem, calc(100vw - 2rem));
	height: min(32rem, calc(100vh - 5rem));
	background: #fff;
	border: 1px solid rgba(10, 35, 66, 0.12);
	border-radius: 1rem;
	overflow: hidden;
	box-shadow: 0 16px 40px rgba(10, 35, 66, 0.2);
	animation: healfast-agent-in 0.22s ease;
}

.healfast-agent-panel.is-open {
	display: flex;
}

@keyframes healfast-agent-in {
	from {
		opacity: 0;
		transform: translateY(0.5rem);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.healfast-agent-header {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 0.75rem;
	padding: 0.9rem 1rem;
	background: var(--hf-agent-nav);
	color: #fff;
}

.healfast-agent-header .healfast-agent-close {
	margin-left: auto;
}

.healfast-agent-header h2 {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.25;
}

.healfast-agent-header p {
	margin: 0.2rem 0 0;
	font-size: 0.8rem;
	opacity: 0.85;
	line-height: 1.35;
}

.healfast-agent-close {
	flex-shrink: 0;
	width: 2rem;
	height: 2rem;
	border: 0;
	border-radius: 0.4rem;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
}

.healfast-agent-close:hover,
.healfast-agent-close:focus-visible {
	background: rgba(255, 255, 255, 0.22);
	outline: none;
}

.healfast-agent-messages {
	flex: 1;
	overflow-y: auto;
	padding: 0.9rem;
	background: linear-gradient(180deg, #f7faf8 0%, #ffffff 40%);
}

.healfast-agent-msg {
	max-width: 92%;
	margin: 0 0 0.65rem;
	padding: 0.65rem 0.8rem;
	border-radius: 0.75rem;
	font-size: 0.9rem;
	line-height: 1.45;
	white-space: pre-wrap;
	word-break: break-word;
}

.healfast-agent-msg--bot {
	background: #eef6f2;
	color: #012559;
	border-bottom-left-radius: 0.2rem;
}

.healfast-agent-msg--user {
	margin-left: auto;
	background: var(--hf-agent-brand);
	color: #fff;
	border-bottom-right-radius: 0.2rem;
}

.healfast-agent-msg--error {
	background: #fff4f0;
	color: #8a2b12;
}

.healfast-agent-suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	padding: 0 0.9rem 0.65rem;
	background: #fff;
}

.healfast-agent-chip {
	border: 1px solid rgba(0, 168, 107, 0.35);
	border-radius: 999px;
	background: #fff;
	color: var(--hf-agent-brand-dark);
	font: 500 0.75rem/1.2 var(--hf-agent-font);
	padding: 0.35rem 0.65rem;
	cursor: pointer;
}

.healfast-agent-chip:hover,
.healfast-agent-chip:focus-visible {
	background: rgba(0, 168, 107, 0.1);
	outline: none;
}

.healfast-agent-form {
	display: flex;
	gap: 0.45rem;
	padding: 0.75rem;
	border-top: 1px solid rgba(10, 35, 66, 0.08);
	background: #fff;
}

.healfast-agent-input {
	flex: 1;
	min-width: 0;
	border: 1px solid rgba(10, 35, 66, 0.18);
	border-radius: 0.65rem;
	padding: 0.65rem 0.75rem;
	font: 400 0.9rem/1.3 var(--hf-agent-font);
	color: #012559;
}

.healfast-agent-input:focus {
	outline: 2px solid rgba(0, 168, 107, 0.45);
	outline-offset: 1px;
	border-color: var(--hf-agent-brand);
}

.healfast-agent-send {
	border: 0;
	border-radius: 0.65rem;
	padding: 0 0.95rem;
	background: var(--hf-agent-brand);
	color: #fff;
	font: 600 0.85rem/1 var(--hf-agent-font);
	cursor: pointer;
}

.healfast-agent-send:disabled {
	opacity: 0.55;
	cursor: wait;
}

.healfast-agent-typing {
	font-size: 0.8rem;
	color: rgba(1, 37, 89, 0.65);
	padding: 0 0.9rem 0.5rem;
	display: none;
}

.healfast-agent-typing.is-on {
	display: block;
}

@media (max-width: 480px) {
	.healfast-agent-root {
		right: 0.65rem;
		bottom: 0.65rem;
	}

	.healfast-agent-panel {
		width: calc(100vw - 1.3rem);
		height: min(70vh, 34rem);
	}

	.healfast-agent-launcher span {
		display: none;
	}

	.healfast-agent-launcher {
		width: 3.25rem;
		height: 3.25rem;
		padding: 0;
		border-radius: 50%;
	}
}
