/* Onlinesoft Chatbot — styles isolés du thème */

.osbot-root {
	--osbot-ink: #14171c;
	--osbot-red: #fa2626;
	--osbot-grey: #5c6470;
	--osbot-bg: #f4f5f7;
	--osbot-line: #e3e5ea;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--osbot-ink);
}

.osbot-root *,
.osbot-root *::before,
.osbot-root *::after {
	box-sizing: border-box;
}

/* --- Bouton d'ouverture --- */

.osbot-launcher {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--osbot-red);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 6px 24px rgba(20, 23, 28, 0.22);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.osbot-launcher:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(250, 38, 38, 0.32);
}

.osbot-launcher:focus-visible {
	outline: 3px solid var(--osbot-ink);
	outline-offset: 3px;
}

.osbot-launcher .osbot-icon-close { display: none; }
.osbot-root.is-open .osbot-launcher .osbot-icon-chat { display: none; }
.osbot-root.is-open .osbot-launcher .osbot-icon-close { display: block; }

/* --- Panneau --- */

.osbot-panel {
	position: absolute;
	right: 0;
	bottom: 74px;
	display: flex;
	flex-direction: column;
	width: 376px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 120px);
	overflow: hidden;
	border: 1px solid var(--osbot-line);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 18px 50px rgba(20, 23, 28, 0.2);
	animation: osbot-in 0.2s ease;
}

.osbot-panel[hidden] { display: none; }

@keyframes osbot-in {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.osbot-panel { animation: none; }
	.osbot-launcher { transition: none; }
}

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

.osbot-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px;
	background: var(--osbot-ink);
	color: #fff;
}

.osbot-brand {
	margin: 0;
	font-size: 17px;
	font-weight: 400;
	letter-spacing: -0.2px;
	color: #fff;
}

.osbot-brand strong { font-weight: 800; color: var(--osbot-red); }

.osbot-status {
	margin: 2px 0 0;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.6);
}

.osbot-close {
	display: flex;
	padding: 4px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: rgba(255, 255, 255, 0.7);
	cursor: pointer;
}

.osbot-close:hover { color: #fff; }
.osbot-close:focus-visible { outline: 2px solid var(--osbot-red); outline-offset: 2px; }

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

.osbot-log {
	flex: 1;
	overflow-y: auto;
	padding: 18px;
	background: var(--osbot-bg);
}

.osbot-msg {
	max-width: 84%;
	margin-bottom: 12px;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 14.5px;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.osbot-msg a { color: inherit; text-decoration: underline; }

.osbot-msg-bot {
	border-bottom-left-radius: 4px;
	background: #fff;
	border: 1px solid var(--osbot-line);
	color: var(--osbot-ink);
}

.osbot-msg-user {
	margin-left: auto;
	border-bottom-right-radius: 4px;
	background: var(--osbot-ink);
	color: #fff;
}

.osbot-msg-error {
	border-bottom-left-radius: 4px;
	background: #fff2f2;
	border: 1px solid #ffd0d0;
	color: #9c1414;
}

.osbot-msg-cta {
	display: inline-block;
	margin-top: 10px;
	padding: 9px 16px;
	border-radius: 8px;
	background: var(--osbot-red);
	color: #fff !important;
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: none !important;
}

.osbot-typing {
	display: flex;
	gap: 4px;
	width: fit-content;
	padding: 13px 14px;
}

.osbot-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--osbot-grey);
	animation: osbot-blink 1.2s infinite;
}

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

@keyframes osbot-blink {
	0%, 60%, 100% { opacity: 0.25; }
	30% { opacity: 1; }
}

/* --- Suggestions --- */

.osbot-quick {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px 18px 0;
	background: #fff;
}

.osbot-quick[hidden] { display: none; }

.osbot-quick button {
	padding: 7px 13px;
	border: 1px solid var(--osbot-line);
	border-radius: 999px;
	background: #fff;
	color: var(--osbot-grey);
	font-family: inherit;
	font-size: 13px;
	cursor: pointer;
}

.osbot-quick button:hover {
	border-color: var(--osbot-red);
	color: var(--osbot-red);
}

/* --- Saisie --- */

.osbot-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px 18px 8px;
	background: #fff;
}

.osbot-form textarea {
	flex: 1;
	max-height: 110px;
	padding: 10px 12px;
	border: 1px solid var(--osbot-line);
	border-radius: 10px;
	background: #fff;
	color: var(--osbot-ink);
	font-family: inherit;
	font-size: 14.5px;
	line-height: 1.4;
	resize: none;
}

.osbot-form textarea:focus {
	outline: none;
	border-color: var(--osbot-red);
}

.osbot-form button {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 10px;
	background: var(--osbot-red);
	color: #fff;
	cursor: pointer;
}

.osbot-form button:disabled { opacity: 0.4; cursor: default; }
.osbot-form button:focus-visible { outline: 2px solid var(--osbot-ink); outline-offset: 2px; }

.osbot-legal {
	margin: 0;
	padding: 0 18px 14px;
	background: #fff;
	font-size: 11.5px;
	line-height: 1.4;
	color: var(--osbot-grey);
}

.osbot-legal a { color: var(--osbot-red); text-decoration: none; font-weight: 600; }

.osbot-root .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* --- Mobile --- */

@media (max-width: 480px) {
	.osbot-root { right: 14px; bottom: 14px; }

	.osbot-panel {
		right: 0;
		bottom: 70px;
		width: calc(100vw - 28px);
		height: calc(100vh - 110px);
	}
}

/* --- Confirmation avant fermeture --- */

.osbot-confirm {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(20, 23, 28, 0.55);
}

.osbot-confirm[hidden] { display: none; }

.osbot-confirm-box {
	width: 100%;
	padding: 18px;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 12px 32px rgba(20, 23, 28, 0.24);
}

.osbot-confirm-title {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 700;
	color: var(--osbot-ink);
}

.osbot-confirm-text {
	margin: 0 0 16px;
	font-size: 13.5px;
	line-height: 1.45;
	color: var(--osbot-grey);
}

.osbot-confirm-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.osbot-confirm-actions button {
	width: 100%;
	padding: 10px 14px;
	border-radius: 8px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.osbot-confirm-cancel {
	border: 1px solid var(--osbot-line);
	background: #fff;
	color: var(--osbot-ink);
}

.osbot-confirm-cancel:hover { border-color: var(--osbot-ink); }

.osbot-confirm-ok {
	border: 0;
	background: var(--osbot-red);
	color: #fff;
}

.osbot-confirm-ok:hover { background: #d81f1f; }

.osbot-confirm-actions button:focus-visible {
	outline: 2px solid var(--osbot-ink);
	outline-offset: 2px;
}
