/* L'assistant du site, 2026-11-20. Uniquement les jetons du style verre (verre.css) :
 * les deux themes (Noir champagne, Porcelaine) suivent tout seuls. */

#xva { --xva-d: calc(12px + env(safe-area-inset-bottom, 0px)); font-family: inherit; }

/* ----- La bulle ----- */
.xva-bouton {
	position: fixed;
	z-index: 60;
	right: var(--gouttiere-d, 16px);
	/* Au-dessus de la barre « Appeler / Reserver » du telephone (56 px + 12). */
	bottom: calc(var(--xva-d) + 68px);
	display: flex;
	align-items: center;
	gap: 8px;
	height: 52px;
	min-width: 52px;
	padding: 0 15px;
	border-radius: 999px;
	border: 0;
	background: var(--cta);
	color: var(--sur-cta);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 16px 36px -14px rgba(var(--ombre), .55), 0 4px 10px -6px rgba(var(--ombre), .3);
	transition: transform .35s var(--quint), box-shadow .35s var(--quint);
}
.xva-bouton:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -14px rgba(var(--ombre), .6), 0 6px 14px -6px rgba(var(--ombre), .35); }
.xva-bouton:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.xva-bouton-txt { display: none; }
@media (min-width: 768px) {
	.xva-bouton { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); padding: 0 20px 0 16px; }
	.xva-bouton-txt { display: inline; }
	/* Le numero de telephone fixe (xv-rail) se tasse a gauche de la bulle. */
	body.xv-assistant-on .xv-rail { right: calc(var(--gouttiere-d, 16px) + 180px); }
}
.xva-ouvert .xva-bouton { display: none; }
@media (min-width: 768px) { .xva-ouvert .xva-bouton { display: flex; } }

