/* Novanta AI Assistant – chat widget */

#novanta-root {
	--nv-primary: #e2541c;
	--nv-on-primary: #ffffff;
	--nv-header-start: #7a0f0f;
	--nv-header-end: #c8381e;
	--nv-ink: #1c1d22;
	--nv-muted: #6b6f7b;
	--nv-line: #e6e7ec;
	--nv-surface: #ffffff;
	--nv-canvas: #f6f7f9;
	--nv-online: #22c55e;
	--nv-radius: 20px;
	--nv-shadow: 0 24px 60px -12px rgba(17, 18, 24, 0.28), 0 8px 20px -8px rgba(17, 18, 24, 0.18);
	--nv-primary-soft: rgba(226, 84, 28, 0.12);
	--nv-primary-glow: rgba(226, 84, 28, 0.38);

	position: fixed;
	bottom: 24px;
	z-index: 2147483000;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--nv-ink);
	-webkit-font-smoothing: antialiased;
}

@supports (color: color-mix(in srgb, red 50%, transparent)) {
	#novanta-root {
		--nv-primary-soft: color-mix(in srgb, var(--nv-primary) 12%, transparent);
		--nv-primary-glow: color-mix(in srgb, var(--nv-primary) 40%, transparent);
	}
}

#novanta-root.novanta-pos-right { right: 24px; }
#novanta-root.novanta-pos-left { left: 24px; }

#novanta-root *,
#novanta-root *::before,
#novanta-root *::after {
	box-sizing: border-box;
}

#novanta-root button,
#novanta-root input,
#novanta-root textarea {
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	margin: 0;
}

#novanta-root [hidden] {
	display: none !important;
}

/* ---------- Launcher ---------- */

#novanta-root .novanta-launcher {
	position: relative;
	display: grid;
	place-items: center;
	width: 62px;
	height: 62px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--nv-primary);
	color: var(--nv-on-primary);
	cursor: pointer;
	box-shadow: 0 12px 28px -6px var(--nv-primary-glow), 0 4px 10px rgba(0, 0, 0, 0.12);
	transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

#novanta-root .novanta-launcher::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	box-shadow: 0 0 0 0 var(--nv-primary-glow);
	animation: novanta-pulse 2.6s ease-out 1.5s 3;
}

#novanta-root .novanta-launcher:hover {
	transform: scale(1.07);
	box-shadow: 0 16px 34px -6px var(--nv-primary-glow), 0 6px 14px rgba(0, 0, 0, 0.14);
}

#novanta-root .novanta-launcher:focus-visible {
	outline: 3px solid var(--nv-primary-glow);
	outline-offset: 3px;
}

#novanta-root .novanta-launcher svg {
	position: absolute;
	transition: transform 0.3s ease, opacity 0.2s ease;
}

#novanta-root .novanta-icon-close {
	opacity: 0;
	transform: rotate(-90deg) scale(0.6);
}

#novanta-root.novanta-open .novanta-icon-chat {
	opacity: 0;
	transform: rotate(90deg) scale(0.6);
}

#novanta-root.novanta-open .novanta-icon-close {
	opacity: 1;
	transform: none;
}

#novanta-root.novanta-open .novanta-launcher::after {
	animation: none;
}

/* ---------- Greeting pop-up ---------- */

#novanta-root .novanta-teaser {
	position: absolute;
	bottom: 80px;
	display: flex;
	align-items: center;
	gap: 12px;
	width: max-content;
	max-width: min(320px, calc(100vw - 48px));
	padding: 14px 40px 14px 14px;
	border-radius: 18px;
	background: var(--nv-surface);
	box-shadow: var(--nv-shadow);
	cursor: pointer;
	animation: novanta-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#novanta-root.novanta-pos-right .novanta-teaser { right: 0; }
#novanta-root.novanta-pos-left .novanta-teaser { left: 0; }

/* Tail pointing at the chat button */
#novanta-root .novanta-teaser::after {
	content: "";
	position: absolute;
	bottom: -7px;
	width: 16px;
	height: 16px;
	background: var(--nv-surface);
	border-radius: 0 0 4px 0;
	transform: rotate(45deg);
	box-shadow: 4px 4px 8px -4px rgba(17, 18, 24, 0.12);
}

#novanta-root.novanta-pos-right .novanta-teaser::after { right: 23px; }
#novanta-root.novanta-pos-left .novanta-teaser::after { left: 23px; }

