/*
 * Container Assistent — chat-widget (nederste VENSTRE hjørne).
 * Alt scopet under .la. Farver styres af --la-primaer (mørkegrøn) og
 * --la-accent (limegrøn).
 *
 * VIGTIGT om !important: temaet (og Elementor/LiteSpeed) sætter egne
 * farver på button:hover / :active / :focus med højere specificitet end
 * ".la .la__..." kan nå. Derfor låses ALLE baggrunde, tekstfarver og
 * kanter på widget'ens egne knapper med !important i både normal-,
 * hover-, focus- og active-tilstand. Ingen temafarve kan lække ind.
 */

.la {
	--la-primaer: #76b82a;
	--la-accent: #7d57d8;
	--la-radius: 18px;
	--la-bg: #ffffff;
	--la-graa-100: #f4f6f3;
	--la-graa-200: #e4e8e2;
	--la-graa-500: #868d86;
	--la-graa-700: #47504a;
	--la-tekst: #17211b;
	position: fixed;
	left: clamp(14px, 3vw, 26px);
	bottom: clamp(14px, 3vw, 26px);
	z-index: 2147483000;
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--la-tekst);
}

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

/* ---------- Nulstil temaets knapper/inputs (så intet lækker ind) ---------- */
.la button,
.la [type="button"],
.la [type="submit"],
.la textarea,
.la input {
	margin: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	line-height: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	text-shadow: none;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	outline: none;
	min-height: 0;
	min-width: 0;
}

.la button {
	padding: 0;
	cursor: pointer;
}

/* Fælles hård nulstilling af ALLE knap-tilstande — dræber temaets
   hover-/active-farver (fx den lyserøde #cc3366) én gang for alle. */
.la button,
.la button:link,
.la button:visited,
.la button:hover,
.la button:focus,
.la button:focus-within,
.la button:focus-visible,
.la button:active {
	background-image: none !important;
	border: 0 !important;
	box-shadow: none !important;
	text-decoration: none !important;
	text-shadow: none !important;
	outline: none;
}

.la svg {
	display: block;
	max-width: none;
	pointer-events: none;
}

/* ---------- Launcher (limegrøn rund cirkel) ---------- */
.la .la__launcher,
.la .la__launcher:link,
.la .la__launcher:visited,
.la .la__launcher:hover,
.la .la__launcher:focus,
.la .la__launcher:focus-within,
.la .la__launcher:focus-visible,
.la .la__launcher:active {
	background: var(--la-accent) !important;
	background-color: var(--la-accent) !important;
	background-image: none !important;
	color: #fff !important;
	opacity: 1 !important;
	border: 0 !important;
	border-radius: 50% !important;
}

.la .la__launcher {
	position: relative;
	width: 60px;
	height: 60px;
	display: grid;
	place-items: center;
	padding: 0;
	box-shadow: 0 10px 28px rgba(20, 40, 28, 0.3) !important;
	transition: transform 0.15s ease, filter 0.15s ease;
}

.la .la__launcher:hover {
	transform: translateY(-2px);
	filter: brightness(0.92);
}

.la .la__launcher:active {
	transform: translateY(0);
	filter: brightness(0.88);
}

.la .la__launcher:focus-visible {
	outline: 3px solid var(--la-primaer) !important;
	outline-offset: 3px;
}

.la .la__launcher-icon {
	grid-area: 1 / 1;
	display: grid;
	place-items: center;
	color: #fff !important;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.la .la__launcher-icon--close {
	opacity: 0;
	transform: scale(0.6) rotate(-45deg);
}

.la.is-open .la__launcher-icon--open {
	opacity: 0;
	transform: scale(0.6) rotate(45deg);
}

.la.is-open .la__launcher-icon--close {
	opacity: 1;
	transform: none;
}

/* ---------- Panel (ingen kant — den lyste hvid mod den mørkegrønne header) ----------
   Baggrunden er GENNEMSIGTIG: header, body, inputbar og disclaimer maler
   hver deres egen baggrund, så en panel-baggrund ville kun kunne ses som
   hvide antialiasing-flige i de runde hjørner (bag headerens kurve). */
.la .la__panel {
	position: absolute;
	left: 0;
	bottom: 74px;
	width: min(380px, calc(100vw - 28px));
	max-height: min(640px, calc(100vh - 110px));
	background: transparent !important;
	border: 0 !important;
	outline: none !important;
	border-radius: var(--la-radius) !important;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 18px 50px rgba(20, 40, 28, 0.24) !important;
	transform-origin: bottom left;
	animation: la-pop 0.16s ease;
}

/* Panelet har display:flex, hvilket ellers overtrumfer browserens
   [hidden] { display: none } — så det aldrig kunne lukkes. */
.la .la__panel[hidden] {
	display: none !important;
}

