/*
 * WERK1 Bewerbungsformular, Frontend
 * Alles ist unter .w1bf gekapselt. Steuerbar über die Variablen unten,
 * die Akzentfarbe setzt das Plugin inline (--w1bf-accent).
 */

.w1bf {
	--w1bf-accent: #C25304;
	--w1bf-accent-hover: var(--w1bf-accent);
	--w1bf-accent-ink: var(--w1bf-accent);
	--w1bf-border: #e6e6e6;
	--w1bf-radius: 8px;
	--w1bf-bg: #fff;
	--w1bf-text: #141617;
	--w1bf-muted: #6b6b6b;
	--w1bf-error: #b3261e;
	--w1bf-gap: 14px;

	/* Abgeleitete Werte, mit Rückfall für ältere Browser */
	--w1bf-tint: rgba(0, 0, 0, 0.04);
	--w1bf-tint-soft: rgba(0, 0, 0, 0.025);
	--w1bf-tint-strong: rgba(0, 0, 0, 0.08);
	--w1bf-tint-drag: rgba(0, 0, 0, 0.04);
	--w1bf-dash: #bcbcbc;
	--w1bf-border-hover: #cfcfcf;
	--w1bf-error-tint: #fdf1f0;
	--w1bf-error-line: #e8b4b0;

	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	color: var(--w1bf-text);
	font: inherit;
	line-height: 1.5;
	text-align: left;
	-webkit-text-size-adjust: 100%;
}

