/**
 * Colvert Chat IA — widget flottant
 */

#colvert-chat-widget {
	--colvert-chat-bg: #eff6ff;
	--colvert-chat-panel: #f8fafc;
	--colvert-chat-border: rgba(37, 99, 235, 0.2);
	--colvert-chat-violet: #2563eb;
	--colvert-chat-violet-light: #60a5fa;
	--colvert-chat-text: #1e3a8a;
	--colvert-chat-muted: #64748b;
	--colvert-chat-invite-bg1: #1e3a8a;
	--colvert-chat-invite-bg2: #1d4ed8;
	--colvert-chat-invite-tail: #1e40af;
	/* Marge depuis le bord : évite dépassement + halo hors viewport */
	--colvert-chat-inset: max(1rem, env(safe-area-inset-right));
	/*
	 * Au-dessus des barres fixes / sélecteurs de langue (souvent z-index très élevé).
	 * Modifiable : #colvert-chat-widget { --colvert-chat-z: 2147483000; }
	 */
	--colvert-chat-z: 2147483000;
	font-family: 'Inter', system-ui, -apple-system, sans-serif;
	position: fixed;
	z-index: var(--colvert-chat-z);
	right: var(--colvert-chat-inset);
	bottom: max(1rem, env(safe-area-inset-bottom));
	left: auto;
	/*
	 * Ne pas utiliser width: max-content : la rangée bulle+bouton peut élargir le scroll du document
	 * (bouton fixe « dans la bande vide » à droite = symptôme classique).
	 * Pas de 100vw seul (barre de scroll → dépassement). dvw = largeur viewport dynamique.
	 */
	width: auto;
	min-width: 0;
	max-width: min(24rem, 92vw);
	max-width: min(
		24rem,
		calc(
			100dvw - max(1rem, env(safe-area-inset-right, 0px)) - max(1rem, env(safe-area-inset-left, 0px))
		)
	);
	overflow-x: hidden;
	overflow-y: visible;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.75rem;
	pointer-events: none;
	contain: layout;
	box-sizing: border-box;
}
@supports (overflow: clip) {
	#colvert-chat-widget {
		overflow-x: clip;
	}
}

#colvert-chat-widget .colvert-chat__panel,
#colvert-chat-widget .colvert-chat__launcher {
	pointer-events: auto;
}

#colvert-chat-widget * {
	box-sizing: border-box;
}

/* Rangée : bulle d’invitation à gauche, bouton rond à droite */
.colvert-chat__launcher {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0.65rem;
	width: 100%;
	max-width: 100%;
	min-width: 0;
}

.colvert-chat__invite {
	position: relative;
	flex: 1;
	min-width: 0;
	margin: 0;
	padding: 0.7rem 1rem 0.7rem 0.95rem;
	display: flex;
	align-items: center;
	gap: 0.65rem;
	border-radius: 1.05rem;
	border: 1px solid rgba(37, 99, 235, 0.42);
	background: linear-gradient(
		155deg,
		var(--colvert-chat-invite-bg1) 0%,
		var(--colvert-chat-invite-bg2) 48%,
		#1d4ed8 100%
	);
	color: #f4f4f8;
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.01em;
	text-align: left;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
	overflow-wrap: break-word;
	word-break: break-word;
	cursor: pointer;
	box-shadow:
		0 4px 6px rgba(0, 0, 0, 0.15) inset,
		0 14px 40px rgba(0, 0, 0, 0.55),
		0 0 0 1px rgba(255, 255, 255, 0.06) inset,
		0 0 24px -10px rgba(37, 99, 235, 0.45);
	transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

/* Accent discret en haut de la bulle */
.colvert-chat__invite::before {
	content: '';
	position: absolute;
	left: 0.85rem;
	right: 0.85rem;
	top: 0;
	height: 2px;
	border-radius: 2px;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(96, 165, 250, 0.85) 30%,
		rgba(37, 99, 235, 0.65) 70%,
		transparent
	);
	opacity: 0.95;
	pointer-events: none;
}

