/* Widerruf-Button – Frontend (Button + responsives Modal) */

.wrb-button-wrap {
	display: block;
	margin: 0;
}

.wrb-align-center {
	text-align: center;
}

.wrb-align-right {
	text-align: right;
}

.wrb-align-left {
	text-align: left;
}

/* Basis-Button. Farben kommen aus dem dynamischen Inline-CSS (überschreibt Theme). */
.wrb-button {
	display: inline-block;
	cursor: pointer;
	font-weight: 500;
	line-height: 1.2;
	font-family: inherit; /* Schriftart vom Theme übernehmen */
	-webkit-appearance: none;
	appearance: none;
	transition: background-color .15s ease, border-color .15s ease, transform .05s ease;
}

.wrb-button:active {
	transform: translateY(1px);
}

/* ---------- Modal ---------- */
.wrb-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(15, 23, 42, 0.55);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	opacity: 0;
	transition: opacity .2s ease;
	box-sizing: border-box;
}

.wrb-modal-overlay[hidden] {
	display: none;
}

.wrb-modal-overlay.wrb-open {
	opacity: 1;
}

.wrb-modal {
	position: relative;
	width: 100%;
	max-width: 480px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: #ffffff;
	color: #1f2937;
	border-radius: 14px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	padding: 28px;
	box-sizing: border-box;
	transform: translateY(12px) scale(0.98);
	transition: transform .2s ease;
	font-family: inherit;
}

.wrb-open .wrb-modal {
	transform: translateY(0) scale(1);
}

/* X-Button: Grundgestaltung. Farben werden zusätzlich per Inline-CSS mit
   !important erzwungen (immer schwarzes X auf weißem Hintergrund). */
.wrb-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid #d1d5db;
	background: #ffffff;
	color: #000000;
	line-height: 1;
	cursor: pointer;
	border-radius: 8px;
}

.wrb-close-icon {
	display: block;
	width: 20px;
	height: 20px;
	color: inherit;
}

.wrb-modal-close:hover,
.wrb-modal-close:focus {
	background: #f3f4f6;
	color: #000000;
}

/* Bestätigungsansicht: Titel und Einleitung ausblenden. */
.wrb-modal.is-success .wrb-modal-header,
.wrb-modal.is-success .wrb-modal-intro {
	display: none;
}

/* Visuell verborgen, aber für Screenreader verfügbar. */
.wrb-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.wrb-modal-header {
	margin: 0 -28px 20px;
	padding: 0 28px 16px;
	border-bottom: 1px solid #e8e8e8;
}

.wrb-modal-title {
	margin: 0 30px 0 0;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.25;
	color: #111827;
}

.wrb-modal-intro {
	margin: 0 0 18px;
	font-size: 14px;
	color: #4b5563;
	line-height: 1.5;
}

.wrb-field {
	margin-bottom: 16px;
}

/* Zwei Felder auf Desktop nebeneinander, auf Mobil untereinander. */
.wrb-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.wrb-row .wrb-field {
	min-width: 0;
}

/* Falls nur eines der beiden Felder aktiv ist, volle Breite nutzen. */
.wrb-row .wrb-field:only-child {
	grid-column: 1 / -1;
}

@media (max-width: 600px) {
	.wrb-row {
		grid-template-columns: 1fr;
		gap: 0;
	}
}

.wrb-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 500;
	color: #374151;
}

.wrb-req {
	color: #dc2626;
}

.wrb-field input[type="text"],
.wrb-field input[type="email"],
.wrb-field input[type="date"],
.wrb-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 11px 13px;
	font-size: 15px;
	font-family: inherit;
	color: #111827;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.wrb-field input:focus,
.wrb-field textarea:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.wrb-field input.wrb-invalid,
.wrb-field textarea.wrb-invalid {
	border-color: #dc2626;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

/* Feldbezogene Fehlermeldung (nur sichtbar, wenn befüllt). */
.wrb-field-error:empty {
	display: none;
}

.wrb-field-error {
	display: block;
	margin: 6px 0 0;
	font-size: 13px;
	color: #dc2626;
}

.wrb-hint {
	margin: 6px 0 0;
	font-size: 12px;
	color: #6b7280;
}

/* Honeypot ausblenden */
.wrb-hp {
	position: absolute !important;
	left: -9999px !important;
	top: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.wrb-message-area {
	margin: 4px 0 12px;
	font-size: 14px;
	color: #dc2626;
}

.wrb-message-area:empty {
	margin: 0;
}

.wrb-actions {
	display: flex;
	gap: 12px;
	justify-content: flex-end;
	align-items: center;
	margin-top: 8px;
	flex-wrap: wrap;
}

.wrb-cancel {
	background: transparent;
	border: 1px solid #d1d5db;
	color: #374151;
	padding: 11px 18px;
	font-size: 15px;
	font-weight: 500;
	font-family: inherit;
	border-radius: 8px;
	cursor: pointer;
	transition: background-color .15s ease;
}

.wrb-cancel:hover,
.wrb-cancel:focus {
	background: #f3f4f6;
}

.wrb-submit {
	cursor: pointer;
	font-weight: 500;
	font-size: 15px;
	font-family: inherit;
	padding: 12px 22px;
	line-height: 1.2;
	transition: background-color .15s ease, border-color .15s ease;
}

.wrb-submit[disabled] {
	opacity: 0.7;
	cursor: progress;
}

/* Erfolgsansicht */
.wrb-success {
	text-align: center;
	padding: 10px 0;
}

.wrb-success-icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: #dcfce7;
	color: #16a34a;
	font-size: 34px;
	line-height: 64px;
}

.wrb-success-title {
	margin: 0 0 10px;
	font-size: 20px;
	line-height: 1.25;
	color: #111827;
}

.wrb-success-title:focus {
	outline: none;
}

.wrb-success-text {
	font-size: 15px;
	color: #374151;
	line-height: 1.5;
	margin: 0 0 12px;
}

.wrb-success-text:empty {
	margin: 0;
}

.wrb-success-hint {
	font-size: 14px;
	color: #6b7280;
	line-height: 1.5;
	margin: 0 0 20px;
}

/* Sichtbare, kontraststarke Fokus-Indikatoren (Barrierefreiheit). */
.wrb-modal :focus-visible,
.wrb-button:focus-visible {
	outline: 3px solid #1d4ed8;
	outline-offset: 2px;
	border-radius: 6px;
}

.wrb-modal-title:focus,
.wrb-modal-title:focus-visible {
	outline: none;
}

/* ---------- Responsive: Mobile Bottom-Sheet ---------- */
@media (max-width: 600px) {
	.wrb-modal-overlay {
		padding: 0;
		align-items: flex-end;
	}

	.wrb-modal {
		max-width: 100%;
		max-height: 92vh;
		border-radius: 18px 18px 0 0;
		padding: 24px 20px 28px;
		transform: translateY(100%);
	}

	.wrb-modal-header {
		margin: 0 -20px 18px;
		padding: 0 20px 14px;
	}

	.wrb-open .wrb-modal {
		transform: translateY(0);
	}

	.wrb-actions {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.wrb-cancel,
	.wrb-submit {
		width: 100%;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.wrb-modal-overlay,
	.wrb-modal,
	.wrb-button {
		transition: none;
	}
}
