/* Regalè Assistente 1.0.3 - mascotte animata, selettori rinforzati contro gli stili dei bottoni/campi del tema */
:root { --rai-color: #b08968; }

html body button.rai-btn {
	position: fixed !important;
	right: 14px !important;
	bottom: 10px !important;
	left: auto !important;
	top: auto !important;
	z-index: 99998 !important;
	width: 92px !important;
	height: 100px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	display: block !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	line-height: 1 !important;
	cursor: pointer !important;
	transform: none !important;
}
html body button.rai-btn svg.rai-mascot { width: 100% !important; height: 100% !important; fill: none !important; display: block !important; overflow: visible !important; }
html body button.rai-btn:hover svg.rai-mascot { transform: scale(1.08); }
.rai-hop { animation: rai-hop 3.6s ease-in-out infinite; transform-origin: 50px 98px; transform-box: view-box; }
.rai-arm { animation: rai-wave 3.6s ease-in-out infinite; transform-origin: 80px 66px; transform-box: view-box; }
.rai-eyes { animation: rai-blink 4.8s infinite; transform-origin: 50px 68px; transform-box: view-box; }
.rai-shadow { fill: rgba(0, 0, 0, .18); animation: rai-shadow 3.6s ease-in-out infinite; transform-origin: 50px 104px; transform-box: view-box; }
@keyframes rai-hop {
	0%, 55%, 100% { transform: translateY(0) scale(1, 1); }
	62% { transform: translateY(0) scale(1.05, .93); }
	72% { transform: translateY(-13px) scale(.97, 1.05); }
	82% { transform: translateY(0) scale(1.05, .94); }
	88% { transform: translateY(-5px) scale(1, 1); }
	94% { transform: translateY(0) scale(1, 1); }
}
@keyframes rai-wave {
	0%, 55%, 100% { transform: rotate(0); }
	62% { transform: rotate(-22deg); }
	70% { transform: rotate(14deg); }
	78% { transform: rotate(-22deg); }
	86% { transform: rotate(14deg); }
	93% { transform: rotate(0); }
}
@keyframes rai-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes rai-shadow { 0%, 55%, 100% { transform: scale(1); opacity: 1; } 72% { transform: scale(.75); opacity: .6; } 94% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rai-hop, .rai-arm, .rai-eyes, .rai-shadow { animation: none !important; } }

html body .rai-bubble {
	position: fixed !important;
	right: 100px !important;
	bottom: 60px !important;
	z-index: 99998 !important;
	max-width: 210px !important;
	padding: 10px 28px 10px 14px !important;
	background: #fff !important;
	color: #3b2a20 !important;
	border: 2.5px solid #3b2a20 !important;
	border-radius: 18px !important;
	font: 600 14px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .18) !important;
	cursor: pointer !important;
	animation: rai-pop .45s cubic-bezier(.3, 1.6, .5, 1) both, rai-float 3.6s ease-in-out 1s infinite !important;
}
html body .rai-bubble[hidden] { display: none !important; }
html body .rai-bubble::after {
	content: ""; position: absolute; right: -11px; bottom: 14px; width: 16px; height: 16px;
	background: #fff; border-right: 2.5px solid #3b2a20; border-top: 2.5px solid #3b2a20;
	transform: rotate(45deg);
}
html body .rai-bubble .rai-bubble-x {
	position: absolute !important; top: 2px !important; right: 4px !important; width: 20px !important; height: 20px !important;
	min-width: 0 !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important;
	color: #3b2a20 !important; font-size: 16px !important; line-height: 1 !important; cursor: pointer !important; box-shadow: none !important;
}
@keyframes rai-pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rai-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { html body .rai-bubble { animation: none !important; } }
@media (max-width: 480px) { html body .rai-bubble { max-width: 160px !important; font-size: 13px !important; } }
html body button.rai-btn:focus-visible,
html body .rai-panel button:focus-visible { outline: 3px solid #1a73e8 !important; outline-offset: 2px !important; }

html body .rai-panel {
	position: fixed !important;
	right: 20px !important;
	bottom: 20px !important;
	left: auto !important;
	top: auto !important;
	z-index: 99999 !important;
	width: 360px;
	max-width: calc(100vw - 24px);
	height: 520px;
	max-height: calc(100vh - 40px);
	display: flex;
	flex-direction: column;
	background: #fff;
	color: #222;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 8px 30px rgba(0, 0, 0, .28);
	font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	text-align: left;
	box-sizing: border-box;
}
html body .rai-panel[hidden] { display: none !important; }
html body .rai-panel *, html body .rai-panel *::before, html body .rai-panel *::after { box-sizing: border-box; }

html body .rai-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	background: var(--rai-color);
	color: #fff;
	font-weight: 600;
}
html body .rai-panel button.rai-close {
	background: transparent !important;
	border: 0 !important;
	color: #fff !important;
	font-size: 26px !important;
	line-height: 1 !important;
	cursor: pointer !important;
	padding: 0 4px !important;
	margin: 0 !important;
	min-width: 0 !important;
	width: auto !important;
	height: auto !important;
	box-shadow: none !important;
}

