/* VES Live Chat — widget visiteur */
.vlc-widget {
	--vlc-accent: #0b6efd;
	--vlc-accent-ink: #ffffff;
	--vlc-ink: #1b2430;
	--vlc-muted: #6b7280;
	--vlc-line: #e5e8ee;
	--vlc-bg: #ffffff;
	position: fixed;
	z-index: 999990;
	bottom: 20px;
	right: 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--vlc-ink);
}
.vlc-widget.vlc-left { right: auto; left: 20px; }

.vlc-widget * { box-sizing: border-box; }
.vlc-widget [hidden] { display: none !important; }

/* Formulaire d'accueil */
.vlc-intro {
	padding: 14px 12px 12px;
	border-top: 1px solid var(--vlc-line);
	background: #fff;
	display: flex;
	flex-direction: column;
	gap: 9px;
}
.vlc-intro__title { margin: 0; font-size: 13px; font-weight: 600; color: var(--vlc-ink); }
.vlc-intro__field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--vlc-muted); }
.vlc-intro__field input {
	border: 1px solid var(--vlc-line);
	border-radius: 10px;
	padding: 10px 12px;
	font: inherit;
	font-size: 14px;
	color: var(--vlc-ink);
	background: #fff;
	outline: none;
}
.vlc-intro__field input:focus { border-color: var(--vlc-accent); box-shadow: 0 0 0 3px rgba(11, 110, 253, .12); }
.vlc-intro__error { margin: 0; color: #b91c1c; font-size: 12.5px; }
.vlc-start {
	border: 0;
	border-radius: 10px;
	background: var(--vlc-accent);
	color: var(--vlc-accent-ink);
	font: inherit;
	font-weight: 600;
	padding: 11px;
	cursor: pointer;
}
.vlc-start:disabled { opacity: .6; cursor: default; }

/* Conversation fermée */
.vlc-closed {
	padding: 14px 12px;
	border-top: 1px solid var(--vlc-line);
	background: #fff;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.vlc-closed__title { margin: 0; font-size: 14px; font-weight: 700; }
.vlc-closed__text { margin: 0; font-size: 12.5px; color: var(--vlc-muted); }
.vlc-closed__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.vlc-closed__primary,
.vlc-closed__secondary {
	border-radius: 10px;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	padding: 10px 12px;
	cursor: pointer;
}
.vlc-closed__primary { border: 0; background: var(--vlc-accent); color: var(--vlc-accent-ink); }
.vlc-closed__secondary { border: 1px solid var(--vlc-line); background: #fff; color: var(--vlc-ink); }

.vlc-launcher {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	padding: 0;
	transition: transform .18s ease;
}
.vlc-launcher:hover { transform: translateY(-2px); }
.vlc-widget.is-open .vlc-launcher { transform: scale(.9); }

/* Mascotte expressive */
.vlc-mascot {
	--m-size: 54px;
	position: relative;
	width: var(--m-size);
	height: calc(var(--m-size) * .86);
	display: block;
	animation: vlc-bob 4s ease-in-out infinite;
}
.vlc-mascot--mini { --m-size: 30px; animation-duration: 4.6s; }
.vlc-mascot--mini .vlc-mascot__body,
.vlc-mascot--mini .vlc-mascot__body::after {
	background: rgba(255, 255, 255, .22);
	box-shadow: none;
	filter: none;
}
.vlc-mascot--mini .vlc-smile { border-color: rgba(255, 255, 255, .9); }
.vlc-mascot__body {
	position: absolute;
	inset: 0;
	border-radius: 34% 34% 30% 30% / 42% 42% 30% 30%;
	background:
		radial-gradient(circle at 32% 20%, rgba(255, 255, 255, .4), transparent 46%),
		var(--vlc-accent);
	box-shadow:
		0 8px 18px rgba(80, 30, 10, .28),
		inset 0 3px 6px rgba(255, 255, 255, .2),
		inset 0 -5px 9px rgba(0, 0, 0, .2);
}
.vlc-mascot__body::after {
	content: "";
	position: absolute;
	left: 12%;
	bottom: -11%;
	width: 28%;
	height: 24%;
	background: inherit;
	clip-path: polygon(0 0, 100% 0, 0 100%);
	border-radius: 0 0 0 40%;
	filter: brightness(.9);
}
.vlc-eyes {
	position: absolute;
	top: -7%;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: calc(var(--m-size) * .12);
	z-index: 3;
}
.vlc-eye {
	width: calc(var(--m-size) * .27);
	height: calc(var(--m-size) * .31);
	background: #fff;
	border-radius: 50%;
	position: relative;
	overflow: hidden;
	box-shadow: inset 0 -2px 5px rgba(70, 30, 10, .18), 0 1px 3px rgba(0, 0, 0, .15);
	transition: transform .1s ease;
	transform-origin: 50% 55%;
}
.vlc-pupil {
	position: absolute;
	width: 48%;
	height: 52%;
	border-radius: 50%;
	background: radial-gradient(circle at 36% 30%, #4a2412, #1f0e06 70%);
	left: 26%;
	top: 24%;
	transition: transform .09s linear;
}
.vlc-pupil::after {
	content: "";
	position: absolute;
	width: 32%;
	height: 30%;
	border-radius: 50%;
	background: #fff;
	left: 16%;
	top: 14%;
	opacity: .95;
}
.vlc-cheek {
	position: absolute;
	bottom: 24%;
	width: 12%;
	height: 7%;
	border-radius: 50%;
	background: rgba(255, 170, 130, .5);
	filter: blur(1px);
	z-index: 2;
}
.vlc-cheek--l { left: 15%; }
.vlc-cheek--r { right: 15%; }
.vlc-smile {
	position: absolute;
	left: 50%;
	bottom: 22%;
	width: 22%;
	height: 10%;
	transform: translateX(-50%);
	border-bottom: max(2px, calc(var(--m-size) * .05)) solid rgba(255, 255, 255, .92);
	border-radius: 0 0 60% 60%;
	z-index: 3;
}
.vlc-mascot.is-blink .vlc-eye { animation: vlc-blink .2s ease-in-out; }
.vlc-mascot.is-bounce { animation: vlc-bounce .65s ease; }
.vlc-zzz {
	display: none;
	position: absolute;
	top: -18%;
	right: -6%;
	width: 36%;
	height: 62%;
	z-index: 6;
	pointer-events: none;
}
.vlc-zzz i {
	position: absolute;
	font-style: normal;
	font-weight: 800;
	color: #b07a54;
	font-size: calc(var(--m-size) * .22);
	opacity: 0;
	animation: vlc-zzz 3.8s ease-in-out infinite;
}
.vlc-zzz i:nth-child(1) { right: 0; bottom: 0; animation-delay: 0s; }
.vlc-zzz i:nth-child(2) { right: 10%; bottom: 34%; font-size: calc(var(--m-size) * .17); animation-delay: 1.2s; }
.vlc-zzz i:nth-child(3) { right: 22%; bottom: 64%; font-size: calc(var(--m-size) * .13); animation-delay: 2.4s; }
.vlc-mascot.is-asleep { animation: vlc-breathe 5.5s ease-in-out infinite; }
.vlc-mascot.is-asleep .vlc-eye { background: transparent; box-shadow: none; overflow: visible; }
.vlc-mascot.is-asleep .vlc-eye::before {
	content: "";
	position: absolute;
	left: 4%;
	right: 4%;
	bottom: 46%;
	height: 26%;
	border-bottom: max(2px, calc(var(--m-size) * .05)) solid #fff;
	border-radius: 50%;
	opacity: .95;
}
.vlc-mascot.is-asleep .vlc-pupil { opacity: 0; }
.vlc-mascot.is-asleep .vlc-smile { opacity: 0; }
.vlc-mascot.is-asleep .vlc-zzz { display: block; }

@keyframes vlc-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes vlc-blip { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes vlc-blink { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.06); } }
@keyframes vlc-bounce {
	0% { transform: translateY(0) scale(1); }
	30% { transform: translateY(-9px) scale(1.05, .96); }
	55% { transform: translateY(2px) scale(.97, 1.04); }
	75% { transform: translateY(-2px) scale(1.01, .99); }
	100% { transform: translateY(0) scale(1); }
}
@keyframes vlc-breathe { 0%, 100% { transform: scale(1) translateY(0); } 50% { transform: scale(1.025) translateY(1px); } }
@keyframes vlc-zzz {
	0% { opacity: 0; transform: translateY(6px) scale(.8); }
	22% { opacity: .9; }
	68% { opacity: .55; }
	100% { opacity: 0; transform: translateY(-12px) scale(1.05); }
}

.vlc-brand-mascot { position: relative; display: inline-flex; flex: 0 0 auto; }
.vlc-head__dot {
	position: absolute;
	right: -2px;
	bottom: 0;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #4ade80;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, .75);
}
.vlc-head__dot.is-away { background: #fbbf24; }

/* Mode nuit */
.vlc-night .vlc-head { background: #7a4326; }
.vlc-night .vlc-send { background: #8a6a52; }
.vlc-night .vlc-unread { display: none; }
.vlc-night .vlc-note--night { background: #f6efe8; border-color: #efdfd1; color: #6b4a33; }

@media (prefers-reduced-motion: reduce) {
	.vlc-mascot, .vlc-mascot * { animation: none !important; }
}

.vlc-unread {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 11px;
	background: #e11d48;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 22px;
	text-align: center;
	box-shadow: 0 0 0 2px #fff;
	display: none;
}
.vlc-unread.is-visible { display: block; }

.vlc-panel {
	position: absolute;
	bottom: 74px;
	right: 0;
	width: min(370px, calc(100vw - 32px));
	height: min(560px, calc(100vh - 120px));
	background: var(--vlc-bg);
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(12px) scale(.98);
	pointer-events: none;
	transition: opacity .18s ease, transform .18s ease;
}
.vlc-widget.vlc-left .vlc-panel { right: auto; left: 0; }
.vlc-widget.is-open .vlc-panel { opacity: 1; transform: none; pointer-events: auto; }

.vlc-head {
	background: var(--vlc-accent);
	color: var(--vlc-accent-ink);
	padding: 16px 18px;
	display: flex;
	align-items: center;
	gap: 12px;
}
.vlc-head__text { flex: 1 1 auto; min-width: 0; }
.vlc-head__title { font-weight: 700; font-size: 15px; margin: 0; }
.vlc-head__sub { font-size: 12px; opacity: .85; margin: 1px 0 0; }
.vlc-close {
	border: 0; background: transparent; color: inherit; cursor: pointer;
	width: 30px; height: 30px; border-radius: 8px; font-size: 20px; line-height: 1;
	display: flex; align-items: center; justify-content: center; opacity: .85;
}
.vlc-close:hover { background: rgba(255, 255, 255, .16); opacity: 1; }

.vlc-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f7f8fb;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

.vlc-note {
	background: #fff;
	border: 1px solid var(--vlc-line);
	border-radius: 12px;
	padding: 10px 12px;
	font-size: 13px;
	color: var(--vlc-muted);
}

.vlc-msg { max-width: 85%; display: flex; flex-direction: column; gap: 3px; }
.vlc-msg__bubble {
	padding: 9px 12px;
	border-radius: 14px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.vlc-msg--visitor { align-self: flex-end; align-items: flex-end; }
.vlc-msg--visitor .vlc-msg__bubble {
	background: var(--vlc-accent);
	color: var(--vlc-accent-ink);
	border-bottom-right-radius: 4px;
}
.vlc-msg--operator { align-self: flex-start; align-items: flex-start; }
.vlc-msg--operator .vlc-msg__bubble {
	background: #fff;
	border: 1px solid var(--vlc-line);
	border-bottom-left-radius: 4px;
}
.vlc-msg--system { align-self: center; max-width: 95%; }
.vlc-msg--system .vlc-msg__bubble {
	background: #eef1f6;
	color: var(--vlc-muted);
	font-size: 12.5px;
	text-align: center;
}
.vlc-msg__time { font-size: 10.5px; color: var(--vlc-muted); padding: 0 4px; }
.vlc-msg__label { font-size: 10.5px; color: var(--vlc-muted); padding: 0 4px; font-style: italic; }

.vlc-foot {
	padding: 12px;
	border-top: 1px solid var(--vlc-line);
	background: #fff;
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
}
.vlc-fields {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.vlc-fields input,
.vlc-foot textarea {
	width: 100%;
	border: 1px solid var(--vlc-line);
	border-radius: 10px;
	padding: 9px 11px;
	font: inherit;
	color: inherit;
	background: #fff;
	outline: none;
}
.vlc-fields input:focus,
.vlc-foot textarea:focus { border-color: var(--vlc-accent); box-shadow: 0 0 0 3px rgba(11, 110, 253, .12); }
.vlc-foot textarea { grid-column: 1 / 2; resize: none; max-height: 96px; min-height: 44px; }
.vlc-send {
	grid-column: 2 / 3;
	align-self: end;
	border: 0;
	border-radius: 10px;
	background: var(--vlc-accent);
	color: var(--vlc-accent-ink);
	font: inherit;
	font-weight: 600;
	padding: 0 16px;
	height: 44px;
	cursor: pointer;
	white-space: nowrap;
}
.vlc-send:disabled { opacity: .55; cursor: default; }
.vlc-send:hover:not(:disabled) { filter: brightness(.94); }

.vlc-powered {
	text-align: center;
	font-size: 11px;
	color: var(--vlc-muted);
	padding: 0 0 8px;
	background: #fff;
}

@media (max-width: 480px) {
	.vlc-widget { bottom: max(14px, env(safe-area-inset-bottom)); right: 14px; }
	.vlc-widget.vlc-left { left: 14px; }
	.vlc-close { width: 44px; height: 44px; font-size: 24px; }
	.vlc-panel {
		position: fixed;
		left: 8px;
		right: 8px;
		width: auto;
		bottom: 92px;
		height: min(70dvh, 540px);
		max-height: calc(100dvh - 110px);
	}
	.vlc-widget.vlc-keyboard .vlc-panel {
		position: fixed;
		left: 8px;
		right: 8px;
		width: auto;
		top: calc(var(--vlc-vtop, 0px) + 8px);
		bottom: auto;
		height: calc(var(--vlc-vh, 100dvh) - 16px);
		max-height: none;
	}
	.vlc-widget.vlc-keyboard .vlc-launcher { display: none; }
}