/* Runde hjørner lægges på selve børnene i stedet for kun at klippe
   panelet med overflow:hidden — ellers efterlader browserens antialiasing
   en hvid flig af panelets baggrund langs de runde hjørner. */
.la .la__panel > .la__header {
	border-top-left-radius: var(--la-radius) !important;
	border-top-right-radius: var(--la-radius) !important;
}

.la .la__panel > *:last-child {
	border-bottom-left-radius: var(--la-radius);
	border-bottom-right-radius: var(--la-radius);
}

@keyframes la-pop {
	from { opacity: 0; transform: translateY(8px) scale(0.98); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.la .la__panel { animation: none; }
	.la .la__launcher-icon { transition: none; }
}

/* ---------- Header (mørkegrøn) ---------- */
.la .la__header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 18px;
	background: var(--la-primaer) !important;
	color: #fff !important;
	border: 0 !important;
}

.la .la__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14) !important;
	color: var(--la-accent) !important;
	display: grid;
	place-items: center;
	flex: none;
}

.la .la__titles {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1;
}

.la .la__name {
	font-weight: 700;
	font-size: 0.98rem;
	letter-spacing: 0.01em;
	color: #fff !important;
}

.la .la__subtitle {
	font-size: 0.8rem;
	opacity: 0.82;
	color: #fff !important;
}

.la .la__close,
.la .la__close:link,
.la .la__close:visited,
.la .la__close:focus,
.la .la__close:focus-within,
.la .la__close:focus-visible,
.la .la__close:active {
	background: rgba(255, 255, 255, 0.16) !important;
	background-image: none !important;
	color: #fff !important;
	opacity: 1 !important;
	border: 0 !important;
	border-radius: 50% !important;
}

.la .la__close {
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	flex: none;
	padding: 0;
	transition: background 0.15s ease;
}

.la .la__close:hover {
	background: rgba(255, 255, 255, 0.3) !important;
	background-image: none !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 50% !important;
}

.la .la__close:focus-visible {
	outline: 2px solid #fff !important;
	outline-offset: 2px;
}

