/* Aluna Live Chat – visitor widget */
#alc-root {
	--alc-a: #2a0fa8;
	--alc-b: #1e88e5;
	--alc-accent: #fc4b10;
	--alc-ink: #1d2240;
	--alc-muted: #6b7190;
	--alc-line: #e4e7f3;
	--alc-soft: #f4f6fd;
	position: fixed;
	bottom: 24px;
	z-index: 999990;
	font-family: "Red Hat Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
	color: var(--alc-ink);
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
}
#alc-root.alc-pos-right { right: 24px; }
#alc-root.alc-pos-left { left: 24px; }
#alc-root *, #alc-root *::before, #alc-root *::after { box-sizing: border-box; }
#alc-root [hidden] { display: none !important; }
#alc-root svg { display: block; }
#alc-root button { font-family: inherit; cursor: pointer; }

/* Keep the theme's back-to-top arrow clear of the launcher. */
body #back-to-top { bottom: 104px !important; }

/* ---------- Launcher ---------- */
.alc-launcher {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 6px 22px 6px 6px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(120deg, var(--alc-a), var(--alc-b));
	color: #fff;
	box-shadow: 0 10px 30px rgba(30, 30, 140, .35), 0 0 0 4px rgba(255, 255, 255, .9);
	transition: transform .2s ease, box-shadow .2s ease;
	margin-left: auto;
	text-align: left;
}
.alc-pos-left .alc-launcher { margin-left: 0; }
.alc-launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(30, 30, 140, .45), 0 0 0 4px #fff; }
.alc-launcher:focus-visible { outline: 3px solid var(--alc-accent); outline-offset: 4px; }
.alc-launcher::before {
	content: "";
	position: absolute;
	inset: -4px;
	border-radius: inherit;
	border: 2px solid var(--alc-accent);
	animation: alc-pulse 2.4s ease-out infinite;
	pointer-events: none;
}
.is-open .alc-launcher::before { animation: none; opacity: 0; }
@keyframes alc-pulse {
	0% { opacity: .9; transform: scale(1); }
	80%, 100% { opacity: 0; transform: scale(1.18, 1.45); }
}
.alc-l-av {
	position: relative;
	flex: 0 0 auto;
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: #fff;
	border: 3px solid #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.alc-l-av svg { width: 100%; height: 100%; border-radius: 50%; }
.alc-online {
	position: absolute;
	right: 1px;
	bottom: 2px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #22c55e;
	border: 2.5px solid #fff;
}
.alc-l-txt { display: flex; flex-direction: column; }
.alc-l-txt strong { font-size: 17px; font-weight: 800; letter-spacing: .01em; }
.alc-l-txt span { font-size: 12.5px; opacity: .9; }
.alc-l-badge {
	position: absolute;
	top: -6px;
	right: -4px;
	min-width: 24px;
	height: 24px;
	padding: 0 6px;
	border-radius: 12px;
	background: var(--alc-accent);
	color: #fff;
	font-size: 13px;
	font-weight: 800;
	line-height: 24px;
	text-align: center;
	box-shadow: 0 0 0 3px #fff;
}
.has-unread .alc-l-av { animation: alc-bounce 1.2s ease infinite; }
@keyframes alc-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ---------- Teaser ---------- */
.alc-teaser {
	position: absolute;
	bottom: calc(100% + 16px);
	right: 0;
	width: 290px;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 34px 14px 14px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 12px 34px rgba(20, 30, 90, .22);
	cursor: pointer;
	animation: alc-in .35s ease;
	font-size: 14.5px;
	font-weight: 600;
}
.alc-pos-left .alc-teaser { right: auto; left: 0; }
.alc-teaser::after {
	content: "";
	position: absolute;
	bottom: -7px;
	right: 40px;
	width: 16px;
	height: 16px;
	background: #fff;
	transform: rotate(45deg);
	border-radius: 3px;
}
.alc-pos-left .alc-teaser::after { right: auto; left: 40px; }
.alc-teaser-av { flex: 0 0 46px; width: 46px; height: 46px; }
.alc-teaser-av svg { width: 100%; height: 100%; border-radius: 50%; }
.alc-teaser-x {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 26px;
	height: 26px;
	padding: 3px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--alc-muted);
}
.alc-teaser-x:hover { background: var(--alc-soft); }
.alc-teaser-x svg { width: 100%; height: 100%; }

/* ---------- Panel ---------- */
.alc-panel {
	position: absolute;
	bottom: calc(100% + 16px);
	right: 0;
	width: 380px;
	height: min(620px, calc(100vh - 140px));
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(20, 30, 90, .32);
	animation: alc-in .28s ease;
}
.alc-pos-left .alc-panel { right: auto; left: 0; }
@keyframes alc-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

.alc-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 18px 16px 18px 18px;
	background: linear-gradient(120deg, var(--alc-a), var(--alc-b));
	color: #fff;
}
.alc-head-av { position: relative; flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; border: 2.5px solid #fff; background: #fff; }
.alc-head-av svg { width: 100%; height: 100%; border-radius: 50%; }
.alc-head-av .alc-online { width: 13px; height: 13px; right: -1px; bottom: 0; }
.alc-head-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.alc-head-txt strong { font-size: 17px; font-weight: 800; }
.alc-head-txt span { font-size: 13px; opacity: .9; }
.alc-x {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .16);
	color: #fff;
}
.alc-x:hover { background: rgba(255, 255, 255, .28); }

