/**
 * Bonus Platform - Public Styles.
 * Modernes, seriöses FinTech-Design: viel Weißraum, klare Zahlen,
 * gedeckte Farben statt reißerischer "Geld verdienen"-Optik. Mobile-first.
 */

:root {
	--bp-color-primary: #1b5e4f;
	--bp-color-primary-dark: #124137;
	--bp-color-bg: #f6f8f7;
	--bp-color-surface: #ffffff;
	--bp-color-border: #e2e6e4;
	--bp-color-text: #16211d;
	--bp-color-text-muted: #5b6b64;
	--bp-color-warning-bg: #fdf3e3;
	--bp-color-warning-text: #7a5210;
	--bp-radius: 10px;
	--bp-shadow: 0 1px 2px rgba(22, 33, 29, 0.06), 0 4px 12px rgba(22, 33, 29, 0.04);
}

.bp-dashboard, .bp-opportunities, .bp-goal-page, .bp-profile-page, .bp-my-opportunities,
.bp-onboarding, .bp-opportunity-single {
	max-width: 960px;
	margin: 0 auto;
	padding: 16px;
	color: var(--bp-color-text);
	font-size: 16px;
	line-height: 1.5;
}

.bp-card {
	background: var(--bp-color-surface);
	border: 1px solid var(--bp-color-border);
	border-radius: var(--bp-radius);
	box-shadow: var(--bp-shadow);
	padding: 24px;
	margin-bottom: 24px;
}

/* --- Ziel-Header (wichtigste Zahl der ganzen Plattform) --- */
.bp-goal-header {
	background: linear-gradient(135deg, var(--bp-color-primary), var(--bp-color-primary-dark));
	color: #fff;
	border-radius: var(--bp-radius);
	padding: 28px 24px;
	margin-bottom: 24px;
}
.bp-goal-header__label { opacity: 0.85; font-size: 14px; margin: 0; }
.bp-goal-header__amount { font-size: clamp(32px, 8vw, 48px); margin: 4px 0 16px; font-weight: 700; }
.bp-goal-header__planned { font-size: 13px; opacity: 0.85; margin: 0 0 16px; }

/* --- "Fortschritt im Detail" - einklappbarer Bereich im Ziel-Header,
   startet serverseitig immer zu (siehe dashboard.php). Eigene, transluzent-
   weiße Variante der .bp-fact/.bp-goal-context-Optik statt der normalen
   hellen Kartenfarben, weil dieser Bereich auf dem dunklen Gradient-
   Hintergrund des Ziel-Headers sitzt, nicht auf einer weißen Karte. --- */
.bp-goal-header__toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	color: #fff;
	font-weight: 600;
	font-size: 14px;
	padding: 0;
	margin: 0 0 4px;
	cursor: pointer;
	opacity: 0.95;
}
.bp-goal-header__toggle .bp-icon { transition: transform 0.2s ease; }
.bp-goal-header__toggle[aria-expanded="true"] .bp-icon { transform: rotate(180deg); }