.colvert-chat__invite::after {
	content: '';
	position: absolute;
	right: -6px;
	top: 50%;
	width: 11px;
	height: 11px;
	background: var(--colvert-chat-invite-tail);
	border-right: 1px solid rgba(37, 99, 235, 0.38);
	border-top: 1px solid rgba(37, 99, 235, 0.38);
	transform: translateY(-50%) rotate(45deg);
	box-shadow: 2px -2px 8px rgba(37, 99, 235, 0.2);
	pointer-events: none;
}

.colvert-chat__invite:hover {
	transform: translateY(-2px);
	border-color: rgba(96, 165, 250, 0.65);
	color: #fff;
	box-shadow:
		0 4px 8px rgba(0, 0, 0, 0.18) inset,
		0 18px 48px rgba(0, 0, 0, 0.6),
		0 0 0 1px rgba(255, 255, 255, 0.09) inset,
		0 0 28px -8px rgba(37, 99, 235, 0.55);
}

.colvert-chat__invite:active {
	transform: translateY(0);
}

.colvert-chat__invite:focus-visible {
	outline: 2px solid var(--colvert-chat-violet-light);
	outline-offset: 3px;
}

/* Miniature dans la bulle d’invitation (sinon l’image PNG peut exploser la mise en page) */
.colvert-chat__invite--has-avatar .colvert-chat__invite-avatar {
	width: 2rem;
	height: 2rem;
	max-width: 2rem;
	max-height: 2rem;
	border-radius: 50%;
	object-fit: cover;
	object-position: 42% 28%;
	flex-shrink: 0;
	display: block;
	border: 1px solid rgba(255, 255, 255, 0.12);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.colvert-chat__toggle-wrap {
	position: relative;
	flex-shrink: 0;
}

/* Point « en ligne » (bouton flottant) */
.colvert-chat__toggle-wrap .colvert-chat__presence {
	position: absolute;
	right: 0.1rem;
	bottom: 0.1rem;
	width: 0.72rem;
	height: 0.72rem;
	border-radius: 50%;
	background: linear-gradient(145deg, #60a5fa, #2563eb);
	border: 2px solid #14141c;
	box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.45);
	z-index: 2;
	pointer-events: none;
}

.colvert-chat__badge {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 0.65rem;
	height: 0.65rem;
	border-radius: 50%;
	background: linear-gradient(145deg, #fb7185, #e11d48);
	border: 2px solid #1a1528;
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.2),
		0 2px 8px rgba(244, 63, 94, 0.55);
	animation: colvert-chat-badge-pulse 2.2s ease-in-out infinite;
	z-index: 1;
}

#colvert-chat-widget.colvert-chat--teaser-off .colvert-chat__badge,
#colvert-chat-widget.colvert-chat--teaser-off .colvert-chat__invite {
	display: none;
}

@keyframes colvert-chat-badge-pulse {
	0%,
	100% {
		transform: scale(1);
		opacity: 1;
	}
	50% {
		transform: scale(1.15);
		opacity: 0.95;
	}
}

.colvert-chat__toggle {
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 50%;
	border: 1px solid rgba(37, 99, 235, 0.45);
	background: linear-gradient(135deg, #1d4ed8, #2563eb);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 12px 32px -8px rgba(37, 99, 235, 0.55);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	padding: 0;
	overflow: hidden;
}

.colvert-chat__toggle--avatar {
	border-color: rgba(34, 211, 238, 0.35);
	box-shadow:
		0 0 0 2px rgba(37, 99, 235, 0.45),
		0 12px 32px -8px rgba(37, 99, 235, 0.55);
}

.colvert-chat__toggle-avatar {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	display: block;
}

.colvert-chat__toggle:hover {
	transform: translateY(-2px);
	box-shadow: 0 16px 40px -8px rgba(37, 99, 235, 0.65);
}

.colvert-chat__toggle:focus-visible {
	outline: 2px solid var(--colvert-chat-violet-light);
	outline-offset: 3px;
}

.colvert-chat__toggle:not(.colvert-chat__toggle--avatar) svg {
	width: 1.5rem;
	height: 1.5rem;
}

.colvert-chat__panel {
	position: relative;
	width: min(22rem, 100%);
	max-height: min(32rem, 70vh);
	max-width: 100%;
	display: none;
	flex-direction: column;
	border-radius: 1rem;
	border: 1px solid var(--colvert-chat-border);
	background: var(--colvert-chat-panel);
	box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
	overflow: hidden;
}

#colvert-chat-widget.is-open .colvert-chat__panel {
	display: flex;
}

