/*
 * Flow2Web Forms & Mail: front-end styles.
 *
 * Everything is scoped to .f2w-form-wrap. The Manifesto theme still supplies fonts, the focus
 * underline animation (input + .input_label), the pill button and light/dark colours through the
 * class names reused in the markup; these rules refine layout, spacing, labels and states.
 * Colours are derived from the inherited text colour (currentColor), so the form works on both
 * dark and light Manifesto sections without hard-coded backgrounds.
 */

.f2w-form-wrap {
	--f2w-gap-x: 48px;
	--f2w-gap-y: 44px;
	--f2w-max: 800px;
	--f2w-ease: 0.25s ease;
	--f2w-error: #ff8a80; /* AA contrast on the theme's dark sections */
	max-width: var(--f2w-max);
	margin-left: auto;
	margin-right: auto;
}

.light-section .f2w-form-wrap {
	--f2w-error: #b00020; /* AA contrast on light sections */
}

/* ---------- Utilities ---------- */

/* Visually hidden but available to assistive technology. */
.f2w-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Honeypot: off-screen, not display:none (simple bots skip display:none fields). */
.f2w-hp {
	position: absolute !important;
	left: -10000px !important;
	top: auto !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- Layout: Contact ---------- */

.f2w-form-wrap .f2w-form #contact-formular {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	column-gap: var(--f2w-gap-x);
	row-gap: var(--f2w-gap-y);
	max-width: var(--f2w-max);
	margin: 0 auto;
	text-align: left;
}

.f2w-form-wrap .f2w-form #contact-formular::after {
	display: none;
}

.f2w-form-wrap .f2w-form .name-box,
.f2w-form-wrap .f2w-form .email-box,
.f2w-form-wrap .f2w-form .f2w-subject-box,
.f2w-form-wrap .f2w-form .message-box {
	float: none;
	width: auto;
	min-width: 0;
	margin: 0;
	position: relative;
}

.f2w-form-wrap .f2w-form .f2w-subject-box,
.f2w-form-wrap .f2w-form .message-box {
	grid-column: 1 / -1;
}

.f2w-form-wrap .f2w-form #contact-formular > br {
	display: none;
}

/* ---------- Layout: Career (four visual groups, no boxes) ---------- */

.f2w-form-wrap .f2w-form #contact-formular:not(.text-align-center) {
	display: flex;
	flex-direction: column;
	gap: 64px;
}

.f2w-form-wrap .f2w-group {
	margin: 0;
	padding: 0;
	min-width: 0;
}

.f2w-form-wrap .f2w-group-title {
	margin: 0 0 32px;
	padding: 0 0 14px;
	border-bottom: 1px solid rgba(128, 128, 128, 0.35);
	border-bottom-color: color-mix(in srgb, currentColor 22%, transparent);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: inherit;
	opacity: 0.85;
}

.f2w-form-wrap .f2w-group-fields {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	column-gap: var(--f2w-gap-x);
	row-gap: var(--f2w-gap-y);
}

.f2w-form-wrap .f2w-group:first-child .f2w-group-fields {
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.f2w-form-wrap .f2w-group-fields > .has-animation {
	margin: 0;
	min-width: 0;
}

/* ---------- Labels ---------- */

.f2w-form-wrap .f2w-label {
	display: block;
	margin: 0 0 2px;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.5;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.75;
	transition: opacity var(--f2w-ease);
}

.f2w-form-wrap .has-animation:focus-within > .f2w-label,
.f2w-form-wrap .has-animation:focus-within .f2w-label {
	opacity: 1;
}

.f2w-form-wrap .f2w-req {
	opacity: 0.8;
}

/* ---------- Controls ---------- */

/* Positioning context for the theme's underline label and the error slot. */
.f2w-form-wrap .f2w-field {
	display: block;
	position: relative;
	height: auto;
}

.f2w-form-wrap .f2w-form .f2w-field input,
.f2w-form-wrap .f2w-form .f2w-field textarea {
	display: block;
	width: 100%;
	height: 52px;
	padding: 12px 0;
	font-size: 17px; /* 16px minimum avoids zoom on iOS focus */
	font-weight: 400;
	line-height: 1.4;
	text-overflow: ellipsis;
	border-bottom-color: rgba(128, 128, 128, 0.55);
	border-bottom-color: color-mix(in srgb, currentColor 38%, transparent);
	transition: border-color var(--f2w-ease), color var(--f2w-ease);
}

.f2w-form-wrap .f2w-form .f2w-field textarea {
	height: 150px;
	min-height: 150px;
	line-height: 1.6;
	resize: vertical;
	text-overflow: clip;
	overflow-wrap: anywhere;
}

.f2w-form-wrap .f2w-form .f2w-compact textarea {
	height: 88px;
	min-height: 88px;
}

.f2w-form-wrap .f2w-form .f2w-field input:hover,
.f2w-form-wrap .f2w-form .f2w-field textarea:hover {
	border-bottom-color: rgba(128, 128, 128, 0.85);
	border-bottom-color: color-mix(in srgb, currentColor 65%, transparent);
}

/* Theme underline animation: anchor it to the bottom of the (variable-height) field. */
.f2w-form-wrap .f2w-form .f2w-field .input_label {
	top: auto;
	bottom: 0;
	height: 2px;
}

/* Placeholder: same colour as the text, softened, so contrast follows the section colour. */
.f2w-form-wrap .f2w-form #contact-formular input::placeholder,
.f2w-form-wrap .f2w-form #contact-formular textarea::placeholder {
	color: inherit;
	opacity: 0.6;
	transition: opacity var(--f2w-ease);
}