#novanta-root .novanta-teaser:hover {
	transform: translateY(-2px);
	transition: transform 0.2s ease;
}

#novanta-root .novanta-teaser-text {
	font-size: 15px;
	font-weight: 500;
	color: var(--nv-ink);
}

#novanta-root .novanta-teaser-close {
	position: absolute;
	top: 8px;
	right: 8px;
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--nv-muted);
	font-size: 13px;
	cursor: pointer;
}

#novanta-root .novanta-teaser-close:hover {
	background: var(--nv-canvas);
	color: var(--nv-ink);
}

/* ---------- Avatars ---------- */

#novanta-root .novanta-avatar {
	display: block;
	flex: none;
	border-radius: 50%;
	object-fit: cover;
	background: var(--nv-primary-soft);
}

#novanta-root .novanta-avatar-initial {
	display: grid;
	place-items: center;
	font-weight: 700;
	color: var(--nv-primary);
}

#novanta-root .novanta-avatar-sm { width: 30px; height: 30px; font-size: 13px; }
#novanta-root .novanta-avatar-md { width: 42px; height: 42px; font-size: 16px; }

#novanta-root .novanta-avatar-lg {
	width: 46px;
	height: 46px;
	font-size: 18px;
	border: 2px solid rgba(255, 255, 255, 0.9);
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
}

/* ---------- Panel ---------- */

#novanta-root .novanta-panel {
	position: absolute;
	bottom: 80px;
	display: flex;
	flex-direction: column;
	width: 380px;
	height: min(640px, calc(100vh - 120px));
	border-radius: var(--nv-radius);
	background: var(--nv-surface);
	box-shadow: var(--nv-shadow);
	overflow: hidden;
	animation: novanta-open 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#novanta-root.novanta-pos-right .novanta-panel { right: 0; transform-origin: bottom right; }
#novanta-root.novanta-pos-left .novanta-panel { left: 0; transform-origin: bottom left; }

/* Header */
#novanta-root .novanta-header {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 18px 14px 18px 18px;
	background:
		radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 55%),
		linear-gradient(120deg, var(--nv-header-start), var(--nv-header-end));
	color: #fff;
}

#novanta-root .novanta-header .novanta-avatar-lg {
	position: relative;
}

/* Online dot on the header avatar */
#novanta-root .novanta-header::before {
	content: "";
	position: absolute;
	left: 54px;
	top: 52px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--nv-online);
	border: 2px solid var(--nv-header-start);
	z-index: 1;
}

#novanta-root .novanta-header-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1;
}

#novanta-root .novanta-header-text strong {
	font-size: 16px;
	font-weight: 650;
	line-height: 1.25;
}

#novanta-root .novanta-status {
	margin-top: 2px;
	font-size: 12.5px;
	opacity: 0.85;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#novanta-root .novanta-icon-btn {
	display: grid;
	place-items: center;
	flex: none;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: background 0.15s ease;
}

#novanta-root .novanta-header .novanta-icon-btn:hover {
	background: rgba(255, 255, 255, 0.16);
}

/* Messages */
#novanta-root .novanta-messages {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 20px 16px 12px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--nv-canvas);
	scroll-behavior: smooth;
}

#novanta-root .novanta-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	animation: novanta-msg-in 0.28s ease both;
}

#novanta-root .novanta-row-user {
	justify-content: flex-end;
}

#novanta-root .novanta-msg {
	max-width: 80%;
	padding: 10px 14px 6px;
	border-radius: 18px;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

#novanta-root .novanta-msg-bot {
	background: var(--nv-surface);
	border: 1px solid var(--nv-line);
	border-bottom-left-radius: 6px;
	box-shadow: 0 1px 2px rgba(17, 18, 24, 0.04);
}

#novanta-root .novanta-msg-user {
	background: var(--nv-primary);
	color: var(--nv-on-primary);
	border-bottom-right-radius: 6px;
}

#novanta-root .novanta-msg-body p { margin: 0 0 6px; }
#novanta-root .novanta-msg-body p:last-child { margin-bottom: 0; }
#novanta-root .novanta-msg-body ul { margin: 2px 0 6px; padding-left: 18px; }
#novanta-root .novanta-msg-body li { margin: 2px 0; }
#novanta-root .novanta-msg-body a { color: inherit; text-decoration: underline; }

