/**
 * PrehabLab Entscheidungshelfer
 * Alle Stile sind auf .phl gescoped. Design-Anpassungen erfolgen über die Variablen unten.
 */

.phl {
	/* Marke (vorläufig aus Logo und erstem Entwurf abgeleitet) */
	--phl-primary: #556f4c;
	--phl-primary-hover: #465d3f;
	--phl-brand: #829b7b;
	--phl-accent-soft: #e3eddb;
	--phl-surface: #f3f2ee;
	--phl-card: #fefdf9;
	--phl-border: #dcdcd3;
	--phl-text: #252726;
	--phl-muted: #5f635e;
	--phl-on-primary: #ffffff;

	/* Form */
	--phl-radius: 10px;
	--phl-radius-lg: 18px;
	--phl-shadow: 0 1px 2px rgb(37 39 38 / 0.04), 0 8px 24px -12px rgb(37 39 38 / 0.18);
	--phl-max-width: 720px;
	--phl-gap: clamp(16px, 3vw, 24px);
	--phl-pad: clamp(20px, 5vw, 48px);
	--phl-scroll-offset: 96px; /* Platz für einen fixierten Theme-Header */

	/* Schrift: standardmässig vom Theme geerbt */
	--phl-font-body: inherit;
	--phl-font-heading: inherit;

	box-sizing: border-box;
	max-width: var(--phl-max-width);
	margin-inline: auto;
	padding: var(--phl-pad);
	border-radius: var(--phl-radius-lg);
	background: var(--phl-surface);
	color: var(--phl-text);
	font-family: var(--phl-font-body);
	font-size: clamp(16px, 1rem, 18px);
	line-height: 1.6;
	text-align: left;
	scroll-margin-top: var(--phl-scroll-offset);
	-webkit-font-smoothing: antialiased;
}

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

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

.phl p,
.phl h2,
.phl h3,
.phl ul {
	margin: 0;
	padding: 0;
}

/* ---------- Typografie ---------- */

.phl .phl-kicker,
.phl .phl-label,
.phl .phl-progress__label {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--phl-primary);
}

.phl .phl-title {
	font-family: var(--phl-font-heading);
	font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.1rem);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--phl-text);
	text-wrap: balance;
	outline: none;
}

.phl .phl-subtitle {
	font-family: var(--phl-font-heading);
	font-size: 1.2rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--phl-text);
}

.phl .phl-lead,
.phl .phl-text {
	color: var(--phl-muted);
	text-wrap: pretty;
}

.phl a {
	color: var(--phl-primary);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.phl .phl-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.phl .phl-icon {
	display: inline-flex;
	flex-shrink: 0;
}

/* ---------- Intro ---------- */

.phl-intro {
	display: grid;
	gap: var(--phl-gap);
	justify-items: start;
}

.phl-intro__icon {
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--phl-accent-soft);
	color: var(--phl-primary);
}

.phl .phl-intro .phl-title {
	margin-top: -8px;
}

.phl-box {
	width: 100%;
	padding: 20px 24px;
	border: 1px solid var(--phl-border);
	border-radius: var(--phl-radius);
	background: var(--phl-card);
}

.phl .phl-box__title {
	margin-bottom: 12px;
	font-weight: 600;
}

.phl .phl-checklist {
	display: grid;
	gap: 10px;
	list-style: none;
}

.phl .phl-checklist li {
	position: relative;
	padding-left: 32px;
	color: var(--phl-muted);
}

.phl .phl-checklist li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.2em;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--phl-accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23556f4c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.phl .phl-js-only {
	display: none;
}

.phl.phl--js .phl-js-only {
	display: inline-flex;
}

.phl .phl-note {
	color: var(--phl-muted);
}

/* ---------- Buttons ---------- */

.phl .phl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	padding: 12px 24px;
	border: 1px solid transparent;
	border-radius: var(--phl-radius);
	font: inherit;
	font-family: var(--phl-font-heading);
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.phl .phl-btn--primary {
	background: var(--phl-primary);
	color: var(--phl-on-primary);
}

.phl .phl-btn--primary:hover {
	background: var(--phl-primary-hover);
	color: var(--phl-on-primary);
}

.phl .phl-btn--primary .phl-icon,
.phl .phl-btn--primary svg {
	transition: transform 0.15s;
}

.phl .phl-btn--primary:hover .phl-icon,
.phl .phl-btn--primary:hover svg {
	transform: translateX(3px);
}

.phl .phl-btn--secondary {
	background: transparent;
	border-color: var(--phl-border);
	color: var(--phl-text);
}

.phl .phl-btn--secondary:hover {
	border-color: var(--phl-primary);
	color: var(--phl-primary);
}

.phl .phl-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 8px 4px;
	border: 0;
	background: none;
	font: inherit;
	font-weight: 600;
	color: var(--phl-muted);
	cursor: pointer;
}

.phl .phl-link:hover {
	color: var(--phl-primary);
}

.phl :is(button, a):focus-visible {
	outline: 3px solid var(--phl-brand);
	outline-offset: 3px;
}

