#valmorca-chatbot-root {
	--vc-primary: #003B73;
	--vc-primary-dark: #002850;
	--vc-accent: #FF6B00;
	--vc-bg: #F4F6F9;
	--vc-surface: #FFFFFF;
	--vc-text: #1E293B;
	--vc-muted: #64748B;
	--vc-border: #E2E8F0;
	--vc-shadow: 0 18px 45px rgba(0, 35, 75, 0.22);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
	position: fixed;
	bottom: var(--vc-bottom, 24px);
	right: 24px;
	z-index: 999999;
	box-sizing: border-box;
}

#valmorca-chatbot-root *,
#valmorca-chatbot-root *::before,
#valmorca-chatbot-root *::after {
	box-sizing: border-box;
}

/* Launcher Button (Speech-bubble + Circular Avatar) */
.vc-launcher {
	display: flex;
	align-items: center;
	gap: 10px;
	background: transparent !important;
	background-color: transparent !important;
	box-shadow: none !important;
	color: var(--vc-primary);
	border: none !important;
	padding: 4px !important;
	margin: 0 !important;
	cursor: pointer;
	transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
	animation: vc-launcher-float 3.6s ease-in-out infinite;
}

.vc-launcher.vc-hidden {
	opacity: 0;
	transform: scale(0.8) translateY(10px);
	pointer-events: none;
	position: absolute;
	right: 0;
	bottom: 0;
}

.vc-launcher:hover,
.vc-launcher:focus,
.vc-launcher:active {
	background: transparent !important;
	background-color: transparent !important;
	box-shadow: none !important;
	border: none !important;
}

.vc-launcher:hover {
	transform: translateY(-3px) scale(1.03);
}

.vc-launcher:active {
	transform: scale(0.96);
}

.vc-launcher:focus-visible {
	outline: 3px solid var(--vc-accent);
	outline-offset: 4px;
	border-radius: 999px;
}

.vc-launcher-badge {
	position: relative;
	background: #FFFFFF;
	color: var(--vc-primary);
	font-size: 13px;
	font-weight: 700;
	padding: 8px 14px;
	border-radius: 16px;
	box-shadow: 0 8px 24px rgba(0, 35, 75, 0.18);
	border: 1px solid rgba(0, 59, 115, 0.12);
	white-space: nowrap;
	transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.vc-launcher-badge::after {
	content: "";
	position: absolute;
	right: -6px;
	top: 50%;
	width: 11px;
	height: 11px;
	background: #FFFFFF;
	border-right: 1px solid rgba(0, 59, 115, 0.12);
	border-top: 1px solid rgba(0, 59, 115, 0.12);
	transform: translateY(-50%) rotate(45deg);
}

.vc-launcher:hover .vc-launcher-badge {
	transform: translateX(-3px);
	box-shadow: 0 12px 28px rgba(0, 35, 75, 0.24);
}

.vc-launcher-avatar {
	width: 62px;
	height: 62px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--vc-primary), var(--vc-primary-dark));
	color: #FFFFFF;
	padding: 3px;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	flex-shrink: 0;
	box-shadow: 0 10px 26px rgba(0, 59, 115, 0.36);
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vc-launcher:hover .vc-launcher-avatar {
	transform: scale(1.08) rotate(-3deg);
}

.vc-launcher-avatar::after {
	content: "";
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 2px solid var(--vc-accent);
	opacity: 0;
	animation: vc-pulse-ring 2.8s cubic-bezier(0.22, 1, 0.36, 1) infinite;
	pointer-events: none;
}

.vc-launcher-avatar img,
.vc-header-avatar img,
.vc-hero-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
	display: block;
	background: #FFFFFF;
}

.vc-launcher-status {
	position: absolute;
	bottom: 2px;
	right: 2px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #22C55E;
	border: 2.5px solid #FFFFFF;
}

@keyframes vc-launcher-float {
	0%, 100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-4px);
	}
}

@keyframes vc-pulse-ring {
	0% {
		transform: scale(0.92);
		opacity: 0.75;
	}
	70%, 100% {
		transform: scale(1.32);
		opacity: 0;
	}
}

/* Main Chat Container (376x544) */
.vc-container-login {
	position: relative;
	width: 376px;
	height: 544px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - var(--vc-bottom, 24px) - 24px);
	background: var(--vc-surface);
	border-radius: 18px;
	box-shadow: var(--vc-shadow);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	border: 1px solid rgba(0, 59, 115, 0.12);
	transform-origin: bottom right;
	opacity: 0;
	transform: translateY(18px) scale(0.88);
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.24s ease-out, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.28s;
}

