/**
 * HA LimeSurvey – Frontend-Styles (Umfrage-Ticker).
 *
 * Alle Farben sind als CSS-Variablen definiert und können im Theme überschrieben werden, z. B.:
 * .ha-ls { --ha-ls-primary: #003366; }
 */

.ha-ls {
	--ha-ls-primary: #1b2f8f;
	--ha-ls-accent: #0e1fa8;
	--ha-ls-text: #1b2f8f;
	--ha-ls-muted: #4a5568;
	--ha-ls-outer-bg: #e8eef3;
	--ha-ls-card-bg: #fff;
	--ha-ls-radius: 10px;
	--ha-ls-v1: #0b2a6f;
	--ha-ls-v2: #12a4b8;
	--ha-ls-v3: #7fc6d3;
	--ha-ls-v1-text: #fff;
	--ha-ls-v2-text: #fff;
	--ha-ls-v3-text: #0b2a6f;
	--ha-ls-error: #b42318;
	--ha-ls-success: #067647;

	box-sizing: border-box;
	container: ha-ls / inline-size;
	max-width: 420px;
	margin: 1.5em auto;
	padding: clamp(8px, 4%, 16px);
	background: var(--ha-ls-outer-bg);
	color: var(--ha-ls-text);
	font-size: 16px;
	line-height: 1.4;
	overflow-wrap: break-word;
}

/* In Widget-Bereichen (z. B. Sidebar der Startseite) volle Spaltenbreite, Abstand regelt das Theme. */
.ha-ls-widget .ha-ls,
.ha-ls-widget .ha-ls-frame {
	max-width: none;
	margin: 0;
}

/* Rahmen um die Box: Die Box nimmt die volle Breite ein, die Freigabe-Nr. steht absolut
 * positioniert rechts außerhalb (im Spaltenabstand) und beeinflusst die Breite nicht. */
.ha-ls-frame {
	position: relative;
	max-width: 420px;
	margin: 1.5em auto;
}

.ha-ls-frame > .ha-ls {
	max-width: none;
	margin: 0;
}

.ha-ls-frame--results-page {
	max-width: 760px;
}

.ha-ls-frame--wide {
	max-width: none;
	margin: 0 0 30px;
}

.ha-ls-frame--wide > .ha-ls.ha-ls--wide {
	margin: 0;
}

/* Freigabe-Nr. („C-Mat: …“) senkrecht rechts außerhalb der Box, um 90° nach links gedreht (von unten nach oben lesbar) */
.ha-ls-frame > .ha-ls__approval {
	position: absolute;
	bottom: 0;
	left: 100%;
	margin: 0 0 0 3px;
	padding: 0;
	color: #1b2f8f;
	font-size: 10px;
	line-height: 1.2;
	letter-spacing: 0.02em;
	white-space: nowrap;
	writing-mode: vertical-rl;
	transform: rotate(180deg);
}

.ha-ls-frame--branding-medpulse > .ha-ls__approval {
	color: #0e1fa8;
}

/* Startseite: unter den Buttons, über der ersten Anzeige (Theme-Container .ha-section--survey) */
.ha-section--survey {
	margin-bottom: 20px;
}

.ha-section--survey .ha-ls,
.ha-section--survey .ha-ls-frame {
	max-width: none;
	margin: 0;
}

.ha-section--survey .ha-ls-frame > .ha-ls {
	margin: 0;
}

