/* Togo360 Assistant — stili widget */
#t360a-root {
	--t360a-accent: #0A2E5C;
	position: fixed;
	bottom: 22px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
}
.t360a-pos-right { right: 22px; }
.t360a-pos-left  { left: 22px; }

/* Bolla */
#t360a-bubble {
	width: 58px;
	height: 58px;
	border: none;
	border-radius: 50%;
	background: var(--t360a-accent);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
}
#t360a-bubble:hover { transform: scale(1.06); }
#t360a-bubble:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* Pannello */
#t360a-panel {
	position: absolute;
	bottom: 72px;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
#t360a-panel[hidden] { display: none !important; }
.t360a-pos-right #t360a-panel { right: 0; }
.t360a-pos-left  #t360a-panel { left: 0; }

/* Header */
#t360a-header {
	background: var(--t360a-accent);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
#t360a-header-txt { display: flex; flex-direction: column; }
#t360a-header-txt strong { font-size: 16px; }
#t360a-header-txt span { font-size: 12px; opacity: 0.85; }
#t360a-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}
#t360a-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Messaggi */
#t360a-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f5f6f7;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.t360a-msg {
	max-width: 84%;
	padding: 9px 12px;
	border-radius: 12px;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.t360a-user {
	align-self: flex-end;
	background: var(--t360a-accent);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.t360a-assistant {
	align-self: flex-start;
	background: #fff;
	color: #222;
	border: 1px solid #e3e5e8;
	border-bottom-left-radius: 4px;
}

/* Indicatore "sta scrivendo" */
.t360a-typing { display: flex; gap: 4px; padding: 12px 14px; }
.t360a-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9aa0a6;
	animation: t360a-blink 1.2s infinite ease-in-out;
}
.t360a-typing span:nth-child(2) { animation-delay: 0.2s; }
.t360a-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes t360a-blink {
	0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
	40% { opacity: 1; transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
	.t360a-typing span { animation: none; opacity: 0.6; }
	#t360a-bubble { transition: none; }
}

/* Input */
#t360a-inputbar {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px;
	background: #fff;
	border-top: 1px solid #e3e5e8;
}
#t360a-input {
	flex: 1;
	resize: none;
	border: 1px solid #d0d3d8;
	border-radius: 10px;
	padding: 9px 12px;
	font: inherit;
	max-height: 110px;
	background: #fff;
	color: #222;
}
#t360a-input:focus { outline: 2px solid var(--t360a-accent); border-color: transparent; }
#t360a-send {
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 10px;
	background: var(--t360a-accent);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
#t360a-send:disabled { opacity: 0.5; cursor: default; }
#t360a-send:focus-visible { outline: 2px solid #222; outline-offset: 2px; }

#t360a-foot {
	font-size: 11px;
	color: #8a8f98;
	text-align: center;
	padding: 5px 10px 8px;
	background: #fff;
}

/* Backdrop (solo mobile) */
#t360a-backdrop {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	z-index: 99998;
}

/* Pulsante chiudi: area di tocco generosa */
#t360a-close {
	min-width: 44px;
	min-height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Mobile: bottom sheet, il sito resta visibile dietro */
@media (max-width: 480px) {
	#t360a-root.t360a-open #t360a-backdrop { display: block; }
	#t360a-panel {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-width: 100%;
		height: 88vh;
		height: 88dvh;
		max-height: 88vh;
		max-height: 88dvh;
		border-radius: 16px 16px 0 0;
		z-index: 99999;
	}
	#t360a-header { border-radius: 16px 16px 0 0; }
	#t360a-close { font-size: 30px; }
	#t360a-inputbar { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
	#t360a-foot { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
}

/* Logo del bot */
#t360a-bubble .t360a-logo {
	width: 34px;
	height: 34px;
	object-fit: contain;
	display: block;
}
#t360a-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: 11px;
	flex-shrink: 0;
}
#t360a-avatar .t360a-logo {
	width: 24px;
	height: 24px;
	object-fit: contain;
}
#t360a-header-txt { flex: 1; }

/* CTA preventivo */
.t360a-cta {
	align-self: flex-start;
	max-width: 84%;
	background: #fff;
	border: 1px solid #e3e5e8;
	border-radius: 12px;
	padding: 12px;
}
.t360a-cta-title {
	font-weight: 600;
	font-size: 13px;
	color: #444;
	margin-bottom: 9px;
}
.t360a-cta-btns {
	display: flex;
	flex-direction: column;
	gap: 7px;
}
.t360a-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 13px;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none !important;
	transition: filter 0.15s ease;
}
.t360a-btn:hover { filter: brightness(1.08); }
.t360a-btn-wa {
	background: #25D366;
	color: #fff !important;
}
.t360a-btn-mail {
	background: var(--t360a-accent);
	color: #fff !important;
}