/* ---------- Body ---------- */
.la .la__body {
	flex: 1;
	overflow-y: auto;
	padding: 18px;
	background: var(--la-graa-100) !important;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.la .la__msg {
	display: flex;
	max-width: 85%;
}

.la .la__msg--bot {
	align-self: flex-start;
}

.la .la__msg--user {
	align-self: flex-end;
}

.la .la__bubble {
	padding: 11px 14px;
	border-radius: 14px !important;
	font-size: 0.94rem;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.la .la__msg--bot .la__bubble {
	background: var(--la-bg) !important;
	border: 1px solid var(--la-graa-200) !important;
	border-bottom-left-radius: 4px !important;
	color: var(--la-tekst) !important;
}

.la .la__msg--user .la__bubble {
	background: var(--la-primaer) !important;
	color: #fff !important;
	border: 0 !important;
	border-bottom-right-radius: 4px !important;
}

/* ---------- Formateret (markdown) indhold i bot-bobler ---------- */
.la .la__bubble--md {
	/* Indholdet er rigtige HTML-blokke nu — ingen pre-wrap, ellers
	   giver linjeskift i kilden dobbelt luft omkring lister. */
	white-space: normal;
}

.la .la__bubble--md > *:first-child { margin-top: 0 !important; }
.la .la__bubble--md > *:last-child { margin-bottom: 0 !important; }

.la .la__bubble--md p {
	margin: 0 0 8px !important;
	padding: 0;
	color: inherit;
	font-size: inherit;
	line-height: 1.5;
}

.la .la__bubble--md strong,
.la .la__bubble--md b {
	font-weight: 700 !important;
	color: inherit;
}

.la .la__bubble--md em,
.la .la__bubble--md i {
	font-style: italic !important;
}

.la .la__bubble--md .la__md-h {
	margin: 12px 0 6px !important;
	font-size: 0.97rem;
}

.la .la__bubble--md .la__md-liste {
	margin: 0 0 8px !important;
	padding: 0 0 0 20px !important;
	list-style-position: outside;
}

.la .la__bubble--md ul.la__md-liste { list-style: disc !important; }
.la .la__bubble--md ol.la__md-liste { list-style: decimal !important; }

.la .la__bubble--md .la__md-liste li {
	margin: 0 0 4px !important;
	padding: 0 !important;
	background: none !important;
	color: inherit;
	list-style: inherit;
}

.la .la__bubble--md .la__md-liste li::before,
.la .la__bubble--md .la__md-liste li::marker {
	content: normal;
	color: inherit;
}

.la .la__bubble--md .la__md-liste li::marker {
	color: var(--la-accent);
}

.la .la__bubble--md a,
.la .la__bubble--md a:hover,
.la .la__bubble--md a:focus,
.la .la__bubble--md a:visited {
	color: var(--la-primaer) !important;
	text-decoration: underline !important;
	text-underline-offset: 2px;
	background: none !important;
	word-break: break-word;
}

.la .la__msg--user .la__bubble--md a {
	color: #fff !important;
}

.la .la__bubble--md .la__md-kode {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.86em;
	background: var(--la-graa-100) !important;
	border: 1px solid var(--la-graa-200) !important;
	border-radius: 5px !important;
	padding: 1px 5px;
	color: var(--la-tekst) !important;
}

.la .la__bubble--md .la__md-hr {
	margin: 10px 0 !important;
	border: 0 !important;
	border-top: 1px solid var(--la-graa-200) !important;
	height: 0;
	background: none !important;
}

/* ---------- Preset-spørgsmål ---------- */
.la .la__presets {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 4px;
}

.la .la__preset,
.la .la__preset:link,
.la .la__preset:visited,
.la .la__preset:focus,
.la .la__preset:focus-within,
.la .la__preset:focus-visible,
.la .la__preset:active {
	background: var(--la-bg) !important;
	background-image: none !important;
	color: var(--la-tekst) !important;
	border: 1px solid var(--la-graa-200) !important;
	border-radius: 12px !important;
	opacity: 1 !important;
}

.la .la__preset {
	text-align: left;
	padding: 11px 14px;
	font-size: 0.9rem;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.la .la__preset:hover {
	background: var(--la-bg) !important;
	background-image: none !important;
	color: var(--la-tekst) !important;
	border: 1px solid var(--la-accent) !important;
	border-radius: 12px !important;
}

.la .la__preset:focus-visible {
	outline: 2px solid var(--la-accent) !important;
	outline-offset: 1px;
}

/* ---------- Lead-formular ---------- */
.la .la__lead {
	align-self: stretch;
	background: var(--la-bg) !important;
	border: 1px solid var(--la-graa-200) !important;
	border-left: 4px solid var(--la-accent) !important;
	border-radius: 14px !important;
	padding: 14px;
}

.la .la__lead-titel {
	display: block;
	font-size: 0.94rem;
	font-weight: 700;
	color: var(--la-primaer) !important;
}

.la .la__lead-intro {
	margin: 4px 0 10px !important;
	font-size: 0.85rem;
	color: var(--la-graa-700) !important;
}

.la .la__lead-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: none !important;
	border: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
}

.la .la__lead-input,
.la .la__lead-input:hover,
.la .la__lead-input:active {
	border: 1px solid var(--la-graa-200) !important;
	border-radius: 10px !important;
	background: var(--la-graa-100) !important;
	background-image: none !important;
	color: var(--la-tekst) !important;
	box-shadow: none !important;
}

.la .la__lead-input {
	padding: 10px 12px;
	font-size: 0.9rem;
	width: 100%;
}

.la .la__lead-input:focus {
	outline: none !important;
	border: 1px solid var(--la-accent) !important;
	border-radius: 10px !important;
	background: #fff !important;
	box-shadow: none !important;
}

.la .la__lead-input::placeholder {
	color: var(--la-graa-500) !important;
	opacity: 1;
}

.la .la__lead-fejl {
	margin: 0 !important;
	font-size: 0.8rem;
	color: #b3261e !important;
}

.la .la__lead-send,
.la .la__lead-send:link,
.la .la__lead-send:visited,
.la .la__lead-send:hover,
.la .la__lead-send:focus,
.la .la__lead-send:focus-within,
.la .la__lead-send:focus-visible,
.la .la__lead-send:active {
	background: var(--la-accent) !important;
	background-color: var(--la-accent) !important;
	background-image: none !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 999px !important;
}

.la .la__lead-send {
	padding: 11px 14px;
	font-weight: 700;
	font-size: 0.9rem;
	text-align: center;
	transition: filter 0.15s ease, opacity 0.15s ease;
}

.la .la__lead-send:hover {
	filter: brightness(0.92);
}

.la .la__lead-send:disabled {
	opacity: 0.55 !important;
	cursor: default;
}

.la .la__lead-send:focus-visible {
	outline: 2px solid var(--la-primaer) !important;
	outline-offset: 2px;
}

/* ---------- Typing-indikator ---------- */
.la .la__typing {
	display: inline-flex;
	gap: 4px;
	align-items: center;
}

.la .la__typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--la-graa-500) !important;
	animation: la-blink 1.2s infinite ease-in-out both;
}

.la .la__typing span:nth-child(2) { animation-delay: 0.2s; }
.la .la__typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes la-blink {
	0%, 80%, 100% { opacity: 0.25; }
	40% { opacity: 1; }
}

