/* "Get in touch" popup (inc/contact.php). */
.t1-contact {
	width: min(640px, calc(100% - 32px));
	max-width: none;
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	border: 0;
	background: #fff;
	color: var(--t1-gray);
	box-shadow: 0 30px 80px rgba(6, 23, 48, 0.35);
	overflow: auto;
	overscroll-behavior: contain;
}

.t1-contact::backdrop {
	background: rgba(14, 36, 64, 0.72);
	backdrop-filter: blur(3px);
}

.t1-contact[open] {
	animation: t1-contact-in 0.45s cubic-bezier(0.2, 0.7, 0.25, 1);
}

.t1-contact[open]::backdrop {
	animation: t1-contact-fade 0.45s ease;
}

.t1-contact.is-closing {
	animation: t1-contact-out 0.25s ease forwards;
}

.t1-contact.is-closing::backdrop {
	animation: t1-contact-fade 0.25s ease reverse forwards;
}

@keyframes t1-contact-in {
	from {
		opacity: 0;
		transform: translateY(24px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes t1-contact-out {
	to {
		opacity: 0;
		transform: translateY(16px);
	}
}

@keyframes t1-contact-fade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

html.t1-contact-open {
	overflow: hidden;
}

.t1-contact__inner {
	position: relative;
	padding: 52px 48px 40px;
	background: var(--t1-gradient-quote);
}

.t1-contact__close {
	position: absolute;
	top: 16px;
	right: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid rgba(6, 53, 120, 0.25);
	border-radius: 50%;
	background: transparent;
	color: var(--t1-blue);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.t1-contact__close:hover,
.t1-contact__close:focus-visible {
	background: var(--t1-blue);
	border-color: var(--t1-blue);
	color: #fff;
}

.t1-contact__title {
	margin: 0 0 28px;
	font-family: var(--t1-font-display);
	font-size: 32px;
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.02em;
	text-align: center;
	text-transform: uppercase;
	color: var(--t1-blue);
}

.t1-contact__intro {
	max-width: 640px;
	margin: -14px auto 24px;
	font-size: 14px;
	line-height: 1.5;
	text-align: center;
	color: var(--t1-gray);
}

/* ---------- Form ---------- */
.t1-contact .wpcf7 {
	margin: 0;
}

.t1-contact .wpcf7-form {
	margin: 0;
}

.t1-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.t1-form__row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.t1-form__field {
	display: block;
	margin: 0;
}

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

.t1-form .wpcf7-form-control-wrap {
	display: block;
	position: relative;
}

.t1-form input[type="text"],
.t1-form input[type="email"],
.t1-form select,
.t1-form textarea {
	display: block;
	width: 100%;
	margin: 0;
	padding: 12px 16px;
	border: 0;
	border-bottom: 2px solid rgba(88, 95, 107, 0.45);
	border-radius: 0;
	background-color: #fff;
	box-shadow: 0 6px 18px rgba(6, 53, 120, 0.06);
	font-family: var(--t1-font-body);
	font-size: 14px;
	line-height: 1.4;
	color: var(--t1-blue);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.t1-form textarea {
	min-height: 96px;
	resize: vertical;
}

.t1-form select {
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23063578' stroke-width='1.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	cursor: pointer;
}

.t1-form select:invalid,
.t1-form select.t1-is-placeholder {
	color: rgba(88, 95, 107, 0.75);
}

.t1-form select option {
	color: var(--t1-gray);
}

.t1-form ::placeholder {
	color: rgba(88, 95, 107, 0.75);
	opacity: 1;
}

.t1-form input:focus,
.t1-form select:focus,
.t1-form textarea:focus {
	outline: none;
	border-bottom-color: var(--t1-blue);
	box-shadow: 0 8px 24px rgba(6, 53, 120, 0.12);
}

.t1-form__submit {
	position: relative;
	margin-top: 6px;
}

.t1-form input[type="submit"] {
	display: block;
	width: 100%;
	height: 46px;
	padding: 0 28px;
	border: 1px solid var(--t1-blue);
	border-radius: 64px;
	background: var(--t1-blue);
	font-family: var(--t1-font-body);
	font-size: 13px;
	line-height: 1;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #fff;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.t1-form input[type="submit"]:hover,
.t1-form input[type="submit"]:focus-visible {
	background: transparent;
	color: var(--t1-blue);
}

.t1-form input[type="submit"]:disabled {
	opacity: 0.6;
	cursor: wait;
}

.t1-form .wpcf7-spinner {
	position: absolute;
	top: 50%;
	right: 20px;
	margin: -12px 0 0;
}

/* Validation + response messages */
.t1-contact .wpcf7-not-valid-tip {
	margin-top: 4px;
	font-size: 11px;
	color: #b3261e;
}

.t1-form .wpcf7-not-valid {
	border-bottom-color: #b3261e;
}

.t1-contact .wpcf7 form .wpcf7-response-output {
	margin: 16px 0 0;
	padding: 10px 16px;
	border: 1px solid var(--t1-line);
	border-radius: 8px;
	background: #fff;
	font-size: 14px;
	text-align: center;
	color: var(--t1-gray);
}

.t1-contact .wpcf7 form.sent .wpcf7-response-output {
	border-color: var(--t1-blue);
	color: var(--t1-blue);
}

.t1-contact .wpcf7 form.invalid .wpcf7-response-output,
.t1-contact .wpcf7 form.failed .wpcf7-response-output,
.t1-contact .wpcf7 form.spam .wpcf7-response-output {
	border-color: #b3261e;
	color: #b3261e;
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
	.t1-contact {
		width: calc(100% - 20px);
		max-height: calc(100dvh - 20px);
	}

	.t1-contact__inner {
		padding: 48px 18px 22px;
	}

	.t1-contact__close {
		top: 10px;
		right: 10px;
	}

	.t1-contact__title {
		font-size: 26px;
		margin-bottom: 20px;
	}

	.t1-form,
	.t1-form__row {
		gap: 10px;
	}

	.t1-form__row {
		grid-template-columns: 1fr;
	}

	.t1-form input[type="text"],
	.t1-form input[type="email"],
	.t1-form select,
	.t1-form textarea {
		font-size: 16px; /* stops iOS zooming into fields */
	}

	.t1-form textarea {
		min-height: 88px;
	}
}
