/* Website Chat Assistant 2.1.0 — slate navy theme (#263945) */

#wca-chat-root {
	--wca-primary: #263945;
	--wca-secondary: #1A2A33;
	--wca-soft: #EEF2F5;
	--wca-text: #1D2B34;
	--wca-muted: #5E7180;
	--wca-border: #DDE4EA;
	--wca-shadow: 38, 57, 69;
}

#wca-chat-root,
#wca-chat-root * {
	box-sizing: border-box;
}

#wca-chat-root svg {
	display: block;
}

/* ---------- Launcher + greeting ---------- */

.wca-launch {
	position: fixed;
	right: var(--wca-right, 20px);
	bottom: var(--wca-bottom, 96px);
	z-index: 999999;
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: calc(100vw - 32px);
}

.wca-greeting {
	display: flex;
	align-items: center;
	gap: 9px;
	background: #fff;
	color: var(--wca-primary);
	border: 1px solid var(--wca-border);
	border-radius: 18px 18px 4px 18px;
	padding: 6px 14px 6px 6px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	box-shadow: 0 8px 24px rgba(var(--wca-shadow), 0.16);
	max-width: calc(100vw - 130px);
	animation: wca-greet-in 0.5s ease 0.6s both;
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.wca-greet-avatar {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: linear-gradient(145deg, #3A5566 0%, var(--wca-primary) 55%, var(--wca-secondary) 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.wca-greet-avatar svg {
	width: 26px;
	height: 26px;
	animation: wca-float 3s ease-in-out infinite;
}

.wca-greet-text {
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wca-launch.wca-is-open .wca-greeting {
	opacity: 0;
	visibility: hidden;
	transform: translateX(8px);
	animation: none;
}

.wca-bubble {
	position: relative;
	width: 62px;
	height: 62px;
	min-width: 62px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.9);
	padding: 0;
	background: linear-gradient(145deg, #3A5566 0%, var(--wca-primary) 50%, var(--wca-secondary) 100%);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 26px rgba(var(--wca-shadow), 0.42), 0 0 0 4px rgba(var(--wca-shadow), 0.12);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wca-bubble::after {
	content: "";
	position: absolute;
	inset: -2px;
	border-radius: 50%;
	border: 2px solid rgba(var(--wca-shadow), 0.45);
	animation: wca-pulse 2.6s ease-out infinite;
	pointer-events: none;
}

.wca-bubble:hover {
	transform: translateY(-2px) scale(1.03);
	box-shadow: 0 14px 30px rgba(var(--wca-shadow), 0.5), 0 0 0 5px rgba(var(--wca-shadow), 0.14);
}

.wca-bubble .wca-bubble-robot {
	width: 40px;
	height: 40px;
}

.wca-online {
	position: absolute;
	right: 2px;
	bottom: 3px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #4DA3FF;
	border: 2px solid #fff;
}

.wca-launch.wca-is-open .wca-bubble::after {
	animation: none;
	opacity: 0;
}

.wca-eye {
	animation: wca-blink 4.5s infinite;
	transform-box: fill-box;
	transform-origin: center;
}

@keyframes wca-greet-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes wca-float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-1.5px); }
}

@keyframes wca-pulse {
	0% { transform: scale(1); opacity: 0.8; }
	100% { transform: scale(1.35); opacity: 0; }
}

@keyframes wca-blink {
	0%, 92%, 100% { transform: scaleY(1); }
	95% { transform: scaleY(0.15); }
}

/* ---------- Chat window ---------- */

.wca-window {
	position: fixed;
	right: var(--wca-right, 20px);
	bottom: calc(var(--wca-bottom, 96px) + 78px);
	width: 370px;
	max-width: calc(100vw - 32px);
	height: min(600px, calc(100vh - var(--wca-bottom, 96px) - 104px));
	min-height: 360px;
	background: #fff;
	border: 1px solid var(--wca-border);
	border-radius: 18px;
	box-shadow: 0 18px 48px rgba(var(--wca-shadow), 0.28);
	display: none;
	flex-direction: column;
	overflow: hidden;
	z-index: 999999;
	font-family: inherit;
}