/* ---------- Input ---------- */
.la .la__inputbar {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px 14px;
	border: 0 !important;
	border-top: 1px solid var(--la-graa-200) !important;
	background: var(--la-bg) !important;
	margin: 0 !important;
}

.la .la__hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.la .la__input,
.la .la__input:hover,
.la .la__input:active {
	border: 1px solid var(--la-graa-200) !important;
	border-radius: 14px !important;
	background: var(--la-graa-100) !important;
	background-image: none !important;
	color: var(--la-tekst) !important;
	box-shadow: none !important;
}

.la .la__input {
	flex: 1;
	padding: 11px 14px;
	font: inherit;
	font-size: 0.94rem;
	resize: none;
	max-height: 120px;
}

.la .la__input:focus {
	outline: none !important;
	border: 1px solid var(--la-accent) !important;
	border-radius: 14px !important;
	background: #fff !important;
	box-shadow: none !important;
}

.la .la__input::placeholder {
	color: var(--la-graa-500) !important;
	opacity: 1;
}

.la .la__send,
.la .la__send:link,
.la .la__send:visited,
.la .la__send:hover,
.la .la__send:focus,
.la .la__send:focus-within,
.la .la__send:focus-visible,
.la .la__send:active {
	background: var(--la-accent) !important;
	background-color: var(--la-accent) !important;
	background-image: none !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 50% !important;
}

.la .la__send {
	width: 44px;
	height: 44px;
	flex: none;
	padding: 0;
	display: grid;
	place-items: center;
	transition: filter 0.15s ease, opacity 0.15s ease;
}

.la .la__send:hover {
	filter: brightness(0.92);
}

.la .la__send:disabled {
	opacity: 0.45 !important;
	cursor: default;
}

.la .la__send:focus-visible {
	outline: 3px solid var(--la-primaer) !important;
	outline-offset: 2px;
}

/* ---------- Disclaimer ---------- */
.la .la__disclaimer {
	margin: 0 !important;
	padding: 8px 16px 12px;
	text-align: center;
	font-size: 0.72rem;
	color: var(--la-graa-500) !important;
	background: var(--la-bg) !important;
	border: 0 !important;
}

/* ---------- Mobil: fuldskærm ---------- */
@media (max-width: 480px) {
	.la {
		left: 12px;
		bottom: 12px;
	}

	.la.is-open .la__panel {
		position: fixed;
		inset: 0;
		width: 100vw;
		max-height: 100vh;
		height: 100%;
		border-radius: 0 !important;
		border: 0 !important;
	}

	.la.is-open .la__panel > .la__header,
	.la.is-open .la__panel > *:last-child {
		border-radius: 0 !important;
	}
}

/* ---------- Teaser ("Vi er online på chatten") ---------- */
.la .la__teaser,
.la .la__teaser:link,
.la .la__teaser:visited,
.la .la__teaser:hover,
.la .la__teaser:focus,
.la .la__teaser:focus-within,
.la .la__teaser:focus-visible,
.la .la__teaser:active {
	background: var(--la-bg) !important;
	background-color: var(--la-bg) !important;
	background-image: none !important;
	color: var(--la-tekst) !important;
	border: 1px solid var(--la-graa-200) !important;
	border-radius: 999px !important;
	opacity: 1 !important;
}

.la .la__teaser {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 8px 22px rgba(20, 40, 28, 0.18) !important;
	transition: transform 0.15s ease;
	animation: la-teaser-ind 0.35s ease 0.8s backwards;
}

.la .la__teaser:hover {
	transform: translateY(-2px);
}

.la .la__teaser:focus-visible {
	outline: 3px solid var(--la-accent) !important;
	outline-offset: 2px;
}

.la .la__teaser-dot {
	width: 9px;
	height: 9px;
	flex: none;
	border-radius: 50%;
	background: var(--la-primaer) !important;
	animation: la-teaser-puls 2s infinite ease-in-out;
}

.la .la__teaser-tekst {
	color: inherit !important;
}

/* Skjul teaseren når chatten er åben. */
.la.is-open .la__teaser {
	display: none !important;
}

@keyframes la-teaser-ind {
	from { opacity: 0; transform: translateX(-8px); }
	to   { opacity: 1; transform: none; }
}

@keyframes la-teaser-puls {
	0%, 100% { box-shadow: 0 0 0 0 rgba(118, 184, 42, 0.5); }
	50%      { box-shadow: 0 0 0 6px rgba(118, 184, 42, 0); }
}

@media (prefers-reduced-motion: reduce) {
	.la .la__teaser { animation: none; }
	.la .la__teaser-dot { animation: none; }
}

@media (max-width: 480px) {
	.la .la__teaser {
		font-size: 0.84rem;
		padding: 9px 13px;
	}
}