/* Zone sous l’en-tête : soit le fil de chat, soit la fiche profil (pas les deux empilés). */
.colvert-chat__main-body {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.colvert-chat__chat-main {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.colvert-chat__chat-main[hidden] {
	display: none !important;
}

#colvert-chat-widget.is-open .colvert-chat__launcher {
	display: none;
}

.colvert-chat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	flex-shrink: 0;
	padding: 0.85rem 1rem;
	background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 48%, #3b82f6 100%);
	border-bottom: 1px solid rgba(37, 99, 235, 0.35);
}

.colvert-chat__head-brand {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	min-width: 0;
	flex: 1;
}

.colvert-chat__avatar-wrap {
	position: relative;
	flex-shrink: 0;
	display: inline-flex;
}

.colvert-chat__avatar-wrap--head .colvert-chat__presence--head {
	position: absolute;
	right: -0.05rem;
	bottom: -0.05rem;
	width: 0.65rem;
	height: 0.65rem;
	border-radius: 50%;
	background: linear-gradient(145deg, #60a5fa, #2563eb);
	border: 2px solid rgba(15, 15, 20, 0.95);
	box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.4);
	z-index: 1;
	pointer-events: none;
}

.colvert-chat__avatar--head {
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	object-fit: cover;
	object-position: 42% 28%;
	flex-shrink: 0;
	border: 2px solid rgba(255, 255, 255, 0.35);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.2),
		0 4px 16px rgba(0, 0, 0, 0.25);
}

.colvert-chat__title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 600;
	color: #fff;
}

.colvert-chat__head-actions {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	flex-shrink: 0;
	position: relative;
	z-index: 2;
}

.colvert-chat__profile-btn {
	border: none;
	background: rgba(255, 255, 255, 0.08);
	color: rgba(255, 255, 255, 0.95);
	width: 2rem;
	height: 2rem;
	border-radius: 0.5rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	padding: 0;
}

.colvert-chat__profile-btn:hover {
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
}

.colvert-chat__profile-btn:focus-visible {
	outline: 2px solid var(--colvert-chat-violet-light);
	outline-offset: 2px;
}

