/*
 * Front-end styles of the busol-formulare plugin.
 *
 * Styles the forms of [busol_kontakt] / [busol_bewerbung] and the job accordion of
 * [busol_stellen] (markup from includes/class-forms.php, behaviour from assets/forms.js).
 * Uses the design tokens of the busol theme (--brand, --line, --surface, ...) but has
 * its own fallback values, so the forms also look right with another theme.
 * The .js class on <html> is set by the theme (functions.php).
 */
.bf-wrap {
	--bf-brand: var(--brand, #1b569e);
	--bf-line: var(--line, #e1e7ef);
	--bf-surface: var(--surface, #fff);
	--bf-ink: var(--ink, #142033);
	--bf-muted: var(--muted, #5d6878);
	--bf-danger: var(--danger, #b42318);
	--bf-radius: var(--radius, 16px);
	position: relative;
	margin: 2em 0;
	padding: clamp(20px, 4vw, 36px);
	border-radius: var(--radius-lg, 24px);
	background: var(--bf-surface);
	border: 1px solid var(--bf-line);
	box-shadow: var(--shadow, 0 10px 30px -12px rgba(15, 35, 66, 0.18));
}
.bf-title {
	margin-top: 0 !important;
}
.bf-intro {
	color: var(--bf-muted);
}
.bf-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}
.bf-field--wide {
	grid-column: 1 / -1;
}
@media (max-width: 640px) {
	.bf-grid {
		grid-template-columns: 1fr;
	}
}
.bf-hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Fields with floating labels (needs placeholder=" " on the controls) */
.bf-field {
	position: relative;
	display: flex;
	flex-direction: column;
}
.bf-field input:not([type="checkbox"]):not([type="file"]),
.bf-field textarea,
.bf-field select {
	width: 100%;
	padding: 24px 16px 9px;
	border-radius: 12px;
	border: 1.5px solid var(--bf-line);
	background: var(--bg, #f6f8fb);
	font: inherit;
	font-size: 1rem;
	color: var(--bf-ink);
	outline: none;
	appearance: none;
	-webkit-appearance: none;
	transition:
		border-color 0.25s,
		box-shadow 0.25s,
		background-color 0.25s;
}
.bf-field textarea {
	resize: vertical;
	min-height: 140px;
	padding-top: 28px;
}
.bf-field select {
	cursor: pointer;
	padding-right: 44px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6878' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 18px;
}
.bf-field:not(.bf-field--check):not(.bf-field--files) > label {
	position: absolute;
	left: 17px;
	top: 17px;
	pointer-events: none;
	color: var(--bf-muted);
	font-size: 1rem;
	line-height: 1.2;
	transform-origin: left top;
	transition:
		transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1),
		color 0.25s;
}
.bf-field input:focus + label,
.bf-field input:not(:placeholder-shown) + label,
.bf-field textarea:focus + label,
.bf-field textarea:not(:placeholder-shown) + label,
.bf-field--select > label {
	transform: translateY(-9px) scale(0.78);
	font-weight: 600;
}
.bf-field input:focus,
.bf-field textarea:focus,
.bf-field select:focus {
	border-color: var(--bf-brand);
	background: var(--bf-surface);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--bf-brand) 14%, transparent);
}
.bf-field input:focus + label,
.bf-field textarea:focus + label,
.bf-field select:focus + label {
	color: var(--bf-brand);
}
.bf-req {
	color: var(--bf-danger);
}
.bf-opt {
	font-size: 0.82em;
	font-weight: 400;
	opacity: 0.7;
	margin-left: 4px;
}
.bf-field.has-error input,
.bf-field.has-error textarea,
.bf-field.has-error select {
	border-color: var(--bf-danger);
}
.bf-err {
	color: var(--bf-danger);
	font-size: 0.88rem;
	font-weight: 600;
	min-height: 0;
	max-height: 0;
	overflow: hidden;
	transition:
		max-height 0.3s,
		margin 0.3s;
}
.bf-field.has-error .bf-err {
	max-height: 80px;
	margin-top: 6px;
}

/* Checkbox */
.bf-field--check {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-start;
}
.bf-field--check input {
	position: relative;
	flex: none;
	width: 22px;
	height: 22px;
	margin: 1px 0 0;
	border-radius: 7px;
	border: 1.5px solid var(--line-strong, #cbd5e1);
	background: var(--bf-surface);
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	transition:
		background-color 0.2s,
		border-color 0.2s;
}
.bf-field--check input:checked {
	background: var(--bf-brand);
	border-color: var(--bf-brand);
}
.bf-field--check input::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 2px;
	width: 6px;
	height: 11px;
	border: solid #fff;
	border-width: 0 2.4px 2.4px 0;
	transform: rotate(45deg) scale(0);
	transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.bf-field--check input:checked::after {
	transform: rotate(45deg) scale(1);
}
.bf-field--check input:focus-visible {
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--bf-brand) 20%, transparent);
	outline: none;
}
.bf-field--check label {
	flex: 1;
	font-size: 0.95rem;
	color: var(--bf-muted);
	cursor: pointer;
}
.bf-field--check .bf-err {
	flex-basis: 100%;
}

/* Upload */
.bf-label {
	font-weight: 600;
	color: var(--bf-ink);
	margin-bottom: 8px;
}
.bf-drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 28px 18px;
	border-radius: var(--bf-radius);
	border: 2px dashed var(--line-strong, #cbd5e1);
	background: var(--bg, #f6f8fb);
	text-align: center;
	cursor: pointer;
	color: var(--bf-muted);
	transition:
		border-color 0.25s,
		background-color 0.25s,
		transform 0.3s;
}
.bf-drop .ico {
	width: 38px;
	height: 38px;
	color: var(--bf-brand);
	margin-bottom: 6px;
	transition: transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.bf-drop strong {
	color: var(--bf-ink);
}
.bf-drop u {
	color: var(--bf-brand);
}
.bf-drop small {
	margin-top: 6px;
	font-size: 0.82rem;
}
.bf-drop:hover,
.bf-drop.is-over {
	border-color: var(--bf-brand);
	background: color-mix(in srgb, var(--bf-brand) 6%, var(--bf-surface));
}
.bf-drop.is-over {
	transform: scale(1.01);
}
.bf-drop:hover .ico,
.bf-drop.is-over .ico {
	transform: translateY(-4px);
}
.js .bf-file-input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}
.bf-file-input:focus-visible + .bf-filelist,
.bf-file-input:focus-visible ~ .bf-drop {
	outline: 2px solid var(--bf-brand);
}
.bf-filelist {
	list-style: none;
	margin: 10px 0 0;
	padding: 0;
	display: grid;
	gap: 8px;
}
.bf-filelist li {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 12px;
	border: 1px solid var(--bf-line);
	background: var(--bf-surface);
	animation: bfIn 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.bf-filelist .bf-fi {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: color-mix(in srgb, var(--bf-brand) 12%, transparent);
	color: var(--bf-brand);
	font: 800 0.7rem/1 var(--font-head, sans-serif);
	text-transform: uppercase;
	flex: none;
}
.bf-filelist .bf-fn {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 600;
	color: var(--bf-ink);
}
.bf-filelist .bf-fs {
	color: var(--bf-muted);
	font-size: 0.85rem;
}
.bf-filelist button {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 0;
	background: transparent;
	color: var(--bf-muted);
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
	transition:
		background-color 0.2s,
		color 0.2s;
}
.bf-filelist button:hover {
	background: color-mix(in srgb, var(--bf-danger) 12%, transparent);
	color: var(--bf-danger);
}
.bf-hint {
	margin: 10px 0 0;
	font-size: 0.92rem;
	color: var(--bf-muted);
}
@keyframes bfIn {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
}

/* Submit */
.bf-submit {
	display: flex;
	align-items: center;
	gap: 18px;
	flex-wrap: wrap;
	margin-top: 6px;
}
.bf-note {
	margin: 0;
	font-size: 0.88rem;
	color: var(--bf-muted);
}
.bf-btn {
	position: relative;
}
.bf-spinner {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 2.5px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	opacity: 0;
}
.bf-form.is-sending .bf-btn {
	pointer-events: none;
}
.bf-form.is-sending .bf-btn > span:not(.bf-spinner),
.bf-form.is-sending .bf-btn > .ico {
	opacity: 0;
}
.bf-form.is-sending .bf-spinner {
	opacity: 1;
	animation: bfSpin 0.8s linear infinite;
}
@keyframes bfSpin {
	to {
		transform: rotate(360deg);
	}
}
.bf-status:empty {
	display: none;
}
.bf-status,
.bf-errors {
	padding: 14px 16px;
	border-radius: 12px;
	background: color-mix(in srgb, var(--bf-danger) 9%, var(--bf-surface));
	color: var(--bf-danger);
	font-weight: 600;
}
.bf-errors {
	margin-bottom: 18px;
}
.bf-errors ul {
	margin: 6px 0 0;
}

/* Success message */
.bf-success {
	text-align: center;
	padding: 20px 0;
	animation: bfIn 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
	outline: none;
}
.bf-success__icon svg {
	width: 72px;
	height: 72px;
	margin: 0 auto 14px;
	display: block;
}
.bf-success__icon circle {
	fill: none;
	stroke: var(--ok, #1f9d6b);
	stroke-width: 3;
	stroke-dasharray: 152;
	stroke-dashoffset: 152;
	animation: bfDraw 0.7s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.bf-success__icon path {
	fill: none;
	stroke: var(--ok, #1f9d6b);
	stroke-width: 3.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 40;
	stroke-dashoffset: 40;
	animation: bfDraw 0.45s cubic-bezier(0.65, 0, 0.45, 1) 0.55s forwards;
}
.bf-success h3 {
	margin: 0 0 6px;
}
.bf-success p {
	color: var(--bf-muted);
	max-width: 460px;
	margin: 0 auto;
}
@keyframes bfDraw {
	to {
		stroke-dashoffset: 0;
	}
}

/* Job listings (accordion) */
.bf-joblist {
	display: grid;
	gap: 14px;
	margin: 1.6em 0 2.4em;
}
.bf-job {
	border-radius: var(--radius, 16px);
	background: var(--surface, #fff);
	border: 1px solid var(--line, #e1e7ef);
	overflow: hidden;
	transition:
		box-shadow 0.35s,
		border-color 0.3s;
}
.bf-job.is-open {
	box-shadow: var(--shadow, 0 10px 30px -12px rgba(15, 35, 66, 0.18));
	border-color: color-mix(
		in srgb,
		var(--brand, #1b569e) 30%,
		var(--line, #e1e7ef)
	);
}
.bf-job__head {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 20px 22px;
	border: 0;
	background: none;
	text-align: left;
	cursor: pointer;
	font: inherit;
	color: inherit;
}
.bf-job__title {
	flex: 1;
	display: grid;
	gap: 4px;
}
.bf-job__title strong {
	font: 700 1.15rem/1.3 var(--font-head, inherit);
	color: var(--ink, #142033);
}
.bf-job__title span {
	color: var(--muted, #5d6878);
	font-size: 0.97rem;
}
.bf-job__meta {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: flex-end;
}
.bf-chip {
	padding: 5px 11px;
	border-radius: 999px;
	background: var(--brand-100, #e7f0fb);
	color: var(--brand, #1b569e);
	font: 700 0.8rem/1 var(--font-head, inherit);
	white-space: nowrap;
}
.bf-chip--loc {
	background: var(--bg-alt, #eef2f7);
	color: var(--slate, #4e5968);
}
.bf-job__chev {
	position: relative;
	width: 36px;
	height: 36px;
	flex: none;
	border-radius: 50%;
	background: var(--bg-alt, #eef2f7);
	transition:
		transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1),
		background-color 0.3s;
}
.bf-job__chev::before,
.bf-job__chev::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 12px;
	height: 2px;
	margin: -1px 0 0 -6px;
	border-radius: 2px;
	background: var(--brand, #1b569e);
	transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.bf-job__chev::after {
	transform: rotate(90deg);
}
.bf-job.is-open .bf-job__chev {
	background: var(--brand, #1b569e);
}
.bf-job.is-open .bf-job__chev::before,
.bf-job.is-open .bf-job__chev::after {
	background: #fff;
}
.bf-job.is-open .bf-job__chev::after {
	transform: rotate(0deg);
}
.bf-job__body {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.bf-job.is-open .bf-job__body {
	grid-template-rows: 1fr;
}
.bf-job__inner {
	min-height: 0;
	overflow: hidden;
	padding: 0 22px;
}
.bf-job.is-open .bf-job__inner {
	padding-bottom: 22px;
}
.bf-job__inner ul {
	list-style: none;
	padding: 0;
	display: grid;
	gap: 8px;
}
.bf-job__inner ul li {
	position: relative;
	padding-left: 30px;
}
.bf-job__inner ul li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.25em;
	width: 18px;
	height: 18px;
	background: var(--brand, #1b569e);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
		center/contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
		center/contain no-repeat;
}
.bf-job__inner h3,
.bf-job__inner h4 {
	margin-top: 1.2em;
	font-size: 1.02rem;
}
@media (max-width: 640px) {
	.bf-job__head {
		flex-wrap: wrap;
	}
	.bf-job__meta {
		order: 3;
		justify-content: flex-start;
		width: 100%;
	}
}
@media (prefers-reduced-motion: reduce) {
	.bf-job__body,
	.bf-field > label,
	.bf-drop {
		transition: none;
	}
}
/* The privacy checkbox label is a normal label: undo the floating-label styles. */
.bf-field--check > label {
	transform: none !important;
	font-weight: 400 !important;
	color: var(--bf-muted) !important;
}
