/* Image captcha shown on the website forms. */

.vkg-captcha {
	max-width: 320px;
}

.vkg-captcha-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 8px;
}

.vkg-captcha .vkg-captcha-img {
	display: block;
	flex: none;
	width: 180px;
	height: 60px;
	max-width: calc(100% - 54px);
	border: 1px solid rgba(182, 144, 82, 0.5);
	border-radius: 4px;
	background: #f6f3ee;
	transition: opacity 0.15s ease;
}

.vkg-captcha.is-loading .vkg-captcha-img {
	opacity: 0.4;
}

.vkg-captcha .vkg-captcha-refresh {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-height: 0;
	padding: 0;
	border: 1px solid rgba(182, 144, 82, 0.6);
	border-radius: 50%;
	background: transparent;
	color: #b69052;
	box-shadow: none;
	cursor: pointer;
}

.vkg-captcha .vkg-captcha-refresh:hover,
.vkg-captcha .vkg-captcha-refresh:focus {
	background: #b69052;
	border-color: #b69052;
	color: #fff;
}

.vkg-captcha .vkg-captcha-refresh:focus-visible {
	outline: 2px solid #24734e;
	outline-offset: 2px;
}

.vkg-captcha.is-loading .vkg-captcha-refresh svg {
	animation: vkg-captcha-spin 0.8s linear infinite;
}

@keyframes vkg-captcha-spin {
	to {
		transform: rotate(360deg);
	}
}

.vkg-captcha .vkg-captcha-input {
	width: 100%;
	text-transform: uppercase;
	letter-spacing: 0.12em;
}

.vkg-captcha .vkg-captcha-input::placeholder {
	text-transform: none;
	letter-spacing: normal;
}

/* WPForms */

/* The captcha sits in the submit row: give it its own line above the button. */
.wpforms-form .wpforms-submit-container {
	flex-wrap: wrap;
}

.wpforms-form .vkg-captcha-wpforms {
	display: flex;
	flex: 0 0 100%;
	flex-direction: column;
	align-items: flex-start;
	width: 100%;
	padding: 10px 0 18px;
}

/* Contact page form: its submit row is centred. */
#wpforms-form-3014 .vkg-captcha-wpforms {
	align-items: center;
}

.wpforms-form .vkg-captcha-wpforms .wpforms-field-label {
	margin: 0 0 8px;
	font-size: 14px;
	font-weight: 400;
	color: #383838;
}

/* Same underlined inputs as the rest of the site's forms. */
.wpforms-form .vkg-captcha .vkg-captcha-input {
	max-width: 100%;
	height: auto;
	min-height: 40px;
	padding: 8px 0;
	border: 0;
	border-bottom: 1px solid #b69052;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	font-family: "PT Serif", serif;
	font-size: 16px;
	color: #2b2b27;
}

.wpforms-form .vkg-captcha .vkg-captcha-input.wpforms-error {
	border-bottom-color: #c00;
}

/* "Register Interest" popup (header Enquire button): compact layout so the
   whole form fits on screen without scrolling. The #customModal prefix is
   needed to win over the popup's own inline styles. */

#customModal .custom-modal-box {
	max-width: 640px;
	max-height: calc(100vh - 40px);
	max-height: calc(100dvh - 40px);
	padding: 0 16px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

#customModal .modal-form {
	padding: 18px 16px 16px;
}

#customModal .modal-form h3.form-title-top {
	margin: 0 0 6px;
	padding-right: 40px;
	font-size: clamp(22px, 2.2vw, 28px);
	line-height: 1.4;
}

#customModal .wpforms-container {
	margin: 0;
	padding: 0 !important;
}

#customModal .wpforms-field-container {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 24px;
}

#customModal .wpforms-field-container > .wpforms-field {
	padding: 6px 0;
}

/* Company and the opt-in line use the full width. */
#customModal #wpforms-6803-field_6-container,
#customModal .wpforms-field-container > .wpforms-field-checkbox {
	grid-column: 1 / -1;
}

#customModal .wpforms-field-container input:not([type="checkbox"]),
#customModal .wpforms-field-container input:not([type="checkbox"])::placeholder {
	font-size: 16px;
}

/* Checkbox on the same line as its text. */
#customModal .wpforms-field-container > .wpforms-field-checkbox {
	margin: 0 !important;
	padding: 8px 0 4px !important;
}

#customModal .wpforms-field-checkbox ul {
	margin: 0;
	padding: 0;
}

#customModal .wpforms-field-checkbox li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

#customModal .wpforms-field-checkbox li input[type="checkbox"] {
	flex: none;
	margin: 3px 0 0;
}

#customModal .wpforms-field-checkbox li label {
	margin: 0;
	font-size: 14px;
	line-height: 1.45;
}

#customModal .wpforms-submit-container {
	padding: 0 !important;
}

#customModal .vkg-captcha-wpforms {
	padding: 4px 0 10px;
}

#customModal .vkg-captcha-wpforms .wpforms-field-label {
	margin-bottom: 4px;
}

/* Code image and input side by side. */
#customModal .vkg-captcha {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	max-width: none;
}

#customModal .vkg-captcha .vkg-captcha-row {
	flex: none;
	margin: 0;
}

#customModal .vkg-captcha .vkg-captcha-img {
	width: 150px;
	height: 50px;
	max-width: none;
}

#customModal .vkg-captcha .vkg-captcha-input {
	flex: 1 1 0;
	width: auto;
	min-width: 0;
}

@media (max-width: 600px) {
	#customModal .custom-modal-box {
		padding: 0 8px;
	}

	#customModal .modal-form {
		padding: 16px 12px 14px;
	}

	#customModal .wpforms-field-container {
		grid-template-columns: minmax(0, 1fr);
	}

	#customModal .wpforms-field-container > .wpforms-field {
		padding: 3px 0;
	}

	#customModal .wpforms-field-container input:not([type="checkbox"]) {
		padding-top: 6px !important;
		padding-bottom: 6px !important;
	}

	#customModal .wpforms-field-checkbox li label {
		font-size: 13px;
	}

	#customModal .vkg-captcha .vkg-captcha-img {
		width: 126px;
		height: 42px;
	}

	#customModal .vkg-captcha .vkg-captcha-refresh {
		width: 40px;
		height: 40px;
	}
}

/* WordPress login and lost-password forms */

.vkg-captcha-login {
	margin: 0 0 16px;
}

.vkg-captcha-login > label {
	display: block;
	margin-bottom: 3px;
}

.login .vkg-captcha .vkg-captcha-input {
	margin: 0;
	font-size: 18px;
}

@media (prefers-reduced-motion: reduce) {
	.vkg-captcha.is-loading .vkg-captcha-refresh svg {
		animation: none;
	}
}
