/**
 * Shared contact form styling.
 *
 * Everything here applies wherever the form is rendered. Placement and chrome
 * belong to the host: dialogs/css/contact.css for the dialog, pages/css/contact.css
 * for the dedicated page.
 */

.contact-form {
	display: flex;
	flex-direction: column;
	font-family: Poppins;
	width: 100%;
}

.contact-form * {
	box-sizing: border-box;
}

.contact-form-heading {
	color: var(--edge-color);
	text-align: center;
	margin-bottom: 24px;
}

.contact-form form {
	display: flex;
	flex-direction: column;
}

.contact-form .field-row {
	display: flex;
	gap: 16px;
}

.contact-form .field {
	display: flex;
	flex-direction: column;
	flex: 1 1 0;
	min-width: 0;
}

.contact-form label {
	font-size: var(--rem-s);
	display: block;
	margin-top: 16px;
	margin-bottom: 6px;
	color: var(--edge-color);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
	font-family: Poppins;
	width: 100%;
	padding: 16px 24px;
	border: 1px solid var(--border-color, #e3ddc6);
	border-radius: 6px;
	background: #fff6fa;
	font-size: 1em;
	margin-bottom: 8px;
	color: var(--text-color);
}

.contact-form select {
	cursor: pointer;
	/* Match the height of the text inputs, which grow with their padding. */
	appearance: none;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%232B2408' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 20px center;
	background-size: 10px 6px;
	padding-right: 44px;
}

.contact-form textarea {
	min-height: 140px;
	resize: vertical;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
	outline: none;
	border-color: var(--edge-color);
}

.contact-form button {
	background: var(--edge-color);
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 12px 0;
	width: 100%;
	font-size: 1.1em;
	margin-top: 18px;
	cursor: pointer;
	transition: background 0.2s;
}

.contact-form button:hover {
	background: #b23a48;
}

.contact-form button[disabled] {
	opacity: 0.6;
	cursor: default;
}

/* The reCAPTCHA notice that stands in for the hidden badge. */
.contact-form .grecaptcha-text {
	margin-top: 12px;
	text-align: center;
	color: var(--edge-color);
}

.contact-form .contact-info {
	margin-top: 32px;
	text-align: center;
	color: var(--edge-color);
}

.contact-form .contact-info p {
	margin: 8px 0;
	/* typography.css aligns every p left; restate the centring here so the
	   .contact-info rule above actually takes effect. */
	text-align: center;
}

/* Server-side validation errors, listed above the form. */
.contact-form-validation {
	border: 1px solid #b23a48;
	border-radius: 6px;
	padding: 16px 24px;
	margin-bottom: 8px;
	color: #b23a48;
}

.contact-form-validation ul {
	margin: 0;
	padding-left: 20px;
}

/* The outcome banners replace the form once there is an outcome to show. */
.contact-form-success,
.contact-form-error {
	display: none;
	color: var(--edge-color);
	margin: auto;
	text-align: center;
	font-size: var(--rem-xl);
	padding: 32px 0;
}

.contact-form.is-success .contact-form-body,
.contact-form.is-success .contact-form-heading,
.contact-form.is-error .contact-form-body,
.contact-form.is-error .contact-form-heading {
	display: none;
}

.contact-form.is-success .contact-form-success {
	display: block;
}

.contact-form.is-error .contact-form-error {
	display: block;
}

/* A validation failure keeps the form on screen so it can be corrected;
   only a delivery failure swaps in the error banner. */
.contact-form.is-error.has-validation-errors .contact-form-body,
.contact-form.is-error.has-validation-errors .contact-form-heading {
	display: block;
}

.contact-form.is-error.has-validation-errors .contact-form-error {
	display: none;
}

@media all and (max-width: 904px) {

	.contact-form .field-row {
		flex-direction: column;
		gap: 0;
	}
}
