/*
 * bizbank/contact-form, all variants. Values of "image" follow the production
 * form section (e.g. /cards/kartka-universalna/), "compact" is the white form
 * card without an image of the credit pages, "card" is the white rounded card
 * with the picture on the right (the factoring page). The form fields start
 * from the Contact Form 7 base of css/blocks.css; the rules below bring them
 * to the section's look. The field markup (.grid_2 > .col, .phone-mask,
 * label.acceptance) is the body of the Contact Form 7 form stored in the
 * database.
 */

.bb-contact-form--image {
	padding: 30px 0;
	background: var(--bb-white);
}

.bb-contact-form .bb-contact-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 30px;
}

.bb-contact-form .bb-contact-form__main {
	margin-bottom: 22px;
}

.bb-contact-form .bb-contact-form__media {
	display: grid;
	align-content: center;
	justify-content: end;
	margin-bottom: 22px;
	border-radius: var(--bb-radius);
	background: var(--bb-body);
	text-align: right;
}

.bb-contact-form .bb-contact-form__img {
	display: block;
	width: 436px;
	max-width: 100%;
	height: auto;
}

.bb-contact-form--compact .bb-contact-form__card {
	margin-top: 14px;
	padding: 40px 20px 42px;
	border-radius: var(--bb-radius);
	background: var(--bb-white);
}

.bb-contact-form .bb-contact-form__title {
	padding: 60px 0 0;
	color: var(--bb-black);
}

.bb-contact-form .bb-contact-form__desc {
	padding-top: 30px;
	font-size: 24px;
	font-weight: 300;
	line-height: 1.5;
	color: var(--bb-black);
}

/*
 * The form: the field look comes from css/blocks.css; this is the layout of
 * the section's form (two columns of fields, the submit button spacing).
 */
.bb-contact-form .wpcf7-form {
	margin-bottom: 60px;
}

.bb-contact-form .wpcf7-form .grid_2 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 30px;
}

.bb-contact-form .wpcf7-form .col {
	margin-bottom: 22px;
}

.bb-contact-form .wpcf7-form input[type="submit"] {
	margin: 30px 0 8px;
}

/* Editor canvas: the form stands in as a plate with its title. */
.bb-contact-form .bb-contact-form__plate {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 8px;
	min-height: 415px;
	margin: 30px 0 60px;
	padding: 30px;
	border: 1px dashed var(--bb-muted);
	border-radius: var(--bb-radius);
	background: var(--bb-body);
	font-size: 16px;
	line-height: 1.5;
	text-align: center;
}

.bb-contact-form .bb-contact-form__plate-label {
	font-size: 14px;
	color: rgba(0, 0, 0, 0.6);
}

.bb-contact-form .bb-contact-form__plate-title {
	font-size: 20px;
	font-weight: 700;
}

.bb-contact-form .bb-contact-form__plate-hint {
	font-size: 14px;
	font-weight: 300;
}

@media screen and (max-width: 991px) {

	.bb-contact-form--image {
		padding-top: 10px;
	}

	.bb-contact-form .bb-contact-form__grid {
		display: block;
	}

	.bb-contact-form .bb-contact-form__media {
		display: none;
	}

	.bb-contact-form .bb-contact-form__title {
		padding-top: 16px;
	}

	.bb-contact-form .bb-contact-form__desc {
		font-size: 20px;
	}

	.bb-contact-form .wpcf7-form {
		margin-bottom: 0;
	}

	.bb-contact-form .wpcf7-form .grid_2 {
		display: block;
	}

	.bb-contact-form .wpcf7-form .grid_2 .col {
		margin-bottom: 14px;
	}

	.bb-contact-form .wpcf7-form input[type="submit"] {
		width: 100%;
	}

	.bb-contact-form .wpcf7-form label.acceptance {
		display: grid;
		grid-template-columns: 31px auto;
		gap: 0;
		max-width: 235px;
		margin: 24px auto 0;
		line-height: 1.4;
	}

	.bb-contact-form .wpcf7-form .acceptance .wpcf7-acceptance {
		padding-top: 1px;
	}

	.bb-contact-form .bb-contact-form__plate {
		min-height: 300px;
		margin-bottom: 0;
	}
}

/*
 * Variant "card": a white card with the form on the left and the picture
 * without a panel on the right. The section owns its vertical rhythm through
 * margin-bottom (64px, 48px up to 650px) and has no padding; the card sits
 * under the anchor "consultation" and keeps 30px above it when scrolled to.
 * The selectors are heavier than the field rules of the theme and of
 * css/blocks.css, which set field height, margins and the phone padding with
 * high specificity. The legal note is the last paragraph of the form
 * (fieldset, .grid_2, p with the button and the consent, p with the note), so
 * "p ~ p" reaches only the note.
 */
.bb.bb-contact-form--card {
	margin: 0 0 64px;
	padding: 0;
	scroll-margin-top: 30px;
}

.bb-contact-form.bb-contact-form--card .bb-contact-form__duo {
	display: grid;
	grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
	gap: 32px;
	padding: 40px;
	border-radius: 22px;
	background: var(--bb-white);
}

.bb-contact-form.bb-contact-form--card .bb-contact-form__main {
	margin: 0;
}

