/* ContactForm — Public frontend styles
   All selectors are namespaced under .contactform to avoid leaking into the theme. */

.contactform {
	--cf-color-text: #1d2327;
	--cf-color-muted: #646970;
	--cf-color-border: #d5d8dc;
	--cf-color-primary: #2271b1;
	--cf-color-primary-hover: #135e96;
	--cf-color-error: #b32d2e;
	--cf-color-error-bg: #fdeeee;
	--cf-color-success: #1a7f37;
	--cf-color-success-bg: #edfaef;
	--cf-font: inherit;

	/* Width / structure — overridden inline per the Design settings
	   (wp-admin > ContactForm > Design). Fallbacks below apply if the
	   inline style is ever stripped. */
	--cf-width: 90%;
	--cf-max-width: 1100px;
	--cf-margin: 0 auto;
	--cf-container-pad: 32px;
	--cf-field-gap: 18px;
	--cf-input-pad-v: 12px;
	--cf-input-pad-h: 14px;
	--cf-font-size: 16px;
	--cf-label-font: 15px;
	--cf-radius: 8px;
	--cf-btn-pad-v: 14px;
	--cf-btn-pad-h: 32px;

	box-sizing: border-box;
	width: var(--cf-width);
	max-width: var(--cf-max-width);
	margin: var(--cf-margin);
	font-family: var(--cf-font);
	font-size: var(--cf-font-size);
	color: var(--cf-color-text);
}

.contactform *,
.contactform *::before,
.contactform *::after {
	box-sizing: inherit;
}

.contactform__form {
	display: flex;
	flex-direction: column;
	gap: var(--cf-field-gap);
}

/* Two-column layout (Design settings > Field Layout): Name/Email side
   by side on screens wide enough to benefit from the extra form width. */
@media (min-width: 700px) {
	.contactform__form--cols-2 {
		display: grid;
		grid-template-columns: 1fr 1fr;
		column-gap: var(--cf-field-gap);
		row-gap: var(--cf-field-gap);
	}

	.contactform__form--cols-2 > .contactform__field:nth-of-type(1),
	.contactform__form--cols-2 > .contactform__field:nth-of-type(2) {
		grid-column: span 1;
	}

	.contactform__form--cols-2 > .contactform__field:nth-of-type(n+3) {
		grid-column: 1 / -1;
	}
}

.contactform__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
}

.contactform__field label {
	font-weight: 600;
	font-size: var(--cf-label-font);
}

.contactform__required {
	color: var(--cf-color-error);
}