.vc-container-login:not(.vc-open) {
	position: absolute;
	right: 0;
	bottom: 0;
}

.vc-container-login.vc-open {
	opacity: 1;
	transform: translateY(0) scale(1);
	visibility: visible;
	pointer-events: auto;
}

.vc-container-login.vc-open .vc-header-avatar {
	animation: vc-avatar-pop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.vc-container-login.vc-open .vc-hero-avatar {
	animation: vc-avatar-pop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) 0.04s both;
}

.vc-container-login.vc-open .vc-welcome-segment {
	animation: vc-welcome-slide 0.32s ease-out 0.08s both;
}

/* Centered overlapping Hero Avatar for Welcome state */
.vc-hero-avatar {
	display: none;
	width: 82px;
	height: 82px;
	border-radius: 50%;
	background: #FFFFFF;
	border: 4px solid #FFFFFF;
	box-shadow: 0 8px 22px rgba(0, 59, 115, 0.22);
	margin: -42px auto 10px;
	position: relative;
	z-index: 4;
	overflow: hidden;
	align-items: center;
	justify-content: center;
	color: var(--vc-primary);
}

.vc-container-login.vc-is-welcome .vc-header {
	padding-bottom: 46px;
}

.vc-container-login.vc-is-welcome .vc-header-avatar {
	display: none;
}

.vc-container-login.vc-is-welcome .vc-hero-avatar {
	display: flex;
}

.vc-container-login.vc-is-welcome .vc-welcome-segment {
	margin-top: 0;
	text-align: center;
	padding-top: 12px;
}

.vc-container-login.vc-is-welcome .vc-quick-prompts {
	justify-content: center;
}

@keyframes vc-avatar-pop {
	0% {
		opacity: 0;
		transform: scale(0.6) rotate(-10deg);
	}
	100% {
		opacity: 1;
		transform: scale(1) rotate(0deg);
	}
}

@keyframes vc-welcome-slide {
	0% {
		opacity: 0;
		transform: translateY(10px);
	}
	100% {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.vc-launcher,
	.vc-launcher-avatar::after,
	.vc-container-login.vc-open .vc-header-avatar,
	.vc-container-login.vc-open .vc-welcome-segment {
		animation: none !important;
	}
	.vc-launcher,
	.vc-launcher-avatar,
	.vc-container-login {
		transition: none !important;
	}
}

/* Top Header */
.vc-header {
	background: linear-gradient(135deg, var(--vc-primary), var(--vc-primary-dark));
	color: #FFFFFF;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 3px solid var(--vc-accent);
	flex-shrink: 0;
	z-index: 3;
}

.vc-header-info {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.vc-header-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	border: 1.5px solid rgba(255, 255, 255, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

#valmorca-chatbot-root .vc-header-title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	color: #FFFFFF !important;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#valmorca-chatbot-root .vc-header-subtitle {
	margin: 2px 0 0;
	font-size: 11.5px;
	color: rgba(255, 255, 255, 0.9) !important;
	display: flex;
	align-items: center;
	gap: 5px;
}

.vc-header-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #22C55E;
	display: inline-block;
}

.vc-header-actions {
	display: flex;
	align-items: center;
	gap: 4px;
}

#valmorca-chatbot-root .vc-icon-btn {
	background: transparent !important;
	background-color: transparent !important;
	border: none !important;
	box-shadow: none !important;
	padding: 0 !important;
	color: #FFFFFF !important;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

#valmorca-chatbot-root .vc-icon-btn:hover {
	background: rgba(255, 255, 255, 0.18) !important;
	color: #FFFFFF !important;
}

/* Overlay layer & welcome segment */
.vc-capa-login {
	position: relative;
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	background: var(--vc-bg);
	overflow: visible;
	z-index: 4;
}

.vc-welcome-segment {
	background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
	margin: 12px 12px 4px;
	padding: 14px;
	border-radius: 14px;
	border: 1px solid var(--vc-border);
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

#valmorca-chatbot-root .vc-welcome-title {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 700;
	color: var(--vc-primary) !important;
}

#valmorca-chatbot-root .vc-welcome-text {
	margin: 0;
	font-size: 12.5px;
	line-height: 1.45;
	color: #475569 !important;
}