.bb-contact-form.bb-contact-form--card .bb-contact-form__title {
	max-width: 620px;
	margin: 0 0 24px;
	padding: 0;
	font-size: 34px;
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: normal;
}

.bb-contact-form.bb-contact-form--card .bb-contact-form__desc {
	margin: 0 0 20px;
	padding: 0;
	font-size: 18px;
	font-weight: 400;
	line-height: 1.5;
}

.bb-contact-form.bb-contact-form--card .bb-contact-form__media {
	display: grid;
	grid-template-columns: minmax(0, 436px);
	align-self: center;
	align-content: center;
	justify-content: end;
	margin: 0;
	border-radius: 0;
	background: none;
}

.bb-contact-form.bb-contact-form--card .bb-contact-form__img {
	width: 100%;
	max-width: 436px;
}

.bb-contact-form.bb-contact-form--card .wpcf7-form {
	margin: 0;
	padding: 0;
}

/* Contact Form 7 adds a <br> after labels and selects; labels are blocks. */
.bb-contact-form.bb-contact-form--card .wpcf7-form br {
	display: none;
}

.bb-contact-form.bb-contact-form--card .wpcf7-form .grid_2 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.bb-contact-form.bb-contact-form--card .wpcf7-form .grid_2 .col {
	margin: 0;
}

.bb-contact-form.bb-contact-form--card .wpcf7-form label {
	display: block;
	font-size: 16px;
	line-height: 24px;
}

.bb-contact-form.bb-contact-form--card .wpcf7-form .wpcf7-form-control-wrap {
	display: block;
}

.bb-contact-form.bb-contact-form--card .wpcf7-form input.wpcf7-form-control:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="file"]),
.bb-contact-form.bb-contact-form--card .wpcf7-form select.wpcf7-form-control {
	display: block;
	height: 60px;
	min-height: 60px;
	margin: 10px 0 0;
	padding: 0 24px;
	line-height: 24px;
}

.bb-contact-form.bb-contact-form--card .wpcf7-form select:not([multiple]) {
	padding: 0 52px 0 24px;
	background-size: 20px auto;
}

/* The prefix is placed from the top of a 60px field: (60 - 24) / 2. */
.bb-contact-form.bb-contact-form--card .wpcf7-form .phone-mask::before {
	top: 18px;
	left: 24px;
}

/* The theme sets the phone padding with !important. */
.bb-contact-form.bb-contact-form--card .wpcf7-form .phone-mask .wpcf7-form-control {
	padding-left: 61px !important;
}

.bb-contact-form.bb-contact-form--card .wpcf7-form input[type="submit"] {
	display: inline-block;
	width: auto;
	height: 52px;
	margin: 28px 0 20px;
	padding: 0 28px;
	font-size: 16px;
	line-height: 24px;
}

/* The spinner stays in the line, so it never changes the row height. */
.bb-contact-form.bb-contact-form--card .wpcf7-form .wpcf7-spinner {
	position: relative;
	left: auto;
	right: auto;
	margin: 0 0 0 12px;
	vertical-align: middle;
}

.bb-contact-form.bb-contact-form--card .wpcf7-form label.acceptance {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	max-width: none;
	margin: 0;
	font-size: 16px;
	line-height: 24px;
}

.bb-contact-form.bb-contact-form--card .wpcf7-form .wpcf7-acceptance,
.bb-contact-form.bb-contact-form--card .wpcf7-form .wpcf7-list-item {
	display: block;
	padding: 0;
}

.bb-contact-form.bb-contact-form--card .wpcf7-form input[type="checkbox"] {
	margin: 0;
}

.bb-contact-form.bb-contact-form--card .wpcf7-form > p ~ p {
	margin: 20px 0;
	font-size: 14px;
	line-height: 1.6;
}

/* The theme removes the outline of links; the ring matches the checkbox's. */
.bb-contact-form.bb-contact-form--card .wpcf7-form > p ~ p a:focus-visible {
	outline: 2px solid var(--bb-blue);
	outline-offset: 2px;
}

.bb-contact-form.bb-contact-form--card .wpcf7-form .wpcf7-response-output {
	margin: 0;
}

/* Editor canvas: the plate is as tall as the real form. */
.bb-contact-form.bb-contact-form--card .bb-contact-form__plate {
	min-height: 394px;
	margin: 0;
}

@media screen and (max-width: 1000px) {

	.bb-contact-form.bb-contact-form--card .bb-contact-form__duo {
		grid-template-columns: minmax(0, 1fr);
	}

	.bb-contact-form.bb-contact-form--card .bb-contact-form__media {
		display: none;
	}
}

@media screen and (max-width: 650px) {

	.bb.bb-contact-form--card {
		margin-bottom: 48px;
	}

	.bb-contact-form.bb-contact-form--card .bb-contact-form__duo {
		padding: 26px 22px;
		border-radius: 18px;
	}

	.bb-contact-form.bb-contact-form--card .bb-contact-form__title {
		font-size: 27px;
	}

	.bb-contact-form.bb-contact-form--card .bb-contact-form__desc {
		font-size: 16px;
	}

	.bb-contact-form.bb-contact-form--card .wpcf7-form .grid_2 {
		grid-template-columns: minmax(0, 1fr);
	}
}
