/**
 * APOLLON Seminarbuchung – Grundlayout.
 * Farben über Custom Properties im Theme überschreibbar, z. B.:
 *   .apb { --apb-primary: #5b2a86; --apb-accent: #f2c230; }
 */

.apb {
	--apb-primary: #5b2a86;
	--apb-primary-contrast: #fff;
	--apb-accent: #f2c230;
	--apb-text: #1f1a24;
	--apb-muted: #6b6474;
	--apb-border: #d9d3df;
	--apb-bg: #fff;
	--apb-bg-soft: #f6f3f9;
	--apb-error: #b3261e;
	--apb-success: #1e7a3c;
	--apb-radius: 8px;
	color: var(--apb-text);
	font-size: 1rem;
	line-height: 1.5;
}

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

/* Ohne JavaScript: Hinweis statt halbfertigem Formular */
.apb:not(.apb--ready) .apb-step:not(:first-of-type) {
	display: none;
}

/* Fangfeld: für Menschen unsichtbar (nicht display:none, das erkennen manche Bots) */
.apb-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.apb [hidden],
.apb .apb-step[hidden] {
	display: none !important;
}

/* Fortschritt */
.apb-progress {
	display: flex;
	gap: .5rem;
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
	counter-reset: none;
}

.apb-progress__item {
	flex: 1 1 0;
	margin: 0;
}

.apb-progress__item > span,
.apb-progress__item > button {
	display: flex;
	align-items: center;
	gap: .5rem;
	width: 100%;
	padding: .5rem 0;
	border: 0;
	border-top: 4px solid var(--apb-border);
	background: none;
	color: var(--apb-muted);
	font: inherit;
	font-size: .875rem;
	text-align: left;
}

.apb-progress__item > button {
	cursor: pointer;
}

.apb-progress__item.is-done > * {
	border-top-color: var(--apb-primary);
	color: var(--apb-text);
}

.apb-progress__item.is-current > * {
	border-top-color: var(--apb-accent);
	color: var(--apb-text);
	font-weight: 600;
}

.apb-progress__num {
	display: inline-grid;
	place-items: center;
	flex: 0 0 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	background: var(--apb-bg-soft);
	font-weight: 700;
}

.apb-progress__item.is-current .apb-progress__num,
.apb-progress__item.is-done .apb-progress__num {
	background: var(--apb-primary);
	color: var(--apb-primary-contrast);
}

/* Schritte */
.apb-step {
	margin: 0 0 1.5rem;
	padding: 0;
	border: 0;
	min-width: 0;
}

.apb-step__title {
	display: block;
	margin: 0 0 1rem;
	padding: 0;
	font-size: 1.375rem;
	font-weight: 700;
	outline: none;
}

.apb-subtitle {
	margin: 1.75rem 0 .75rem;
	font-size: 1.125rem;
}

.apb-hint,
.apb-note,
.apb-intro {
	color: var(--apb-muted);
	font-size: .9375rem;
}

/* Angebotsauswahl */
.apb-options {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 1rem;
}

.apb-option {
	padding: 1rem 1.25rem;
	border: 2px solid var(--apb-border);
	border-radius: var(--apb-radius);
	background: var(--apb-bg);
	transition: border-color .15s;
}

.apb-option.is-selected {
	border-color: var(--apb-primary);
	background: var(--apb-bg-soft);
}

.apb-option.is-disabled {
	opacity: .6;
}

.apb-option__head {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: .25rem .75rem;
	align-items: center;
	cursor: pointer;
}

.apb-option__title {
	font-size: 1.125rem;
	font-weight: 700;
}

.apb-option__price {
	grid-column: 2;
	font-weight: 700;
	color: var(--apb-primary);
}

.apb-option__price small {
	font-weight: 400;
	color: var(--apb-muted);
}

.apb-option__text {
	margin: .5rem 0 0;
	font-size: .9375rem;
}

.apb-option__topics {
	display: grid;
	gap: .5rem;
	margin-top: 1rem;
}

.apb-check {
	display: flex;
	gap: .75rem;
	align-items: flex-start;
	padding: .625rem .75rem;
	border: 1px solid var(--apb-border);
	border-radius: var(--apb-radius);
	background: var(--apb-bg);
	cursor: pointer;
}

.apb-check.is-disabled {
	opacity: .6;
	cursor: not-allowed;
}

.apb-check input {
	margin-top: .25rem;
}

.apb-check__num {
	display: inline-block;
	min-width: 2rem;
	color: var(--apb-primary);
	font-weight: 700;
}

/* Termine */
.apb-dategroup {
	margin-bottom: 1.5rem;
}

