/**
 * Powerline FAQ Assistent – Stylesheet
 *
 * Alle Klassen sind mit "plfaq-" geprefixt und über ".plfaq-wrapper"
 * gescoped, damit möglichst wenig mit dem WordPress-Theme kollidiert.
 *
 * Farben, Radien und Abstände sind als CSS-Variablen definiert und
 * können bequem oben angepasst werden (siebe :root-Block bzw. .plfaq-wrapper).
 */

/* =========================================================
   1. Design-Tokens (hier zentral Farben/Abstände anpassen)
   ========================================================= */
.plfaq-wrapper {
	/* Akzent (freundliches, ruhiges Blau – harmoniert mit mld-service.eu) */
	--plfaq-accent: #2563eb;
	--plfaq-accent-dark: #1e40af;
	--plfaq-accent-soft: #eaf1fe;

	/* Statusfarben – dezent gehalten */
	--plfaq-success: #1b8a5a;
	--plfaq-success-bg: #e9f7f0;
	--plfaq-warning: #a86710;
	--plfaq-warning-bg: #fdf4e3;
	--plfaq-error: #c0392b;
	--plfaq-error-bg: #fdecea;

	/* Neutrale Flächen und Text */
	--plfaq-text: #1f2933;
	--plfaq-text-muted: #5b6673;
	--plfaq-border: #e2e6ec;
	--plfaq-surface: #ffffff;
	--plfaq-surface-alt: #f5f7fa;

	/* Form */
	--plfaq-radius: 14px;
	--plfaq-radius-sm: 10px;
	--plfaq-shadow: 0 6px 24px rgba(20, 34, 61, 0.08);
	--plfaq-shadow-sm: 0 2px 8px rgba(20, 34, 61, 0.06);
	--plfaq-gap: 20px;

	/* Grundlayout des Wrappers */
	box-sizing: border-box;
	display: block;
	max-width: 1080px;
	margin: 28px auto;
	color: var(--plfaq-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.55;
	-webkit-text-size-adjust: 100%;
}

/* Innerhalb des Wrappers box-sizing vereinheitlichen (theme-sicher). */
.plfaq-wrapper *,
.plfaq-wrapper *::before,
.plfaq-wrapper *::after {
	box-sizing: border-box;
}

.plfaq-wrapper p {
	margin: 0 0 0.6em;
}

/* =========================================================
   2. Buttons (allgemein)
   ========================================================= */
.plfaq-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	padding: 12px 20px;
	border-radius: var(--plfaq-radius-sm);
	border: 2px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
	min-height: 44px; /* gute Touch-Fläche */
}

.plfaq-btn-primary {
	background: var(--plfaq-accent);
	color: #fff;
	border-color: var(--plfaq-accent);
}

.plfaq-btn-primary:hover {
	background: var(--plfaq-accent-dark);
	border-color: var(--plfaq-accent-dark);
}

.plfaq-btn-ghost {
	background: transparent;
	color: var(--plfaq-text-muted);
	border-color: var(--plfaq-border);
}

.plfaq-btn-ghost:hover {
	background: var(--plfaq-surface-alt);
	color: var(--plfaq-text);
}

.plfaq-btn-secondary {
	background: var(--plfaq-surface);
	color: var(--plfaq-accent-dark);
	border-color: var(--plfaq-accent);
}

.plfaq-btn-secondary:hover {
	background: var(--plfaq-accent-soft);
}

.plfaq-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Deaktivierter "Weiter"-Button (nach der letzten Frage):
   klar erkennbar blass-hellblau statt "fast normal". */
.plfaq-btn-secondary:disabled {
	opacity: 1;
	background: var(--plfaq-accent-soft);
	color: #a9bde0;
	border-color: var(--plfaq-accent-soft);
}

.plfaq-btn-secondary:disabled:hover {
	background: var(--plfaq-accent-soft);
	color: #a9bde0;
	border-color: var(--plfaq-accent-soft);
}

/* Deutlich sichtbarer Fokus für Tastaturbedienung */
.plfaq-wrapper button:focus-visible,
.plfaq-wrapper a:focus-visible,
.plfaq-wrapper select:focus-visible,
.plfaq-wrapper [tabindex]:focus-visible {
	outline: 3px solid var(--plfaq-accent);
	outline-offset: 2px;
}

