/*
 * The row that pairs the form with the details panel. Columns grow in the 718:456 ratio Figma
 * draws rather than taking fixed widths, so they never outgrow a container narrower than 1248.
 * Only the inline gap is set — stacking on mobile is spaced by each block's own margin.
 */
.nordemo-contact-columns {
	display: flex;
	/* Bricks blocks default to a column; this row has to say so explicitly. */
	flex-direction: row;
	align-items: flex-start;
	column-gap: 74px;
}

.nordemo-contact-columns > .nordemo-contact-form {
	flex: none;
	width: calc((100% - 74px) * 718 / 1174);
}

.nordemo-contact-columns > .nordemo-contact-info {
	flex: none;
	width: calc((100% - 74px) * 456 / 1174);
}

@media (max-width: 991px) {
	.nordemo-contact-columns {
		flex-direction: column;
	}

	.nordemo-contact-columns > .nordemo-contact-form,
	.nordemo-contact-columns > .nordemo-contact-info {
		flex: none;
		width: 100%;
	}
}

.nordemo-contact-form {
	margin-block: 0 72px;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.nordemo-contact-form__intro {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.nordemo-contact-form__text {
	max-width: 590px;
	margin: 0;
}

/*
 * One grid serves both layouts: beside the icon on desktop, wrapping under the icon and title
 * on mobile, where the notice text spans the full width.
 */
.nordemo-contact-form__notice {
	display: grid;
	grid-template-columns: 32px 1fr;
	align-items: start;
	gap: 8px 16px;
	padding: 24px 16px;
	background: var(--nordemo-notice-surface);
	border-radius: var(--nordemo-radius);
}

.nordemo-contact-form__notice-icon {
	grid-row: 1 / span 2;
	flex: none;
	display: block;
	width: 32px;
	height: 32px;
}

.nordemo-contact-form__notice-title {
	margin: 0;
	font-weight: 600;
}

.nordemo-contact-form__notice-text {
	color: var(--nordemo-text-muted);
}

.nordemo-contact-form__notice-text p {
	margin: 0;
}

.nordemo-contact-form__notice-text a {
	font-weight: 500;
	color: var(--nordemo-text-muted);
	text-decoration: underline;
}

.nordemo-contact-form .wpcf7-form {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.nordemo-form__grid {
	display: flex;
	gap: 24px;
}

.nordemo-form__field {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.nordemo-form__label {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: 0.0938em;
	text-transform: uppercase;
	color: var(--nordemo-primary-deep);
}

/* CF7 wraps every control in an inline span, whose leading would pad the field row. */
.nordemo-contact-form .wpcf7-form-control-wrap {
	display: block;
}

.nordemo-contact-form input[type='text'],
.nordemo-contact-form input[type='tel'],
.nordemo-contact-form input[type='email'],
.nordemo-contact-form textarea {
	width: 100%;
	padding: 12px 16px;
	font-family: inherit;
	font-size: 17px;
	line-height: 1.412;
	color: inherit;
	border: 0;
	border-radius: 6px;
	/* Figma strokes sit inside the frame, so an outset border would make the field 50px, not 48. */
	box-shadow: inset 0 0 0 1px #b8b8b8;
}

.nordemo-contact-form textarea {
	height: 167px;
	resize: vertical;
}

.nordemo-contact-form ::placeholder {
	color: #b8b8b8;
	opacity: 1;
}

.nordemo-form__consent {
	max-width: 509px;
	margin: 0;
	font-size: 14px;
	font-style: italic;
	line-height: 1.571;
	color: var(--nordemo-text-caption);
}

/*
 * CF7 renders the submit as an <input>, which cannot hold the icon element the design draws.
 * The padding reproduces the designed label position and leaves the 24px icon box free; the
 * arrow is placed where that box would centre it.
 */
.nordemo-form__submit {
	/* 16px to the consent line above, against the desktop form's 24px rhythm everywhere else. */
	margin-top: -8px;
	width: 325px;
	padding-right: 48px;
	background-image: url('../icons/arrow-right-on-dark.svg');
	background-repeat: no-repeat;
	background-position: right 24.77px center;
	background-size: 6.46px 11.43px;
}

.nordemo-contact-form :focus-visible {
	outline: 2px solid var(--nordemo-primary);
	outline-offset: 2px;
}

/* Validation and response states are not drawn in Figma; these only keep the spacing sane. */
.nordemo-contact-form .wpcf7-not-valid-tip {
	margin-top: 6px;
	font-size: 14px;
	line-height: 1.571;
}

.nordemo-contact-form .wpcf7-response-output {
	margin: 0;
	padding: 12px 16px;
	font-size: 14px;
	line-height: 1.571;
	border-radius: var(--nordemo-radius);
}

@media (max-width: 991px) {
	.nordemo-contact-form {
		margin-block: 0 16px;
	}

	.nordemo-contact-form__notice {
		align-items: center;
	}

	.nordemo-contact-form__notice-icon {
		grid-row: 1;
	}

	.nordemo-contact-form__notice-text {
		grid-column: 1 / -1;
	}

	.nordemo-contact-form .wpcf7-form,
	.nordemo-form__grid {
		gap: 16px;
	}

	.nordemo-form__grid {
		flex-direction: column;
	}

	.nordemo-form__consent {
		font-size: 13px;
		line-height: 1.692;
	}

	/* The narrow form's rhythm is already 16px, so no pull-up is needed to land on 16. */
	.nordemo-form__submit {
		margin-top: 0;
		width: 100%;
	}
}
