/* FDTC Chatbot widget. Colors follow the fdtc theme; --fdtc-chat-color is set from Settings. */
.fdtc-chat {
	--fdtc-chat-color: #283090;
	--fdtc-chat-ink: #1b1d3a;
	--fdtc-chat-muted: #4a4e6b;
	--fdtc-chat-line: #d9dcea;
	--fdtc-chat-panel: #eef0f8;
	font-family: "Fira Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--fdtc-chat-ink);
}

.fdtc-chat *,
.fdtc-chat *::before,
.fdtc-chat *::after {
	box-sizing: border-box;
}

.fdtc-chat-bubble {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99998;
	width: 64px;
	height: 64px;
	padding: 0;
	border: 3px solid #fff;
	border-radius: 50%;
	background: var(--fdtc-chat-color);
	box-shadow: 0 6px 20px rgba(27, 29, 58, 0.3);
	cursor: pointer;
	overflow: hidden;
	transition: transform 0.15s ease;
}

.fdtc-chat-bubble:hover {
	transform: scale(1.06);
}

.fdtc-chat-bubble:focus-visible,
.fdtc-chat button:focus-visible,
.fdtc-chat a:focus-visible,
.fdtc-chat input:focus-visible,
.fdtc-chat textarea:focus-visible {
	outline: 3px solid #e81820;
	outline-offset: 2px;
}

.fdtc-chat-bubble .fdtc-chat-avatar {
	width: 100%;
	height: 100%;
}

.fdtc-chat-avatar {
	display: block;
	width: 40px;
	height: 40px;
	flex: none;
	border-radius: 50%;
	object-fit: cover;
	background: #fff;
}

.fdtc-chat-avatar-blank {
	display: grid;
	place-items: center;
	font-size: 22px;
	background: transparent;
}

.fdtc-chat-panel {
	position: fixed;
	right: 20px;
	bottom: 96px;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	width: 380px;
	max-width: calc(100vw - 40px);
	height: 600px;
	max-height: calc(100vh - 120px);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 12px 40px rgba(27, 29, 58, 0.28);
	overflow: hidden;
}

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

.fdtc-chat-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 8px 10px 14px;
	background: var(--fdtc-chat-color);
	color: #fff;
}

.fdtc-chat-title {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
	line-height: 1.2;
}

.fdtc-chat-title strong {
	font-size: 16px;
}

.fdtc-chat-title span {
	font-size: 12px;
	opacity: 0.85;
}

.fdtc-chat-icon {
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #fff;
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
}

.fdtc-chat-icon:hover {
	background: rgba(255, 255, 255, 0.18);
}

.fdtc-chat-log {
	flex: 1;
	padding: 14px;
	overflow-y: auto;
	background: #fffdfa;
}

.fdtc-chat-msg {
	max-width: 88%;
	margin: 0 0 10px;
}

.fdtc-chat-text {
	padding: 9px 12px;
	border-radius: 14px;
	overflow-wrap: anywhere;
}

.fdtc-chat-text p,
.fdtc-chat-text ul,
.fdtc-chat-text ol {
	margin: 0 0 0.5em;
}

.fdtc-chat-text > :last-child {
	margin-bottom: 0;
}

.fdtc-chat-text ul,
.fdtc-chat-text ol {
	padding-left: 1.3em;
}

.fdtc-chat-text a {
	color: var(--fdtc-chat-color);
	font-weight: 600;
	text-decoration: underline;
}

.fdtc-chat-bot .fdtc-chat-text {
	border-bottom-left-radius: 4px;
	background: var(--fdtc-chat-panel);
}

.fdtc-chat-bot.is-error .fdtc-chat-text {
	background: #fdecec;
}

.fdtc-chat-user {
	margin-left: auto;
}

.fdtc-chat-user .fdtc-chat-text {
	border-bottom-right-radius: 4px;
	background: var(--fdtc-chat-color);
	color: #fff;
	white-space: pre-wrap;
}

.fdtc-chat-rate {
	display: flex;
	gap: 2px;
	margin-top: 2px;
}

.fdtc-chat-rate button {
	display: grid;
	place-items: center;
	width: 28px;
	height: 26px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #8a8ea8;
	cursor: pointer;
}