.apb-dategroup__title {
	margin: 0 0 .5rem;
	font-size: 1rem;
}

.apb-dategroup__options {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: .75rem;
}

.apb-date {
	position: relative;
	display: grid;
	gap: .125rem;
	padding: .75rem 1rem .75rem 2.5rem;
	border: 2px solid var(--apb-border);
	border-radius: var(--apb-radius);
	background: var(--apb-bg);
	cursor: pointer;
}

.apb-date input {
	position: absolute;
	top: 1rem;
	left: .875rem;
}

.apb-date.is-selected {
	border-color: var(--apb-primary);
	background: var(--apb-bg-soft);
}

.apb-date.is-disabled {
	opacity: .55;
	cursor: not-allowed;
}

.apb-date__format {
	font-weight: 700;
}

.apb-date--online .apb-date__format::after {
	content: " · live";
	font-weight: 400;
	color: var(--apb-muted);
}

.apb-date__when {
	font-size: .9375rem;
}

.apb-badge {
	justify-self: start;
	margin-top: .25rem;
	padding: .125rem .5rem;
	border-radius: 999px;
	font-size: .75rem;
	font-weight: 600;
}

.apb-badge--low {
	background: #fff4cc;
	color: #6a5200;
}

.apb-badge--full {
	background: #fde7e6;
	color: var(--apb-error);
}

/* Teilnehmerzahl */
.apb-count {
	margin-top: 1.5rem;
}

.apb-count__label {
	display: block;
	margin-bottom: .5rem;
	font-weight: 600;
}

.apb-count__control {
	display: inline-flex;
	align-items: stretch;
	gap: .25rem;
}

.apb-count__control input {
	width: 4.5rem;
	text-align: center;
	font-size: 1.125rem;
}

/* Felder */
.apb-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem 1.25rem;
}

.apb-field {
	display: block;
	font-weight: 600;
	font-size: .9375rem;
}

.apb-field--wide {
	grid-column: 1 / -1;
}

.apb-field input[type="text"],
.apb-field input[type="email"],
.apb-field input[type="tel"],
.apb-field textarea,
.apb-count__control input {
	display: block;
	width: 100%;
	margin-top: .25rem;
	padding: .625rem .75rem;
	border: 1px solid var(--apb-border);
	border-radius: 6px;
	background: var(--apb-bg);
	font: inherit;
	font-weight: 400;
}

.apb-count__control input {
	width: 4.5rem;
	margin-top: 0;
}

.apb-field--radio .wpcf7-list-item {
	margin: 0 1.5rem 0 0;
}

.apb-req {
	color: var(--apb-error);
	text-decoration: none;
	border: 0;
}

.apb-opt {
	font-weight: 400;
	color: var(--apb-muted);
}

.apb-invalid,
.apb .wpcf7-not-valid {
	border-color: var(--apb-error) !important;
}

.apb-error,
.apb-step-error {
	display: block;
	margin-top: .375rem;
	color: var(--apb-error);
	font-size: .875rem;
	font-weight: 600;
}

.apb-step-error {
	padding: .75rem 1rem;
	border-left: 4px solid var(--apb-error);
	background: #fde7e6;
}

.apb-participant {
	margin-bottom: 1.25rem;
	padding: 1rem 1.25rem;
	border: 1px solid var(--apb-border);
	border-radius: var(--apb-radius);
	background: var(--apb-bg-soft);
}

.apb-participant__title {
	margin: 0 0 .75rem;
	font-size: 1rem;
}

.apb-participant__title small {
	font-weight: 400;
	color: var(--apb-muted);
}

/* Zusammenfassung */
.apb-summary {
	display: grid;
	gap: 1rem;
}

.apb-summary__block {
	padding: 1rem 1.25rem;
	border: 1px solid var(--apb-border);
	border-radius: var(--apb-radius);
}

.apb-summary__block header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	margin-bottom: .5rem;
}

.apb-summary__block h4 {
	margin: 0;
	font-size: 1rem;
}

.apb-summary__block ul {
	margin: 0;
	padding-left: 1.25rem;
}

.apb-summary__block dl {
	margin: 0;
}

.apb-summary__row {
	display: grid;
	grid-template-columns: 12rem 1fr;
	gap: .5rem;
	padding: .25rem 0;
}

.apb-summary__row dt {
	color: var(--apb-muted);
}

.apb-summary__row dd {
	margin: 0;
}

.apb-table {
	width: 100%;
	border-collapse: collapse;
	font-size: .9375rem;
}