.contactform input[type="text"],
.contactform input[type="email"],
.contactform textarea {
	width: 100%;
	padding: var(--cf-input-pad-v) var(--cf-input-pad-h);
	border: 1px solid var(--cf-color-border);
	border-radius: var(--cf-radius);
	font-size: var(--cf-font-size);
	font-family: inherit;
	color: var(--cf-color-text);
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.contactform input:focus,
.contactform textarea:focus {
	outline: none;
	border-color: var(--cf-color-primary);
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

.contactform textarea {
	resize: vertical;
	min-height: 120px;
}

.contactform__field--checkbox label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-weight: 400;
}

.contactform__field--humancheck input[type="text"] {
	max-width: 120px;
}

.contactform__honeypot {
	position: absolute !important;
	left: -9999px !important;
	top: -9999px;
	height: 0;
	width: 0;
	overflow: hidden;
}

.contactform__submit {
	background: var(--cf-color-primary);
	color: #fff;
	border: none;
	border-radius: var(--cf-radius);
	padding: var(--cf-btn-pad-v) var(--cf-btn-pad-h);
	font-size: var(--cf-font-size);
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.1s ease;
}

/* Button width & alignment — set via Design settings > Submit Button. */
.contactform__submit--align-left {
	align-self: flex-start;
}

.contactform__submit--align-center {
	align-self: center;
}

.contactform__submit--align-right {
	align-self: flex-end;
}

.contactform__submit--full {
	align-self: stretch;
	width: 100%;
	text-align: center;
}

.contactform__submit:hover {
	background: var(--cf-color-primary-hover);
}

.contactform__submit:focus-visible {
	outline: 3px solid rgba(34, 113, 177, 0.4);
	outline-offset: 2px;
}

.contactform__notice {
	padding: 14px 16px;
	border-radius: var(--cf-radius);
	margin-bottom: 16px;
	font-size: 0.95em;
}

.contactform__notice--error {
	background: var(--cf-color-error-bg);
	color: var(--cf-color-error);
	border: 1px solid rgba(179, 45, 46, 0.25);
}

.contactform__notice--error ul {
	margin: 0;
	padding-left: 18px;
}

.contactform__notice--success {
	background: var(--cf-color-success-bg);
	color: var(--cf-color-success);
	border: 1px solid rgba(26, 127, 55, 0.25);
}

@media (max-width: 480px) {
	.contactform__submit {
		width: 100%;
		text-align: center;
	}
}

/* -------------------------------------------------- */
/* Design: Modern (default)                            */
/* -------------------------------------------------- */
.contactform--modern {
	background: #ffffff;
	border: 1px solid var(--cf-color-border);
	border-radius: 12px;
	padding: var(--cf-container-pad);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
}

.contactform--modern .contactform__submit {
	border-radius: 8px;
}

/* -------------------------------------------------- */
/* Design: Minimal                                     */
/* -------------------------------------------------- */
.contactform--minimal {
	padding: 0;
}

.contactform--minimal input[type="text"],
.contactform--minimal input[type="email"],
.contactform--minimal textarea {
	border: none;
	border-bottom: 2px solid var(--cf-color-border);
	border-radius: 0;
	padding: 8px 2px;
	background: transparent;
}

.contactform--minimal input:focus,
.contactform--minimal textarea:focus {
	box-shadow: none;
	border-bottom-color: var(--cf-color-primary);
}

.contactform--minimal .contactform__submit {
	border-radius: 0;
	background: var(--cf-color-text);
}

.contactform--minimal .contactform__submit:hover {
	background: #000;
}

/* -------------------------------------------------- */
/* Design: Classic                                     */
/* -------------------------------------------------- */
.contactform--classic {
	background: #fafafa;
	border: 1px solid #ccc;
	padding: var(--cf-container-pad);
	border-radius: 2px;
}

.contactform--classic input[type="text"],
.contactform--classic input[type="email"],
.contactform--classic textarea {
	border-radius: 2px;
	border-color: #b7b7b7;
}

.contactform--classic .contactform__submit {
	border-radius: 2px;
	background: #444;
}

.contactform--classic .contactform__submit:hover {
	background: #222;
}

/* -------------------------------------------------- */
/* Design: Rounded                                     */
/* -------------------------------------------------- */
.contactform--rounded {
	background: #ffffff;
	border: 1px solid var(--cf-color-border);
	border-radius: 24px;
	padding: var(--cf-container-pad);
}

.contactform--rounded input[type="text"],
.contactform--rounded input[type="email"],
.contactform--rounded textarea {
	border-radius: 18px;
	padding: 12px 18px;
}

.contactform--rounded textarea {
	border-radius: 18px;
}

.contactform--rounded .contactform__submit {
	border-radius: 999px;
	padding: 12px 32px;
}

/* -------------------------------------------------- */
/* Design: Elegant                                     */
/* -------------------------------------------------- */
.contactform--elegant {
	background: #101418;
	color: #f5f5f5;
	border-radius: 10px;
	padding: var(--cf-container-pad);
}

.contactform--elegant .contactform__field label {
	color: #d9d9d9;
	font-weight: 500;
	letter-spacing: 0.02em;
}

.contactform--elegant input[type="text"],
.contactform--elegant input[type="email"],
.contactform--elegant textarea {
	background: #1b2026;
	border-color: #333a42;
	color: #f5f5f5;
}

.contactform--elegant input::placeholder,
.contactform--elegant textarea::placeholder {
	color: #8a8f96;
}

.contactform--elegant .contactform__submit {
	background: #d4af37;
	color: #101418;
}

.contactform--elegant .contactform__submit:hover {
	background: #c19d2c;
}

.contactform--elegant .contactform__notice--success {
	background: rgba(26, 127, 55, 0.15);
	color: #4ade80;
	border-color: rgba(74, 222, 128, 0.3);
}

.contactform--elegant .contactform__notice--error {
	background: rgba(179, 45, 46, 0.15);
	color: #f87171;
	border-color: rgba(248, 113, 113, 0.3);
}