@supports (color: color-mix(in srgb, red 10%, white)) {
	.w1bf {
		--w1bf-tint: color-mix(in srgb, var(--w1bf-accent) 5%, transparent);
		--w1bf-tint-soft: color-mix(in srgb, var(--w1bf-accent) 2.5%, transparent);
		--w1bf-tint-strong: color-mix(in srgb, var(--w1bf-accent) 9%, transparent);
		--w1bf-tint-drag: color-mix(in srgb, var(--w1bf-accent) 6%, var(--w1bf-bg));
		--w1bf-accent-hover: color-mix(in srgb, var(--w1bf-accent) 84%, #000);
		--w1bf-accent-ink: color-mix(in srgb, var(--w1bf-accent) 78%, #000);
		--w1bf-border-hover: color-mix(in srgb, var(--w1bf-text) 20%, var(--w1bf-bg));
		--w1bf-dash: color-mix(in srgb, var(--w1bf-accent) 32%, var(--w1bf-border));
		--w1bf-error-tint: color-mix(in srgb, var(--w1bf-error) 6%, var(--w1bf-bg));
		--w1bf-error-line: color-mix(in srgb, var(--w1bf-error) 35%, var(--w1bf-bg));
	}
}

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

.w1bf [hidden] {
	display: none !important;
}

.w1bf .w1bf-form {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
}

/* Honigtopf und nur für Screenreader */
.w1bf .w1bf-hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.w1bf .w1bf-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Felder */
.w1bf .w1bf-field {
	display: block;
	position: relative;
	margin: 0 0 var(--w1bf-gap);
	padding: 0;
}

.w1bf .w1bf-input {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 15px 20px;
	font: inherit;
	line-height: 1.3;
	letter-spacing: inherit;
	color: var(--w1bf-text);
	background: var(--w1bf-bg);
	border: 1px solid var(--w1bf-border);
	border-radius: var(--w1bf-radius);
	box-shadow: none;
	outline: 0;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.w1bf .w1bf-input::placeholder {
	color: var(--w1bf-text);
	opacity: 1;
}

/* Hover nur dezent und neutral, nicht in Akzentfarbe */
.w1bf .w1bf-input:hover {
	border-color: var(--w1bf-border-hover);
}

.w1bf .w1bf-input:focus {
	border-color: var(--w1bf-accent);
}

.w1bf .w1bf-input:focus-visible {
	border-color: var(--w1bf-accent);
	outline: 2px solid var(--w1bf-accent);
	outline-offset: 2px;
}

.w1bf .w1bf-input:-webkit-autofill {
	-webkit-text-fill-color: var(--w1bf-text);
	-webkit-box-shadow: 0 0 0 1000px var(--w1bf-bg) inset;
}

.w1bf .w1bf-input[aria-invalid="true"] {
	border-color: var(--w1bf-error);
}

.w1bf .w1bf-input[aria-invalid="true"]:focus-visible {
	outline-color: var(--w1bf-error);
}

.w1bf .w1bf-textarea {
	min-height: 180px;
	resize: vertical;
}

/* Select mit abgetrenntem Pfeilbereich */
.w1bf .w1bf-select-wrap {
	position: relative;
	display: block;
	width: 100%;
}

.w1bf .w1bf-select {
	padding-right: 64px;
	text-overflow: ellipsis;
	cursor: pointer;
	background-image: none;
}

.w1bf .w1bf-select::-ms-expand {
	display: none;
}

.w1bf .w1bf-select-wrap::after {
	content: "";
	position: absolute;
	top: 1px;
	right: 1px;
	bottom: 1px;
	width: 48px;
	border-left: 1px solid var(--w1bf-border);
	border-radius: 0 calc(var(--w1bf-radius) - 1px) calc(var(--w1bf-radius) - 1px) 0;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%231a1a1a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6l5 5 5-5'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
	pointer-events: none;
}

/* Hinweistext zwischen den Feldern */
.w1bf .w1bf-text {
	margin: 28px 0 14px;
	padding: 0;
	font: inherit;
	color: var(--w1bf-text);
}

.w1bf .w1bf-text p {
	margin: 0 0 0.5em;
}

.w1bf .w1bf-text p:last-child {
	margin-bottom: 0;
}

/* Fehlertexte */
.w1bf .w1bf-error {
	margin: 8px 0 0;
	padding: 0 4px;
	font-size: 0.875em;
	line-height: 1.4;
	color: var(--w1bf-error);
}

/* Dateifelder */
.w1bf .w1bf-field--file {
	margin-bottom: 22px;
}

.w1bf .w1bf-file-label {
	display: block;
	margin: 0 0 10px;
	padding: 0;
	font: inherit;
	font-weight: 600;
	color: var(--w1bf-text);
}

.w1bf .w1bf-optional {
	margin-left: 6px;
	font-size: 0.9em;
	font-weight: 400;
	color: var(--w1bf-muted);
}

.w1bf .w1bf-dropzone {
	position: relative;
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	background: var(--w1bf-bg);
	border: 1.5px dashed var(--w1bf-dash);
	border-radius: var(--w1bf-radius);
	transition: border-color 0.18s ease, background-color 0.18s ease;
}

.w1bf .w1bf-dropzone:hover {
	border-color: var(--w1bf-accent);
	background: var(--w1bf-tint-soft);
}

/* Das native Feld liegt unsichtbar über der Fläche, so funktioniert
   Klick und Ziehen auch ohne JavaScript. */
.w1bf .w1bf-file-input {
	position: absolute;
	z-index: 2;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	opacity: 0;
	cursor: pointer;
	font-size: 0;
	border: 0;
}

.w1bf .w1bf-dropzone-inner {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: center;
	align-content: center;
	row-gap: 2px;
	width: 100%;
	margin: 0;
	padding: 18px 20px;
	font: inherit;
	line-height: 1.4;
	text-align: left;
	cursor: pointer;
}

.w1bf .w1bf-file-input:focus-visible + .w1bf-dropzone-inner {
	outline: 2px solid var(--w1bf-accent);
	outline-offset: 3px;
	border-radius: var(--w1bf-radius);
}

.w1bf .w1bf-dropzone-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	grid-column: 1;
	grid-row: 1 / span 2;
	width: 40px;
	height: 40px;
	margin: 0 18px 0 0;
	color: var(--w1bf-accent);
	background: var(--w1bf-tint-strong);
	border-radius: 10px;
	transition: transform 0.2s ease, background-color 0.18s ease;
}

.w1bf .w1bf-dropzone-icon:empty {
	display: none;
}

.w1bf .w1bf-dropzone-icon svg {
	display: block;
	width: 24px;
	height: 24px;
	margin: 0;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.w1bf .w1bf-dropzone-text {
	display: block;
	grid-column: 2;
	grid-row: 1;
	align-self: end;
	font: inherit;
	color: var(--w1bf-text);
}

.w1bf .w1bf-dropzone-link {
	font-weight: 600;
	color: var(--w1bf-accent);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.w1bf .w1bf-dropzone-hint {
	display: block;
	grid-column: 2;
	grid-row: 2;
	align-self: start;
	font-size: 0.8em;
	line-height: 1.4;
	color: var(--w1bf-muted);
}

.w1bf .w1bf-dropzone.is-dragover {
	border-style: solid;
	border-color: var(--w1bf-accent);
	background: var(--w1bf-tint-drag);
}

.w1bf .w1bf-dropzone.is-dragover .w1bf-dropzone-icon {
	background: var(--w1bf-bg);
	transform: translateY(-2px);
}

.w1bf .w1bf-field--file.has-error .w1bf-dropzone {
	border-color: var(--w1bf-error);
	background: var(--w1bf-error-tint);
}

/* Liste gewählter Dateien */
.w1bf .w1bf-file-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.w1bf .w1bf-file-list:empty {
	display: none;
	margin: 0;
}

.w1bf .w1bf-file {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
	margin: 0;
	padding: 12px 14px 12px 20px;
	list-style: none;
	background: var(--w1bf-bg);
	border: 1px solid var(--w1bf-border);
	border-radius: var(--w1bf-radius);
	animation: w1bf-in 0.2s ease both;
}

.w1bf .w1bf-file-ext {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 46px;
	height: 38px;
	padding: 0 8px;
	font-size: 0.7em;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1;
	color: var(--w1bf-accent-ink);
	background: var(--w1bf-tint-strong);
	border-radius: 6px;
}

.w1bf .w1bf-file-body {
	flex: 1 1 auto;
	min-width: 0;
}

.w1bf .w1bf-file-name {
	display: block;
	overflow: hidden;
	font-size: 0.9em;
	font-weight: 600;
	line-height: 1.35;
	color: var(--w1bf-text);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.w1bf .w1bf-file-meta {
	display: block;
	font-size: 0.8em;
	line-height: 1.4;
	color: var(--w1bf-muted);
}

.w1bf .w1bf-file-replace {
	flex: 0 0 auto;
	margin: 0 -4px 0 0;
	padding: 7px 10px;
	font: inherit;
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: normal;
	color: var(--w1bf-accent-ink);
	background: transparent;
	border: 0;
	border-radius: 6px;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.w1bf .w1bf-file-replace:hover {
	background: var(--w1bf-tint-strong);
}

.w1bf .w1bf-file-replace:focus-visible {
	outline: 2px solid var(--w1bf-accent);
	outline-offset: 1px;
}

.w1bf .w1bf-field--file.is-dragover .w1bf-file:not(.w1bf-file--error) {
	border-color: var(--w1bf-accent);
	background: var(--w1bf-tint-drag);
}

.w1bf .w1bf-file-remove {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	font: inherit;
	font-size: 1.3em;
	line-height: 1;
	text-transform: none;
	color: var(--w1bf-muted);
	background: transparent;
	border: 0;
	border-radius: 50%;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.w1bf .w1bf-file-remove:hover {
	color: var(--w1bf-text);
	background: var(--w1bf-tint-strong);
}

.w1bf .w1bf-file-remove:focus-visible {
	outline: 2px solid var(--w1bf-accent);
	outline-offset: 1px;
}

.w1bf .w1bf-file--error {
	background: var(--w1bf-error-tint);
	border-color: var(--w1bf-error-line);
}

.w1bf .w1bf-file--error .w1bf-file-ext {
	color: var(--w1bf-error);
	background: var(--w1bf-bg);
}

.w1bf .w1bf-file--error .w1bf-file-meta {
	color: var(--w1bf-error);
}

/* Checkboxen */
.w1bf .w1bf-check {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin: 0;
	padding: 0;
	font: inherit;
	line-height: 1.5;
	color: var(--w1bf-text);
	cursor: pointer;
}

.w1bf .w1bf-check input[type="checkbox"] {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	margin: 0.1em 0 0;
	margin-top: max(0px, calc((1.5em - 22px) / 2));
	padding: 0;
	font: inherit;
	background: var(--w1bf-bg) center / 14px 14px no-repeat;
	border: 1.5px solid #b5b5b5;
	border-radius: 6px;
	box-shadow: none;
	cursor: pointer;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.w1bf .w1bf-check input[type="checkbox"]:hover {
	border-color: var(--w1bf-accent);
}

.w1bf .w1bf-check input[type="checkbox"]:checked {
	background-color: var(--w1bf-accent);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 7.4l3 3 6-6.4'/%3E%3C/svg%3E");
	border-color: var(--w1bf-accent);
}

.w1bf .w1bf-check input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--w1bf-accent);
	outline-offset: 2px;
}

.w1bf .w1bf-check input[type="checkbox"][aria-invalid="true"] {
	border-color: var(--w1bf-error);
}

.w1bf .w1bf-check span {
	display: block;
	min-width: 0;
}

.w1bf .w1bf-check a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.w1bf .w1bf-field--consent {
	margin-top: 22px;
}

.w1bf .w1bf-field--consent .w1bf-check {
	font-size: 0.875em;
	line-height: 1.5;
}

.w1bf .w1bf-field--checkbox .w1bf-error,
.w1bf .w1bf-field--consent .w1bf-error {
	padding-left: 36px;
}

/* Absenden */
.w1bf .w1bf-actions {
	margin: 26px 0 0;
	padding: 0;
}

.w1bf .w1bf-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	min-width: 220px;
	height: auto;
	margin: 0;
	padding: 15px 33px;
	font: inherit;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: inherit;
	text-transform: none;
	color: #fff;
	background: var(--w1bf-accent);
	border: 1px solid var(--w1bf-accent);
	border-radius: var(--w1bf-radius);
	box-shadow: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.w1bf .w1bf-submit:hover:not(:disabled) {
	background: var(--w1bf-accent-hover, var(--w1bf-accent));
	border-color: var(--w1bf-accent-hover, var(--w1bf-accent));
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
	transform: translateY(-1px);
}

.w1bf .w1bf-submit:active:not(:disabled) {
	transform: translateY(0);
	box-shadow: none;
}

.w1bf .w1bf-submit:focus-visible {
	outline: 2px solid var(--w1bf-accent);
	outline-offset: 3px;
}

.w1bf .w1bf-submit:disabled,
.w1bf .w1bf-submit[disabled] {
	opacity: 0.55;
	cursor: progress;
	transform: none;
	box-shadow: none;
}

.w1bf .w1bf-progress {
	height: 4px;
	margin: 18px 0 0;
	overflow: hidden;
	background: var(--w1bf-border);
	border-radius: 999px;
}

.w1bf .w1bf-progress-bar {
	width: 0;
	height: 100%;
	background: var(--w1bf-accent);
	border-radius: 999px;
	transition: width 0.15s linear;
}

/* Statusmeldung */
.w1bf .w1bf-status {
	margin: 18px 0 0;
	padding: 16px 20px;
	font-size: 0.95em;
	line-height: 1.45;
	color: var(--w1bf-text);
	background: var(--w1bf-tint);
	border: 1px solid var(--w1bf-border);
	border-radius: var(--w1bf-radius);
}

.w1bf .w1bf-status--error {
	color: var(--w1bf-error);
	background: var(--w1bf-error-tint);
	border-color: var(--w1bf-error-line);
}

.w1bf .w1bf-status p {
	margin: 0;
}

.w1bf > .w1bf-status--error:first-child,
.w1bf .w1bf-form > .w1bf-status--error:first-child {
	margin: 0 0 var(--w1bf-gap);
}

/* Erfolg */
.w1bf .w1bf-success {
	position: relative;
	margin: 0;
	padding: 30px 24px 26px 84px;
	min-height: 92px;
	font: inherit;
	line-height: 1.55;
	color: var(--w1bf-text);
	background: var(--w1bf-bg);
	border: 1px solid var(--w1bf-border);
	border-radius: var(--w1bf-radius);
}

.w1bf .w1bf-success:focus {
	outline: 0;
}

.w1bf .w1bf-success::before,
.w1bf .w1bf-success-icon {
	content: "";
	position: absolute;
	top: 24px;
	left: 20px;
	display: block;
	width: 44px;
	height: 44px;
	background: var(--w1bf-accent) center / 22px 22px no-repeat;
	border-radius: 50%;
}

.w1bf .w1bf-success::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 11.5l4 4 8-9'/%3E%3C/svg%3E");
}

.w1bf .w1bf-success--js::before {
	content: none;
}

.w1bf .w1bf-success-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
}

.w1bf .w1bf-success-icon svg {
	display: block;
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.w1bf .w1bf-success p {
	margin: 0 0 0.6em;
}

.w1bf .w1bf-success p:last-child {
	margin-bottom: 0;
}

.w1bf .w1bf-success a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.w1bf .w1bf-success--js {
	animation: w1bf-in 0.35s ease both;
}

/* Turnstile */
.w1bf .w1bf-field--turnstile {
	margin: 20px 0 0;
}

.w1bf .w1bf-turnstile {
	max-width: 100%;
	min-height: 0;
}

/* Hinweis ohne JavaScript */
.w1bf .w1bf-noscript {
	margin: 18px 0 0;
	padding: 16px 20px;
	font-size: 0.95em;
	line-height: 1.45;
	color: var(--w1bf-text);
	background: var(--w1bf-tint);
	border: 1px solid var(--w1bf-border);
	border-radius: var(--w1bf-radius);
}

/* Bewegung */
@keyframes w1bf-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.w1bf *,
	.w1bf *::before,
	.w1bf *::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}

	.w1bf .w1bf-submit:hover:not(:disabled),
	.w1bf .w1bf-dropzone.is-dragover .w1bf-dropzone-icon {
		transform: none;
	}
}

/* Mobil */
@media (max-width: 600px) {
	.w1bf .w1bf-input {
		padding: 13px 16px;
	}

	.w1bf .w1bf-select {
		padding-right: 52px;
	}

	.w1bf .w1bf-select-wrap::after {
		width: 40px;
	}

	.w1bf .w1bf-text {
		margin-top: 22px;
	}

	.w1bf .w1bf-dropzone-inner {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 4px;
		padding: 18px 16px;
		text-align: center;
	}

	.w1bf .w1bf-dropzone-text,
	.w1bf .w1bf-dropzone-hint {
		align-self: center;
	}

	.w1bf .w1bf-file-replace {
		padding: 7px 6px;
	}

	.w1bf .w1bf-dropzone-icon {
		width: 36px;
		height: 36px;
		margin: 0 0 6px;
	}

	.w1bf .w1bf-file {
		gap: 12px;
		padding: 10px 10px 10px 16px;
	}

	.w1bf .w1bf-submit {
		width: 100%;
		padding: 13px 19px;
	}

	.w1bf .w1bf-success {
		padding: 76px 16px 20px;
		min-height: 0;
	}

	.w1bf .w1bf-success::before,
	.w1bf .w1bf-success-icon {
		top: 20px;
		left: 16px;
	}
}