.f2w-form-wrap .f2w-form #contact-formular input:focus::placeholder,
.f2w-form-wrap .f2w-form #contact-formular textarea:focus::placeholder {
	opacity: 0.35;
}

/* Browser autofill: keep the text colour and no coloured background, whatever the section colour. */
.f2w-form-wrap .f2w-form input:-webkit-autofill,
.f2w-form-wrap .f2w-form textarea:-webkit-autofill {
	-webkit-text-fill-color: currentColor;
	caret-color: currentColor;
	transition: background-color 600000s 0s, color 600000s 0s;
}

/* Visible keyboard focus (the theme removes outlines). */
.f2w-form input:focus-visible,
.f2w-form textarea:focus-visible,
.f2w-form .f2w-status:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

.f2w-form [type="submit"]:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 6px;
	border-radius: 100px;
}

/* ---------- Validation ---------- */

.f2w-form-wrap .f2w-form .f2w-field [aria-invalid="true"] {
	border-bottom-color: var(--f2w-error);
}

/* Message sits just below the field, inside the row gap, so showing it never moves anything. */
.f2w-form-wrap .f2w-error {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 6px;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.35;
	color: var(--f2w-error);
}

/* Not colour alone: a mark precedes the text (decorative; the text itself is announced). */
.f2w-form-wrap .f2w-error::before {
	content: "!";
	content: "!" / "";
	display: inline-block;
	width: 15px;
	height: 15px;
	margin-right: 7px;
	border: 1.5px solid currentColor;
	border-radius: 50%;
	font-size: 10px;
	font-weight: 700;
	line-height: 12px;
	text-align: center;
	vertical-align: 1px;
}

.f2w-form-wrap .f2w-error[hidden] {
	display: none;
}

/* ---------- Submit button ---------- */

.f2w-form-wrap .f2w-form .button-box {
	grid-column: 1 / -1;
	justify-self: center;
	margin: 20px 0 0;
	float: none;
}

.f2w-form-wrap .f2w-form #contact-formular:not(.text-align-center) > .button-box {
	align-self: center;
}

.f2w-form-wrap .f2w-form .f2w-submit {
	min-height: 56px;
	cursor: pointer;
}

.f2w-form-wrap .f2w-form .f2w-submit:disabled {
	cursor: progress;
	opacity: 0.55;
}

/* Loading: a thin bar runs along the bottom of the button while the request is in flight. */
.f2w-form-wrap .f2w-form[aria-busy="true"] .button-border {
	position: relative;
	overflow: hidden;
}

.f2w-form-wrap .f2w-form[aria-busy="true"] .button-border::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 40%;
	height: 2px;
	background: currentColor;
	animation: f2w-load 1.1s ease-in-out infinite;
}

@keyframes f2w-load {
	0% { transform: translateX(-100%); }
	100% { transform: translateX(250%); }
}

.f2w-form[aria-busy="true"] {
	cursor: progress;
}

/* ---------- Privacy notice and status ---------- */

.f2w-form-wrap .f2w-privacy {
	clear: both;
	margin: 28px auto 0;
	max-width: 560px;
	font-size: 13px;
	line-height: 1.6;
	color: inherit;
	opacity: 0.75;
	text-align: center;
}

.f2w-form-wrap .f2w-privacy a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.f2w-form-wrap .f2w-status {
	clear: both;
	margin: 24px auto 0;
	max-width: 560px;
	font-size: 15px;
	line-height: 1.6;
	text-align: center;
}

/* Empty live region stays in the page (so announcements work) but takes no space. */
.f2w-form-wrap .f2w-status:empty {
	margin: 0;
	padding: 0;
	border: 0;
	min-height: 0;
}

.f2w-form-wrap .f2w-status--busy {
	opacity: 0.75;
}

.f2w-form-wrap .f2w-status--ok {
	padding: 18px 22px;
	border: 1px solid rgba(128, 128, 128, 0.6);
	border-color: color-mix(in srgb, currentColor 45%, transparent);
	font-weight: 500;
}

.f2w-form-wrap .f2w-status--error {
	padding: 14px 20px;
	border-left: 3px solid var(--f2w-error);
	color: var(--f2w-error);
	text-align: left;
}

.f2w-form-wrap .f2w-noscript {
	text-align: center;
	font-size: 14px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.f2w-form-wrap {
		--f2w-gap-x: 32px;
	}
}

@media (max-width: 640px) {
	.f2w-form-wrap {
		--f2w-gap-y: 44px; /* room for a two-line error message */
	}

	.f2w-form-wrap .f2w-form #contact-formular,
	.f2w-form-wrap .f2w-form .f2w-group:first-child .f2w-group-fields {
		grid-template-columns: minmax(0, 1fr);
	}

	.f2w-form-wrap .f2w-form #contact-formular:not(.text-align-center) {
		gap: 52px;
	}

	.f2w-form-wrap .f2w-form .f2w-field input {
		height: 56px; /* comfortable touch target */
	}
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
	.f2w-form * {
		transition: none !important;
		animation: none !important;
	}
}