.wca-window.wca-open {
	display: flex;
	animation: wca-greet-in 0.22s ease both;
}

/* Header */
.wca-header {
	background: linear-gradient(135deg, #34505F 0%, var(--wca-primary) 45%, var(--wca-secondary) 100%);
	color: #fff;
	padding: 14px 14px 14px 16px;
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
}

.wca-header-icon {
	position: relative;
	width: 42px;
	height: 42px;
	min-width: 42px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
	display: flex;
	align-items: center;
	justify-content: center;
}

.wca-header-icon svg {
	width: 32px;
	height: 32px;
}

.wca-header-icon .wca-online {
	right: -1px;
	bottom: 0;
	width: 11px;
	height: 11px;
	border-color: var(--wca-primary);
}

.wca-header-text {
	flex: 1 1 auto;
	min-width: 0;
}

.wca-header-title {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.25;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wca-header-sub {
	font-size: 12px;
	line-height: 1.35;
	opacity: 0.8;
	margin-top: 2px;
}

.wca-close {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.wca-close:hover {
	background: rgba(255, 255, 255, 0.14);
}

/* Messages */
.wca-messages {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #F7F9FB;
}

.wca-bot-row {
	align-self: flex-start;
	display: flex;
	align-items: flex-end;
	gap: 7px;
	max-width: 92%;
}

.wca-bot-avatar {
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: linear-gradient(145deg, #3A5566 0%, var(--wca-primary) 55%, var(--wca-secondary) 100%);
	display: flex;
	align-items: center;
	justify-content: center;
}

.wca-bot-avatar svg {
	width: 22px;
	height: 22px;
}

.wca-msg {
	max-width: 88%;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--wca-text);
	overflow-wrap: anywhere;
	word-wrap: break-word;
}

.wca-bot-row .wca-msg {
	max-width: 100%;
}

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

.wca-msg-user {
	align-self: flex-end;
	background: var(--wca-primary);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.wca-msg-bot a {
	color: var(--wca-primary);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.wca-msg-bot a:hover {
	color: var(--wca-secondary);
}

.wca-msg-bot a:focus-visible {
	outline: 2px solid var(--wca-primary);
	outline-offset: 2px;
}

.wca-msg-typing {
	display: flex;
	gap: 4px;
	padding: 11px 13px;
	background: #fff;
	border: 1px solid var(--wca-border);
	border-radius: 14px;
	border-bottom-left-radius: 4px;
}

.wca-msg-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--wca-primary);
	opacity: 0.3;
	animation: wca-bounce 1.2s infinite ease-in-out;
}

.wca-msg-typing span:nth-child(2) {
	animation-delay: 0.15s;
}

.wca-msg-typing span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes wca-bounce {
	0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
	40% { opacity: 1; transform: translateY(-3px); }
}

/* Quick service buttons (above the input) — short and compact */
.wca-quick {
	flex: 0 0 auto;
	padding: 8px 10px;
	border-top: 1px solid var(--wca-border);
	background: #fff;
}

.wca-quick-label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wca-muted);
	margin: 0 2px 6px;
}

.wca-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 5px;
}

