/*
 * Re-skins Contact Form 7's generated markup. CF7 renders each field as
 * <label>…<span class="wpcf7-form-control-wrap"><input/></span></label> and
 * we don't control that markup (it comes from the form's tags — see
 * inc/cf7-integration.php), so the styling has to target CF7's own classes.
 *
 * Loaded on every page where CF7 is active, and written to work on BOTH
 * panel backgrounds on Where To Buy: the gradient retail panel and the dark
 * trade panel. Colours are taken from `currentColor` and translucent
 * black/white rather than fixed values wherever that's possible, so one set
 * of rules covers both.
 */

.wpcf7-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.wpcf7-form p { margin: 0; grid-column: span 2; }
.wpcf7-form p:has(input[name="your-name"]),
.wpcf7-form p:has(input[name="your-email"]),
.wpcf7-form p:has(input[name="your-suburb"]),
.wpcf7-form p:has(input[name="your-size"]),
.wpcf7-form p:has(input[name="your-phone"]),
.wpcf7-form p:has(input[name="your-company"]) {
	grid-column: span 1;
}

/* Visible caption above each input — the inputs carry placeholders but a
   placeholder is not a label. */
.wpcf7-form label {
	display: block;
	font: 600 11px/1.4 var(--hl-font-head);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: inherit;
	opacity: 0.85;
}

.wpcf7-form-control-wrap { display: block; margin-top: 7px; }

.wpcf7-form-control {
	width: 100%;
	box-sizing: border-box;
	padding: 14px 15px;
	border: 1px solid currentColor;
	border-radius: var(--hl-radius-btn);
	background: rgba(0, 0, 0, 0.14);
	color: inherit;
	/* Reset the label's typography so the visitor's own text isn't forced to
	   uppercase and letter-spaced. */
	font: 400 15px/1.4 var(--hl-font-body);
	text-transform: none;
	letter-spacing: normal;
}
.wpcf7-form-control::placeholder { color: currentColor; opacity: 0.5; }
.wpcf7-form-control:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
textarea.wpcf7-form-control { resize: vertical; min-height: 110px; }

/* The trade panel is dark, so its fields need a lighter frame than
   currentColor (which is body grey there) would give. */
.hl-wtb__panel--trade .wpcf7-form-control {
	border-color: rgba(255, 255, 255, 0.22);
	background: rgba(255, 255, 255, 0.04);
	color: var(--hl-text);
}
.hl-wtb__panel--trade .wpcf7-form-control:focus-visible {
	outline-color: var(--hl-cyan);
	border-color: var(--hl-cyan);
}

.wpcf7-form input[type="submit"] {
	grid-column: span 2;
	justify-self: start;
	margin-top: 4px;
	padding: 16px 30px;
	border: none;
	border-radius: var(--hl-radius-btn);
	background: #0a0b0d;
	color: #fff;
	font: 700 12px/1 var(--hl-font-head);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
}
.wpcf7-form input[type="submit"]:hover { background: #16181c; }
.wpcf7-form input[type="submit"]:disabled { opacity: 0.6; cursor: default; }

/* On the dark panel a near-black button disappears — use the brand gradient. */
.hl-wtb__panel--trade .wpcf7-form input[type="submit"] {
	background: var(--hl-heat);
	color: var(--hl-on-heat);
}
.hl-wtb__panel--trade .wpcf7-form input[type="submit"]:hover { filter: brightness(1.08); }

.wpcf7-not-valid-tip {
	margin-top: 5px;
	font: 400 12px/1.4 var(--hl-font-body);
	color: #ffd7d2;
}
.hl-wtb__panel--trade .wpcf7-not-valid-tip { color: #ff8a80; }

/*
 * Response message.
 *
 * CF7 5.x+ moved the status classes off the message div and onto the <form>
 * (init/sent/failed/aborted/invalid/unaccepted). The pre-5.x classes are kept
 * so styling survives a rollback, but the form-level selectors are the ones
 * that match on 6.x. The explicit `color` is not optional: CF7 ships no
 * colour of its own, so an unstyled message inherits near-black on a
 * near-black panel and reads as an empty red box.
 */
.wpcf7-response-output {
	grid-column: span 2;
	margin: 10px 0 0;
	padding: 12px 16px;
	border: 1px solid currentColor;
	border-radius: var(--hl-radius-btn);
	font: 400 14px/1.5 var(--hl-font-body);
	color: inherit;
	background: rgba(0, 0, 0, 0.12);
}

.wpcf7 form.sent .wpcf7-response-output,
.wpcf7-mail-sent-ok {
	color: #b8f5e9;
	border-color: var(--hl-cyan);
	background: rgba(23, 231, 220, 0.12);
}

.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output,
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.payment-required .wpcf7-response-output,
.wpcf7-validation-errors,
.wpcf7-mail-sent-ng {
	color: #ffd7d2;
	border-color: #ff8a80;
	background: rgba(255, 138, 128, 0.14);
}
.hl-wtb__panel--trade .wpcf7 form.sent .wpcf7-response-output { color: var(--hl-cyan); }

.wpcf7-spinner { margin: 0 0 0 12px; }

/* Honeypot (inc/cf7-integration.php). Positioned off-screen rather than
   display:none — see the note there. */
.hl-hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

@media (max-width: 700px) {
	.wpcf7-form,
	.wpcf7-form p:has(input) {
		grid-template-columns: 1fr;
		grid-column: span 2;
	}
}