.apb-table th,
.apb-table td {
	padding: .5rem .25rem;
	border-bottom: 1px solid var(--apb-border);
	text-align: left;
	vertical-align: top;
}

.apb-table small {
	color: var(--apb-muted);
}

.apb-table tfoot th {
	font-size: 1.125rem;
	border-bottom: 0;
}

.apb-table__vat td {
	border-bottom: 0;
	color: var(--apb-muted);
	font-size: .875rem;
}

.apb .apb-num {
	text-align: right;
	white-space: nowrap;
}

/* Rechtliches + Absenden */
.apb-legal {
	margin: 1.5rem 0 1rem;
	padding: 1rem 1.25rem;
	border-left: 4px solid var(--apb-accent);
	background: var(--apb-bg-soft);
	font-size: .9375rem;
}

.apb-legal p {
	margin: 0 0 .5rem;
}

.apb-legal p:last-child {
	margin-bottom: 0;
}

.apb-field--accept {
	margin-bottom: 1rem;
	font-weight: 400;
}

.apb-submit .wpcf7-submit {
	padding: .875rem 1.75rem;
	border: 0;
	border-radius: var(--apb-radius);
	background: var(--apb-primary);
	color: var(--apb-primary-contrast);
	font: inherit;
	font-size: 1.125rem;
	font-weight: 700;
	cursor: pointer;
}

.apb-submit .wpcf7-submit:disabled {
	opacity: .5;
	cursor: not-allowed;
}

/* Gesamtpreis */
.apb-total {
	position: sticky;
	bottom: 0;
	z-index: 5;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: .5rem 1.5rem;
	margin: 1rem 0;
	padding: 1rem 1.25rem;
	border-radius: var(--apb-radius);
	background: var(--apb-primary);
	color: var(--apb-primary-contrast);
	box-shadow: 0 -2px 12px rgba(0, 0, 0, .08);
}

.apb-total__info small,
.apb-total__sum small {
	display: block;
	opacity: .85;
	font-size: .8125rem;
}

.apb-total__sum {
	text-align: right;
}

.apb-total__sum strong {
	font-size: 1.5rem;
	color: var(--apb-accent);
}

.apb-tip {
	padding: .75rem 1rem;
	border-radius: var(--apb-radius);
	background: #fff4cc;
	font-size: .9375rem;
}

/* Buttons / Navigation */
.apb-nav {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 1rem;
}

.apb-btn {
	padding: .75rem 1.5rem;
	border: 2px solid var(--apb-primary);
	border-radius: var(--apb-radius);
	background: var(--apb-bg);
	color: var(--apb-primary);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.apb-btn--primary {
	background: var(--apb-primary);
	color: var(--apb-primary-contrast);
}

.apb-btn--icon {
	width: 2.75rem;
	padding: 0;
	font-size: 1.25rem;
}

.apb-btn:disabled {
	opacity: .4;
	cursor: not-allowed;
}

.apb-link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--apb-primary);
	font: inherit;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}

.apb-btn:focus-visible,
.apb-link:focus-visible,
.apb-progress button:focus-visible {
	outline: 3px solid var(--apb-accent);
	outline-offset: 2px;
}

/* Abgeschlossen */
.apb--done > :not(.apb-success) {
	display: none !important;
}

.apb-is-done .wpcf7-response-output {
	display: none !important;
}

.apb-is-submitting .wpcf7-submit {
	cursor: progress;
}

.apb-success {
	padding: 1.5rem;
	border-left: 4px solid var(--apb-success);
	border-radius: var(--apb-radius);
	background: #e9f6ee;
	outline: none;
}

.apb-success__title {
	margin-top: 0;
}

@media (max-width: 640px) {
	.apb-grid {
		grid-template-columns: 1fr;
	}

	.apb-progress__label {
		display: none;
	}

	.apb-progress__item.is-current .apb-progress__label {
		display: inline;
	}

	.apb-summary__row {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.apb-total__sum {
		text-align: left;
	}

	.apb-table thead {
		display: none;
	}
}

/* Widerrufsformular [apollon_widerruf] */
.apw {
	max-width: 46rem;
}

.apw .apw-intro {
	margin: 0 0 1rem;
}

.apw .apb-field {
	margin-bottom: 1rem;
}

.apw .apw-declaration {
	margin: 1.5rem 0 1rem;
	padding: 1rem 1.25rem;
	border-left: 4px solid var(--apb-accent);
	background: var(--apb-bg-soft);
	font-weight: 600;
}

.apw .apw-admin-hint {
	padding: .75rem 1rem;
	border-left: 4px solid var(--apb-error);
	background: #fdecea;
}