/* Theme-Abwehr: Themes wie Hello Elementor stylen button/a global (Hover-Farben, nowrap, Grossschreibung).
   Die doppelte Klasse hebt die Spezifität über typische Kit-Selektoren wie .elementor-kit-1 button:hover. */
.phl.phl :is(button, .phl-btn) {
	white-space: normal;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
}

.phl.phl .phl-answer:is(:hover, :focus, :active) {
	background: var(--phl-card);
	color: var(--phl-text);
}

.phl.phl .phl-answer:hover {
	border-color: var(--phl-brand);
	box-shadow: var(--phl-shadow);
}

.phl.phl .phl-answer.is-selected:is(:hover, :focus, :active, :not(:hover)) {
	border-color: var(--phl-primary);
	background: var(--phl-accent-soft);
	box-shadow: inset 0 0 0 1px var(--phl-primary);
}

.phl.phl .phl-link:is(:hover, :focus, :active) {
	background: none;
	color: var(--phl-primary);
}

.phl.phl .phl-btn--primary:is(:hover, :focus, :active) {
	background: var(--phl-primary-hover);
	color: var(--phl-on-primary);
}

.phl.phl .phl-btn--secondary:is(:hover, :focus, :active) {
	background: transparent;
	border-color: var(--phl-primary);
	color: var(--phl-primary);
}

/* Falls ein Builder trotzdem <br> einschleust (wpautop). */
.phl .phl-inner br,
.phl .phl-btn > br {
	display: none;
}

.phl .phl-title:focus {
	outline: none;
}

.phl .phl-answer__label {
	min-width: 0;
	overflow-wrap: break-word;
	hyphens: auto;
}

/* ---------- Fortschritt ---------- */

.phl-progress {
	display: grid;
	gap: 12px;
	margin-bottom: 8px;
}

.phl-progress__track {
	height: 6px;
	overflow: hidden;
	border-radius: 99px;
	background: var(--phl-border);
}

.phl-progress__bar {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--phl-primary);
	transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.phl-progress.is-done {
	margin-bottom: 4px;
}

/* ---------- Fragen ---------- */

.phl-step {
	display: grid;
	gap: var(--phl-gap);
}

.phl-answers {
	display: grid;
	gap: 12px;
}

.phl .phl-answer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	min-height: 64px;
	padding: 16px 20px;
	border: 1px solid var(--phl-border);
	border-radius: var(--phl-radius);
	background: var(--phl-card);
	box-shadow: none;
	font: inherit;
	line-height: 1.4;
	text-align: left;
	color: var(--phl-text);
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.phl .phl-answer .phl-icon {
	color: var(--phl-brand);
	transition: transform 0.15s, color 0.15s;
}

.phl .phl-answer:hover {
	border-color: var(--phl-brand);
	box-shadow: var(--phl-shadow);
}

.phl .phl-answer:hover .phl-icon {
	color: var(--phl-primary);
	transform: translateX(3px);
}

.phl .phl-answer:active {
	transform: scale(0.99);
}

.phl .phl-answer.is-selected {
	border-color: var(--phl-primary);
	background: var(--phl-accent-soft);
	box-shadow: inset 0 0 0 1px var(--phl-primary);
}

.phl .phl-answer.is-selected .phl-icon {
	color: var(--phl-primary);
}

.phl-nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 24px;
	padding-top: 8px;
	border-top: 1px solid var(--phl-border);
}

/* ---------- Ergebnis ---------- */

.phl-card {
	display: grid;
	gap: 14px;
	padding: clamp(20px, 4vw, 32px);
	border: 1px solid var(--phl-border);
	border-radius: var(--phl-radius-lg);
	background: var(--phl-card);
}

.phl-card--primary {
	border-color: transparent;
	box-shadow: var(--phl-shadow);
}

.phl .phl-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	justify-self: start;
	padding: 6px 12px;
	border-radius: 99px;
	background: var(--phl-accent-soft);
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--phl-primary);
}

.phl-card--alt {
	background: transparent;
	gap: 8px;
}

.phl-card--alt .phl-label {
	color: var(--phl-muted);
}

.phl-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 6px;
}

.phl-hint {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 16px 20px;
	border-radius: var(--phl-radius);
	background: var(--phl-accent-soft);
	color: var(--phl-text);
}

.phl-hint .phl-icon {
	margin-top: 2px;
	color: var(--phl-primary);
}

.phl .phl-hint a {
	font-weight: 600;
	white-space: nowrap;
}

.phl .phl-disclaimer {
	font-size: 0.85rem;
	color: var(--phl-muted);
}

/* ---------- Mobil ---------- */

@media (max-width: 560px) {
	.phl {
		border-radius: var(--phl-radius);
	}

	.phl .phl-actions .phl-btn,
	.phl .phl-intro .phl-btn {
		width: 100%;
	}
}

/* ---------- Bewegung ---------- */

.phl-enter {
	animation: phl-enter 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

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

@media (prefers-reduced-motion: reduce) {
	.phl *,
	.phl *::before,
	.phl *::after {
		animation: none !important;
		transition: none !important;
	}
}