/* =========================================================
   3. Eingeklappte Startbox
   ========================================================= */
.plfaq-collapsed {
	display: flex;
	align-items: center;
	gap: var(--plfaq-gap);
	flex-wrap: wrap;
	background: var(--plfaq-surface);
	border: 1px solid var(--plfaq-border);
	border-radius: var(--plfaq-radius);
	box-shadow: var(--plfaq-shadow-sm);
	padding: 22px 24px;
}

.plfaq-collapsed-icon {
	font-size: 34px;
	line-height: 1;
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--plfaq-accent-soft);
	border-radius: 50%;
}

.plfaq-collapsed-text {
	flex: 1 1 260px;
	min-width: 220px;
}

.plfaq-collapsed-title {
	margin: 0 0 4px;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--plfaq-text);
}

.plfaq-collapsed-desc {
	margin: 0;
	color: var(--plfaq-text-muted);
}

.plfaq-collapsed-actions {
	display: flex;
	gap: 10px;
	flex: 0 0 auto;
	flex-wrap: wrap;
}

/* Dezente Ablehnungsmeldung */
.plfaq-dismissed {
	background: var(--plfaq-surface-alt);
	border: 1px dashed var(--plfaq-border);
	border-radius: var(--plfaq-radius);
	padding: 16px 20px;
	color: var(--plfaq-text-muted);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.plfaq-noscript {
	background: var(--plfaq-warning-bg);
	color: var(--plfaq-warning);
	border: 1px solid var(--plfaq-warning);
	border-radius: var(--plfaq-radius-sm);
	padding: 14px 16px;
	margin-bottom: 12px;
}

/* =========================================================
   4. Geöffnete App – Kopf & Layout
   ========================================================= */
.plfaq-app {
	background: var(--plfaq-surface);
	border: 1px solid var(--plfaq-border);
	border-radius: var(--plfaq-radius);
	box-shadow: var(--plfaq-shadow);
	overflow: hidden;
}

.plfaq-app-header {
	padding: 22px 24px 6px;
}

.plfaq-app-title {
	margin: 0 0 4px;
	font-size: 1.4rem;
	font-weight: 700;
}

.plfaq-app-intro {
	margin: 0 0 14px;
	color: var(--plfaq-text-muted);
}

/* Werkzeugleiste (Disclaimer-Link, Reset) */
.plfaq-toolbar {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin-top: 10px;
}

.plfaq-toolbar-link {
	background: none;
	border: none;
	padding: 4px 2px;
	font: inherit;
	font-size: 0.9rem;
	color: var(--plfaq-text-muted);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.plfaq-toolbar-link:hover {
	color: var(--plfaq-accent-dark);
}

/* Fortschritt */
.plfaq-progress {
	padding: 4px 24px 18px;
}

.plfaq-progress-labels {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 0.9rem;
	color: var(--plfaq-text-muted);
	margin-bottom: 8px;
}

.plfaq-progress-current {
	font-weight: 600;
	color: var(--plfaq-text);
}

.plfaq-progress-track {
	height: 8px;
	background: var(--plfaq-surface-alt);
	border-radius: 999px;
	overflow: hidden;
}

.plfaq-progress-bar {
	height: 100%;
	width: 0;
	background: var(--plfaq-accent);
	border-radius: 999px;
	transition: width 0.35s ease;
}

.plfaq-progress-hint {
	margin: 10px 0 0;
	font-size: 0.9rem;
	color: var(--plfaq-success);
	background: var(--plfaq-success-bg);
	border-radius: var(--plfaq-radius-sm);
	padding: 8px 12px;
}

/* Zwei-Spalten-Grid */
.plfaq-columns {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
	border-top: 1px solid var(--plfaq-border);
}

@media (min-width: 900px) {
	.plfaq-columns {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}

	.plfaq-col-questions {
		border-right: 1px solid var(--plfaq-border);
	}
}

.plfaq-col-questions,
.plfaq-col-result {
	padding: 22px 24px 26px;
	min-width: 0;
}

.plfaq-col-result {
	background: var(--plfaq-surface-alt);
}

/* =========================================================
   5. Fragekarte & Antworten
   ========================================================= */
.plfaq-question-card {
	background: var(--plfaq-surface);
	border: 1px solid var(--plfaq-border);
	border-radius: var(--plfaq-radius);
	box-shadow: var(--plfaq-shadow-sm);
	padding: 20px;
}

.plfaq-question-kicker {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--plfaq-accent-dark);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 6px;
}

.plfaq-question-title {
	margin: 0 0 6px;
	font-size: 1.15rem;
	font-weight: 700;
}

.plfaq-question-help {
	margin: 0 0 16px;
	font-size: 0.92rem;
	color: var(--plfaq-text-muted);
}

.plfaq-answers {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0 0 8px;
}

/* Antwort-Buttons (Single- und Mehrfachauswahl) */
.plfaq-answer-button {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	text-align: left;
	background: var(--plfaq-surface);
	border: 2px solid var(--plfaq-border);
	border-radius: var(--plfaq-radius-sm);
	padding: 13px 15px;
	font: inherit;
	color: var(--plfaq-text);
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
	min-height: 48px;
}

.plfaq-answer-button:hover {
	border-color: var(--plfaq-accent);
	background: var(--plfaq-accent-soft);
}

.plfaq-answer-button[aria-pressed="true"],
.plfaq-answer-button.is-selected {
	border-color: var(--plfaq-accent);
	background: var(--plfaq-accent-soft);
	box-shadow: inset 0 0 0 1px var(--plfaq-accent);
}

/* Auswahl-Marker (nicht nur Farbe – auch Form) */
.plfaq-answer-marker {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border: 2px solid var(--plfaq-border);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	line-height: 1;
	color: #fff;
	background: transparent;
}

/* Mehrfachauswahl bekommt eckige Marker */
.plfaq-answer-button[data-multi="1"] .plfaq-answer-marker {
	border-radius: 6px;
}

.plfaq-answer-button[aria-pressed="true"] .plfaq-answer-marker,
.plfaq-answer-button.is-selected .plfaq-answer-marker {
	background: var(--plfaq-accent);
	border-color: var(--plfaq-accent);
}

.plfaq-answer-label {
	flex: 1 1 auto;
}

/* Unterfrage (z. B. Etage, Überspannungsschutz) */
.plfaq-subquestion {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px dashed var(--plfaq-border);
}

.plfaq-subquestion-title {
	font-size: 0.98rem;
	font-weight: 600;
	margin: 0 0 10px;
}

/* Select-Felder (Frage 4) */
.plfaq-select-group {
	display: grid;
	gap: 14px;
	margin-bottom: 4px;
}

@media (min-width: 480px) {
	.plfaq-select-group.plfaq-select-two {
		grid-template-columns: 1fr 1fr;
	}
}

.plfaq-field-label {
	display: block;
	font-weight: 600;
	font-size: 0.95rem;
	margin-bottom: 6px;
}

.plfaq-select {
	width: 100%;
	font: inherit;
	padding: 11px 12px;
	border: 2px solid var(--plfaq-border);
	border-radius: var(--plfaq-radius-sm);
	background: var(--plfaq-surface);
	color: var(--plfaq-text);
	min-height: 46px;
}

.plfaq-select:hover {
	border-color: var(--plfaq-accent);
}

/* Chip-Auswahl für Mehrfachauswahl-Kompaktanzeige (optional genutzt) */
.plfaq-inline-choices {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* Navigation */
.plfaq-nav {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	margin-top: 18px;
}

.plfaq-nav .plfaq-btn {
	flex: 0 0 auto;
}

/* =========================================================
   6. Antwortübersicht ("Deine Angaben")
   ========================================================= */
.plfaq-summary {
	margin-top: 22px;
	background: var(--plfaq-surface);
	border: 1px solid var(--plfaq-border);
	border-radius: var(--plfaq-radius);
	padding: 16px 18px;
}

.plfaq-summary-title {
	margin: 0 0 10px;
	font-size: 1rem;
	font-weight: 700;
}

.plfaq-summary-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.plfaq-summary-item {
	display: flex;
	align-items: baseline;
	gap: 10px;
	font-size: 0.92rem;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--plfaq-border);
}

.plfaq-summary-item:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.plfaq-summary-key {
	flex: 0 0 34%;
	color: var(--plfaq-text-muted);
	font-weight: 600;
}

.plfaq-summary-value {
	flex: 1 1 auto;
	color: var(--plfaq-text);
}

.plfaq-summary-change {
	flex: 0 0 auto;
	background: none;
	border: none;
	padding: 2px 4px;
	font: inherit;
	font-size: 0.85rem;
	color: var(--plfaq-accent-dark);
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.plfaq-summary-change:hover {
	color: var(--plfaq-accent);
}

.plfaq-summary-empty {
	color: var(--plfaq-text-muted);
	font-size: 0.9rem;
}

/* =========================================================
   7. Live-Ergebnisbereich (Kurzanleitung / Druckbereich)
   ========================================================= */
.plfaq-result {
	position: relative;
}

@media (min-width: 900px) {
	.plfaq-result {
		position: sticky;
		top: 20px;
	}
}

.plfaq-result-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.plfaq-result-title {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--plfaq-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.plfaq-result-disclaimer {
	flex: 0 0 auto;
	font-size: 0.85rem;
}

/* Das eigentliche "Dokument", das gedruckt wird */
.plfaq-print-area {
	position: relative;
	background: var(--plfaq-surface);
	border: 1px solid var(--plfaq-border);
	border-radius: var(--plfaq-radius);
	box-shadow: var(--plfaq-shadow-sm);
	padding: 22px 22px 60px;
}

.plfaq-doc-title {
	margin: 0 0 4px;
	font-size: 1.2rem;
	font-weight: 800;
}

.plfaq-doc-subtitle {
	margin: 0 0 16px;
	font-size: 0.9rem;
	color: var(--plfaq-text-muted);
}

.plfaq-doc-placeholder {
	color: var(--plfaq-text-muted);
	background: var(--plfaq-surface-alt);
	border-radius: var(--plfaq-radius-sm);
	padding: 18px;
}

.plfaq-doc-hint {
	margin-top: 8px;
	font-size: 0.85rem;
}

/* Abschnitte der Anleitung */
.plfaq-section {
	margin: 0 0 18px;
}

.plfaq-section:last-of-type {
	margin-bottom: 0;
}

.plfaq-section-title {
	margin: 0 0 8px;
	font-size: 1.02rem;
	font-weight: 700;
	color: var(--plfaq-accent-dark);
	padding-bottom: 4px;
	border-bottom: 2px solid var(--plfaq-accent-soft);
}

.plfaq-section p {
	margin: 0 0 8px;
}

.plfaq-section ul,
.plfaq-section ol {
	margin: 0 0 8px;
	padding-left: 22px;
}

.plfaq-section li {
	margin-bottom: 5px;
}

.plfaq-section li:last-child {
	margin-bottom: 0;
}

/* Kurzfassung optisch hervorheben */
.plfaq-section-summary p {
	background: var(--plfaq-accent-soft);
	border-radius: var(--plfaq-radius-sm);
	padding: 12px 14px;
}

/* Hinweisboxen innerhalb der Anleitung */
.plfaq-note {
	border-radius: var(--plfaq-radius-sm);
	padding: 10px 14px;
	margin: 8px 0;
	font-size: 0.92rem;
	border-left: 4px solid transparent;
}

.plfaq-note::before {
	font-weight: 700;
	margin-right: 6px;
}

.plfaq-note-success {
	background: var(--plfaq-success-bg);
	color: #14603f;
	border-left-color: var(--plfaq-success);
}

.plfaq-note-success::before {
	content: "✓";
	color: var(--plfaq-success);
}

.plfaq-note-warning {
	background: var(--plfaq-warning-bg);
	color: #7a4d0c;
	border-left-color: var(--plfaq-warning);
}

.plfaq-note-warning::before {
	content: "!";
	color: var(--plfaq-warning);
}

.plfaq-note-error {
	background: var(--plfaq-error-bg);
	color: #8f271c;
	border-left-color: var(--plfaq-error);
}

.plfaq-note-error::before {
	content: "•";
	color: var(--plfaq-error);
}

.plfaq-note-info {
	background: var(--plfaq-accent-soft);
	color: var(--plfaq-accent-dark);
	border-left-color: var(--plfaq-accent);
}

.plfaq-note-info::before {
	content: "i";
	font-style: italic;
	color: var(--plfaq-accent);
}

/* Druckbutton unten rechts im Ergebnisbereich */
.plfaq-print-button {
	position: absolute;
	right: 16px;
	bottom: 16px;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 2px solid var(--plfaq-border);
	background: var(--plfaq-surface);
	color: var(--plfaq-accent-dark);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: var(--plfaq-shadow-sm);
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.plfaq-print-button:hover {
	background: var(--plfaq-accent);
	border-color: var(--plfaq-accent);
	color: #fff;
}

.plfaq-print-button svg {
	width: 22px;
	height: 22px;
	display: block;
	fill: currentColor;
}

/* Screenreader-only Text */
.plfaq-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* =========================================================
   8. Disclaimer-Overlay
   ========================================================= */
.plfaq-overlay {
	/* Das Overlay hängt an <body> – daher hier eigene Tokens definieren,
	   sonst greifen die Variablen aus .plfaq-wrapper nicht. */
	--plfaq-accent: #2563eb;
	--plfaq-accent-dark: #1e40af;
	--plfaq-accent-soft: #eaf1fe;
	--plfaq-success: #1b8a5a;
	--plfaq-text: #1f2933;
	--plfaq-text-muted: #5b6673;
	--plfaq-border: #e2e6ec;
	--plfaq-surface: #ffffff;
	--plfaq-radius: 14px;
	--plfaq-radius-sm: 10px;

	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(15, 23, 42, 0.72);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--plfaq-text);
	box-sizing: border-box;
}

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

.plfaq-overlay[hidden] {
	display: none;
}

.plfaq-modal {
	background: #ffffff;
	color: var(--plfaq-text);
	border-radius: var(--plfaq-radius);
	box-shadow: 0 24px 70px rgba(15, 23, 42, 0.5);
	width: 100%;
	max-width: 640px;
	max-height: 86vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.plfaq-modal-header {
	padding: 20px 24px 12px;
	border-bottom: 1px solid var(--plfaq-border);
}

.plfaq-modal-title {
	margin: 0 0 4px;
	font-size: 1.3rem;
	font-weight: 800;
}

.plfaq-modal-scope {
	margin: 0;
	font-size: 0.92rem;
	color: var(--plfaq-text-muted);
}

.plfaq-modal-body {
	padding: 16px 24px;
	overflow-y: auto;
	flex: 1 1 auto;
	font-size: 0.95rem;
}

.plfaq-modal-body p {
	margin: 0 0 12px;
}

.plfaq-modal-body strong {
	color: var(--plfaq-text);
}

.plfaq-modal-footer {
	flex: 0 0 auto;
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding: 14px 24px;
	border-top: 1px solid var(--plfaq-border);
	background: #ffffff;
}

/* Beide Fuß-Buttons sehen absichtlich identisch aus: dezent, in Textfarbe. */
.plfaq-modal-footer .plfaq-btn {
	background: #ffffff;
	color: #3f4a56;
	border-color: #cfd6df;
	font-weight: 600;
}

.plfaq-modal-footer .plfaq-btn:hover {
	background: #f2f4f7;
	color: #1f2933;
	border-color: #b7c0cc;
}

.plfaq-copy-feedback {
	margin-right: auto;
	align-self: center;
	font-size: 0.88rem;
	color: var(--plfaq-success);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.plfaq-copy-feedback.is-visible {
	opacity: 1;
}

/* Body-Scroll sperren, wenn Overlay offen ist */
body.plfaq-no-scroll {
	overflow: hidden;
}

/* =========================================================
   9. Utility
   ========================================================= */
.plfaq-wrapper [hidden] {
	display: none !important;
}

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
	.plfaq-wrapper *,
	.plfaq-overlay * {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

/* =========================================================
   10. Druck
   Der Ausdruck erfolgt theme-unabhängig über einen versteckten
   iframe (siehe powerline-faq.js -> printGuide()), der nur die
   Kurzanleitung mit eigenem Print-CSS enthält. Dadurch entstehen
   keine Konflikte mit dem WordPress-Theme.
   ========================================================= */