.alc-body { flex: 1; overflow-y: auto; padding: 18px 16px; background: var(--alc-soft); overscroll-behavior: contain; }

/* Form */
.alc-form { display: flex; flex-direction: column; gap: 12px; }
.alc-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; color: var(--alc-ink); }
#alc-root .alc-field input,
#alc-root .alc-field textarea,
#alc-root .alc-compose textarea {
	width: 100%;
	margin: 0;
	padding: 11px 13px;
	border: 1.5px solid var(--alc-line);
	border-radius: 12px;
	background: #fff;
	color: var(--alc-ink);
	font: 500 14.5px/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif;
	box-shadow: none;
	transition: border-color .15s, box-shadow .15s;
	resize: vertical;
}
#alc-root .alc-field input:focus,
#alc-root .alc-field textarea:focus,
#alc-root .alc-compose textarea:focus {
	outline: none;
	border-color: var(--alc-b);
	box-shadow: 0 0 0 3px rgba(30, 136, 229, .18);
}
.alc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.alc-error { padding: 10px 12px; border-radius: 10px; background: #fff1ec; color: #b23a0c; font-size: 13.5px; font-weight: 600; }
.alc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 20px;
	border: 0;
	border-radius: 25px;
	background: var(--alc-accent);
	color: #fff;
	font-size: 16px;
	font-weight: 800;
	box-shadow: 0 8px 20px rgba(252, 75, 16, .35);
	transition: transform .15s, filter .15s;
}
.alc-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.alc-btn:disabled, .alc-btn.is-loading { opacity: .65; pointer-events: none; }
.alc-fine { margin: 0; font-size: 12px; color: var(--alc-muted); text-align: center; }

/* Messages */
.alc-thread { display: flex; flex-direction: column; gap: 12px; }
.alc-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 100%; }
.alc-msg-av { flex: 0 0 32px; width: 32px; height: 32px; }
.alc-msg-av svg { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.alc-bubble {
	max-width: 82%;
	padding: 11px 14px;
	border-radius: 16px;
	font: 500 14.5px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.alc-msg-admin .alc-bubble { background: #fff; color: var(--alc-ink); border-bottom-left-radius: 4px; box-shadow: 0 2px 8px rgba(20, 30, 90, .07); }
.alc-msg-me { justify-content: flex-end; }
.alc-msg-me .alc-bubble { background: linear-gradient(120deg, var(--alc-a), var(--alc-b)); color: #fff; border-bottom-right-radius: 4px; }
.alc-meta { display: block; margin-top: 4px; font-size: 11px; opacity: .7; }
.alc-msg-me .alc-meta { text-align: right; }
.alc-welcome { margin-bottom: 4px; }
.alc-welcome .alc-bubble { max-width: 88%; }
.alc-note {
	align-self: center;
	max-width: 94%;
	padding: 10px 14px;
	border-radius: 12px;
	background: #eaf7ef;
	color: #1f5136;
	font-size: 13px;
	text-align: center;
}
.alc-note-err { color: #b23a0c; }

/* Compose */
.alc-compose { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--alc-line); background: #fff; }
#alc-root .alc-compose textarea { resize: none; max-height: 120px; border-radius: 20px; padding: 10px 14px; }
.alc-send {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: var(--alc-accent);
	color: #fff;
	box-shadow: 0 4px 12px rgba(252, 75, 16, .35);
}
.alc-compose.is-loading .alc-send { opacity: .6; pointer-events: none; }
.alc-foot { padding: 0 12px 10px; background: #fff; text-align: center; }
.alc-new { border: 0; background: none; color: var(--alc-muted); font-size: 12.5px; text-decoration: underline; padding: 2px 6px; }
.alc-new:hover { color: var(--alc-a); }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
	#alc-root { bottom: 16px; }
	#alc-root.alc-pos-right { right: 16px; }
	#alc-root.alc-pos-left { left: 16px; }
	.alc-launcher { padding: 5px 16px 5px 5px; gap: 10px; }
	.alc-l-av { width: 50px; height: 50px; }
	.alc-l-txt strong { font-size: 15px; }
	.alc-l-txt span { font-size: 11.5px; }
	.alc-teaser { width: min(290px, calc(100vw - 32px)); }
	.alc-panel {
		position: fixed;
		inset: 0;
		width: 100%;
		height: 100%;
		border-radius: 0;
	}
	.is-open .alc-launcher { display: none; }
	#alc-root .alc-field input, #alc-root .alc-field textarea, #alc-root .alc-compose textarea { font-size: 16px; }
	body #back-to-top { bottom: 88px !important; }
}
@media (prefers-reduced-motion: reduce) {
	.alc-launcher::before, .has-unread .alc-l-av, .alc-panel, .alc-teaser { animation: none; }
}