/* Tracking-Pixel unsichtbar, ohne Layout-Einfluss */
.ha-ls__tracking {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.ha-ls *,
.ha-ls *::before,
.ha-ls *::after {
	box-sizing: inherit;
}

.ha-ls--results-page {
	max-width: 760px;
}

/* Kopf / Branding */
.ha-ls__brand {
	display: flex;
	justify-content: center;
	margin-bottom: 12px;
}

.ha-ls__logo {
	display: block;
	max-width: 180px;
	max-height: 60px;
	height: auto;
}

.ha-ls__logo[src*=".svg"]:not(.ha-ls__logo--medpulse) {
	width: auto;
	height: 60px;
	object-fit: contain;
}

/* MEDPulse-Logo (SVG): „Pulse“ ist transparent hinterlegt → weißer Grund wie in den Vorlagen. */
.ha-ls .ha-ls__logo--medpulse {
	width: auto;
	max-width: none;
	height: 32px;
	max-height: none;
	background: #fff;
}

/* Karte */
.ha-ls__card {
	position: relative;
	padding: 18px 16px;
	border-radius: var(--ha-ls-radius);
	background: var(--ha-ls-card-bg);
	text-align: center;
}

/* Fragebereich innerhalb des Formulars (Bezugsrahmen für die Freigabe-Nr.) */
.ha-ls__panel {
	position: relative;
}

.ha-ls__kicker {
	margin: 0 0 8px;
	font-size: 0.75em;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ha-ls__title {
	margin: 0 0 12px;
	color: var(--ha-ls-primary);
	font-family: inherit;
	font-size: 1.3em;
}

.ha-ls__question {
	display: block;
	margin: 0 0 14px;
	padding: 0;
	color: var(--ha-ls-primary);
	font-size: 1.25em;
	font-weight: 700;
	line-height: 1.25;
}

/* Formular */
.ha-ls__form {
	margin: 0;
}

.ha-ls__fieldset {
	min-width: 0;
	margin: 0 0 14px;
	padding: 0;
	border: 0;
}

.ha-ls__options {
	display: flex;
	flex-direction: column;
	gap: 8px;
	text-align: left;
}

.ha-ls__options--inline {
	flex-flow: row wrap;
	justify-content: center;
	gap: 8px 24px;
}

.ha-ls__option {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-weight: 600;
}

.ha-ls__options--inline .ha-ls__option {
	text-transform: uppercase;
	font-size: 0.85em;
}

.ha-ls__option input {
	flex: 0 0 auto;
	width: 1.1em;
	height: 1.1em;
	margin: 0;
	accent-color: var(--ha-ls-primary);
}

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

.ha-ls__button {
	display: inline-block;
	padding: 8px 22px;
	border: 2px solid var(--ha-ls-primary);
	border-radius: 999px;
	background: #fff;
	color: var(--ha-ls-primary);
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.ha-ls__button::after {
	content: " ›";
}

.ha-ls__button:hover,
.ha-ls__button:focus-visible {
	background: var(--ha-ls-primary);
	color: #fff;
}

.ha-ls__actions {
	margin: 12px 0 0;
}

/* JS aktiv + Autosubmit: Button ausblenden (ohne JS bleibt er sichtbar). */
.ha-ls--js [data-ha-ls-autosubmit] .ha-ls__button {
	display: none;
}

/* Meldungen */
.ha-ls__message {
	margin: 0 0 12px;
	font-size: 0.9em;
	font-weight: 600;
}

.ha-ls__message--success {
	color: var(--ha-ls-success);
}

.ha-ls__message--error {
	color: var(--ha-ls-error);
}

/* Ergebnis: gestapelter Balken (Live-Abstimmung) */
.ha-ls__stack {
	display: flex;
	overflow: hidden;
	min-height: 22px;
	border-radius: 4px;
	background: #e2e8f0;
	font-size: 0.75em;
	font-weight: 700;
}

.ha-ls__stack-seg {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	min-width: 0;
	padding: 3px 6px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: clip;
	transition: width 0.6s ease;
}

.ha-ls__stack-seg--v1 {
	background: var(--ha-ls-v1);
	color: var(--ha-ls-v1-text);
}

.ha-ls__stack-seg--v2 {
	justify-content: center;
	background: var(--ha-ls-v2);
	color: var(--ha-ls-v2-text);
}

.ha-ls__stack-seg--v3 {
	justify-content: flex-end;
	background: var(--ha-ls-v3);
	color: var(--ha-ls-v3-text);
}

.ha-ls__summary,
.ha-ls__meta {
	margin: 8px 0 0;
	color: var(--ha-ls-muted);
	font-size: 0.7em;
}

/* Ergebnis: Balken je Antwort (MEDPulse).
 * Bewusst <div> statt <ul>/<li>: Themes stylen Listen in Beiträgen sehr spezifisch (Bullets per ::before, display: table).
 * Balkenbreite = Prozentwert, mindestens aber so breit wie die Beschriftung; lange Texte brechen um. */
.ha-ls .ha-ls__bars {
	margin: 0;
	padding: 0;
	text-align: left;
}

.ha-ls .ha-ls__bar-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	margin: 0 0 10px;
	padding: 0;
}

.ha-ls .ha-ls__bar-track {
	display: grid;
	grid-template-columns: minmax(var(--ha-ls-pct, 0%), max-content) minmax(0, 1fr);
	min-width: 0;
}

.ha-ls .ha-ls__bar {
	display: block;
	min-width: 0;
	padding: 6px 12px;
	border: 2px solid #fff;
	border-radius: 8px;
	font-weight: 700;
	line-height: 1.3;
}

.ha-ls .ha-ls__bar-label {
	overflow-wrap: anywhere;
	white-space: normal;
}

.ha-ls .ha-ls__bar-value {
	min-width: 3.2em;
	font-weight: 700;
	text-align: right;
	white-space: nowrap;
}

.ha-ls__chart {
	position: relative;
	margin: 14px 0 0;
}

/* Sponsor / Werbung */
.ha-ls__sponsor {
	margin-top: 12px;
	color: var(--ha-ls-primary);
	font-size: 0.75em;
	text-align: center;
}

.ha-ls__sponsor p {
	margin: 0 0 4px;
}

.ha-ls__sponsor a {
	color: inherit;
	font-weight: 700;
}

.ha-ls__sponsor-logo,
.ha-ls__footer-logo {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-top: 10px;
}

.ha-ls__sponsor-logo a,
.ha-ls__footer-logo a {
	display: block;
}

/* Feste Höhe: SVGs ohne eigene Abmessungen fallen sonst (v. a. in einem Link) auf 0 zusammen. */
.ha-ls__sponsor-logo img,
.ha-ls__footer-logo img {
	display: block;
	width: auto;
	max-width: 200px;
	height: 60px;
	max-height: none;
	object-fit: contain;
}

.ha-ls__sponsor-logo img[src*=".svg"],
.ha-ls__footer-logo img[src*=".svg"] {
	width: 200px;
}

.ha-ls__ad {
	margin-top: 12px;
}

.ha-ls__ad-label {
	font-size: 0.9em;
}

/* Variante MEDPulse */
.ha-ls--branding-medpulse {
	--ha-ls-card-bg: #a6dcf5;
	--ha-ls-primary: #0e1fa8;
	--ha-ls-text: #0e1fa8;
	--ha-ls-v1: #a6f2c0;
	--ha-ls-v2: transparent;
	--ha-ls-v3: #f6c8f4;
	--ha-ls-v1-text: #0e1fa8;
	--ha-ls-v2-text: #0e1fa8;
	--ha-ls-v3-text: #0e1fa8;
}

.ha-ls--branding-medpulse .ha-ls__brand {
	margin-bottom: 0;
}

.ha-ls--branding-medpulse .ha-ls__card {
	border-radius: 0;
}

.ha-ls--branding-medpulse .ha-ls__question {
	font-size: 1.4em;
}

.ha-ls__bar--v1 {
	background: var(--ha-ls-v1);
	color: var(--ha-ls-v1-text);
}

.ha-ls__bar--v2 {
	background: var(--ha-ls-v2);
	color: var(--ha-ls-v2-text);
}

.ha-ls__bar--v3 {
	background: var(--ha-ls-v3);
	color: var(--ha-ls-v3-text);
}

/* Im Live-Abstimmungs-Layout ohne Hintergrundfarben für Balken-Varianten (Ergebnisseite). */
.ha-ls--branding-own .ha-ls__bar {
	border-color: transparent;
}

.ha-ls--branding-own .ha-ls__bar--v2,
.ha-ls--branding-own .ha-ls__bar--v3 {
	color: #fff;
}

/* MEDPulse-Formular: Optionen als Zeilen mit Rahmen (wie Ergebnisbalken) */
.ha-ls--medpulse .ha-ls__option {
	padding: 6px 12px;
	border: 2px solid #fff;
	border-radius: 8px;
}

.ha-ls--medpulse .ha-ls__option:hover,
.ha-ls--medpulse .ha-ls__option:focus-within {
	background: rgba(255, 255, 255, 0.4);
}

/* Variante MEDPulse + Addon (Vorlage): hellblauer Rahmen, weiße Fragebox, Button darunter auf blauem Grund */
.ha-ls--medpulse-addon {
	--ha-ls-outer-bg: #c8e9f8;
	--ha-ls-card-bg: transparent;
	padding-top: 0;
}

.ha-ls--medpulse-addon .ha-ls__card {
	padding: 0;
}

.ha-ls--medpulse-addon .ha-ls__panel,
.ha-ls--medpulse-addon .ha-ls__card > .ha-ls__results,
.ha-ls--medpulse-addon .ha-ls__card > .ha-ls__message {
	padding: 24px 20px;
	background: #fff;
	text-align: left;
}

.ha-ls--medpulse-addon .ha-ls__panel .ha-ls__message {
	margin: 0;
	text-align: center;
}

.ha-ls--medpulse-addon .ha-ls__question {
	font-size: 1.15em;
	text-align: center;
}

.ha-ls--medpulse-addon .ha-ls__fieldset:last-of-type {
	margin-bottom: 0;
}

.ha-ls--medpulse-addon .ha-ls__options {
	gap: 14px;
}

.ha-ls--medpulse-addon .ha-ls__option input {
	width: 1.3em;
	height: 1.3em;
}

.ha-ls--medpulse-addon .ha-ls__button {
	display: block;
	width: 80%;
	margin: 16px auto 0;
	border-color: #fff;
	background: #fff;
	color: var(--ha-ls-primary);
}

.ha-ls--medpulse-addon .ha-ls__button:hover,
.ha-ls--medpulse-addon .ha-ls__button:focus-visible {
	border-color: var(--ha-ls-primary);
	background: var(--ha-ls-primary);
	color: #fff;
}

.ha-ls--medpulse-addon .ha-ls__actions {
	margin-top: 0;
}

/* Redakteurshinweise */
.ha-ls-notice {
	margin: 1em 0;
	padding: 10px 14px;
	border-left: 4px solid #dba617;
	background: #fcf9e8;
	color: #1d2327;
	font-size: 14px;
}

.ha-ls-notice code {
	font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
	.ha-ls__bar,
	.ha-ls__stack-seg {
		transition: none;
	}
}

@media (min-width: 700px) {
	.ha-ls--results-page .ha-ls__card {
		padding: 28px 32px;
	}
}

/* Schmale Container (Sidebar ≈ 240–330 px): kleinere Schrift und Abstände wie im Startseiten-Mockup.
 * Container Queries reagieren auf die Breite des Widgets selbst, nicht auf das Browserfenster. */
@container ha-ls (max-width: 340px) {
	.ha-ls__card {
		padding: 14px 10px;
	}

	.ha-ls__question,
	.ha-ls--branding-medpulse .ha-ls__question,
	.ha-ls--medpulse-addon .ha-ls__question {
		font-size: 1em;
		line-height: 1.3;
	}

	.ha-ls--medpulse-addon .ha-ls__panel,
	.ha-ls--medpulse-addon .ha-ls__card > .ha-ls__results,
	.ha-ls--medpulse-addon .ha-ls__card > .ha-ls__message {
		padding: 16px 12px;
	}

	.ha-ls__option,
	.ha-ls__bar,
	.ha-ls__bar-value {
		font-size: 0.875em;
	}

	.ha-ls__options {
		gap: 10px;
	}

	.ha-ls--medpulse .ha-ls__option {
		padding: 5px 8px;
	}

	.ha-ls .ha-ls__bar {
		padding: 5px 8px;
	}

	.ha-ls .ha-ls__bar-row {
		gap: 8px;
	}

	.ha-ls__button,
	.ha-ls--medpulse-addon .ha-ls__button {
		width: 100%;
		padding: 7px 12px;
		font-size: 0.875em;
	}

	.ha-ls .ha-ls__logo--medpulse {
		height: 26px;
	}

	.ha-ls__logo {
		max-width: 140px;
		max-height: 44px;
	}

	.ha-ls__logo[src*=".svg"]:not(.ha-ls__logo--medpulse) {
		height: 44px;
	}

	.ha-ls__sponsor {
		font-size: 0.7em;
	}

	.ha-ls__sponsor-logo img,
	.ha-ls__footer-logo img {
		max-width: 160px;
		height: 48px;
	}

	.ha-ls__sponsor-logo img[src*=".svg"],
	.ha-ls__footer-logo img[src*=".svg"] {
		width: 160px;
	}

	.ha-ls__kicker {
		font-size: 0.7em;
	}
}

/* ==========================================================================
 * Breite Ergebnisbox (layout="wide") – Premium-Artikellayout, Vorlage
 * „Bsp_Ergebnisseite_Premium_Layout.pdf“: grauer Rahmen, Logo-Reiter oben links,
 * hellblaues Ergebnis-Panel, rechts Kundenlogo (ohne Hintergrund, mittig) und Sponsor-Text.
 * ======================================================================== */
.ha-ls.ha-ls--wide {
	--ha-ls-wide-panel: var(--ha-ls-card-bg);
	max-width: none;
	margin: 0 0 30px;
	padding: 0 0 24px 24px;
	background: var(--ha-ls-outer-bg);
}

.ha-ls--wide.ha-ls--branding-medpulse {
	--ha-ls-outer-bg: #e8edf0;
	--ha-ls-wide-panel: #c4ecf3;
}

.ha-ls--wide:not(.ha-ls--wide-sponsored) {
	padding-right: 24px;
}

.ha-ls__wide {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
}

.ha-ls--wide-sponsored .ha-ls__wide {
	grid-template-columns: minmax(0, 1fr) minmax(200px, 27%);
}

.ha-ls--wide .ha-ls__brand {
	justify-content: flex-start;
	margin: 0;
}

.ha-ls--wide .ha-ls__logo--medpulse {
	height: 40px;
}

.ha-ls__wide-panel {
	position: relative;
	padding: 40px 56px 20px;
	background: var(--ha-ls-wide-panel);
	text-align: left;
}

.ha-ls--wide .ha-ls__question {
	margin-bottom: 18px;
	font-size: 1em;
	text-align: left;
}

.ha-ls--wide .ha-ls__result + .ha-ls__result {
	margin-top: 28px;
}

.ha-ls--wide .ha-ls__bar-row {
	margin-bottom: 12px;
}

.ha-ls--wide .ha-ls__bar {
	padding: 9px 18px;
	border-width: 3px;
	border-radius: 10px;
	font-size: 0.9em;
}

.ha-ls--wide .ha-ls__bar-value {
	min-width: 4em;
	font-size: 0.95em;
}

.ha-ls--wide .ha-ls__meta {
	margin-top: 24px;
	text-align: right;
}

.ha-ls--wide .ha-ls__message {
	text-align: left;
}

/* Rechte Spalte: beginnt auf Höhe des Panels (unter dem Logo-Reiter) */
.ha-ls__wide-side {
	display: flex;
	flex-direction: column;
	padding-top: 40px;
	color: var(--ha-ls-primary);
	font-size: 0.75em;
	text-align: center;
}

.ha-ls__wide-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 70px;
	padding: 10px 16px;
}

.ha-ls__wide-logo a {
	display: block;
}

.ha-ls__wide-logo img {
	display: block;
	width: auto;
	max-width: 170px;
	height: 90px;
	object-fit: contain;
}

.ha-ls__wide-logo img[src*=".svg"] {
	width: 240px;
}

.ha-ls__wide-sponsor {
	padding: 22px 16px 0;
}

.ha-ls__wide-sponsor p {
	margin: 0 0 14px;
}

.ha-ls__wide-sponsor a {
	color: inherit;
	font-weight: 700;
}

/* Schmal (Mobil, schmale Inhaltsspalte): Sponsor-Spalte unter das Panel */
@container ha-ls (max-width: 640px) {
	.ha-ls--wide-sponsored .ha-ls__wide {
		grid-template-columns: minmax(0, 1fr);
	}

	.ha-ls__wide-panel {
		padding: 24px 18px 16px;
	}

	.ha-ls__wide-side {
		padding: 16px 24px 0 0;
	}

	.ha-ls--wide .ha-ls__logo--medpulse {
		height: 32px;
	}
}