html body .rai-msgs {
	flex: 1;
	overflow-y: auto;
	padding: 12px;
	background: #f6f3ef;
}
html body .rai-msg {
	max-width: 88%;
	margin: 0 0 8px;
	padding: 9px 12px;
	border-radius: 12px;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	color: #222;
}
html body .rai-bot { background: #fff; border: 1px solid #e6dfd6; border-bottom-left-radius: 4px; }
html body .rai-user { margin-left: auto; background: var(--rai-color); color: #fff; border-bottom-right-radius: 4px; }
html body .rai-msg a { color: inherit; text-decoration: underline; font-weight: 600; }
html body .rai-bot a { color: #7a4e1d; }
html body .rai-typing { opacity: .6; }

html body .rai-consent {
	padding: 12px 14px;
	background: #fff;
	border-top: 1px solid #e6dfd6;
	font-size: 13px;
	color: #222;
}
html body .rai-consent p { margin: 0 0 10px; }
html body .rai-consent a { color: #7a4e1d; text-decoration: underline; }
html body .rai-panel button.rai-ok {
	width: 100% !important;
	min-width: 0 !important;
	height: auto !important;
	margin: 0 !important;
	padding: 10px !important;
	border: 0 !important;
	border-radius: 8px !important;
	background: var(--rai-color) !important;
	color: #fff !important;
	font-size: 15px !important;
	line-height: 1.3 !important;
	text-transform: none !important;
	cursor: pointer !important;
	box-shadow: none !important;
}

html body .rai-form {
	display: flex;
	gap: 8px;
	padding: 10px;
	margin: 0;
	border-top: 1px solid #e6dfd6;
	background: #fff;
}
html body .rai-panel input.rai-input {
	flex: 1 1 auto !important;
	min-width: 0 !important;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	padding: 10px 12px !important;
	border: 1px solid #cfc6bb !important;
	border-radius: 8px !important;
	background: #fff !important;
	color: #222 !important;
	font-size: 16px !important;
	line-height: 1.3 !important;
	box-shadow: none !important;
}
html body .rai-panel button.rai-send {
	flex: 0 0 auto !important;
	width: auto !important;
	min-width: 0 !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0 16px !important;
	border: 0 !important;
	border-radius: 8px !important;
	background: var(--rai-color) !important;
	color: #fff !important;
	font-size: 15px !important;
	line-height: 1.3 !important;
	text-transform: none !important;
	cursor: pointer !important;
	box-shadow: none !important;
}
html body .rai-panel button.rai-send:disabled { opacity: .5 !important; cursor: default !important; }

@media (max-width: 480px) {
	html body .rai-panel {
		right: 0 !important;
		bottom: 0 !important;
		width: 100vw;
		max-width: 100vw;
		height: 85vh;
		border-radius: 14px 14px 0 0;
	}
	html body button.rai-btn { right: 14px !important; bottom: 14px !important; }
}
