/* Auno Chat. Brand colour comes from --auno-color, set in the plugin settings. */

.auno {
	--auno-brand: var(--auno-color, #F25C04);
	--auno-ink: #121212;
	--auno-muted: #666666;
	--auno-soft: #F6F6F4;
	--auno-line: #E8E8E6;
	--auno-tint: #FFF1E8;
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99990;
	font-family: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--auno-ink);
	text-align: left;
}

.auno *,
.auno *::before,
.auno *::after {
	box-sizing: border-box;
}

.auno [hidden] {
	display: none !important;
}

/* Neutralise theme button and field styles inside the widget. */
.auno button {
	margin: 0;
	border: 0;
	font: inherit;
	line-height: 1;
	text-transform: none;
	letter-spacing: 0;
	box-shadow: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.auno input,
.auno textarea {
	margin: 0;
	width: 100%;
	font: inherit;
	color: var(--auno-ink);
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

.auno button:focus-visible,
.auno input:focus-visible,
.auno textarea:focus-visible,
.auno a:focus-visible {
	outline: 2px solid var(--auno-ink);
	outline-offset: 2px;
}

/* Launcher bubble */
.auno .auno-launcher {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	margin-left: auto;
	padding: 0;
	border-radius: 50%;
	background: var(--auno-brand);
	color: var(--auno-ink);
	box-shadow: 0 10px 28px rgba(18, 18, 18, .22);
	transition: transform .2s ease, filter .2s ease;
}

.auno .auno-launcher:hover,
.auno .auno-launcher:focus {
	background: var(--auno-brand);
	color: var(--auno-ink);
	filter: brightness(.93);
	transform: translateY(-2px);
}

/* Panel */
.auno .auno-panel {
	display: flex;
	flex-direction: column;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 580px;
	max-height: calc(100vh - 130px);
	max-height: calc(100dvh - 130px);
	margin-bottom: 14px;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--auno-line);
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(18, 18, 18, .2);
	animation: auno-in .2s ease;
}

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

/* Header */
.auno .auno-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 14px 14px 16px;
	background: var(--auno-ink);
	color: #fff;
}

.auno .auno-avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--auno-brand);
	color: var(--auno-ink);
	font-weight: 800;
	font-size: 17px;
}

.auno .auno-titles {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}

.auno .auno-name {
	font-size: 16px;
	font-weight: 800;
	color: #fff;
}

.auno .auno-sub {
	font-size: 12px;
	color: rgba(255, 255, 255, .7);
}

.auno .auno-close {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 34px;
	height: 34px;
	padding: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .1);
	color: #fff;
}

.auno .auno-close:hover,
.auno .auno-close:focus {
	background: rgba(255, 255, 255, .2);
	color: #fff;
}

.auno .auno-close:focus-visible {
	outline-color: #fff;
}

/* Messages */
.auno .auno-messages {
	flex: 1;
	min-height: 0;
	padding: 16px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #fff;
}

.auno .auno-row {
	display: flex;
	margin-bottom: 10px;
}

.auno .auno-row-user {
	justify-content: flex-end;
}

.auno .auno-bubble {
	max-width: 84%;
	padding: 10px 14px;
	border-radius: 16px;
	border-bottom-left-radius: 4px;
	background: var(--auno-soft);
	color: var(--auno-ink);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.auno .auno-row-user .auno-bubble {
	border-radius: 16px;
	border-bottom-right-radius: 4px;
	background: var(--auno-brand);
	color: var(--auno-ink);
	font-weight: 600;
}

.auno .auno-bubble a {
	color: inherit;
	text-decoration: underline;
}

/* Typing dots */
.auno .auno-typing {
	display: flex;
	gap: 5px;
	padding: 14px;
}

.auno .auno-typing i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--auno-muted);
	animation: auno-dot 1.1s infinite ease-in-out;
}

.auno .auno-typing i:nth-child(2) { animation-delay: .15s; }
.auno .auno-typing i:nth-child(3) { animation-delay: .3s; }