.fdtc-chat-rate .fdtc-chat-down svg {
	transform: scaleY(-1);
}

.fdtc-chat-rate button:hover {
	color: var(--fdtc-chat-ink);
}

.fdtc-chat-rate button[aria-pressed="true"] {
	background: var(--fdtc-chat-panel);
	color: var(--fdtc-chat-color);
}

.fdtc-chat-typing {
	display: flex;
	gap: 5px;
	width: 62px;
	padding: 13px 14px;
	border-radius: 14px;
	background: var(--fdtc-chat-panel);
}

.fdtc-chat-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--fdtc-chat-muted);
	animation: fdtc-chat-dot 1.2s infinite ease-in-out;
}

.fdtc-chat-typing span:nth-child(2) {
	animation-delay: 0.2s;
}

.fdtc-chat-typing span:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes fdtc-chat-dot {
	0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
	40% { opacity: 1; transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
	.fdtc-chat-typing span { animation: none; }
	.fdtc-chat-bubble { transition: none; }
}

.fdtc-chat-presets {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 8px 14px 0;
	background: #fffdfa;
}

.fdtc-chat-presets[hidden] {
	display: none;
}

.fdtc-chat-chip {
	padding: 6px 12px;
	border: 1.5px solid var(--fdtc-chat-color);
	border-radius: 999px;
	background: #fff;
	color: var(--fdtc-chat-color);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.fdtc-chat-chip:hover {
	background: var(--fdtc-chat-color);
	color: #fff;
}

.fdtc-chat-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid var(--fdtc-chat-line);
	background: #fff;
}

.fdtc-chat-input {
	flex: 1;
	min-height: 40px;
	max-height: 120px;
	padding: 9px 12px;
	border: 1.5px solid var(--fdtc-chat-line);
	border-radius: 12px;
	font: inherit;
	resize: none;
	color: inherit;
	background: #fff;
}

.fdtc-chat-send {
	width: 40px;
	height: 40px;
	flex: none;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--fdtc-chat-color);
	color: #fff;
	font-size: 16px;
	cursor: pointer;
}

.fdtc-chat-send:disabled {
	opacity: 0.5;
	cursor: default;
}

.fdtc-chat-note {
	margin: 0;
	padding: 0 12px 8px;
	background: #fff;
	color: var(--fdtc-chat-muted);
	font-size: 11px;
	line-height: 1.3;
}

.fdtc-chat-contact {
	max-width: 100%;
	padding: 12px;
	border: 1.5px solid var(--fdtc-chat-line);
	border-radius: 14px;
	background: #fff;
}

.fdtc-chat-contact p {
	margin: 0 0 8px;
}

.fdtc-chat-contact.is-sent {
	padding: 0;
	border: 0;
}

.fdtc-chat-contact-title {
	font-weight: 700;
}

.fdtc-chat-contact label {
	display: block;
	font-size: 13px;
	font-weight: 600;
}

.fdtc-chat-contact input,
.fdtc-chat-contact textarea {
	width: 100%;
	padding: 7px 9px;
	border: 1.5px solid var(--fdtc-chat-line);
	border-radius: 8px;
	font: inherit;
	color: inherit;
	background: #fff;
}

.fdtc-chat-hp {
	position: absolute !important;
	left: -9999px;
}

.fdtc-chat-status {
	color: var(--fdtc-chat-muted);
	font-size: 13px;
}

.fdtc-chat-status:empty {
	display: none;
}

.fdtc-chat-contact-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.fdtc-chat-primary {
	padding: 8px 14px;
	border: 0;
	border-radius: 8px;
	background: var(--fdtc-chat-color);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.fdtc-chat-primary:disabled {
	opacity: 0.6;
}

.fdtc-chat-link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--fdtc-chat-muted);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

@media (max-width: 640px) {
	.fdtc-chat-panel {
		inset: 0;
		width: 100%;
		max-width: none;
		height: 100%;
		max-height: none;
		border-radius: 0;
	}

	.fdtc-chat-bubble.is-open {
		display: none;
	}

	.fdtc-chat-input {
		font-size: 16px; /* Stops iOS zooming in on focus. */
	}
}

/* One-tap questions under a page greeting. */
.fdtc-chat-topic {
	padding: 8px 0 0;
	background: transparent;
}
