/* Ascent Africa — "Submit a complaint" form. Scoped to .af-complaint so the
   other two Contact Form 7 forms on the site are untouched. */

.af-complaint {
	--af-ink: #121212;
	--af-red: #d12d33;
	--af-muted: #5c6070;
	--af-line: rgba(9, 21, 66, 0.15);
}

.af-complaint .af-formnote {
	margin: 0 0 26px;
	font-size: 15px;
	line-height: 1.55;
	color: var(--af-muted);
}

/* ---- field groups -------------------------------------------------------
   The label now belongs to the field below it, not the field above it:
   8px under the label, 28px under the group. */

.af-complaint .af-field {
	display: block;
	margin: 0 0 28px;
}

.af-complaint .af-fieldset {
	min-width: 0;
	margin: 0 0 28px;
	padding: 0;
	border: 0;
}

.af-complaint .af-label {
	display: block;
	float: none;
	width: auto;
	margin: 0 0 8px;
	padding: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--af-ink);
}

.af-complaint legend.af-label {
	width: 100%;
}

.af-complaint .af-req {
	margin-left: 2px;
	color: var(--af-red);
	font-weight: 700;
}

.af-complaint .af-section {
	font-family: oak_suns, sans-serif;
	margin: 6px 0 22px;
	padding-top: 26px;
	border-top: 1px solid var(--af-line);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--af-ink);
}

/* ---- controls ---------------------------------------------------------- */

.af-complaint .wpcf7-form-control-wrap {
	display: block;
}

.af-complaint input[type="text"],
.af-complaint input[type="email"],
.af-complaint input[type="tel"],
.af-complaint select,
.af-complaint textarea {
	display: block;
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.af-complaint textarea {
	min-height: 160px;
	resize: vertical;
}

.af-complaint select,
.af-complaint select option {
	text-transform: none;
}

.af-complaint input::placeholder,
.af-complaint textarea::placeholder {
	color: #9aa0ab;
	opacity: 1;
}

/* There was no visible focus state at all before this. */
.af-complaint input:focus,
.af-complaint select:focus,
.af-complaint textarea:focus {
	outline: none;
	border-color: var(--af-ink);
	box-shadow: 0 0 0 3px rgba(18, 18, 18, 0.12);
}

/* ---- radios ------------------------------------------------------------
   Were 13px browser defaults with a ~16px hit area; now real 44px targets. */

.af-complaint .wpcf7-radio {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.af-complaint .wpcf7-list-item {
	margin: 0;
}

.af-complaint .wpcf7-radio .wpcf7-list-item > label {
	display: flex;
	align-items: center;
	gap: 10px;
	/* the theme sets `label { padding: 0 0 5px }` at a higher specificity, which
	   left the pill text touching its own border */
	min-height: 44px !important;
	margin: 0 !important;
	padding: 10px 18px !important;
	border: 1px solid var(--af-line);
	background: #fff;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--af-ink);
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.af-complaint .wpcf7-radio .wpcf7-list-item > label:hover {
	border-color: var(--af-ink);
}

.af-complaint .wpcf7-list-item input[type="radio"] {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 0;
	padding: 0;
	appearance: none;
	-webkit-appearance: none;
	border: 1px solid #9aa0ab;
	border-radius: 50%;
	background: #fff;
	transition: border 0.12s ease;
}

.af-complaint .wpcf7-list-item input[type="radio"]:checked {
	border: 5px solid var(--af-red);
}

.af-complaint .wpcf7-list-item input[type="radio"]:focus-visible {
	outline: 2px solid var(--af-ink);
	outline-offset: 3px;
}

.af-complaint .wpcf7-radio .wpcf7-list-item > label:has(input[type="radio"]:checked) {
	border-color: var(--af-red);
	background: #fdf5f5;
}

.af-complaint .wpcf7-list-item-label {
	line-height: 1.2;
}

/* ---- conditional field + counters -------------------------------------- */

.af-complaint .af-conditional[hidden] {
	display: none;
}

.af-complaint .af-counter {
	display: block;
	margin-top: 6px;
	font-size: 13px;
	line-height: 1.2;
	color: var(--af-muted);
	text-align: right;
}

.af-complaint .af-counter.is-near {
	color: var(--af-red);
	font-weight: 600;
}

/* ---- validation + status ----------------------------------------------- */

.af-complaint .wpcf7-not-valid {
	border-color: var(--af-red);
}

.af-complaint .wpcf7-not-valid-tip {
	display: block;
	margin-top: 6px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--af-red);
}

.af-complaint .af-submit-row {
	margin-top: 6px;
}

.af-complaint input[type="submit"] {
	min-height: 52px;
	cursor: pointer;
}

.af-complaint form.submitting input[type="submit"],
.wpcf7-form.submitting .af-complaint input[type="submit"] {
	opacity: 0.65;
	cursor: progress;
}

.af-complaint .af-legal {
	margin: 14px 0 0;
	font-size: 13px;
	line-height: 1.55;
	color: var(--af-muted);
}

.af-complaint .af-legal a {
	color: var(--af-muted);
	text-decoration: underline;
}

.wpcf7[data-wpcf7-id="18253"] .wpcf7-response-output {
	margin: 26px 0 0;
	padding: 16px 18px;
	border: 1px solid var(--af-line, rgba(9, 21, 66, 0.15));
	font-size: 15px;
	line-height: 1.55;
}

.wpcf7[data-wpcf7-id="18253"] form.sent .wpcf7-response-output {
	border-color: #1f7a45;
	background: #f2fbf5;
	color: #14532d;
}

.wpcf7[data-wpcf7-id="18253"] form.invalid .wpcf7-response-output,
.wpcf7[data-wpcf7-id="18253"] form.unaccepted .wpcf7-response-output,
.wpcf7[data-wpcf7-id="18253"] form.spam .wpcf7-response-output,
.wpcf7[data-wpcf7-id="18253"] form.failed .wpcf7-response-output {
	border-color: #d12d33;
	background: #fdf3f3;
	color: #7f1d1d;
}

/* ---- small screens ----------------------------------------------------- */

@media (max-width: 767px) {
	.af-complaint .af-label {
		font-size: 15px;
	}

	.af-complaint .af-section {
		font-size: 20px;
	}

	.af-complaint .wpcf7-list-item label {
		padding: 10px 14px;
	}

	.af-complaint textarea {
		min-height: 140px;
	}
}
