*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

:root {
	--brand: #0d9488;
	--brand-deep: #0f766e;
	--ink: #0f172a;
	--muted: #64748b;
	--line: rgba(15, 23, 42, 0.08);
	--panel: #f8fafc;
	--bot-bubble: #eef6f5;
	--user-bubble: var(--brand);
	--font: 'Manrope', 'Segoe UI', sans-serif;
	--display: 'Sora', 'Manrope', sans-serif;
	--shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

html,
body {
	height: 100%;
	overflow: hidden;
	font-family: var(--font);
	color: var(--ink);
	background:
		radial-gradient(1200px 500px at 10% -10%, rgba(13, 148, 136, 0.18), transparent 55%),
		radial-gradient(900px 420px at 100% 0%, rgba(245, 158, 11, 0.12), transparent 50%),
		linear-gradient(180deg, #f4f7f8 0%, #eef2f4 100%);
}

.shell {
	display: flex;
	flex-direction: column;
	height: 100%;
	max-width: 480px;
	margin: 0 auto;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(10px);
	box-shadow: var(--shadow);
}

.header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 18px;
	background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
	color: #fff;
	flex-shrink: 0;
	animation: header-in 0.45s ease both;
}

@keyframes header-in {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.avatar {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: #fff;
	display: grid;
	place-items: center;
	overflow: hidden;
	flex-shrink: 0;
	font-family: var(--display);
	font-weight: 700;
	color: var(--brand-deep);
}

.avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.header-copy {
	min-width: 0;
}

.header-copy h1 {
	font-family: var(--display);
	font-size: 1rem;
	font-weight: 650;
	letter-spacing: -0.02em;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.header-copy p {
	margin-top: 2px;
	font-size: 0.72rem;
	opacity: 0.9;
}

.messages {
	flex: 1;
	overflow-y: auto;
	padding: 20px 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	scrollbar-width: thin;
}

.message {
	display: flex;
	gap: 8px;
	max-width: 88%;
	animation: msg-in 0.28s ease both;
}

@keyframes msg-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.message.bot {
	align-self: flex-start;
}

.message.user {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.bubble {
	padding: 11px 14px;
	border-radius: 16px;
	font-size: 0.92rem;
	line-height: 1.55;
	word-break: break-word;
}

.message.bot .bubble {
	background: var(--bot-bubble);
	border-bottom-left-radius: 4px;
}

.message.user .bubble {
	background: var(--user-bubble);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.quick-replies {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 16px 12px;
	flex-shrink: 0;
}

.quick-replies[hidden],
.lead-form[hidden],
.shell[hidden],
.loading[hidden] {
	display: none !important;
}

.qr-btn {
	appearance: none;
	border: 1.5px solid color-mix(in srgb, var(--brand) 35%, transparent);
	background: #fff;
	color: var(--brand-deep);
	font-family: var(--font);
	font-size: 0.84rem;
	font-weight: 650;
	padding: 9px 14px;
	border-radius: 999px;
	cursor: pointer;
	transition:
		transform 0.15s ease,
		background 0.15s ease,
		border-color 0.15s ease;
}

.qr-btn:hover {
	transform: translateY(-1px);
	background: color-mix(in srgb, var(--brand) 10%, #fff);
	border-color: var(--brand);
}

.qr-btn:active {
	transform: scale(0.98);
}

.qr-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

.status {
	padding: 10px 16px 14px;
	font-size: 0.75rem;
	color: var(--muted);
	text-align: center;
	flex-shrink: 0;
}

.status.error {
	color: #b45309;
}

.lead-form {
	display: grid;
	gap: 8px;
	padding: 0 16px 14px;
	flex-shrink: 0;
	animation: msg-in 0.28s ease both;
}

.lead-form input {
	border: 1.5px solid var(--line);
	border-radius: 12px;
	padding: 11px 12px;
	font: inherit;
	outline: none;
}

.lead-form input:focus {
	border-color: var(--brand);
	box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.lead-form button {
	border: none;
	border-radius: 12px;
	padding: 11px 14px;
	font: inherit;
	font-weight: 700;
	color: #fff;
	background: var(--brand);
	cursor: pointer;
}

.loading {
	display: grid;
	place-items: center;
	height: 100%;
	gap: 10px;
	color: var(--muted);
	font-family: var(--display);
}

.loading-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--brand);
	animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
	0%,
	100% {
		transform: scale(0.85);
		opacity: 0.5;
	}
	50% {
		transform: scale(1.15);
		opacity: 1;
	}
}