#novanta-root .novanta-time {
	display: block;
	margin-top: 3px;
	font-size: 11px;
	text-align: right;
	color: var(--nv-muted);
}

#novanta-root .novanta-msg-user .novanta-time {
	color: inherit;
	opacity: 0.75;
}

/* Typing indicator */
#novanta-root .novanta-typing {
	display: flex;
	gap: 4px;
	padding: 14px 16px;
}

#novanta-root .novanta-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #b5b8c2;
	animation: novanta-bounce 1.2s infinite ease-in-out;
}

#novanta-root .novanta-typing span:nth-child(2) { animation-delay: 0.15s; }
#novanta-root .novanta-typing span:nth-child(3) { animation-delay: 0.3s; }

/* Action buttons (booking, contact form) */
#novanta-root .novanta-action {
	align-self: flex-start;
	margin-left: 38px;
	padding: 10px 18px;
	border: 1.5px solid var(--nv-primary);
	border-radius: 999px;
	background: var(--nv-surface);
	color: var(--nv-primary);
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	animation: novanta-msg-in 0.28s ease both;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

#novanta-root .novanta-action:hover:not(:disabled) {
	transform: translateY(-1px);
	background: var(--nv-primary-soft);
}

#novanta-root .novanta-action:disabled {
	opacity: 0.5;
	cursor: default;
}

#novanta-root .novanta-action {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

#novanta-root .novanta-action-icon {
	display: inline-flex;
}

#novanta-root .novanta-action-primary {
	background: var(--nv-primary);
	color: var(--nv-on-primary);
	box-shadow: 0 8px 18px -8px var(--nv-primary-glow);
}

#novanta-root .novanta-action-primary:hover:not(:disabled) {
	background: var(--nv-primary);
	box-shadow: 0 10px 22px -8px var(--nv-primary-glow);
}

/* Quick replies */
#novanta-root .novanta-quick {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 4px 16px 12px;
	background: var(--nv-canvas);
}

#novanta-root .novanta-chip {
	padding: 7px 14px;
	border: 1px solid var(--nv-line);
	border-radius: 999px;
	background: var(--nv-surface);
	color: var(--nv-ink);
	font-size: 13.5px;
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

#novanta-root .novanta-chip:hover {
	border-color: var(--nv-primary);
	color: var(--nv-primary);
	background: var(--nv-primary-soft);
}

/* Composer */
#novanta-root .novanta-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px 12px 10px;
	border-top: 1px solid var(--nv-line);
	background: var(--nv-surface);
}

#novanta-root .novanta-input {
	flex: 1;
	min-height: 44px;
	max-height: 96px;
	padding: 11px 16px;
	border: 1px solid var(--nv-line);
	border-radius: 22px;
	background: var(--nv-canvas);
	color: var(--nv-ink);
	font-size: 15px;
	line-height: 1.4;
	resize: none;
	overflow-y: hidden;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

#novanta-root .novanta-input:focus {
	border-color: var(--nv-primary);
	background: var(--nv-surface);
	box-shadow: 0 0 0 3px var(--nv-primary-soft);
}

#novanta-root .novanta-send {
	display: grid;
	place-items: center;
	flex: none;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--nv-primary);
	color: var(--nv-on-primary);
	font-size: 17px;
	cursor: pointer;
	transition: transform 0.15s ease, opacity 0.15s ease;
}

#novanta-root .novanta-send:hover:not(:disabled) { transform: scale(1.06); }
#novanta-root .novanta-send:disabled { opacity: 0.5; cursor: default; }

/* Footer */
#novanta-root .novanta-powered {
	padding: 0 12px 10px;
	background: var(--nv-surface);
	font-size: 12px;
	text-align: center;
	color: var(--nv-muted);
}

#novanta-root .novanta-powered-brand {
	font-weight: 650;
	color: var(--nv-primary);
}

/* ---------- Contact form ---------- */

#novanta-root .novanta-lead {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-left: 38px;
	animation: novanta-msg-in 0.28s ease both;
}

#novanta-root .novanta-lead-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px;
	border: 1px solid var(--nv-line);
	border-radius: 16px;
	background: var(--nv-surface);
	box-shadow: 0 1px 2px rgba(17, 18, 24, 0.04);
}