.wca-service-btn {
	display: flex;
	align-items: center;
	gap: 4px;
	min-width: 0;
	min-height: 28px;
	padding: 4px 6px;
	background: var(--wca-soft);
	border: 1px solid transparent;
	border-radius: 8px;
	color: var(--wca-primary);
	font-family: inherit;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.15;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.wca-service-btn:hover {
	background: var(--wca-primary);
	border-color: var(--wca-primary);
	color: #fff;
}

.wca-service-btn:hover .wca-service-icon {
	color: #fff;
}

.wca-service-btn:active {
	background: var(--wca-secondary);
}

.wca-service-btn:focus-visible,
.wca-bubble:focus-visible,
.wca-close:focus-visible,
.wca-send:focus-visible {
	outline: 3px solid #7FA8C4;
	outline-offset: 2px;
}

.wca-service-icon {
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	color: var(--wca-primary);
	display: flex;
	align-items: center;
	justify-content: center;
}

.wca-service-icon svg {
	width: 14px;
	height: 14px;
}

.wca-service-name {
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Input row */
.wca-input-row {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid var(--wca-border);
	background: #fff;
}

.wca-input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 10px 14px;
	border: 1px solid #CFD9E0;
	border-radius: 24px;
	font-family: inherit;
	font-size: 14px;
	color: var(--wca-text);
	background: #fff;
}

.wca-input:focus {
	outline: none;
	border-color: var(--wca-primary);
	box-shadow: 0 0 0 3px rgba(var(--wca-shadow), 0.14);
}

.wca-send {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 50%;
	background: var(--wca-primary);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background 0.2s ease;
}

.wca-send:hover {
	background: var(--wca-secondary);
}

.wca-send:disabled {
	opacity: 0.55;
	cursor: default;
}

.wca-send svg {
	width: 18px;
	height: 18px;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.wca-greeting,
	.wca-greet-avatar svg,
	.wca-bubble::after,
	.wca-eye,
	.wca-window.wca-open {
		animation: none !important;
	}
}

/* ---------- Phones ---------- */

@media (max-width: 480px) {
	.wca-launch {
		right: max(16px, var(--wca-right, 20px));
	}

	.wca-bubble {
		width: 58px;
		height: 58px;
		min-width: 58px;
	}

	.wca-bubble .wca-bubble-robot {
		width: 36px;
		height: 36px;
	}

	.wca-window {
		left: 16px;
		right: 16px;
		width: auto;
		max-width: none;
		bottom: calc(var(--wca-bottom, 96px) + 74px);
		height: calc(100vh - var(--wca-bottom, 96px) - 100px);
		min-height: 320px;
	}

	.wca-input {
		font-size: 16px; /* prevents iOS zoom on focus */
	}
}

/* ---------- Theme-proofing (2.1.1) ----------
 * The site theme styles every <button> (gradient, square corners, large
 * text). These rules reset that inside the widget only, and use #183F4C
 * for the launcher, quick buttons, close and send buttons. */

#wca-chat-root {
	--wca-btn: #183F4C;
	--wca-btn-hover: #12313B;
}

#wca-chat-root button {
	margin: 0 !important;
	background-image: none !important;
	text-shadow: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	text-decoration: none !important;
	box-sizing: border-box !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}

/* Launcher */
#wca-chat-root button.wca-bubble {
	width: 62px !important;
	height: 62px !important;
	min-width: 62px !important;
	min-height: 0 !important;
	padding: 0 !important;
	border-radius: 50% !important;
	border: 2px solid rgba(255, 255, 255, 0.9) !important;
	background: var(--wca-btn) !important;
	background-image: linear-gradient(145deg, #23596B 0%, #183F4C 55%, #12313B 100%) !important;
	box-shadow: 0 10px 26px rgba(24, 63, 76, 0.42), 0 0 0 4px rgba(24, 63, 76, 0.12) !important;
	line-height: 1 !important;
}

#wca-chat-root button.wca-bubble::after {
	border-color: rgba(24, 63, 76, 0.45);
}

/* Close (×) */
#wca-chat-root button.wca-close {
	width: 32px !important;
	height: 32px !important;
	min-width: 32px !important;
	min-height: 0 !important;
	padding: 0 !important;
	border: 1px solid rgba(255, 255, 255, 0.22) !important;
	border-radius: 50% !important;
	background: var(--wca-btn) !important;
	color: #fff !important;
	font-size: 20px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	box-shadow: none !important;
}

#wca-chat-root button.wca-close:hover {
	background: var(--wca-btn-hover) !important;
}

