/* Adroit AI Chatbot widget.
 * Many WordPress themes style every <button> (background, colour, capitals, hover).
 * The rules below use !important on colours and text style so the chat looks the same on any theme. */

.adroit-cb,
.adroit-cb * {
	box-sizing: border-box;
}

.adroit-cb {
	--c: var(--adroit-cb-color, #0b5cab);
	--c-dark: color-mix(in srgb, var(--c) 62%, #04122b);
	--ink: #1b2430;
	--muted: #5f6b7a;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--ink);
	-webkit-font-smoothing: antialiased;
}

/* Same look for every button inside the chat, whatever the theme says. */
.adroit-cb button {
	font-family: inherit !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	text-shadow: none !important;
	min-height: 0 !important;
	margin: 0;
	-webkit-appearance: none;
	appearance: none;
}

/* ---------- Floating mode ---------- */
.adroit-cb--floating {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
}

.adroit-cb .adroit-cb__launcher {
	position: relative;
	width: 68px;
	height: 68px;
	border-radius: 50% !important;
	border: 3px solid #fff !important;
	overflow: visible;
	background: var(--c) !important;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 22px rgba(4, 18, 43, 0.35) !important;
	padding: 0 !important;
	transition: transform 0.18s ease;
}
.adroit-cb .adroit-cb__launcher::before {
	content: "";
	position: absolute;
	inset: -3px;
	border-radius: 50%;
	border: 2px solid var(--c);
	opacity: 0;
	animation: adroit-cb-ring 2.8s ease-out infinite;
	pointer-events: none;
}
.adroit-cb .adroit-cb__launcher::after {
	content: "";
	position: absolute;
	right: 1px;
	bottom: 3px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #22c55e;
	border: 2.5px solid #fff;
}
.adroit-cb .adroit-cb__launcher:hover { transform: scale(1.06); background: var(--c) !important; }
.adroit-cb .adroit-cb__launcher.is-hidden { display: none; }

@keyframes adroit-cb-ring {
	0% { transform: scale(1); opacity: 0.55; }
	70%, 100% { transform: scale(1.45); opacity: 0; }
}

/* ---------- Panel ---------- */
.adroit-cb__panel {
	display: none;
	flex-direction: column;
	background: #fff;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 18px 50px rgba(4, 18, 43, 0.32), 0 2px 8px rgba(4, 18, 43, 0.12);
}

.adroit-cb__panel.is-open {
	display: flex;
	animation: adroit-cb-open 0.22s ease-out;
}

@keyframes adroit-cb-open {
	from { opacity: 0; transform: translateY(14px) scale(0.98); }
	to { opacity: 1; transform: none; }
}

.adroit-cb--floating .adroit-cb__panel {
	width: 380px;
	max-width: calc(100vw - 24px);
	height: 560px;
	max-height: calc(100vh - 40px);
}

.adroit-cb--inline .adroit-cb__panel {
	width: 100%;
	max-width: 720px;
	height: 580px;
	margin: 0 auto;
	border: 1px solid #dfe5ee;
}

.adroit-cb__header {
	background: var(--c);
	background: linear-gradient(135deg, var(--c) 0%, var(--c-dark) 100%);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.adroit-cb__titlewrap { flex: 1; min-width: 0; }
.adroit-cb__title { font-weight: 700; font-size: 17px; line-height: 1.2; color: #fff; }
.adroit-cb__tagline { font-size: 12.5px; opacity: 0.92; line-height: 1.3; color: #fff; margin-top: 2px; }

/* ---------- Mr. Pal avatar ---------- */
.adroit-cb__avatar {
	flex: none;
	border-radius: 50%;
	object-fit: cover;
	background: #271c5e;
	display: block;
}
.adroit-cb__avatar--header {
	width: 46px;
	height: 46px;
	margin-right: 12px;
	border: 2px solid rgba(255, 255, 255, 0.85);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.adroit-cb__avatar--msg { width: 30px; height: 30px; }

.adroit-cb__row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	align-self: flex-start;
	max-width: 94%;
}
.adroit-cb__row .adroit-cb__msg { max-width: none; min-width: 0; }

.adroit-cb__launcher-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
}

.adroit-cb .adroit-cb__close {
	background: rgba(255, 255, 255, 0.16) !important;
	border: 0 !important;
	color: #fff !important;
	font-size: 22px;
	line-height: 1;
	width: 32px;
	height: 32px;
	border-radius: 50% !important;
	cursor: pointer;
	padding: 0 !important;
	box-shadow: none !important;
}
.adroit-cb .adroit-cb__close:hover { background: rgba(255, 255, 255, 0.3) !important; color: #fff !important; }

/* ---------- Messages ---------- */
.adroit-cb__messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px 14px;
	background: #f3f6fb;
	display: flex;
	flex-direction: column;
	gap: 11px;
	scroll-behavior: smooth;
}

.adroit-cb__msg {
	max-width: 86%;
	padding: 10px 14px;
	border-radius: 16px;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	font-size: 15px;
	line-height: 1.5;
	animation: adroit-cb-in 0.18s ease-out;
}

@keyframes adroit-cb-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

.adroit-cb__msg p { margin: 0 0 7px; }
.adroit-cb__msg p:last-child { margin-bottom: 0; }
.adroit-cb__msg a { color: var(--c) !important; font-weight: 600; text-decoration: underline; word-break: break-word; }
.adroit-cb__msg--user a { color: #fff !important; }
.adroit-cb__msg ul { margin: 4px 0 6px 18px; padding: 0; }
.adroit-cb__msg li { margin: 0 0 3px; }

.adroit-cb__msg--bot {
	align-self: flex-start;
	background: #fff;
	color: var(--ink);
	border-bottom-left-radius: 5px;
	box-shadow: 0 1px 3px rgba(4, 18, 43, 0.1);
}

.adroit-cb__msg--user {
	align-self: flex-end;
	background: var(--c);
	background: linear-gradient(135deg, var(--c) 0%, var(--c-dark) 100%);
	color: #fff;
	border-bottom-right-radius: 5px;
	box-shadow: 0 2px 6px rgba(4, 18, 43, 0.18);
}

.adroit-cb__msg.is-error {
	background: #fff4f4;
	color: #8a2024;
	box-shadow: inset 0 0 0 1px #f0b8bb;
}

.adroit-cb__typing { display: flex; gap: 5px; padding: 14px 16px; }
.adroit-cb__typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9aa6b6;
	animation: adroit-cb-bounce 1.2s infinite ease-in-out;
}
.adroit-cb__typing span:nth-child(2) { animation-delay: 0.15s; }
.adroit-cb__typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes adroit-cb-bounce {
	0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
	40% { transform: translateY(-5px); opacity: 1; }
}

/* ---------- Suggested questions ---------- */
.adroit-cb__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-self: flex-start;
	margin: 2px 0 2px 38px;
}
.adroit-cb .adroit-cb__chip {
	border: 1.5px solid var(--c) !important;
	background: #fff !important;
	color: var(--c) !important;
	border-radius: 20px !important;
	padding: 8px 14px !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	line-height: 1.25 !important;
	text-align: left;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(4, 18, 43, 0.08) !important;
	transition: background 0.15s, color 0.15s, transform 0.1s;
}
.adroit-cb .adroit-cb__chip:hover,
.adroit-cb .adroit-cb__chip:focus-visible {
	background: var(--c) !important;
	color: #fff !important;
	outline: none;
	transform: translateY(-1px);
}

/* ---------- Footer ---------- */
.adroit-cb__note {
	font-size: 11.5px;
	color: var(--muted);
	padding: 6px 14px;
	background: #f3f6fb;
	text-align: center;
}

.adroit-cb__form {
	display: flex;
	gap: 8px;
	padding: 10px 12px 12px;
	background: #fff;
	border-top: 1px solid #e6ebf2;
}

.adroit-cb .adroit-cb__input {
	flex: 1;
	min-width: 0;
	border: 1.5px solid #cfd8e3 !important;
	border-radius: 22px !important;
	padding: 10px 16px !important;
	font-size: 16px; /* 16px stops iOS zooming into the field */
	font-family: inherit;
	background: #fff !important;
	color: var(--ink) !important;
	box-shadow: none !important;
	height: auto !important;
	margin: 0;
}

.adroit-cb .adroit-cb__input:focus {
	outline: none;
	border-color: var(--c) !important;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent) !important;
}

.adroit-cb .adroit-cb__send {
	border: 0 !important;
	background: var(--c) !important;
	color: #fff !important;
	border-radius: 22px !important;
	padding: 0 20px !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	cursor: pointer;
	box-shadow: none !important;
	transition: filter 0.15s;
}
.adroit-cb .adroit-cb__send:hover,
.adroit-cb .adroit-cb__send:focus-visible { background: var(--c) !important; color: #fff !important; filter: brightness(1.12); outline: none; }

.adroit-cb__send:disabled,
.adroit-cb__input:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- Greeting bubble ---------- */
.adroit-cb__hook {
	position: absolute;
	right: 0;
	bottom: 82px;
	width: 262px;
	max-width: calc(100vw - 40px);
	background: #fff;
	border-radius: 16px 16px 4px 16px;
	box-shadow: 0 10px 28px rgba(4, 18, 43, 0.25);
	display: flex;
	align-items: flex-start;
	animation: adroit-cb-open 0.25s ease-out;
}
.adroit-cb .adroit-cb__hook-text {
	flex: 1;
	border: 0 !important;
	background: transparent !important;
	text-align: left;
	font-size: 14px !important;
	line-height: 1.4 !important;
	color: var(--ink) !important;
	padding: 12px 4px 12px 14px !important;
	cursor: pointer;
	box-shadow: none !important;
}
.adroit-cb .adroit-cb__hook-x {
	border: 0 !important;
	background: transparent !important;
	font-size: 20px !important;
	line-height: 1 !important;
	color: #7a8696 !important;
	padding: 6px 10px !important;
	cursor: pointer;
	box-shadow: none !important;
}

/* ---------- Phones: full-screen chat ---------- */
@media (max-width: 480px) {
	.adroit-cb--floating { right: 14px; bottom: 14px; }
	.adroit-cb--floating .adroit-cb__panel.is-open {
		position: fixed;
		inset: 0;
		width: 100%;
		max-width: none;
		height: 100%;
		max-height: none;
		border-radius: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.adroit-cb *, .adroit-cb *::before { animation: none !important; transition: none !important; }
}