.colvert-chat__close {
	border: none;
	background: rgba(255, 255, 255, 0.08);
	color: rgba(255, 255, 255, 0.95);
	width: 2rem;
	height: 2rem;
	border-radius: 0.5rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.colvert-chat__close:hover {
	background: rgba(255, 255, 255, 0.14);
	color: #ffffff;
}

.colvert-chat__profile-sheet {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	background: var(--colvert-chat-panel);
	border-top: 1px solid var(--colvert-chat-border);
	color: var(--colvert-chat-text);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.colvert-chat__profile-sheet[hidden] {
	display: none !important;
}

.colvert-chat__profile-inner {
	flex: 1;
	padding: 0.75rem 1rem 0.85rem;
}

.colvert-chat__profile-title {
	margin: 0 0 0.35rem 0;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--colvert-chat-text);
}

.colvert-chat__profile-hint {
	margin: 0 0 0.65rem 0;
	font-size: 0.68rem;
	line-height: 1.45;
	color: var(--colvert-chat-muted);
}

.colvert-chat__profile-fields {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
}

.colvert-chat__profile-field {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.colvert-chat__profile-label {
	font-size: 0.7rem;
	font-weight: 500;
	color: var(--colvert-chat-muted);
}

.colvert-chat__profile-input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.4rem 0.5rem;
	border-radius: 0.4rem;
	border: 1px solid var(--colvert-chat-border);
	background: #fff;
	color: var(--colvert-chat-text);
	font-size: 0.8125rem;
	font-family: inherit;
}

.colvert-chat__profile-input:focus {
	outline: none;
	border-color: rgba(37, 99, 235, 0.55);
	box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.colvert-chat__profile-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem;
	margin-top: 0.65rem;
}

.colvert-chat__profile-save {
	border: none;
	border-radius: 0.45rem;
	padding: 0.4rem 0.75rem;
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
	background-color: #2563eb;
	color: #fff;
	font-family: inherit;
}

.colvert-chat__profile-save:hover {
	filter: brightness(1.08);
}

.colvert-chat__profile-close {
	border: 1px solid var(--colvert-chat-border);
	border-radius: 0.45rem;
	padding: 0.4rem 0.75rem;
	font-size: 0.8125rem;
	font-weight: 500;
	cursor: pointer;
	background: #fff;
	color: var(--colvert-chat-muted);
	font-family: inherit;
}

.colvert-chat__profile-close:hover {
	color: var(--colvert-chat-text);
	border-color: rgba(37, 99, 235, 0.35);
	background: #f1f5f9;
}

.colvert-chat__profile-clear {
	border: 1px solid rgba(220, 38, 38, 0.35);
	border-radius: 0.45rem;
	padding: 0.4rem 0.75rem;
	font-size: 0.8125rem;
	font-weight: 500;
	cursor: pointer;
	background: #fef2f2;
	color: #b91c1c;
	font-family: inherit;
}

.colvert-chat__profile-clear:hover {
	background: #fee2e2;
	color: #991b1b;
	border-color: rgba(220, 38, 38, 0.55);
}

.colvert-chat__profile-clear:focus-visible {
	outline: 2px solid rgba(248, 113, 113, 0.8);
	outline-offset: 2px;
}

.colvert-chat__messages {
	flex: 1;
	overflow-y: auto;
	padding: 1rem 1.1rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	min-height: 10rem;
	max-height: 18rem;
	background: #eff6ff;
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/*
 * Assistant (Coincoin) à gauche, vous à droite.
 */
.colvert-chat__msg-stack {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	max-width: 85%;
	min-width: 0;
}

.colvert-chat__msg-stack--user {
	align-self: flex-end;
	align-items: flex-end;
}

.colvert-chat__msg-stack--bot {
	align-self: flex-start;
	align-items: flex-start;
}

.colvert-chat__msg-label {
	font-size: 0.75rem;
	line-height: 1.2;
	color: #64748b;
}

.colvert-chat__msg-stack--user .colvert-chat__msg-label {
	padding-right: 0.35rem;
	text-align: right;
	align-self: flex-end;
}

.colvert-chat__msg-stack--bot .colvert-chat__msg-label {
	padding-left: 0.35rem;
	align-self: flex-start;
	color: #1d4ed8;
}

.colvert-chat__msg-bubble {
	padding: 0.75rem 1.1rem;
	border-radius: 15px;
	font-size: 0.875rem;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-word;
}

.colvert-chat__msg-bubble--user {
	background-color: #2563eb;
	color: #ffffff;
	border-bottom-right-radius: 2px;
}

.colvert-chat__msg-bubble--bot {
	background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 55%, #93c5fd 100%);
	background-color: #dbeafe;
	color: #1e3a8a;
	border-bottom-left-radius: 2px;
	border: 1px solid rgba(37, 99, 235, 0.35);
}

.colvert-chat__msg-bubble strong {
	font-weight: 600;
}

.colvert-chat__msg-bubble em {
	font-style: italic;
}

.colvert-chat__msg-bubble--bot .colvert-chat__md-link {
	color: #1d4ed8;
	text-decoration: underline;
	text-underline-offset: 2px;
	word-break: break-all;
}

.colvert-chat__msg-bubble--bot .colvert-chat__md-link:hover {
	color: #1e40af;
}

.colvert-chat__msg-stack--has-avatar {
	max-width: 100%;
	align-items: flex-start;
}

.colvert-chat__msg-stack--has-avatar .colvert-chat__msg-row {
	display: flex;
	align-items: flex-end;
	gap: 0.45rem;
	max-width: 100%;
}

.colvert-chat__msg-stack--has-avatar .colvert-chat__msg-bubble--bot {
	flex: 1;
	min-width: 0;
}

.colvert-chat__avatar--bubble {
	width: 1.9rem;
	height: 1.9rem;
	border-radius: 50%;
	object-fit: cover;
	object-position: 42% 28%;
	flex-shrink: 0;
	border: 1px solid rgba(37, 99, 235, 0.35);
	box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

/* Erreurs API (hors bulles) */
.colvert-chat__msg.colvert-chat__msg--error {
	align-self: stretch;
	max-width: none;
	width: 100%;
	box-sizing: border-box;
	padding: 0.55rem 0.75rem;
	border-radius: 0.5rem;
	font-size: 0.8125rem;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-word;
	background: rgba(239, 68, 68, 0.12);
	color: #fecaca;
	border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Indicateur « en train d’écrire » (dans une bulle assistant) */
.colvert-chat__msg-bubble--loading {
	display: inline-flex;
	align-items: center;
	min-height: 2.25rem;
	min-width: 3.5rem;
	box-sizing: border-box;
}

.colvert-chat__msg-stack--loading .colvert-chat__typing-dot {
	background: rgba(37, 99, 235, 0.75);
	opacity: 0.75;
}

.colvert-chat__typing {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	height: 1.15rem;
}

.colvert-chat__typing-dot {
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
	opacity: 0.65;
	animation: colvert-chat-typing-wave 1.25s ease-in-out infinite;
}

.colvert-chat__typing-dot:nth-child(2) {
	animation-delay: 0.2s;
}

.colvert-chat__typing-dot:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes colvert-chat-typing-wave {
	0%,
	60%,
	100% {
		transform: translateY(0);
		opacity: 0.45;
	}
	30% {
		transform: translateY(-0.32rem);
		opacity: 1;
	}
}

@media screen and (max-width: 600px) {
	.colvert-chat__msg-stack {
		max-width: 90%;
	}
}

/* Formulaire contact (même pipeline que le plugin Colvert Contact) */
.colvert-chat__contact {
	flex-shrink: 0;
	border-top: 1px solid rgba(37, 99, 235, 0.12);
	background: #eff6ff;
}

.colvert-chat__contact[hidden] {
	display: none !important;
}

.colvert-chat__contact-intro {
	margin: 0;
	padding: 0.65rem 1rem 0.35rem;
	font-size: 0.7rem;
	line-height: 1.45;
	color: var(--colvert-chat-muted);
}

.colvert-chat__contact-toggle {
	display: block;
	width: calc(100% - 2rem);
	margin: 0 1rem 0.5rem;
	padding: 0.45rem 0.65rem;
	border-radius: 0.5rem;
	border: 1px solid rgba(37, 99, 235, 0.35);
	background: rgba(37, 99, 235, 0.12);
	color: var(--colvert-chat-violet-light);
	font-size: 0.78rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	text-align: center;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.colvert-chat__contact-toggle:hover {
	background: rgba(37, 99, 235, 0.2);
	border-color: rgba(37, 99, 235, 0.5);
	color: #fff;
}

.colvert-chat__contact-toggle:focus-visible {
	outline: 2px solid var(--colvert-chat-violet-light);
	outline-offset: 2px;
}

.colvert-chat__contact-panel {
	max-height: min(14rem, 38vh);
	overflow-y: auto;
	padding: 0 0.75rem 0.65rem;
	-webkit-overflow-scrolling: touch;
}

.colvert-chat__contact-form {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
}

.colvert-chat__contact-field {
	margin: 0;
}

.colvert-chat__contact-label {
	display: block;
	font-size: 0.65rem;
	font-weight: 600;
	color: var(--colvert-chat-muted);
}

.colvert-chat__contact-input,
.colvert-chat__contact-textarea {
	width: 100%;
	margin-top: 0.2rem;
	border: 1px solid var(--colvert-chat-border);
	border-radius: 0.45rem;
	background: rgba(255, 255, 255, 0.05);
	color: #fff;
	padding: 0.4rem 0.5rem;
	font-size: 0.78rem;
	font-family: inherit;
}

.colvert-chat__contact-textarea {
	resize: vertical;
	min-height: 4.5rem;
	max-height: 10rem;
	line-height: 1.45;
}

.colvert-chat__contact-input::placeholder,
.colvert-chat__contact-textarea::placeholder {
	color: #6b7280;
}

.colvert-chat__contact-input:focus,
.colvert-chat__contact-textarea:focus {
	outline: none;
	border-color: rgba(96, 165, 250, 0.45);
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.colvert-chat__contact-field--privacy {
	padding-top: 0.15rem;
}

.colvert-chat__contact-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 0.4rem;
	font-size: 0.65rem;
	line-height: 1.45;
	color: var(--colvert-chat-muted);
	cursor: pointer;
}

.colvert-chat__contact-checkbox-input {
	flex-shrink: 0;
	margin-top: 0.1rem;
	accent-color: var(--colvert-chat-violet);
}

.colvert-chat__contact-privacy-text a {
	color: var(--colvert-chat-violet-light);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.colvert-chat__contact-error {
	margin: 0;
	font-size: 0.7rem;
	color: #fecaca;
	line-height: 1.4;
}

.colvert-chat__contact-submit {
	margin-top: 0.15rem;
	width: 100%;
	padding: 0.5rem 0.75rem;
	border: none;
	border-radius: 0.5rem;
	background: var(--colvert-chat-violet);
	color: #fff;
	font-weight: 600;
	font-size: 0.8rem;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.2s;
}

.colvert-chat__contact-submit:hover {
	background: #1d4ed8;
}

.colvert-chat__footer-note {
	padding: 0 1rem 0.5rem;
	font-size: 0.65rem;
	line-height: 1.45;
	color: var(--colvert-chat-muted);
	text-align: center;
}

.colvert-chat__footer-note a {
	color: var(--colvert-chat-violet-light);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.colvert-chat__footer-note a:hover {
	color: #1d4ed8;
}

.colvert-chat__form {
	display: flex;
	gap: 0.5rem;
	padding: 0.75rem;
	border-top: 1px solid rgba(37, 99, 235, 0.15);
	background: #eff6ff;
}

/* Étape accueil (offre) : uniquement les boutons, pas de champ pour inciter au clic */
.colvert-chat__form.colvert-chat__form--offer-only {
	display: none;
}

.colvert-chat__input {
	flex: 1;
	border: 1px solid rgba(37, 99, 235, 0.25);
	border-radius: 0.5rem;
	background: #ffffff;
	color: #1e3a8a;
	padding: 0.5rem 0.65rem;
	font-size: 0.875rem;
	font-family: inherit;
	resize: none;
	min-height: 2.5rem;
	max-height: 6rem;
}

.colvert-chat__input::placeholder {
	color: #6b7280;
}

.colvert-chat__input:focus {
	outline: none;
	border-color: rgba(96, 165, 250, 0.65);
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.colvert-chat__send {
	flex-shrink: 0;
	border: none;
	border-radius: 0.5rem;
	background: var(--colvert-chat-violet);
	color: #fff;
	font-weight: 600;
	font-size: 0.8125rem;
	padding: 0 0.85rem;
	cursor: pointer;
	transition: background 0.2s;
}

.colvert-chat__send:hover:not(:disabled) {
	background: #1d4ed8;
}

.colvert-chat__send:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/*
 * Mobile : panneau plein écran (lisible, zone messages maximisée).
 * Largeur max 639px = sous le breakpoint sm Tailwind / usage téléphone.
 */
@media (max-width: 639px) {
	#colvert-chat-widget.is-open {
		/* Renforce le plan au-dessus des overlays de traduction / header mobile */
		z-index: var(--colvert-chat-z);
		inset: 0;
		left: 0;
		right: 0;
		top: 0;
		bottom: 0;
		width: 100%;
		max-width: none;
		min-height: 100vh;
		min-height: 100dvh;
		max-height: 100vh;
		max-height: 100dvh;
		box-sizing: border-box;
		/* safe areas + marge clavier virtuel (WebView Facebook, etc.) posée par chat.js */
		padding-top: env(safe-area-inset-top, 0px);
		padding-right: env(safe-area-inset-right, 0px);
		padding-left: env(safe-area-inset-left, 0px);
		padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--colvert-chat-keyboard-inset, 0px));
		align-items: stretch;
		justify-content: stretch;
		display: flex;
		flex-direction: column;
	}

	#colvert-chat-widget.is-open .colvert-chat__panel {
		width: 100%;
		flex: 1;
		min-height: 0;
		max-width: none;
		max-height: none;
		height: auto;
		border-radius: 0;
		box-shadow: none;
	}

	.colvert-chat__messages {
		flex: 1 1 auto;
		min-height: 0;
		max-height: none;
	}

	.colvert-chat__head {
		flex-shrink: 0;
	}

	.colvert-chat__form {
		flex-shrink: 0;
	}

	.colvert-chat__contact-panel {
		max-height: min(20rem, 42vh);
	}
}

/* Desktop : fenêtre de chat plus grande quand le panneau est ouvert */
@media (min-width: 900px) {
	#colvert-chat-widget.is-open {
		max-width: min(
			36rem,
			calc(
				100dvw - max(1rem, env(safe-area-inset-right, 0px)) - max(1rem, env(safe-area-inset-left, 0px))
			)
		);
	}

	#colvert-chat-widget.is-open .colvert-chat__panel {
		width: min(34rem, 100%);
		max-height: min(44rem, 85vh);
	}

	#colvert-chat-widget.is-open .colvert-chat__messages {
		min-height: 12rem;
		max-height: min(32rem, 58vh);
	}

	#colvert-chat-widget.is-open .colvert-chat__contact-panel {
		max-height: min(18rem, 45vh);
	}
}

