/* com_kurstermine - frontend styles that are not already covered by the site template */

.kurstermine-action-cell {
	white-space: nowrap;
}

/* Buchen-Button - dieselbe Optik wie der CTA-Menüpunkt ("Jetzt anmelden") in der Hauptnavigation.
   Eigene Klasse statt .btn-primary, da presets/preset1.css .btn-primary mit einer fixen
   Preset-Farbe überschreibt (das Original-CTA umgeht das aus demselben Grund). */
.kurstermine-buchen-btn {
	display: inline-block;
	border: 1px solid var(--action-primary);
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.5;
	padding: 4px 8px;
	background: var(--action-primary);
	border-radius: var(--radius-sm);
	color: #fff;
	white-space: nowrap;
	cursor: pointer;
}
.kurstermine-buchen-btn:hover,
.kurstermine-buchen-btn:focus {
	background: var(--action-primary-hover);
	border-color: var(--action-primary-hover);
	color: #fff;
}

.kurstermine-cta {
	margin-top: 32px;
}

.kurstermine-cta .kurstermine-buchen-btn {
	margin-top: 8px;
}

/* --- Buchungs-Popup (native <dialog>) --- */
.kurstermine-dialog {
	width: min(480px, calc(100vw - 32px));
	max-height: min(640px, calc(100vh - 64px));
	padding: 0;
	border: none;
	border-radius: var(--radius-lg, 14px);
	box-shadow: var(--shadow-card, 0 6px 24px rgba(0, 0, 0, 0.2));
	background: var(--surface-card, #fff);
	color: var(--text-body, #1f2430);
}

.kurstermine-dialog::backdrop {
	background: rgba(15, 23, 42, 0.55);
}

.kurstermine-dialog__form {
	position: relative;
	padding: 28px 28px 24px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.kurstermine-dialog__form h2 {
	margin: 0 32px 4px 0;
	font-size: var(--text-xl, 1.25rem);
	color: var(--text-heading, inherit);
}

.kurstermine-dialog__subtitle {
	margin: 0 0 4px;
	font-size: var(--text-sm, 0.875rem);
	color: var(--text-muted, #6b7280);
}

.kurstermine-dialog__close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 32px;
	height: 32px;
	line-height: 1;
	border: none;
	background: transparent;
	font-size: 1.5rem;
	cursor: pointer;
	color: var(--text-muted, #6b7280);
	border-radius: 999px;
}

.kurstermine-dialog__close:hover,
.kurstermine-dialog__close:focus-visible {
	background: var(--surface-raised, rgba(0, 0, 0, 0.06));
}

.kurstermine-dialog__row {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.kurstermine-dialog__field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1 1 0;
	min-width: 0;
}

/* Wider popup on desktop, with paired fields (Vorname/Name, E-Mail/Telefon) side by side.
   Must come after the base .kurstermine-dialog__row / __field rules above so it actually
   overrides them at this breakpoint (equal specificity - source order decides the winner). */
@media (min-width: 640px) {
	.kurstermine-dialog {
		width: min(680px, calc(100vw - 64px));
		max-height: min(680px, calc(100vh - 64px));
	}

	.kurstermine-dialog__row {
		flex-direction: row;
	}
}

.kurstermine-dialog__field label {
	font-size: var(--text-sm, 0.875rem);
	font-weight: 600;
	color: var(--text-heading, inherit);
}

.kurstermine-dialog__field input,
.kurstermine-dialog__field textarea {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid var(--border-default, #d0d5dd);
	border-radius: var(--radius-md, 8px);
	font: inherit;
	background: #fff;
	color: inherit;
}

.kurstermine-dialog__field input:focus-visible,
.kurstermine-dialog__field textarea:focus-visible {
	outline: 2px solid var(--action-primary, #1e2547);
	outline-offset: 1px;
}

/* Floating labels: label sits inside the field at rest and moves up once the field is
   focused or filled. Must come after the base field/label rules above (equal specificity -
   source order decides the winner). */
.kurstermine-dialog__field--floating {
	position: relative;
}

.kurstermine-dialog__field--floating input {
	box-sizing: border-box;
	height: 58px;
	padding: 24px 12px 6px;
}

.kurstermine-dialog__field--floating textarea {
	box-sizing: border-box;
	min-height: 96px;
	padding: 26px 12px 8px;
}

.kurstermine-dialog__field--floating label {
	position: absolute;
	left: 13px;
	top: 50%;
	transform: translateY(-50%);
	transform-origin: left top;
	margin: 0;
	max-width: calc(100% - 26px);
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: inherit;
	line-height: 1;
	font-weight: 400;
	color: var(--text-muted, #6b7280);
	pointer-events: none;
	transition: top 150ms ease, transform 150ms ease, color 150ms ease;
}

.kurstermine-dialog__field--floating textarea ~ label {
	top: 26px;
	transform: translateY(0);
}

.kurstermine-dialog__field--floating input:focus ~ label,
.kurstermine-dialog__field--floating input:not(:placeholder-shown) ~ label,
.kurstermine-dialog__field--floating textarea:focus ~ label,
.kurstermine-dialog__field--floating textarea:not(:placeholder-shown) ~ label {
	top: 5px;
	transform: translateY(0) scale(0.72);
	color: var(--action-primary, #1e2547);
}

.kurstermine-dialog__consent .kurstermine-dialog__consent-label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 11px;
	line-height: 1.4;
	font-weight: 200;
	color: inherit;
	cursor: pointer;
}

.kurstermine-dialog__consent .kurstermine-dialog__consent-label input[type="checkbox"] {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	margin-top: 3px;
}

.kurstermine-dialog__consent .kurstermine-dialog__consent-label a {
	color: var(--action-primary, #1e2547);
	text-decoration: underline;
}

.kurstermine-dialog__alert {
	padding: 10px 14px;
	border-radius: var(--radius-md, 8px);
	font-size: var(--text-sm, 0.875rem);
}

.kurstermine-dialog__alert.is-success {
	background: #d1e7dd;
	color: #0a3622;
}

.kurstermine-dialog__alert.is-error {
	background: #f8d7da;
	color: #58151c;
}

.kurstermine-dialog__captcha {
	margin-top: 4px;
}

.kurstermine-dialog__captcha altcha-widget {
	--altcha-max-width: 100%;
	display: block;
}

.kurstermine-dialog__actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 8px;
}

/* Honeypot: hidden from sighted users, kept out of the tab order, but not display:none
   so basic bots that skip hidden fields still fill it in. */
.kurstermine-dialog__honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* --- Mobile: stacked "cards" instead of a table (per spec) --- */
@media (max-width: 575.98px) {
	.kurstermine-table thead {
		display: none;
	}

	.kurstermine-table,
	.kurstermine-table tbody,
	.kurstermine-table tr,
	.kurstermine-table td {
		display: block;
		width: 100%;
	}

	.kurstermine-table tr {
		padding: 14px 16px;
		border-bottom: 1px solid var(--border-default, #e5e7eb);
	}

	.kurstermine-table tr:last-child {
		border-bottom: none;
	}

	.kurstermine-table td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 12px;
		padding: 4px 0;
		border: none;
		text-align: right;
	}

	.kurstermine-table td::before {
		content: attr(data-label);
		font-weight: 600;
		font-size: var(--text-xs, 0.75rem);
		text-transform: uppercase;
		letter-spacing: 0.06em;
		color: var(--text-muted, #6b7280);
		text-align: left;
	}

}