@keyframes auno-dot {
	0%, 60%, 100% { opacity: .3; transform: none; }
	30% { opacity: 1; transform: translateY(-3px); }
}

/* Composer */
.auno .auno-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	margin: 0;
	padding: 12px;
	border-top: 1px solid var(--auno-line);
	background: #fff;
}

.auno .auno-input {
	flex: 1;
	min-height: 44px;
	max-height: 110px;
	padding: 11px 14px;
	border: 1px solid var(--auno-line);
	border-radius: 12px;
	background: var(--auno-soft);
	font-size: 16px; /* 16px stops iOS zooming on focus */
	line-height: 1.35;
	resize: none;
}

.auno .auno-input:focus {
	border-color: var(--auno-brand);
	background: #fff;
	outline: none;
	box-shadow: 0 0 0 4px rgba(242, 92, 4, .15);
}

.auno .auno-send {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 12px;
	background: var(--auno-brand);
	color: var(--auno-ink);
	transition: filter .2s ease;
}

.auno .auno-send:hover,
.auno .auno-send:focus {
	background: var(--auno-brand);
	color: var(--auno-ink);
	filter: brightness(.93);
}

.auno .auno-send:disabled {
	opacity: .5;
	cursor: default;
}

/* Footer */
.auno .auno-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 0 14px 12px;
	background: #fff;
	font-size: 11.5px;
	color: var(--auno-muted);
}

.auno .auno-team {
	flex: none;
	margin-left: auto;
	padding: 4px 0;
	background: none;
	color: var(--auno-ink);
	font-size: 12px;
	font-weight: 700;
	text-decoration: underline;
}

.auno .auno-team:hover,
.auno .auno-team:focus {
	background: none;
	color: var(--auno-ink);
	text-decoration: none;
}

/* Lead form */
.auno .auno-lead {
	margin: 4px 0 10px;
	padding: 14px;
	border: 1.5px solid var(--auno-brand);
	border-radius: 14px;
	background: var(--auno-tint);
}

.auno .auno-lead-title {
	display: block;
	margin-bottom: 10px;
	font-size: 15px;
	font-weight: 800;
}

.auno .auno-field {
	display: block;
	margin: 0 0 10px;
	font-size: 12.5px;
	font-weight: 600;
}

.auno .auno-field span {
	display: block;
	margin-bottom: 4px;
}

.auno .auno-field input,
.auno .auno-field textarea {
	padding: 10px 12px;
	border: 1px solid var(--auno-line);
	border-radius: 10px;
	background: #fff;
	font-size: 16px;
	resize: vertical;
}

.auno .auno-field input:focus,
.auno .auno-field textarea:focus {
	border-color: var(--auno-brand);
	outline: none;
	box-shadow: 0 0 0 4px rgba(242, 92, 4, .15);
}

.auno .auno-trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.auno .auno-lead-error {
	margin: 0 0 10px;
	font-size: 12.5px;
	font-weight: 600;
	color: #B3261E;
}

.auno .auno-lead-submit {
	width: 100%;
	padding: 13px 16px;
	border-radius: 10px;
	background: var(--auno-ink);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
}

.auno .auno-lead-submit:hover,
.auno .auno-lead-submit:focus {
	background: #2C2C2C;
	color: #fff;
}

.auno .auno-lead-submit:disabled {
	opacity: .6;
	cursor: default;
}

/* Phones: the panel fills the screen */
@media (max-width: 480px) {
	.auno {
		right: 16px;
		bottom: 16px;
	}

	.auno.auno-open {
		inset: 0;
	}

	.auno.auno-open .auno-panel {
		width: 100%;
		max-width: none;
		height: 100%;
		max-height: none;
		margin: 0;
		border: 0;
		border-radius: 0;
	}

	.auno.auno-open .auno-launcher {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.auno .auno-panel,
	.auno .auno-typing i {
		animation: none;
	}

	.auno .auno-launcher,
	.auno .auno-send {
		transition: none;
	}
}
