.contact-form {
	--cf-gap: clamp(32px, 4.4vw, 72px);
	--cf-danger: #d92d20;
}

.contact-form__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--cf-gap);
	align-items: start;
}

.contact-form__aside {
	display: flex;
	flex-direction: column;
	gap: clamp(24px, 3vw, 40px);
	min-width: 0;
}

.contact-form__aside .section-head {
	max-width: 50ch;
}

.contact-form__list {
	gap: clamp(18px, 2vw, 26px);
}

.contact-form__list .icon-list__icon--bubble {
	color: var(--cf-accent, var(--c-accent));
	border-width: 1px;
	border-color: var(--c-line);
}

.contact-form__list .icon-list__value {
	font-size: 1rem;
}

.contact-form__link {
	text-decoration: none;
	transition: color var(--dur-fast) var(--ease-out);
}

.contact-form__link:hover {
	color: var(--c-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.contact-form__socials {
	margin-top: 4px;
	margin-left: -7px;
}

.contact-form__placeholder {
	padding: 24px;
	margin: 0;
	font-size: var(--fs-sm);
	color: var(--c-ink-55);
	text-align: center;
	border: 1px dashed var(--c-line);
	border-radius: var(--radius-md);
}

.contact-card {
	display: grid;
	min-width: 0;
	box-shadow: var(--shadow-md);
}

.contact-card__body,
.contact-card__success {
	grid-area: 1 / 1;
	transition:
			opacity var(--dur-base) var(--ease-out),
			visibility var(--dur-base) linear,
			transform var(--dur-base) var(--ease-out);
}

.contact-card__body {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.contact-card__title {
	margin: 0;
	font-family: var(--font-heading);
	font-size: var(--fs-title-sm);
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.01em;
	text-transform: uppercase;
	color: var(--c-ink);
}

.contact-card__lead {
	margin: 10px 0 0;
	font-size: var(--fs-sm);
	line-height: var(--lh-base);
	color: var(--c-ink-70);
}

.contact-card__form {
	margin-top: clamp(20px, 2.4vw, 28px);
}

.contact-card__note {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 14px 0 0;
	font-size: 0.75rem;
	line-height: 1.35;
	color: var(--c-ink-55);
}

.contact-card__note-icon {
	flex: none;
	width: 16px;
	height: 16px;
	margin-top: 1px;
}

.contact-card__note-icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

.contact-card__note a,
.form-consent a {
	color: var(--c-ink-70);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.contact-card__note a:hover,
.form-consent a:hover {
	color: var(--c-ink);
}

.form-fields {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.form-field {
	--field-pad-x: 20px;
	--field-pad-left: var(--field-pad-x);
	--field-pad-top: 27px;
	--field-line: 22px;
	--field-icon-top: 20px;
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	min-width: 0;
	cursor: text;
}

.form-field > .wpcf7-form-control-wrap {
	display: contents;
}

.form-field__input {
	grid-area: 1 / 1;
	width: 100%;
	padding: var(--field-pad-top) var(--field-pad-x) 10px var(--field-pad-left);
	font-family: inherit;
	font-size: 0.9375rem;
	line-height: var(--field-line);
	color: var(--c-ink);
	background-color: var(--c-surface);
	border: 1px solid var(--c-line);
	border-radius: var(--radius-md);
	appearance: none;
	transition:
			border-color var(--dur-base) var(--ease-out),
			box-shadow var(--dur-base) var(--ease-out);
	outline: 0;
}

textarea.form-field__input {
	min-height: 160px;
	resize: vertical;
}

.form-field__input:hover {
	border-color: var(--c-ink-12);
}

.form-field:focus-within .form-field__input {
	border-color: var(--cf-accent, var(--c-accent));
}

.form-field__input:focus-visible {
	border-radius: var(--radius-md);
}

.form-field__input::placeholder {
	color: var(--c-ink-55);
	opacity: 0;
	transition: opacity var(--dur-base) var(--ease-out);
}

.form-field:focus-within .form-field__input::placeholder {
	opacity: 1;
}

.form-field__input:-webkit-autofill,
.form-field__input:-webkit-autofill:hover,
.form-field__input:-webkit-autofill:focus {
	-webkit-text-fill-color: var(--c-ink);
	caret-color: var(--c-ink);
	box-shadow: 0 0 0 1000px var(--c-surface) inset;
}

.form-field__label {
	grid-area: 1 / 1;
	align-self: start;
	justify-self: start;
	max-width: calc(100% - var(--field-pad-left) - var(--field-pad-x));
	margin: 20px 0 0 var(--field-pad-left);
	overflow: hidden;
	font-size: 0.9375rem;
	line-height: var(--field-line);
	color: var(--c-ink-55);
	text-overflow: ellipsis;
	white-space: nowrap;
	pointer-events: none;
	transform-origin: left top;
	transition:
			transform var(--dur-base) var(--ease-out),
			color var(--dur-base) var(--ease-out);
}

.form-field:focus-within .form-field__label,
.form-field.is-filled .form-field__label {
	transform: translateY(-12px) scale(0.8);
}

.form-field:has(.form-field__input:not(:placeholder-shown)) .form-field__label {
	transform: translateY(-12px) scale(0.78);
}

.form-field:has(.form-field__input:autofill) .form-field__label {
	transform: translateY(-17px) scale(0.78);
}

.form-field:focus-within .form-field__label {
	color: var(--cf-accent, var(--c-accent-to));
}

.form-field--user,
.form-field--mail,
.form-field--phone,
.form-field--chat {
	--field-pad-left: 54px;
}

.form-field--user::after,
.form-field--mail::after,
.form-field--phone::after,
.form-field--chat::after {
	content: "";
}

.form-field::after {
	grid-area: 1 / 1;
	align-self: start;
	justify-self: start;
	width: 22px;
	height: 22px;
	margin: var(--field-icon-top) 0 0 18px;
	background-color: var(--c-ink-55);
	-webkit-mask: var(--field-icon) center / contain no-repeat;
	mask: var(--field-icon) center / contain no-repeat;
	pointer-events: none;
	transition: background-color var(--dur-base) var(--ease-out);
}

.form-field--phone::after {
	width: 19px;
}

.form-field:focus-within::after {
	background-color: var(--cf-accent, var(--c-accent));
}

.form-field--user {
	--field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='6.6' r='3.1'/%3E%3Cpath d='M4.2 16.4a5.8 5.8 0 0 1 11.6 0'/%3E%3C/svg%3E");
}

.form-field--mail {
	--field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.8' y='4.6' width='14.4' height='10.8' rx='2'/%3E%3Cpath d='m3.4 6.4 5.7 4a1.6 1.6 0 0 0 1.8 0l5.7-4'/%3E%3C/svg%3E");
}

.form-field--phone {
	--field-icon: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iaWNvbi1saXN0X19pY29uLXN2ZyIgZm9jdXNhYmxlPSJmYWxzZSIgYXJpYS1oaWRkZW49InRydWUiPgogIDxwYXRoIGQ9Ik0yMiAxNi45MnYzYTIgMiAwIDAgMS0yLjE4IDIgMTkuNzkgMTkuNzkgMCAwIDEtOC42My0zLjA3IDE5LjUgMTkuNSAwIDAgMS02LTYgMTkuNzkgMTkuNzkgMCAwIDEtMy4wNy04LjY3QTIgMiAwIDAgMSA0LjExIDJoM2EyIDIgMCAwIDEgMiAxLjcyIDEyLjg0IDEyLjg0IDAgMCAwIC43IDIuODEgMiAyIDAgMCAxLS40NSAyLjExTDguMDkgOS45MWExNiAxNiAwIDAgMCA2IDZsMS4yNy0xLjI3YTIgMiAwIDAgMSAyLjExLS40NSAxMi44NCAxMi44NCAwIDAgMCAyLjgxLjdBMiAyIDAgMCAxIDIyIDE2LjkyeiI+PC9wYXRoPgo8L3N2Zz4=");
}

.form-field--chat {
	--field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 12.4a2 2 0 0 1-2 2H7.7L4 17.3V5.6a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------- phone: intl-tel-input --
 *
 * The library is styled entirely through its own --iti-* tokens, so the vendor file stays
 * untouched and upgradable. Everything below either feeds it theme values or repairs the
 * two things its markup changes: it wraps the input in a .iti div (which becomes the grid
 * item the input used to be), and it makes the input positioned — which would otherwise
 * paint its opaque background over the floating label.
 */

.form-field--phone {
	--iti-border-width: 1px;
	--iti-border-color: var(--c-line);
	--iti-country-selector-bg: var(--c-surface);
	--iti-hover-color: var(--c-ink-06);
	--iti-icon-color: var(--c-ink-55);
	--iti-spacer-horizontal: 14px;
	--iti-arrow-padding: 8px;
	--iti-flag-width: 22px;
	--iti-strict-reject-flash-color: rgba(217, 45, 32, 0.12);
}

/* The wrapper stands in for the input as the grid item — same cell, same full width. */
.form-field--phone .iti {
	display: block;
	grid-area: 1 / 1;
	min-width: 0;
}

/* Stacking order inside the field: input, then the label above it, then the country button,
 * then the open dropdown above everything. Without the label's own layer the positioned
 * input would cover it. */
.form-field--phone.is-iti .form-field__label {
	position: relative;
	z-index: 1;
}

.form-field--phone .iti__country-container {
	z-index: 2;
	cursor: pointer;
}

.form-field--phone .iti__country-selector {
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-md);
}

/*
 * The library measures the room left below the field and writes the result onto the panel as
 * an inline height. A max-height of our own on the list fights that measurement: the list
 * grows past the panel holding it and spills out of the bottom. Making the panel a column and
 * letting the list take whatever is left over instead means it always fits the computed
 * height — and uses all of it.
 *
 * The specificity is deliberate. The library sets z-index and the list height from rules
 * carrying three classes of its own, and the block stylesheet is not guaranteed to load after
 * the vendor one — it is lazy-loaded below the fold. Winning on specificity rather than on
 * order is what makes these stick.
 */
/*
 * :not(.iti__hide) is load-bearing. Closing the panel is the library setting display:none
 * through that class, from a rule far weaker than this one — take the guard off and the list
 * stands open permanently, and selecting a country no longer appears to close anything.
 */
.form-field--phone.is-iti .iti .iti__country-selector:not(.iti__hide) {
	display: flex;
}

.form-field--phone.is-iti .iti .iti__country-selector {
	flex-direction: column;
	z-index: 5;
}

.form-field--phone.is-iti .iti .iti__country-list {
	flex: 1 1 auto;
	min-height: 0;
	max-height: none;
}

/* The country button occupies the slot the static glyph had — two icons there would be one
 * too many. The glyph stays for as long as the library has not taken over. */
.form-field--phone.is-iti::after {
	content: none;
}

.form-field--phone .iti__selected-country {
	border-radius: var(--radius-md) 0 0 var(--radius-md);
	transition: background-color var(--dur-fast) var(--ease-out);
}

.form-field--phone .iti__selected-country-primary {
	border-radius: inherit;
}

.form-field--phone .iti__country,
.form-field--phone .iti__search-input {
	font-family: inherit;
	font-size: 0.9375rem;
	line-height: var(--lh-base);
	color: var(--c-ink);
}

/* Lenis drives the page scroll; a dropdown that scrolls the page behind it looks broken. */
.form-field--phone .iti__country-list {
	overscroll-behavior: contain;
}

.form-field--phone .iti__dial-code {
	color: var(--c-ink-55);
}

.form-field--phone .iti__search-input {
	background-color: var(--c-surface);
	border: 0;
	border-radius: var(--radius-md) var(--radius-md) 0 0;
	outline: 0;
}

.form-field--phone .iti__country.iti__highlight {
	background-color: var(--c-accent-soft);
}

.form-field__input.wpcf7-not-valid,
.form-field:focus-within .form-field__input.wpcf7-not-valid {
	border-color: var(--cf-danger);
}

.form-field .wpcf7-not-valid-tip {
	grid-area: 2 / 1;
	margin-top: 6px;
	font-size: 0.75rem;
	line-height: 1.35;
	color: var(--cf-danger);
}

.form-trap {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.form-consent .wpcf7-list-item {
	display: block;
	margin: 0;
}

.form-consent label {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
}

.form-consent .wpcf7-list-item-label {
	font-size: 0.75rem;
	line-height: 1.45;
	color: var(--c-ink-55);
}

.form-consent .wpcf7-list-item-label::before,
.form-consent .wpcf7-list-item-label::after {
	content: none;
}

.form-consent__box {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	cursor: pointer;
	background-color: var(--c-surface);
	background-position: center;
	background-size: 14px 14px;
	background-repeat: no-repeat;
	border: 1px solid var(--c-line);
	border-radius: var(--radius-sm);
	appearance: none;
	transition:
			background-color var(--dur-fast) var(--ease-out),
			border-color var(--dur-fast) var(--ease-out);
}

.form-consent__box:hover {
	border-color: var(--c-ink-12);
}

.form-consent__box:checked {
	background-color: var(--cf-accent, var(--c-accent));
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 10.4 3.3 3.3L15 6.6'/%3E%3C/svg%3E");
	border-color: transparent;
}

.form-consent .wpcf7-not-valid .form-consent__box {
	border-color: var(--cf-danger);
}

.form-consent .wpcf7-not-valid-tip {
	display: block;
	margin-top: 6px;
	font-size: 0.75rem;
	line-height: 1.35;
	color: var(--cf-danger);
}

.form-submit {
	position: relative;
	display: grid;
	margin-top: 4px;
}

.form-submit__btn {
	gap: 14px;
	min-height: 56px;
	cursor: pointer;
}

.form-submit__btn[disabled] {
	cursor: default;
	opacity: 0.6;
	box-shadow: none;
	transform: none;
}

.form-submit .wpcf7-spinner {
	position: absolute;
	top: 50%;
	right: 24px;
	margin: 0;
	transform: translateY(-50%);
}

.wpcf7-form[data-status="submitting"] .form-submit__btn {
	pointer-events: none;
	opacity: 0.85;
}

.wpcf7-form[data-status="submitting"] .form-submit__btn .btn__icon {
	opacity: 0;
}

.contact-card .wpcf7 form .wpcf7-response-output {
	padding: 12px 16px;
	margin: 16px 0 0;
	font-size: var(--fs-sm);
	line-height: 1.4;
	color: var(--cf-danger);
	border: 1px solid currentColor;
	border-radius: var(--radius-sm);
}

.contact-card .wpcf7 form[data-status="sent"] .wpcf7-response-output {
	display: none;
}

.contact-card__success {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 20px 0;
	text-align: center;
	visibility: hidden;
	opacity: 0;
	transform: translateY(12px);
	pointer-events: none;
}

.contact-card__success:focus {
	outline: none;
}

.contact-card__success-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	color: #fff;
	background-color: var(--c-accent-from);
	background-image: var(--grad-accent);
	border-radius: var(--radius-pill);
	box-shadow: var(--shadow-accent);
}

.contact-card__success-icon svg {
	display: block;
	width: 34px;
	height: 34px;
}

.contact-card__success-title {
	max-width: 26ch;
	margin: 0;
	font-family: var(--font-heading);
	font-size: var(--fs-title-sm);
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.01em;
	text-transform: uppercase;
	color: var(--c-ink);
}

.contact-card__success-text {
	max-width: 40ch;
	margin: 0;
	font-size: var(--fs-sm);
	line-height: var(--lh-base);
	color: var(--c-ink-70);
}

.contact-card.is-sent .contact-card__body {
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transform: translateY(-12px);
}

.contact-card.is-sent .contact-card__success {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	transform: none;
}

.contact-card.is-sent .contact-card__success-icon {
	animation: contact-card-pop var(--dur-slow) var(--ease-spring) both;
}

.contact-card:has(.wpcf7-form[data-status="sent"]) .contact-card__body,
.contact-card:has(.wpcf7-form[data-status="resetting"]) .contact-card__body {
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transform: translateY(-12px);
}

.contact-card:has(.wpcf7-form[data-status="sent"]) .contact-card__success,
.contact-card:has(.wpcf7-form[data-status="resetting"]) .contact-card__success {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	transform: none;
}

.contact-card:has(.wpcf7-form[data-status="sent"]) .contact-card__success-icon {
	animation: contact-card-pop var(--dur-slow) var(--ease-spring) both;
}

@keyframes contact-card-pop {
	from {
		transform: scale(0.7);
		opacity: 0;
	}

	to {
		transform: scale(1);
		opacity: 1;
	}
}

@media (min-width: 600px) {
	.form-fields {
		gap: 16px;
	}
}

@media (min-width: 1024px) {
	.contact-form__inner {
		grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
	}

	.contact-form--reverse .contact-form__aside {
		grid-column: 2;
		grid-row: 1;
	}

	.contact-form--reverse .contact-card {
		grid-column: 1;
		grid-row: 1;
	}
}