/* ----- La fenetre ----- */
.xva-fenetre {
	position: fixed;
	z-index: 70;
	inset: auto 8px calc(8px + env(safe-area-inset-bottom, 0px)) 8px;
	height: min(640px, calc(100dvh - 24px));
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: var(--r-l, 22px);
	/* « Verre givré clair », choisi par Xavier le 2026-11-20 : la fenetre garde la
	 * meme vitre givree dans les deux themes. On redefinit localement les jetons
	 * Porcelaine du site, et tout l'interieur suit sans autre regle. */
	--encre: #15130f;
	--encre-2: #5c564b;
	--filet: rgba(21, 19, 15, .10);
	--carte: rgba(255, 255, 255, .72);
	--cta: #15130f;
	--sur-cta: #f4ead2;
	--signal: #8a6d3b;
	--sol: rgba(255, 255, 255, .8);
	--sur-verre: rgba(255, 255, 255, .5);
	--sur-verre-fort: rgba(255, 255, 255, .85);
	--sur-verre-filet: rgba(21, 19, 15, .14);
	border: 1px solid rgba(255, 255, 255, .55);
	/* Plus opaque vers le bas : la zone du champ reste nette, meme si un element
	 * de la page echappe au flou (vu le 2026-11-20 sur le lien « 15 min » du heros). */
	background: linear-gradient(180deg, rgba(251, 250, 247, .62), rgba(251, 250, 247, .66) 60%, rgba(251, 250, 247, .9));
	-webkit-backdrop-filter: blur(36px) saturate(150%);
	backdrop-filter: blur(36px) saturate(150%);
	box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .55), 0 12px 26px -14px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .8);
	color: var(--encre);
	font-size: 15px;
	line-height: 1.5;
	animation: xva-entre .45s var(--quint);
}
.xva-fenetre[hidden] { display: none; }
@media (min-width: 768px) {
	.xva-fenetre {
		inset: auto var(--gouttiere-d, 16px) calc(84px + env(safe-area-inset-bottom, 0px)) auto;
		width: 404px;
		height: min(640px, calc(100dvh - 120px));
	}
}
@keyframes xva-entre { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

.xva-tete { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--filet); }
.xva-avatar {
	position: relative; flex: none;
	width: 44px; height: 44px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	background: var(--carte);
	border: 2px solid #ffffff;
	color: var(--signal);
	font-family: var(--font-heading); font-weight: 600; font-size: 14px; letter-spacing: -.02em;
}
.xva-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.xva-en-ligne { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #2E9E6B; border: 2px solid #ffffff; }
.xva-ident { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.xva-ident strong { font-family: var(--font-heading); font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.xva-ident span { font-size: 12.5px; color: var(--encre-2); }
.xva-fermer {
	flex: none; width: 44px; height: 44px; padding: 0;
	display: flex; align-items: center; justify-content: center;
	border-radius: 999px; border: 1px solid var(--filet); background: var(--sur-verre);
	color: var(--encre-2); cursor: pointer;
	transition: background .25s var(--quint), color .25s;
}
.xva-fermer:hover { background: var(--sur-verre-fort); color: var(--encre); }

/* Sous le champ, en petit : meme allure que la mention du pied. */
.xva-avis {
	margin: 0; padding: 0 16px 12px;
	font-size: 11.5px; line-height: 1.45; color: var(--encre-2); text-align: center;
}
.xva-avis strong { font-weight: 600; color: var(--encre); }

.xva-liste {
	flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
	display: flex; flex-direction: column; gap: 8px;
	padding: 14px 14px 6px;
}
.xva-bulle { max-width: 86%; padding: 10px 14px; font-size: 14.5px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.xva-elle { align-self: flex-start; border-radius: 16px 16px 16px 6px; background: var(--carte); border: 1px solid var(--filet); }
.xva-moi { align-self: flex-end; border-radius: 16px 16px 6px 16px; background: var(--cta); color: var(--sur-cta); margin-top: 4px; }
.xva-ecrit { display: flex; gap: 5px; padding: 14px 16px; }
.xva-ecrit span { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); animation: xva-point 1.2s infinite ease-in-out; }
.xva-ecrit span:nth-child(2) { animation-delay: .15s; }
.xva-ecrit span:nth-child(3) { animation-delay: .3s; }
@keyframes xva-point { 0%, 80%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }

.xva-action {
	align-self: flex-start;
	display: inline-flex; align-items: center; min-height: 40px;
	padding: 0 16px; border-radius: 999px;
	background: var(--cta); color: var(--sur-cta) !important;
	font-weight: 600; font-size: 13.5px; text-decoration: none !important;
	transition: transform .25s var(--quint), filter .25s;
}
.xva-action:hover { transform: translateY(-1px); filter: brightness(1.06); }
.xva-note { align-self: flex-start; margin: 0; padding-left: 4px; font-size: 12px; font-style: italic; color: var(--encre-2); }

.xva-puces { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 14px 10px; }
.xva-puces[hidden] { display: none; }
.xva-puce {
	min-height: 36px; padding: 7px 13px;
	border-radius: 999px; border: 1px solid var(--sur-verre-filet);
	background: var(--sur-verre); color: var(--encre);
	font: inherit; font-size: 13px; line-height: 1.3; text-align: left; cursor: pointer;
	transition: background .25s var(--quint), border-color .25s var(--quint);
}
.xva-puce:hover { background: var(--sur-verre-fort); border-color: var(--signal); }

.xva-form { display: flex; gap: 8px; align-items: center; padding: 12px 14px 8px; border-top: 1px solid var(--filet); }
.xva-champ {
	flex: 1; min-width: 0; height: 44px; box-sizing: border-box; padding: 0 16px;
	border-radius: 999px; border: 1px solid var(--sur-verre-filet);
	background: var(--sol); color: var(--encre);
	font: inherit; font-size: 16px; /* jamais sous 16 px : iOS zoomerait */
}
.xva-champ::placeholder { color: var(--encre-2); }
.xva-champ:focus { outline: none; border-color: var(--signal); }
.xva-envoi {
	flex: none; width: 44px; height: 44px; padding: 0;
	display: flex; align-items: center; justify-content: center;
	border: 0; border-radius: 999px; background: var(--cta); color: var(--sur-cta); cursor: pointer;
}
.xva-envoi:disabled { opacity: .5; cursor: default; }
.xva-pied { margin: 0; padding: 0 16px 12px; font-size: 11.5px; color: var(--encre-2); text-align: center; }

.xva-puce:focus-visible, .xva-envoi:focus-visible, .xva-fermer:focus-visible, .xva-action:focus-visible, .xva-champ:focus-visible {
	outline: 2px solid var(--signal); outline-offset: 2px;
}
.xva-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Le menu mobile ouvert passe devant tout. */
body:has(details[open] > summary.xv-nav-mobile) #xva { display: none; }

@media (prefers-reduced-motion: reduce) {
	.xva-fenetre, .xva-ecrit span { animation: none; }
	.xva-bouton, .xva-action { transition: none; }
}

/* Sur telephone, la barre « Appeler / Reserver » passe devant la fenetre ouverte :
 * on la cache le temps du clavardage (meme principe que dans etapes.css). */
@media (max-width: 767px) {
	body:has(#xva.xva-ouvert) .xv-barre-action { display: none; }
}
