/*
 * BroWave Opt-in – Formular-Frontend.
 * Farbe/Radius/Abstand als CSS-Variablen, damit sich das Formular per Theme-CSS
 * überschreiben lässt, ohne diese Datei anzufassen, z.B.:
 *   .lmo-form { --lmo-accent: #ff7a00; --lmo-radius: 4px; }
 */
.lmo-form {
	--lmo-accent: #ff8d01;
	--lmo-accent-hover: #e07d00;
	--lmo-text: inherit;
	--lmo-border: #d1d5db;
	--lmo-border-focus: var(--lmo-accent);
	--lmo-radius: 8px;
	--lmo-gap: 1.1em;
	--lmo-font-size: 1rem;

	display: flex;
	flex-direction: column;
	gap: var(--lmo-gap);
	max-width: 100%;
	font-size: var(--lmo-font-size);
	color: var(--lmo-text);
}

.lmo-form .lmo-field {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
	margin: 0;
}

.lmo-form .lmo-field label {
	font-weight: 600;
	font-size: 0.92em;
}

.lmo-form .lmo-field input[type="text"],
.lmo-form .lmo-field input[type="email"],
.lmo-form .lmo-field input[type="number"],
.lmo-form .lmo-field select,
.lmo-form .lmo-field textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 0.75em 0.9em;
	font-size: 1em;
	font-family: inherit;
	color: inherit;
	background: #fff;
	border: 1px solid var(--lmo-border);
	border-radius: var(--lmo-radius);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lmo-form .lmo-field textarea {
	resize: vertical;
	min-height: 5em;
}

.lmo-form .lmo-field input:focus-visible,
.lmo-form .lmo-field select:focus-visible,
.lmo-form .lmo-field textarea:focus-visible {
	outline: none;
	border-color: var(--lmo-border-focus);
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.2);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--lmo-accent) 20%, transparent);
}

.lmo-form .lmo-field-checkbox {
	display: block;
}

/* Absolute Checkbox statt Flexbox: das Label enthält oft Text UND einen Link
   (Datenschutzerklärung) als separate Inline-Elemente – in einem Flex-Container
   würden Text und Link zu eigenen Flex-Items und der Link springt an den rechten
   Rand statt im Fließtext zu bleiben. So bleibt alles normaler, umbrechender Text. */
.lmo-form .lmo-field-checkbox label {
	display: block;
	position: relative;
	padding-left: 1.75em;
	font-weight: normal;
	font-size: 14px;
	line-height: 1.45;
	cursor: pointer;
}

.lmo-form .lmo-field-checkbox input[type="checkbox"] {
	position: absolute;
	left: 0;
	top: 0.15em;
	width: 1.15em;
	height: 1.15em;
	margin: 0;
	accent-color: var(--lmo-accent);
	cursor: pointer;
}

.lmo-form .lmo-field-checkbox a {
	color: var(--lmo-accent);
}

.lmo-form .lmo-radio-option {
	display: flex;
	align-items: center;
	gap: 0.5em;
	font-weight: normal;
	margin-top: 0.4em;
}

.lmo-form .lmo-radio-option:first-of-type {
	margin-top: 0;
}

.lmo-form-hp {
	position: absolute;
	left: -9999px;
	top: -9999px;
}

.lmo-form-submit {
	margin: 0;
}

.lmo-form-submit button {
	width: 100%;
	padding: 0.85em 1.5em;
	font-size: 1em;
	font-weight: 600;
	color: #fff;
	background: var(--lmo-accent);
	border: none;
	border-radius: var(--lmo-radius);
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.05s ease;
}

.lmo-form-submit button:hover:not(:disabled) {
	background: var(--lmo-accent-hover);
}

.lmo-form-submit button:active:not(:disabled) {
	transform: translateY(1px);
}

.lmo-form-submit button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.lmo-form-submit button:focus-visible {
	outline: 2px solid var(--lmo-accent);
	outline-offset: 2px;
}

.lmo-form-message {
	margin: 0;
	font-size: 0.92em;
}

.lmo-form-message:empty {
	display: none;
}

/* Inline-"Dankesseite": nach erfolgreicher Anmeldung werden Felder und Button
   ausgeblendet, nur die Erfolgsmeldung bleibt sichtbar – keine echte WP-Seite nötig
   (es sei denn, eine Dankeseiten-URL ist hinterlegt, dann leitet das Formular dorthin um). */
.lmo-form-success .lmo-field,
.lmo-form-success .lmo-form-hp,
.lmo-form-success .lmo-form-submit {
	display: none;
}

.lmo-form-success .lmo-form-message-success {
	font-size: 1.1em;
	font-weight: 600;
}

.lmo-form-message-success {
	color: #166534;
}

.lmo-form-message-error {
	color: #991b1b;
}

@media (max-width: 480px) {
	.lmo-form {
		--lmo-gap: 0.9em;
		--lmo-font-size: 0.95rem;
	}

	.lmo-form .lmo-field input[type="text"],
	.lmo-form .lmo-field input[type="email"],
	.lmo-form .lmo-field input[type="number"],
	.lmo-form .lmo-field select,
	.lmo-form .lmo-field textarea,
	.lmo-form-submit button {
		padding: 0.7em 0.85em;
	}
}