.bp-goal-header__details {
	margin: 12px 0 16px;
	padding-top: 16px;
	border-top: 1px solid rgba(255,255,255,0.25);
}
.bp-goal-header__details .bp-fact { background: rgba(255,255,255,0.14); }
.bp-goal-header__details .bp-fact__value { color: #fff; }
.bp-goal-header__details .bp-fact__label { color: rgba(255,255,255,0.75); }
.bp-goal-header__details .bp-goal-context { background: rgba(255,255,255,0.14); margin-top: 16px; }
.bp-goal-header__details .bp-goal-context__summary { color: rgba(255,255,255,0.85); }
.bp-goal-header__details .bp-progress-forecast--positive { border-left: 3px solid #6fe3a0; }
.bp-goal-header__details .bp-progress-forecast--positive .bp-goal-context__summary { color: #d7fbe4; font-weight: 600; }
.bp-goal-header__details .bp-progress-forecast--warning { border-left: 3px solid #ffcf7a; }
.bp-goal-header__details .bp-progress-forecast--warning .bp-goal-context__summary { color: #ffe9c2; font-weight: 600; }

.bp-progress {
	background: rgba(255,255,255,0.25);
	border-radius: 999px;
	height: 12px;
	overflow: hidden;
	margin-bottom: 8px;
}
.bp-goal-page .bp-progress, .bp-dashboard .bp-card .bp-progress {
	background: var(--bp-color-border);
}
.bp-progress__bar {
	background: #fff;
	height: 100%;
	border-radius: 999px;
	transition: width 0.3s ease;
}
.bp-goal-page .bp-progress__bar, .bp-dashboard .bp-card .bp-progress__bar {
	background: var(--bp-color-primary);
}
.bp-progress__meta { font-size: 14px; margin: 0 0 16px; opacity: 0.9; }

/* --- Buttons --- */
.bp-btn {
	display: inline-block;
	padding: 10px 18px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	border: 1px solid transparent;
	cursor: pointer;
	margin-right: 8px;
	/* Ohne explizite Farbe fällt ein <button> auf das UA-Standard-Schwarz
	   zurück, unabhängig vom Seitenhintergrund - im Dark Mode dann kaum
	   lesbares Schwarz-auf-Dunkelgrün (z.B. beim reinen ".bp-btn" ohne
	   --primary/--secondary/--ghost-Modifier, wie dem "Zurück"-Button im
	   Onboarding). Die Modifier-Klassen unten überschreiben die Farbe
	   ohnehin explizit, dieser Fallback greift nur für "nackte" Buttons. */
	color: var(--bp-color-text);
}
.bp-btn--primary { background: var(--bp-color-primary); color: #fff; }
.bp-btn--primary:hover { background: var(--bp-color-primary-dark); color: #fff; }
.bp-btn--secondary { background: #fff; color: var(--bp-color-primary); border-color: var(--bp-color-primary); }
.bp-btn--large { padding: 14px 24px; font-size: 16px; }
.bp-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* --- Opportunity-Karten --- */
.bp-opportunity-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 16px;
}
.bp-opportunity-card {
	background: var(--bp-color-surface);
	border: 1px solid var(--bp-color-border);
	border-radius: var(--bp-radius);
	padding: 18px;
	box-shadow: var(--bp-shadow);
}
.bp-opportunity-card__image {
	width: calc(100% + 36px);
	margin: -18px -18px 14px;
	max-width: none;
	height: 140px;
	object-fit: cover;
	border-radius: var(--bp-radius) var(--bp-radius) 0 0;
	display: block;
}
.bp-opportunity-card h3 { margin: 0 0 4px; font-size: 17px; }
.bp-opportunity-card__category { color: var(--bp-color-text-muted); font-size: 13px; margin: 0 0 12px; }
.bp-opportunity-card__facts { list-style: none; margin: 0 0 14px; padding: 0; font-size: 14px; }
.bp-opportunity-card__facts li { margin-bottom: 4px; }

/* --- Ablaufdatum/persönliche Frist auf Opportunity-Karten (siehe
   templates/partials/opportunity-card-deadline.php) - dieselbe Farblogik
   wie der Frist-Chip im Wizard (.bp-wizard-deadline-chip). --- */
.bp-opportunity-card__deadline {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--bp-color-text-muted);
	margin: 0 0 14px;
}
.bp-opportunity-card__deadline--warning { color: var(--bp-color-warning-text); font-weight: 600; }
.bp-opportunity-card__deadline--critical { color: #a3312a; font-weight: 600; }

.bp-opportunity-card__row { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.bp-opportunity-card__row .bp-btn { margin-right: 0; }

.bp-in-progress { margin-bottom: 24px; }
.bp-in-progress h2, .bp-saved h2 { margin-top: 0; }

/* --- "Opportunity abschließen"-Widget (Dashboard-Karten + Detailseite) --- */
.bp-complete-widget { display: inline-block; }
.bp-complete-widget__form {
	background: var(--bp-color-bg);
	border: 1px solid var(--bp-color-border);
	border-radius: 8px;
	padding: 12px;
	margin-top: 8px;
	min-width: 220px;
}
.bp-complete-widget__form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.bp-complete-widget__form input[type="number"] {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--bp-color-border);
	border-radius: 6px;
	margin-bottom: 10px;
}
.bp-complete-widget__actions { display: flex; gap: 8px; }
.bp-complete-widget__actions .bp-btn { margin-right: 0; }

.bp-opportunity-single__image {
	width: 100%;
	max-height: 320px;
	object-fit: cover;
	border-radius: var(--bp-radius);
	margin-bottom: 16px;
}

/* --- Fakten-Grid auf der Detailseite --- */
.bp-fact-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 12px;
	margin: 20px 0;
}
.bp-fact { background: var(--bp-color-bg); border-radius: 8px; padding: 14px; }
.bp-fact__value { display: block; font-size: 18px; font-weight: 700; }
.bp-fact__label { display: block; font-size: 12px; color: var(--bp-color-text-muted); margin-top: 2px; }

.bp-content { margin-bottom: 20px; }
.bp-content--warning { background: var(--bp-color-warning-bg); color: var(--bp-color-warning-text); padding: 14px; border-radius: 8px; }
.bp-content--warning .bp-icon { margin-right: 4px; }

.bp-affiliate-hint, .bp-legal-note, .bp-note {
	font-size: 13px;
	color: var(--bp-color-text-muted);
	background: var(--bp-color-bg);
	padding: 10px 14px;
	border-radius: 8px;
	margin: 12px 0;
}

/* Zentrale Icon-Utility (siehe includes/class-icons.php) - Ersatz für
   Emojis: SVG mit expliziten width/height rendert immer exakt in der
   deklarierten Größe, unabhängig vom System-Emoji-Font (verhindert das
   "Emoji wird riesig"-Problem strukturell statt nur kosmetisch). */
.bp-icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }

.bp-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--bp-color-bg); text-transform: none; margin-bottom: 8px; }
.bp-badge--demo { background: var(--bp-color-warning-bg); color: var(--bp-color-warning-text); text-transform: uppercase; }

/* Status-Badges (BP_Progress::display_status()) - überall wiederverwendet:
   Dashboard-Karten, Opportunities-Liste, "Meine Aktionen". */
.bp-badge--blue    { background: #e3edfb; color: #1c4d9c; }
.bp-badge--yellow   { background: #fdf3e3; color: #7a5210; }
.bp-badge--cyan     { background: #dff3f6; color: #0d6b78; }
.bp-badge--orange   { background: #fde7d8; color: #92400e; }
.bp-badge--purple   { background: #f0e6fa; color: #6b21a8; }
.bp-badge--green    { background: #e1f5e6; color: #1a7e34; }
.bp-badge--gray     { background: var(--bp-color-bg); color: var(--bp-color-text-muted); }
.bp-badge--red      { background: #fbe2e1; color: #a3312a; }

/* --- Onboarding-Wizard --- */
.bp-onboarding__hint { color: var(--bp-color-text-muted); font-size: 14px; margin: -8px 0 16px; }
.bp-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 16px 0 24px; }
.bp-choice {
	background: var(--bp-color-surface);
	color: var(--bp-color-text);
	border: 2px solid var(--bp-color-border);
	border-radius: 8px;
	padding: 14px;
	font-size: 15px;
	cursor: pointer;
	text-align: center;
}
.bp-choice.is-selected { border-color: var(--bp-color-primary); background: var(--bp-color-bg); font-weight: 700; }
.bp-choice--custom { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.bp-onboarding__actions { display: flex; gap: 8px; }
.bp-onboarding__error { color: #a3312a; }

/* --- Payoff-Reveal-Screen (nach Onboarding-Abschluss) --- */
.bp-onboarding-reveal { text-align: center; padding: 24px 0; }
.bp-onboarding-reveal__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--bp-color-primary);
	color: #fff;
	margin-bottom: 12px;
}
.bp-onboarding-reveal h2 { font-size: 22px; margin: 0 0 8px; }
.bp-onboarding-reveal__estimate {
	color: var(--bp-color-text-muted);
	font-size: 14px;
	margin: 0 0 20px;
}
.bp-onboarding-reveal .bp-opportunity-grid { text-align: left; margin-bottom: 24px; }

/* --- Ziel-Kontext-Banner ("Warum mache ich das gerade?") --- */
.bp-goal-context {
	background: var(--bp-color-bg);
	border: 1px solid var(--bp-color-border);
	border-radius: var(--bp-radius);
	padding: 14px 18px;
	margin-bottom: 20px;
}
.bp-goal-context p { margin: 0 0 4px; font-size: 14px; }
.bp-goal-context p:last-child { margin-bottom: 0; }
.bp-goal-context__goal { font-weight: 700; }
.bp-goal-context__summary { color: var(--bp-color-text-muted); }

/* --- Zielprognose (Dashboard "Fortschritt im Detail") - wiederverwendet
   die .bp-goal-context-Optik, ergänzt um zwei Ampel-Varianten für den
   Soll-Ist-Vergleich mit der Zielfrist (Analog zu den bereits etablierten
   .bp-wizard-deadline-chip--warning/--critical-Farbmustern). --- */
.bp-progress-forecast--positive { background: #e1f5e6; }
.bp-progress-forecast--positive .bp-goal-context__summary { color: #1a7e34; font-weight: 600; }
.bp-progress-forecast--warning { background: var(--bp-color-warning-bg); }
.bp-progress-forecast--warning .bp-goal-context__summary { color: var(--bp-color-warning-text); font-weight: 600; }

/* --- Opportunity-Wizard --- */
/* --- Wizard-Stepper (5 Schritte, siehe templates/partials/wizard-stepper.php) --- */
.bp-wizard-stepper__intro { font-size: 14px; color: var(--bp-color-text-muted); margin: 0 0 16px; }

.bp-wizard-stepper { display: flex; list-style: none; margin: 0 0 20px; padding: 0; counter-reset: none; }
.bp-wizard-stepper__item {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	position: relative;
	font-size: 12px;
}
.bp-wizard-stepper__item:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 14px;
	left: 50%;
	width: 100%;
	height: 2px;
	background: var(--bp-color-border);
	z-index: 0;
}
.bp-wizard-stepper__item.is-complete:not(:last-child)::after { background: var(--bp-color-primary); }

.bp-wizard-stepper__circle {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--bp-color-surface);
	border: 2px solid var(--bp-color-border);
	color: var(--bp-color-text-muted);
	font-weight: 700;
	margin-bottom: 6px;
}
.bp-wizard-stepper__check { display: none; }
.bp-wizard-stepper__item.is-complete .bp-wizard-stepper__circle { background: var(--bp-color-primary); border-color: var(--bp-color-primary); color: #fff; }
.bp-wizard-stepper__item.is-complete .bp-wizard-stepper__number { display: none; }
.bp-wizard-stepper__item.is-complete .bp-wizard-stepper__check { display: inline-flex; }
.bp-wizard-stepper__item.is-current .bp-wizard-stepper__circle { border-color: var(--bp-color-primary); color: var(--bp-color-primary); }
.bp-wizard-stepper__item.is-current .bp-wizard-stepper__label { color: var(--bp-color-text); font-weight: 700; }
.bp-wizard-stepper__label { color: var(--bp-color-text-muted); }

.bp-wizard-stepper__mobile-label { display: none; font-size: 13px; font-weight: 700; color: var(--bp-color-primary); margin: 0 0 20px; }

@media (max-width: 600px) {
	.bp-wizard-stepper__label { display: none; }
	.bp-wizard-stepper__mobile-label { display: block; }
}

/* --- Persistenter Frist-Chip (ersetzt den früheren eigenen Wizard-Schritt) --- */
.bp-wizard-deadline-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--bp-color-bg);
	border-radius: 999px;
	padding: 6px 14px;
	font-size: 13px;
	font-weight: 700;
	margin-bottom: 20px;
	color: var(--bp-color-primary);
}
.bp-wizard-deadline-chip--warning { color: #92400e; background: #fdf3e3; }
.bp-wizard-deadline-chip--critical { color: #a3312a; background: #fbe2e1; }

.bp-wizard__facts { list-style: none; margin: 12px 0; padding: 0; font-size: 14px; }
.bp-wizard__facts li { margin-bottom: 6px; }
.bp-wizard__question { font-weight: 600; margin-top: 20px; }
.bp-wizard__actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.bp-wizard__checklist { list-style: none; margin: 16px 0; padding: 0; }
.bp-wizard__checklist li { padding: 10px 0; border-bottom: 1px solid var(--bp-color-border); }
.bp-wizard__checklist label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.bp-wizard__checklist input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; }

/* --- Warnungs-Bestätigung (Schritt 1, siehe Admin-Feld "Hinweise &
   Warnungen") - eigene, kompakte Zeile statt der vollen Checklisten-Optik,
   da es hier nur einen einzelnen Punkt zum Abhaken gibt. --- */
.bp-wizard__ack { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; font-size: 14px; font-weight: 600; cursor: pointer; }
.bp-wizard__ack input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; }
.bp-wizard__progress-label { font-size: 13px; font-weight: 700; color: var(--bp-color-primary); }

.bp-wizard-outcome { text-align: center; padding: 32px 16px; }
.bp-wizard-outcome h2 { font-size: 24px; margin-bottom: 8px; }
.bp-wizard-outcome--ineligible h2, .bp-wizard-outcome--expired h2 { color: var(--bp-color-text-muted); }
.bp-wizard-outcome--completed h2 { color: var(--bp-color-primary); }
.bp-wizard-outcome .bp-progress { max-width: 320px; margin: 16px auto; }
.bp-wizard-outcome__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--bp-color-primary);
	color: #fff;
	margin-bottom: 12px;
}

/* --- Formulare --- */
.bp-goal-page form p, .bp-profile-page form p { margin-bottom: 16px; }
.bp-goal-page label, .bp-profile-page label { display: block; font-weight: 600; margin-bottom: 4px; }
.bp-goal-page input, .bp-profile-page input, .bp-profile-page select {
	width: 100%;
	max-width: 320px;
	padding: 8px 10px;
	border: 1px solid var(--bp-color-border);
	border-radius: 6px;
}
.bp-checkbox-list { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.bp-checkbox-list label { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.bp-form-feedback { margin-left: 10px; color: var(--bp-color-primary); font-weight: 600; }

/* --- Tabelle "Meine Aktionen" --- */
.bp-table { width: 100%; border-collapse: collapse; background: var(--bp-color-surface); }
.bp-table th, .bp-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--bp-color-border); }

/* --- "Abgeschlossene Aktionen" (Dashboard, ganz unten) - bewusst eine
   schlanke Zeilenliste statt Karten: kann über die Zeit lang werden, große
   Karten würden den Dashboard-Fuß sprengen (siehe README 11c). --- */
.bp-completed-list { list-style: none; margin: 0; padding: 0; }
.bp-completed-list__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px 16px;
	padding: 12px 0;
	border-bottom: 1px solid var(--bp-color-border);
}
.bp-completed-list__item:last-child { border-bottom: none; }
.bp-completed-list__main { display: flex; flex-direction: column; }
.bp-completed-list__title { font-weight: 600; }
.bp-completed-list__category { font-size: 13px; color: var(--bp-color-text-muted); }
.bp-completed-list__meta { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.bp-completed-list__reward { font-weight: 700; color: var(--bp-color-primary); }
.bp-completed-list__date { color: var(--bp-color-text-muted); }
.bp-completed-actions .bp-btn--secondary { margin-top: 16px; margin-right: 0; }

/* --- Pagination --- */
.bp-pagination { display: flex; gap: 6px; margin: 20px 0; }
.bp-pagination__link { padding: 6px 12px; border-radius: 6px; border: 1px solid var(--bp-color-border); text-decoration: none; color: var(--bp-color-text); }
.bp-pagination__link.is-active { background: var(--bp-color-primary); color: #fff; border-color: var(--bp-color-primary); }

/* --- Dark Mode (folgt System-Präferenz) --- */
@media (prefers-color-scheme: dark) {
	:root {
		--bp-color-bg: #101613;
		--bp-color-surface: #182420;
		--bp-color-border: #2a3733;
		--bp-color-text: #eef3f0;
		--bp-color-text-muted: #9fb0a9;
	}
}

@media (max-width: 600px) {
	.bp-btn { width: 100%; margin-right: 0; margin-bottom: 8px; text-align: center; }
	.bp-onboarding__actions { flex-direction: column; }
}