.vc-quick-prompts {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

.vc-quick-btn {
	background: #FFFFFF;
	border: 1px solid rgba(0, 59, 115, 0.25);
	color: var(--vc-primary);
	border-radius: 999px;
	padding: 5px 11px;
	font-size: 11.5px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
}

.vc-quick-btn:hover {
	background: var(--vc-primary);
	color: #FFFFFF;
	border-color: var(--vc-primary);
}

/* Messages Area */
.vc-messages {
	flex: 1;
	overflow-y: auto;
	padding: 10px 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	scroll-behavior: smooth;
}

.vc-messages::-webkit-scrollbar {
	width: 5px;
}

.vc-messages::-webkit-scrollbar-thumb {
	background: rgba(100, 116, 139, 0.3);
	border-radius: 999px;
}

.vc-msg {
	display: flex;
	flex-direction: column;
	max-width: 84%;
}

.vc-msg-user {
	align-self: flex-end;
	align-items: flex-end;
}

.vc-msg-bot {
	align-self: flex-start;
	align-items: flex-start;
}

.vc-bubble {
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 13.5px;
	line-height: 1.45;
	word-wrap: break-word;
	white-space: pre-wrap;
}

.vc-msg-user .vc-bubble {
	background: var(--vc-primary);
	color: #FFFFFF;
	border-bottom-right-radius: 4px;
}

.vc-msg-bot .vc-bubble {
	background: #FFFFFF;
	color: var(--vc-text);
	border: 1px solid var(--vc-border);
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
	white-space: normal;
}

.vc-msg-bot .vc-bubble p {
	margin: 0 0 6px;
}

.vc-msg-bot .vc-bubble p:last-child {
	margin-bottom: 0;
}

.vc-msg-bot .vc-bubble ul,
.vc-msg-bot .vc-bubble ol {
	margin: 4px 0 6px;
	padding-left: 18px;
}

.vc-msg-bot .vc-bubble li {
	margin-bottom: 3px;
}

.vc-msg-bot .vc-bubble code {
	background: #F1F5F9;
	padding: 1px 5px;
	border-radius: 4px;
	font-size: 12.5px;
}

.vc-retry-btn {
	margin-top: 8px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: var(--vc-primary);
	color: #FFFFFF;
	border: none;
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.vc-retry-btn:hover {
	opacity: 0.9;
}

.vc-msg-bot .vc-bubble a {
	color: var(--vc-primary);
	text-decoration: underline;
}

.vc-msg-time {
	font-size: 10px;
	color: var(--vc-muted);
	margin-top: 3px;
	padding: 0 4px;
}

/* Typing indicator */
.vc-typing {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 10px 14px;
	background: #FFFFFF;
	border: 1px solid var(--vc-border);
	border-radius: 14px;
	border-bottom-left-radius: 4px;
}

.vc-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--vc-primary);
	opacity: 0.4;
	animation: vc-bounce 1.2s infinite ease-in-out;
}

.vc-typing span:nth-child(2) {
	animation-delay: 0.2s;
}

.vc-typing span:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes vc-bounce {
	0%, 80%, 100% {
		transform: scale(0.7);
		opacity: 0.4;
	}
	40% {
		transform: scale(1);
		opacity: 1;
	}
}

/* Input Bar */
.vc-input-bar {
	background: #FFFFFF;
	border-top: 1px solid var(--vc-border);
	padding: 10px 12px;
	display: flex;
	align-items: flex-end;
	gap: 8px;
	flex-shrink: 0;
}

.vc-input {
	flex: 1;
	border: 1px solid var(--vc-border);
	border-radius: 12px;
	padding: 9px 12px;
	font-size: 13.5px;
	font-family: inherit;
	color: var(--vc-text);
	background: var(--vc-bg);
	resize: none;
	max-height: 90px;
	min-height: 38px;
	line-height: 1.35;
	outline: none;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.vc-input:focus {
	border-color: var(--vc-primary);
	background: #FFFFFF;
}

.vc-send-btn {
	width: 38px;
	height: 38px;
	padding: 0;
	border-radius: 12px;
	border: none;
	background: var(--vc-accent);
	color: #FFFFFF;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.vc-send-btn svg,
.vc-icon-btn svg {
	width: 18px;
	height: 18px;
	stroke: #FFFFFF;
	fill: none;
	display: block;
	flex-shrink: 0;
}

.vc-send-btn:hover:not(:disabled) {
	transform: translateY(-1px);
	opacity: 0.94;
}

.vc-send-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

@media (max-width: 480px) {
	#valmorca-chatbot-root {
		bottom: var(--vc-bottom, 16px);
		right: 12px;
		left: 12px;
		display: flex;
		justify-content: flex-end;
	}

	.vc-container-login {
		width: 100%;
		height: calc(100vh - var(--vc-bottom, 16px) - 16px);
		max-width: 100%;
		max-height: calc(100vh - var(--vc-bottom, 16px) - 16px);
	}
}
