/* ==========================================================================
   Formulare im Stil der Website: Contact Form 7 (inc/kontakt.php) und eigene
   Formulare mit class="ew-form" (z. B. Blogger-Bewerbung, inc/blogger.php).
   Wird nur auf Seiten mit Formular geladen und ersetzt das CSS des Plugins.
   Farben und Schriften aus style.css.
   ========================================================================== */

.wpcf7 { position: relative; }

/* Ansagen für Screenreader (Plugin) – sichtbar bleibt die Meldung unter dem Formular. */
.wpcf7 .screen-reader-response {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	border: 0;
	word-wrap: normal !important;
}
.wpcf7 .hidden-fields-container { display: none; }
:is(.wpcf7, .ew-form) .ew-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

:is(.wpcf7 form, form.ew-form) { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.wpcf7 [inert] { opacity: 0.6; }

/* ---------- Felder ---------- */
:is(.wpcf7, .ew-form) .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
:is(.wpcf7, .ew-form) .field > label { font-size: 15px; font-weight: 800; line-height: 1.4; color: var(--ink); }
:is(.wpcf7, .ew-form) .field > label span { font-weight: 600; color: var(--ink-70); }
.wpcf7 .wpcf7-form-control-wrap { position: relative; display: block; }

/* :where() hält die Spezifität niedrig, damit textarea/select unten ihre Form behalten. */
:is(.wpcf7 form, form.ew-form) :where(input[type="text"], input[type="email"], input[type="url"], input[type="tel"], input[type="number"], input[type="date"], select, textarea) {
	display: block;
	width: 100%;
	min-height: 54px;
	margin: 0;
	padding: 0 20px;
	border: 1.5px solid var(--line-strong);
	border-radius: var(--radius-control);
	background-color: #fff;
	font: inherit;
	font-size: 17px;
	line-height: 1.4;
	color: var(--ink);
	box-shadow: none;
}
:is(.wpcf7 form, form.ew-form) textarea {
	min-height: 168px;
	padding: 14px 20px;
	border-radius: var(--radius-control);
	line-height: 1.55;
	resize: vertical;
}
:is(.wpcf7 form, form.ew-form) select {
	padding-right: 52px;
	-webkit-appearance: none;
	appearance: none;
	background-image: url("../icons/chevron-down-violet.svg");
	background-repeat: no-repeat;
	background-position: right 20px center;
	background-size: 18px;
	cursor: pointer;
}
:is(.wpcf7 form, form.ew-form) :is(input, textarea)::placeholder { color: var(--ink-50); opacity: 1; }
:is(.wpcf7 form, form.ew-form) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
	border-color: var(--accent);
	outline: 3px solid var(--focus);
	outline-offset: 2px;
	box-shadow: none;
}
:is(.wpcf7 form, form.ew-form) :is(input, select, textarea)[aria-invalid="true"] { border-color: #B3261E; }

/* Fehler als Text unter dem Feld (nicht nur Farbe). */
.wpcf7 .wpcf7-not-valid-tip {
	display: block;
	margin-top: 6px;
	padding-left: 20px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.45;
	color: #B3261E;
}

/* Hinweis unter einem Feld, Fehler eigener Formulare */
.ew-form .field__hint { font-size: 14px; line-height: 1.5; color: var(--ink-70); }
.ew-form .field__error { display: block; font-size: 14px; font-weight: 700; line-height: 1.45; color: #B3261E; }
.ew-form .field__error[hidden] { display: none; }
.ew-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.ew-form legend { padding: 0; font-size: 15px; font-weight: 800; line-height: 1.4; color: var(--ink); }
.ew-form legend span { font-weight: 600; color: var(--ink-70); }
.ew-form .field--check .field__error { padding-left: 34px; }

/* ---------- Einwilligung ---------- */
:is(.wpcf7, .ew-form) .field--check .wpcf7-list-item { display: block; margin: 0; }
:is(.wpcf7, .ew-form) .field--check label {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.55;
	color: var(--ink-70);
	cursor: pointer;
}
:is(.wpcf7, .ew-form) .field--check input[type="checkbox"] {
	flex: none;
	width: 22px;
	height: 22px;
	margin: 1px 0 0;
	accent-color: var(--accent);
	cursor: pointer;
}
:is(.wpcf7, .ew-form) .field--check input[type="checkbox"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
:is(.wpcf7, .ew-form) .field--check a { font-weight: 700; color: var(--accent); }
.wpcf7 .field--check .wpcf7-not-valid-tip { padding-left: 34px; }

/* ---------- Absenden ---------- */
.wpcf7 .field--submit { position: relative; }
.wpcf7 .wpcf7-submit {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 56px;
	padding: 0 56px;
	border: 1.5px solid var(--accent);
	border-radius: var(--radius-button);
	box-shadow: var(--button-keyline);
	background: var(--accent);
	color: #fff;
	font-family: var(--font-body);
	font-size: 17px;
	font-weight: 800;
	cursor: pointer;
	transition: background-color 0.2s, border-color 0.2s;
}
.wpcf7 .wpcf7-submit:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.wpcf7 .wpcf7-submit:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: var(--radius-button); }
.wpcf7 .wpcf7-submit:disabled { opacity: 0.6; cursor: default; }

/* Ladekreis rechts im Knopf, nur während des Sendens. */
.wpcf7 .wpcf7-spinner {
	position: absolute;
	top: 50%;
	right: 22px;
	width: 22px;
	height: 22px;
	margin-top: -11px;
	border: 3px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	visibility: hidden;
	animation: ew-spin 0.8s linear infinite;
	pointer-events: none;
}
.wpcf7 form.submitting .wpcf7-spinner { visibility: visible; }
@keyframes ew-spin {
	to { transform: rotate(360deg); }
}

/* ---------- Meldung nach dem Absenden ---------- */
.wpcf7 form .wpcf7-response-output {
	margin: 0;
	padding: 14px 16px;
	border: 1.5px solid #E8B4AF;
	border-radius: 16px;
	background: #FCECEA;
	color: #8A1C15;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.5;
}
.wpcf7 form.init .wpcf7-response-output,
.wpcf7 form.resetting .wpcf7-response-output,
.wpcf7 form.submitting .wpcf7-response-output { display: none; }
.wpcf7 form.sent .wpcf7-response-output {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 16px 18px;
	border-color: transparent;
	background: var(--success-bg);
	color: var(--success);
	font-size: 16px;
}
.wpcf7 form.sent .wpcf7-response-output::before {
	content: "";
	flex: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #fff url("../icons/heart-violet.svg") center / 20px no-repeat;
}

@media (prefers-reduced-motion: reduce) {
	.wpcf7 .wpcf7-submit { transition: none; }
	.wpcf7 .wpcf7-spinner { animation-duration: 2.4s; }
}