/* Parcours demande de contact : boutons Passer / J'accepte sous le fil de messages */
.colvert-chat__devis-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	padding: 0.35rem 0.75rem 0.5rem;
	border-top: 1px solid var(--colvert-chat-border);
	background: rgba(0, 0, 0, 0.15);
}
.colvert-chat__devis-actions[hidden] {
	display: none !important;
}
.colvert-chat__devis-choice {
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	padding: 0.55rem 1rem;
	border-radius: 0.65rem;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
	flex: 1 1 calc(50% - 0.25rem);
	min-width: min(100%, 9.5rem);
}
.colvert-chat__devis-choice-devis {
	border: 1px solid rgba(37, 99, 235, 0.55);
	background: linear-gradient(165deg, rgba(37, 99, 235, 0.35) 0%, rgba(37, 99, 235, 0.15) 100%);
	color: #f5f3ff;
	box-shadow: 0 4px 18px -8px rgba(37, 99, 235, 0.55);
}
.colvert-chat__devis-choice-devis:hover {
	border-color: rgba(96, 165, 250, 0.75);
	background: linear-gradient(165deg, rgba(37, 99, 235, 0.5) 0%, rgba(37, 99, 235, 0.25) 100%);
}
.colvert-chat__devis-choice-chat {
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: rgba(255, 255, 255, 0.06);
	color: var(--colvert-chat-text);
}
.colvert-chat__devis-choice-chat:hover {
	border-color: rgba(96, 165, 250, 0.35);
	background: rgba(37, 99, 235, 0.12);
	color: #fff;
}
.colvert-chat__devis-pass,
.colvert-chat__devis-privacy {
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	padding: 0.45rem 0.9rem;
	border-radius: 0.5rem;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s, color 0.2s;
	flex: 0 0 auto;
}
.colvert-chat__devis-pass {
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: rgba(255, 255, 255, 0.06);
	color: var(--colvert-chat-muted);
}
.colvert-chat__devis-pass:hover {
	border-color: rgba(96, 165, 250, 0.35);
	color: var(--colvert-chat-text);
	background: rgba(37, 99, 235, 0.12);
}
.colvert-chat__devis-privacy {
	border: 1px solid rgba(37, 99, 235, 0.45);
	background: linear-gradient(180deg, rgba(37, 99, 235, 0.22), rgba(37, 99, 235, 0.12));
	color: #ede9fe;
}
.colvert-chat__devis-privacy:hover {
	background: rgba(37, 99, 235, 0.35);
}

/* Verrou scroll arrière-plan quand le chat mobile est ouvert (classe posée par chat.js). */
html.colvert-chat-mobile-open {
	overflow: hidden;
	overscroll-behavior: none;
}

@media (prefers-reduced-motion: reduce) {
	.colvert-chat__toggle {
		transition: none;
	}
	.colvert-chat__badge {
		animation: none;
	}
	.colvert-chat__typing-dot {
		animation: none;
		opacity: 0.75;
	}
}