#novanta-root .novanta-lead input,
#novanta-root .novanta-lead textarea {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid #d9dbe2;
	border-radius: 12px;
	background: var(--nv-surface);
	color: var(--nv-ink);
	font-size: 15px;
	outline: none;
	resize: vertical;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#novanta-root .novanta-lead input:focus,
#novanta-root .novanta-lead textarea:focus {
	border-color: var(--nv-primary);
	box-shadow: 0 0 0 3px var(--nv-primary-soft);
}

/* Composer waits for the contact form */
#novanta-root .novanta-form-locked .novanta-input { cursor: not-allowed; opacity: 0.7; }

#novanta-root .novanta-lead .novanta-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
}

#novanta-root .novanta-consent {
	padding: 10px 12px;
	border-radius: 12px;
	background: #eef0f4;
	font-size: 12px;
	line-height: 1.5;
	color: var(--nv-muted);
}

#novanta-root .novanta-lead-error {
	font-size: 13px;
	color: #c62828;
}

#novanta-root .novanta-lead-error:empty { display: none; }

#novanta-root .novanta-lead-actions {
	display: flex;
	justify-content: flex-end;
}

#novanta-root .novanta-send-lead {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 22px;
	border: 0;
	border-radius: 12px;
	background: var(--nv-primary);
	color: var(--nv-on-primary);
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 8px 18px -8px var(--nv-primary-glow);
	transition: transform 0.15s ease, opacity 0.15s ease;
}

#novanta-root .novanta-send-lead:hover:not(:disabled) { transform: translateY(-1px); }
#novanta-root .novanta-send-lead:disabled { opacity: 0.6; cursor: default; }

/* ---------- Booking pop-up ---------- */

#novanta-root .novanta-modal {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 24px;
	background: rgba(14, 15, 20, 0.55);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	animation: novanta-fade 0.2s ease both;
}

#novanta-root .novanta-modal-box {
	display: flex;
	flex-direction: column;
	width: min(920px, 100%);
	height: min(760px, 100%);
	border-radius: 18px;
	background: var(--nv-surface);
	box-shadow: var(--nv-shadow);
	overflow: hidden;
	animation: novanta-open 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#novanta-root .novanta-modal-bar {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 12px 12px 20px;
	border-bottom: 1px solid var(--nv-line);
}

#novanta-root .novanta-modal-bar strong {
	flex: 1;
	font-size: 15px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#novanta-root .novanta-modal-bar a {
	font-size: 13px;
	font-weight: 600;
	color: var(--nv-primary);
	text-decoration: none;
	white-space: nowrap;
}

#novanta-root .novanta-modal-bar .novanta-icon-btn {
	color: var(--nv-muted);
}

#novanta-root .novanta-modal-bar .novanta-icon-btn:hover {
	background: var(--nv-canvas);
	color: var(--nv-ink);
}

#novanta-root .novanta-modal iframe {
	flex: 1;
	width: 100%;
	border: 0;
	background: var(--nv-surface);
}

/* ---------- Phones: full-screen chat ---------- */

@media (max-width: 480px) {
	#novanta-root { bottom: 16px; }
	#novanta-root.novanta-pos-right { right: 16px; }
	#novanta-root.novanta-pos-left { left: 16px; }

	#novanta-root .novanta-panel {
		position: fixed;
		inset: 0;
		width: 100%;
		height: 100%;
		border-radius: 0;
	}

	#novanta-root.novanta-open .novanta-launcher { display: none; }

	#novanta-root .novanta-input { font-size: 16px; } /* Prevents iOS zoom on focus */

	#novanta-root .novanta-modal { padding: 0; }
	#novanta-root .novanta-modal-box { width: 100%; height: 100%; border-radius: 0; }
}

/* ---------- Animations ---------- */

@keyframes novanta-open {
	from { opacity: 0; transform: translateY(16px) scale(0.96); }
	to { opacity: 1; transform: none; }
}

@keyframes novanta-rise {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

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

@keyframes novanta-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

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

@keyframes novanta-pulse {
	0% { box-shadow: 0 0 0 0 var(--nv-primary-glow); }
	70% { box-shadow: 0 0 0 16px rgba(0, 0, 0, 0); }
	100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
	#novanta-root *,
	#novanta-root *::before,
	#novanta-root *::after {
		animation: none !important;
		transition: none !important;
	}
}
