/* ==========================================================================
   Antonio – consulente di Veicoli Industriali Basilicata – stile
   Colori e font sono quelli globali di Elementor del sito (giallo #FFC400,
   antracite #1C1C1C, grigi caldi; font Jost). I valori dopo la virgola sono
   il ripiego se il sito non li definisce.
   ========================================================================== */

.antonio {
	--antonio-primary: var(--e-global-color-41368ef, #1C1C1C);
	--antonio-accent: var(--e-global-color-primary, #FFC400);
	--antonio-cta: var(--antonio-accent);
	--antonio-text: var(--e-global-color-text, #3A3A3A);
	--antonio-secondary: var(--e-global-color-text, #3A3A3A);
	--antonio-on-primary: #ffffff;
	--antonio-bg: #FFFFFF;
	--antonio-bot-bg: var(--e-global-color-bb981c9, #F4F4F1);
	--antonio-line: var(--e-global-color-125d6f7, #D9D9D4);
	--antonio-radius: 14px;
	--antonio-shadow: 0 18px 50px rgba(28, 28, 28, .30), 0 2px 8px rgba(28, 28, 28, .14);
	--antonio-font: "Jost", var(--e-global-typography-text-font-family, system-ui), system-ui, sans-serif;

	position: fixed;
	bottom: 20px;
	z-index: 99990;
	font-family: var(--antonio-font);
	font-weight: 400;
	font-size: 15px;
	line-height: 1.55;
	color: var(--antonio-text);
	-webkit-font-smoothing: antialiased;
}
.antonio--right { right: 20px; }
.antonio--left { left: 20px; }

.antonio *, .antonio *::before, .antonio *::after { box-sizing: border-box; }
.antonio button, .antonio input { font: inherit; color: inherit; margin: 0; }
.antonio [hidden] { display: none !important; }
.antonio-sr {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ------------------------------ Pulsante fluttuante ------------------------------ */

.antonio-fab {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.antonio--left .antonio-fab { flex-direction: row-reverse; }
.antonio-fab__img {
	position: relative;
	z-index: 1;
	width: 68px;
	height: 68px;
	border-radius: 50%;
	background: var(--antonio-primary);
	border: 3px solid var(--antonio-accent);
	box-shadow: var(--antonio-shadow);
	transition: transform .25s ease;
	order: 2;
}
.antonio--left .antonio-fab__img { order: 0; }
.antonio-fab:hover .antonio-fab__img, .antonio-fab:focus-visible .antonio-fab__img { transform: scale(1.06) rotate(-4deg); }
.antonio-fab__ring {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 68px;
	height: 68px;
	border-radius: 50%;
	border: 2px solid var(--antonio-accent);
	animation: antonio-pulse 2.6s ease-out infinite;
}
.antonio--left .antonio-fab__ring { right: auto; left: 0; }
.antonio-fab__label {
	order: 1;
	padding: 9px 16px;
	border-radius: 999px;
	background: var(--antonio-accent);
	color: var(--antonio-primary);
	text-transform: uppercase;
	font-family: var(--antonio-font);
	font-weight: 500;
	font-size: 14px;
	letter-spacing: .04em;
	white-space: nowrap;
	box-shadow: 0 6px 18px rgba(28, 28, 28, .18);
	border: 0;
	transition: opacity .2s ease, transform .2s ease;
}
.antonio.is-open .antonio-fab__label,
.antonio.is-open .antonio-fab__ring { opacity: 0; transform: translateX(6px); pointer-events: none; animation: none; }
.antonio-fab:focus-visible { outline: none; }
.antonio-fab:focus-visible .antonio-fab__img { outline: 3px solid var(--antonio-accent); outline-offset: 3px; }

@keyframes antonio-pulse {
	0% { transform: scale(1); opacity: .8; }
	80%, 100% { transform: scale(1.45); opacity: 0; }
}

/* --------------------------------- Pannello --------------------------------- */

.antonio-panel {
	position: absolute;
	bottom: 84px;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 600px;
	max-height: calc(100vh - 130px);
	max-height: calc(100dvh - 130px);
	display: flex;
	flex-direction: column;
	background: var(--antonio-bg);
	border-radius: var(--antonio-radius);
	box-shadow: var(--antonio-shadow);
	overflow: hidden;
	opacity: 0;
	transform: translateY(14px) scale(.98);
	transform-origin: bottom right;
	transition: opacity .22s ease, transform .22s ease;
}
.antonio--right .antonio-panel { right: 0; }
.antonio--left .antonio-panel { left: 0; transform-origin: bottom left; }
.antonio-panel.is-visible { opacity: 1; transform: none; }

.antonio-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 12px 18px 16px;
	background: var(--antonio-primary);
	color: var(--antonio-on-primary);
	position: relative;
}
.antonio-head::after {
	/* striscia di sicurezza gialla e nera */
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: 0;
	height: 6px;
	background: repeating-linear-gradient(-45deg, var(--antonio-accent) 0 10px, var(--antonio-primary) 10px 20px);
}
.antonio-head__img {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 2px solid var(--antonio-accent);
	background: var(--antonio-secondary);
	flex: none;
}
.antonio.is-speaking .antonio-head__img { animation: antonio-talk 1s ease-in-out infinite; }
@keyframes antonio-talk {
	0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); }
	50% { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0); }
}
.antonio-head__txt { flex: 1; min-width: 0; }
.antonio-head__title {
	margin: 0 !important;
	padding: 0;
	font-family: var(--antonio-font) !important;
	font-size: 20px !important;
	line-height: 1.15 !important;
	font-weight: 600 !important;
	color: inherit !important;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.antonio-head__title::after { content: ""; display: block; width: 28px; height: 3px; margin-top: 4px; background: var(--antonio-accent); }
.antonio-head__title em { font-style: italic; font-weight: 500; opacity: .92; }
.antonio-head__sub { margin: 2px 0 0 !important; font-size: 12.5px; letter-spacing: .03em; opacity: .85; color: inherit; font-weight: 300; }

.antonio-iconbtn {
	flex: none;
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	transition: background .15s ease, transform .15s ease;
}
.antonio-iconbtn svg { width: 22px; height: 22px; fill: currentColor; }
.antonio-head .antonio-iconbtn:hover, .antonio-head .antonio-iconbtn:focus-visible { background: rgba(255, 255, 255, .16); outline: none; }
.antonio-head .antonio-iconbtn:focus-visible { box-shadow: 0 0 0 2px var(--antonio-accent); }
.antonio-ico-off { display: none; }
.antonio.voice-off .antonio-ico-on { display: none; }
.antonio.voice-off .antonio-ico-off { display: block; }

/* --------------------------------- Messaggi --------------------------------- */

.antonio-log {
	flex: 1;
	overflow-y: auto;
	padding: 20px 14px 8px;
	scroll-behavior: smooth;
	overscroll-behavior: contain;
}
.antonio-msg { display: flex; gap: 8px; margin: 0 0 12px; align-items: flex-end; animation: antonio-in .25s ease both; }
@keyframes antonio-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.antonio-msg--user { justify-content: flex-end; }
.antonio-msg__avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; background: var(--antonio-primary); border: 1.5px solid var(--antonio-accent); }

.antonio-bubble {
	max-width: 84%;
	padding: 10px 14px;
	border-radius: 16px;
	word-wrap: break-word;
}
.antonio-msg--bot .antonio-bubble { background: var(--antonio-bot-bg); border-bottom-left-radius: 4px; color: var(--antonio-text); }
.antonio-msg--user .antonio-bubble { background: var(--antonio-primary); color: var(--antonio-on-primary); border-bottom-right-radius: 4px; }
.antonio-bubble p { margin: 0 0 8px !important; padding: 0; font-size: 15px; color: inherit; }
.antonio-bubble p:last-child { margin-bottom: 0 !important; }
.antonio-bubble ul { margin: 4px 0 8px !important; padding: 0 0 0 18px !important; }
.antonio-bubble li { margin: 0 0 5px; padding: 0; font-size: 14.5px; list-style: disc; }
.antonio-bubble li::marker { color: var(--antonio-accent); }
.antonio-bubble strong { color: var(--antonio-primary); font-weight: 600; }
.antonio-msg--user .antonio-bubble strong { color: inherit; }
.antonio-bubble a { color: var(--antonio-primary); text-decoration: underline; text-underline-offset: 2px; }

.antonio-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.antonio-bubble a.antonio-linkbtn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	border: 1.5px solid var(--antonio-primary);
	background: transparent;
	color: var(--antonio-primary);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: .02em;
	text-decoration: none;
	line-height: 1.3;
	transition: background .15s ease, color .15s ease;
}
.antonio-bubble a.antonio-linkbtn::after { content: "→"; }
.antonio-bubble a.antonio-linkbtn:hover, .antonio-bubble a.antonio-linkbtn:focus-visible { background: var(--antonio-primary); color: var(--antonio-on-primary); outline: none; }
.antonio-bubble a.antonio-linkbtn--main { background: var(--antonio-cta); border-color: var(--antonio-cta); color: var(--antonio-primary); }
.antonio-bubble a.antonio-linkbtn--main:hover, .antonio-bubble a.antonio-linkbtn--main:focus-visible { background: var(--antonio-primary); border-color: var(--antonio-primary); color: #fff; }

.antonio-dots { display: inline-flex; gap: 4px; padding: 4px 2px; }
.antonio-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--antonio-primary); opacity: .4; animation: antonio-dot 1.1s infinite; }
.antonio-dots i:nth-child(2) { animation-delay: .15s; }
.antonio-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes antonio-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ------------------------------ Risposte rapide ------------------------------ */

.antonio-chips {
	display: flex;
	gap: 6px;
	padding: 6px 14px 10px;
	overflow-x: auto;
	flex-wrap: wrap;
	max-height: 112px;
	overflow-y: auto;
}
.antonio-chips:empty { display: none; }
.antonio-chip {
	padding: 7px 13px;
	border-radius: 999px;
	border: 1.5px solid var(--antonio-accent);
	background: var(--antonio-bg);
	color: var(--antonio-secondary);
	font-size: 13.5px !important;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	white-space: nowrap;
	transition: background .15s ease, color .15s ease, transform .1s ease;
}
.antonio-chip:hover, .antonio-chip:focus-visible { background: var(--antonio-accent); color: var(--antonio-primary); outline: none; }
.antonio-chip:active { transform: scale(.97); }
.antonio-chip--ghost { border-style: dashed; opacity: .85; }

/* --------------------------------- Input --------------------------------- */

.antonio-form {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 !important;
	padding: 10px 10px 8px;
	border-top: 1px solid var(--antonio-line);
	background: var(--antonio-bg);
}
.antonio-input {
	flex: 1;
	min-width: 0;
	height: 44px;
	padding: 0 14px !important;
	border: 1.5px solid var(--antonio-line) !important;
	border-radius: 999px !important;
	background: #fff !important;
	color: var(--antonio-text) !important;
	font-size: 16px !important; /* evita lo zoom su iOS */
	box-shadow: none !important;
	outline: none;
}
.antonio-input:focus { border-color: var(--antonio-accent) !important; }
.antonio-form .antonio-iconbtn { width: 44px; height: 44px; color: var(--antonio-primary); }
.antonio-form .antonio-iconbtn:hover, .antonio-form .antonio-iconbtn:focus-visible { background: var(--antonio-bot-bg); outline: none; }
.antonio-send { background: var(--antonio-primary) !important; color: var(--antonio-on-primary) !important; }
/* Microfono sempre ben visibile: pulsante pieno, immune agli stili dei pulsanti del tema */
.antonio .antonio-form .antonio-mic,
.antonio .antonio-form .antonio-mic:hover,
.antonio .antonio-form .antonio-mic:focus,
.antonio .antonio-form .antonio-mic:focus-visible {
	background: var(--antonio-accent) !important;
	color: var(--antonio-primary) !important;
	border: 0 !important;
	box-shadow: none;
	opacity: 1 !important;
}
.antonio .antonio-form .antonio-mic:hover { filter: brightness(1.08); }
.antonio .antonio-form .antonio-mic:focus-visible { box-shadow: 0 0 0 3px var(--antonio-bot-bg), 0 0 0 5px var(--antonio-accent); }
.antonio .antonio-iconbtn { border: 0 !important; min-height: 0 !important; line-height: 1 !important; }
.antonio .antonio-iconbtn svg { fill: currentColor !important; }
.antonio-send svg { width: 20px; height: 20px; }
.antonio.is-listening .antonio-form .antonio-mic, .antonio.is-listening .antonio-form .antonio-mic:hover, .antonio.is-listening .antonio-form .antonio-mic:focus { background: #c0392b !important; color: #fff !important; animation: antonio-mic 1.2s ease-in-out infinite; }
@keyframes antonio-mic { 0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, .5); } 50% { box-shadow: 0 0 0 8px rgba(192, 57, 43, 0); } }

.antonio-foot {
	margin: 0 !important;
	padding: 0 0 8px;
	text-align: center;
	font-size: 11px;
	opacity: .55;
	background: var(--antonio-bg);
}

/* ------------------------------ Mobile ------------------------------ */

@media (max-width: 600px) {
	.antonio { bottom: 14px; }
	.antonio--right { right: 14px; }
	.antonio--left { left: 14px; }
	.antonio-fab__label { display: none; }
	.antonio-fab__img, .antonio-fab__ring { width: 60px; height: 60px; }
	.antonio.is-open .antonio-fab { display: none; }
	.antonio-panel {
		position: fixed;
		inset: auto 0 0 0;
		width: 100vw;
		max-width: 100vw;
		height: 88vh;
		height: 88dvh;
		max-height: none;
		border-radius: 20px 20px 0 0;
	}
	.antonio--left .antonio-panel, .antonio--right .antonio-panel { left: 0; right: 0; }
}

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

/* I contenuti nascosti servono solo come fonte traducibile */
.antonio-kb { display: none !important; }

/* Pulsante fluttuante nascosto: [antonio_vib pulsante="no"] */
.antonio--nofab .antonio-fab { display: none !important; }
.antonio--nofab .antonio-panel { bottom: 0; }
