@charset "UTF-8";
/* =========================================================================
   Conseiller IA — Centre d'Affaires du Parc
   Les couleurs reprennent les jetons du thème quand il est actif, avec un
   repli explicite : le widget doit rester présentable si la feuille du thème
   n'est pas chargée (page de paiement, thème de secours).
   ====================================================================== */

.cdp-ia {
	position: fixed;
	right: clamp(16px, 3vw, 28px);
	bottom: calc(clamp(16px, 3vw, 28px) + 68px);
	z-index: 160;
	display: flex;
	flex-direction: column;
	width: min(400px, calc(100vw - 32px));
	height: min(620px, calc(100vh - 140px));
	overflow: hidden;
	background: var(--blanc, #fff);
	border: 1px solid var(--filet, rgba(37, 59, 90, 0.12));
	border-radius: var(--r-lg, 20px);
	box-shadow: 0 2px 4px rgba(12, 23, 37, 0.05), 0 28px 60px -28px rgba(12, 23, 37, 0.34);
	font-family: var(--corps, 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif);
	color: var(--encre, #21303f);
	opacity: 0;
	transform: translateY(12px) scale(0.98);
	transition: opacity 200ms ease, transform 200ms ease;
}

.cdp-ia[hidden] { display: none; }
.cdp-ia.est-ouvert { opacity: 1; transform: none; }

/* -- En-tête ------------------------------------------------------------ */

.cdp-ia__entete {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.9rem 1rem;
	background: var(--nuit, #253b5a);
	color: #fff;
}

.cdp-ia__identite { display: flex; align-items: center; gap: 0.7rem; }

.cdp-ia__pastille {
	position: relative;
	flex: none;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--or, #c9a25f);
}

.cdp-ia__pastille::after {
	content: '';
	position: absolute;
	right: -1px;
	bottom: -1px;
	width: 10px;
	height: 10px;
	border: 2px solid var(--nuit, #253b5a);
	border-radius: 50%;
	background: #35c47c;
}

.cdp-ia__titre { margin: 0; font-size: 0.95rem; font-weight: 700; line-height: 1.2; }
.cdp-ia__etat { margin: 0.1rem 0 0; font-size: 0.75rem; opacity: 0.75; }

.cdp-ia__fermer {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	transition: background 180ms ease;
}

.cdp-ia__fermer:hover { background: rgba(255, 255, 255, 0.22); }

/* -- Fil de discussion -------------------------------------------------- */

.cdp-ia__fil {
	flex: 1;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	padding: 1rem;
	background: var(--brume, #f5f7fa);
	scroll-behavior: smooth;
	overscroll-behavior: contain;
}

.cdp-ia__msg {
	max-width: 86%;
	padding: 0.7rem 0.9rem;
	border-radius: 14px;
	font-size: 0.9rem;
	line-height: 1.55;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.cdp-ia__msg--agent {
	align-self: flex-start;
	background: #fff;
	border: 1px solid var(--filet, rgba(37, 59, 90, 0.12));
	border-bottom-left-radius: 4px;
}

.cdp-ia__msg--visiteur {
	align-self: flex-end;
	background: var(--nuit, #253b5a);
	border-bottom-right-radius: 4px;
	color: #fff;
}

.cdp-ia__msg a { color: var(--or-fonce, #8e6c28); text-decoration: underline; text-underline-offset: 2px; }
.cdp-ia__msg--visiteur a { color: #fff; }
.cdp-ia__msg strong { font-weight: 700; }
.cdp-ia-puce { color: var(--or, #c9a25f); font-weight: 700; }

.cdp-ia__msg--erreur {
	align-self: stretch;
	max-width: 100%;
	background: #fdf3f2;
	border: 1px solid #f0cfcb;
	color: #8a2f27;
}

/* Trois points d'attente — le visiteur doit voir que ça travaille. */
.cdp-ia__attente { display: inline-flex; gap: 4px; padding: 0.2rem 0; }

.cdp-ia__attente span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--nuit-200, #93a5be);
	animation: cdp-ia-rebond 1.2s infinite ease-in-out;
}

.cdp-ia__attente span:nth-child(2) { animation-delay: 0.15s; }
.cdp-ia__attente span:nth-child(3) { animation-delay: 0.3s; }

@keyframes cdp-ia-rebond {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
	30% { transform: translateY(-4px); opacity: 1; }
}

/* -- Suggestions -------------------------------------------------------- */

.cdp-ia__suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	padding: 0 1rem 0.6rem;
	background: var(--brume, #f5f7fa);
}

.cdp-ia__suggestions:empty { display: none; }

.cdp-ia__suggestion {
	padding: 0.45rem 0.75rem;
	border: 1px solid var(--filet-fort, rgba(37, 59, 90, 0.2));
	border-radius: 999px;
	background: #fff;
	color: var(--nuit, #253b5a);
	font: inherit;
	font-size: 0.8rem;
	line-height: 1.3;
	text-align: left;
	cursor: pointer;
	transition: border-color 180ms ease, color 180ms ease;
}

.cdp-ia__suggestion:hover { border-color: var(--or, #c9a25f); color: var(--or-fonce, #8e6c28); }

/* -- Saisie ------------------------------------------------------------- */

.cdp-ia__saisie {
	display: flex;
	align-items: flex-end;
	gap: 0.5rem;
	padding: 0.7rem;
	border-top: 1px solid var(--filet, rgba(37, 59, 90, 0.12));
	background: #fff;
}

.cdp-ia__label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.cdp-ia__saisie textarea {
	flex: 1;
	max-height: 110px;
	padding: 0.6rem 0.8rem;
	border: 1px solid var(--filet-fort, rgba(37, 59, 90, 0.2));
	border-radius: 12px;
	background: #fff;
	color: inherit;
	font: inherit;
	font-size: 0.9rem;
	line-height: 1.4;
	resize: none;
}

.cdp-ia__saisie textarea:focus {
	outline: 2px solid var(--or, #c9a25f);
	outline-offset: 1px;
	border-color: transparent;
}

.cdp-ia__saisie button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: var(--or, #c9a25f);
	color: #fff;
	cursor: pointer;
	transition: background 180ms ease, opacity 180ms ease;
}

.cdp-ia__saisie button:hover { background: var(--or-fonce, #8e6c28); }
.cdp-ia__saisie button[disabled] { opacity: 0.45; cursor: not-allowed; }

.cdp-ia__mention {
	margin: 0;
	padding: 0 1rem 0.8rem;
	background: #fff;
	color: var(--encre-douce, #7b8899);
	font-size: 0.7rem;
	line-height: 1.4;
}

.cdp-ia__mention a { color: var(--or-fonce, #8e6c28); }

/* -- Plein écran sur téléphone ------------------------------------------ */

@media (max-width: 640px) {
	.cdp-ia {
		right: 0;
		bottom: 0;
		width: 100vw;
		height: 100dvh;
		max-height: none;
		border: 0;
		border-radius: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cdp-ia { transition: none; }
	.cdp-ia__attente span { animation: none; }
	.cdp-ia__fil { scroll-behavior: auto; }
}