/* Quick buttons */
#wca-chat-root button.wca-service-btn {
	display: flex !important;
	align-items: center !important;
	justify-content: flex-start !important;
	gap: 4px !important;
	width: 100% !important;
	min-width: 0 !important;
	height: auto !important;
	min-height: 28px !important;
	padding: 4px 7px !important;
	border: 1px solid var(--wca-btn) !important;
	border-radius: 8px !important;
	background: var(--wca-btn) !important;
	color: #fff !important;
	font-size: 11px !important;
	font-weight: 600 !important;
	line-height: 1.15 !important;
	text-align: left !important;
	box-shadow: none !important;
}

#wca-chat-root button.wca-service-btn:hover {
	background: var(--wca-btn-hover) !important;
	border-color: var(--wca-btn-hover) !important;
}

#wca-chat-root button.wca-service-btn .wca-service-icon,
#wca-chat-root button.wca-service-btn:hover .wca-service-icon {
	color: #fff !important;
	width: 13px !important;
	height: 13px !important;
	margin: 0 !important;
}

#wca-chat-root button.wca-service-btn .wca-service-icon svg {
	width: 13px !important;
	height: 13px !important;
}

#wca-chat-root button.wca-service-btn .wca-service-name {
	font-size: 11px !important;
	line-height: 1.15 !important;
	color: inherit !important;
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
}

/* Send */
#wca-chat-root button.wca-send {
	width: 42px !important;
	height: 42px !important;
	min-width: 42px !important;
	min-height: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--wca-btn) !important;
	color: #fff !important;
	box-shadow: none !important;
}

#wca-chat-root button.wca-send:hover {
	background: var(--wca-btn-hover) !important;
}

/* Input (theme also styles text fields) */
#wca-chat-root input.wca-input {
	height: auto !important;
	margin: 0 !important;
	padding: 10px 14px !important;
	border: 1px solid #CFD9E0 !important;
	border-radius: 24px !important;
	background: #fff !important;
	box-shadow: none !important;
	font-size: 14px !important;
	line-height: 1.3 !important;
}

#wca-chat-root input.wca-input:focus {
	border-color: var(--wca-btn) !important;
	box-shadow: 0 0 0 3px rgba(24, 63, 76, 0.14) !important;
}

@media (max-width: 480px) {
	#wca-chat-root button.wca-bubble {
		width: 58px !important;
		height: 58px !important;
		min-width: 58px !important;
	}

	#wca-chat-root input.wca-input {
		font-size: 16px !important;
	}
}

/* ---------- Centre icons inside round buttons (2.1.2) ---------- */
#wca-chat-root button.wca-bubble,
#wca-chat-root button.wca-send,
#wca-chat-root button.wca-close {
	position: relative !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	text-align: center !important;
	gap: 0 !important;
}

#wca-chat-root button.wca-bubble svg,
#wca-chat-root button.wca-send svg {
	flex: 0 0 auto !important;
	display: block !important;
	margin: 0 auto !important;
	padding: 0 !important;
	float: none !important;
	max-width: none !important;
	position: static !important;
}

#wca-chat-root button.wca-bubble svg.wca-bubble-robot {
	width: 40px !important;
	height: 40px !important;
}

#wca-chat-root button.wca-send svg {
	width: 18px !important;
	height: 18px !important;
	transform: translateX(1px);
}

#wca-chat-root button.wca-bubble .wca-online {
	position: absolute !important;
	right: 2px !important;
	bottom: 3px !important;
	margin: 0 !important;
}

#wca-chat-root .wca-header-icon,
#wca-chat-root .wca-bot-avatar,
#wca-chat-root .wca-greet-avatar {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
}

#wca-chat-root .wca-header-icon svg,
#wca-chat-root .wca-bot-avatar svg,
#wca-chat-root .wca-greet-avatar svg {
	margin: 0 auto !important;
	max-width: none !important;
	float: none !important;
}

@media (max-width: 480px) {
	#wca-chat-root button.wca-bubble svg.wca-bubble-robot {
		width: 36px !important;
		height: 36px !important;
	}
}
