/* =========================================================
   Weorex Contact Form 2.0
   Matches the active theme (Avanam / Electech on weorexpacking.in):
   fonts are inherited (Lexend), colours come from the theme's
   --global-palette variables, so light/dark mode follow the site.
   Inputs, selects and textareas keep the theme's own field styling.
========================================================= */

.wcf-wrapper {
	--wcf-accent: var(--global-palette1, #146cda);
	--wcf-heading: var(--global-palette3, #333333);
	--wcf-text: var(--global-palette4, #666666);
	--wcf-muted: var(--global-palette6, #888888);
	--wcf-line: var(--global-gray-400, #e5e5e5);
	--wcf-card: var(--global-palette9, #ffffff);
	--wcf-ok: var(--color-success, #2a7a25);
	--wcf-ok-bg: var(--color-success-bg, #e6f7e6);
	--wcf-err: var(--color-alert, #da3f3f);
	--wcf-err-bg: var(--color-alert-bg, #fbe9e7);
	width: 100%;
	font-family: var(--global-body-font-family, inherit);
	color: var(--wcf-text);
	text-align: left;
}

.wcf-wrapper,
.wcf-wrapper *,
.wcf-wrapper *::before,
.wcf-wrapper *::after {
	box-sizing: border-box;
}

/* Full contact form = a card like the theme's boxed sections. */
.wcf-type-contact {
	background: var(--wcf-card);
	border: 1px solid var(--wcf-line);
	border-top: 3px solid var(--wcf-accent);
	border-radius: 5px;
	padding: 26px 26px 24px;
}

/* "Ask a question" sits inside the theme's own pop-up / page box. */
.wcf-type-question {
	background: transparent;
	/* The theme pop-up sizes itself to its content: keep the old CF7 width. */
	min-width: min(364px, calc(100vw - 72px));
}

/* ---------- Header ---------- */

.wcf-header {
	text-align: left;
	margin: 0 0 18px;
	padding: 0 0 16px;
	border-bottom: 1px solid var(--wcf-line);
}

.wcf-wrapper .wcf-title {
	margin: 0;
	font-family: inherit;
	font-size: 22px;
	line-height: 1.3;
	font-weight: 500;
	letter-spacing: 0.3px;
	color: var(--wcf-heading);
	text-transform: none;
}

.wcf-wrapper .wcf-intro {
	margin: 8px 0 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--wcf-text);
}

/* ---------- Layout ---------- */

.wcf-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.wcf-anchor {
	display: block;
	position: relative;
	top: -120px; /* clear the sticky header when jumping to the form */
	visibility: hidden;
}

.wcf-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px 16px;
}

.wcf-field {
	grid-column: 1 / -1;
	margin: 0;
	min-width: 0;
}

.wcf-field.wcf-half {
	grid-column: span 1;
}

/* Narrow places (pop-up, sidebars, phones): one column. */
.wcf-type-question .wcf-field.wcf-half {
	grid-column: 1 / -1;
}

@media (max-width: 600px) {
	.wcf-field.wcf-half {
		grid-column: 1 / -1;
	}
	.wcf-type-contact {
		padding: 20px 16px;
	}
}

.wcf-wrapper .wcf-field label {
	display: block;
	margin: 0 0 6px;
	font-size: 14px;
	line-height: 1.4;
	font-weight: 500;
	color: var(--wcf-heading);
}

.wcf-req {
	color: var(--wcf-err);
}

.wcf-opt {
	font-weight: 400;
	font-size: 12px;
	color: var(--wcf-muted);
}

/* Fields: the theme styles them; we only make them fill the column. */
.wcf-wrapper input[type="text"],
.wcf-wrapper input[type="tel"],
.wcf-wrapper input[type="email"],
.wcf-wrapper select,
.wcf-wrapper textarea {
	width: 100%;
	max-width: 100%;
	margin: 0;
}

.wcf-wrapper textarea {
	min-height: 104px;
	resize: vertical;
}

.wcf-wrapper input:focus,
.wcf-wrapper select:focus,
.wcf-wrapper textarea:focus {
	border-color: var(--wcf-accent);
	outline: none;
	box-shadow: 0 0 0 1px var(--wcf-accent);
}

.wcf-wrapper .wcf-invalid {
	border-color: var(--wcf-err) !important;
	box-shadow: 0 0 0 1px var(--wcf-err);
}

/* ---------- Terms ---------- */

.wcf-terms {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 16px 0 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--wcf-text);
	cursor: pointer;
}

.wcf-terms input[type="checkbox"] {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	accent-color: var(--wcf-accent);
}

.wcf-terms a {
	color: var(--wcf-accent);
	text-decoration: underline;
}

/* ---------- Button (theme button colours) ---------- */

.wcf-wrapper .wcf-submit {
	display: block;
	width: 100%;
	margin: 18px 0 0;
	min-height: 46px;
	padding: 10px 20px;
	border: 0;
	border-radius: 5px;
	background: var(--global-palette-btn-bg, var(--wcf-accent));
	color: var(--global-palette-btn, #ffffff);
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.2s ease, opacity 0.2s ease;
}

.wcf-wrapper .wcf-submit:hover,
.wcf-wrapper .wcf-submit:focus-visible {
	background: var(--global-palette-btn-bg-hover, var(--global-palette2, #171d27));
	color: var(--global-palette-btn-hover, #ffffff);
}

.wcf-wrapper .wcf-submit[disabled] {
	opacity: 0.7;
	cursor: wait;
}

/* ---------- Messages ---------- */

.wcf-message {
	margin: 16px 0 0;
	padding: 12px 14px;
	border-radius: 5px;
	border-left: 4px solid currentColor;
	font-size: 14px;
	line-height: 1.5;
}

.wcf-message[hidden] {
	display: none;
}

.wcf-success {
	color: var(--wcf-ok);
	background: var(--wcf-ok-bg);
}

.wcf-error {
	color: var(--wcf-err);
	background: var(--wcf-err-bg);
}

.wcf-wrapper > .wcf-message {
	margin: 0 0 16px;
}

/* ---------- Newsletter ([weorex_newsletter_form]) ---------- */

.wcf-type-newsletter {
	max-width: 500px;
	margin: 0 auto;
	background: var(--wcf-card);
	border: 1px solid var(--wcf-line);
	border-top: 3px solid var(--wcf-accent);
	border-radius: 5px;
	padding: 32px 30px 30px;
	box-shadow: 0 10px 30px rgba(20, 108, 218, 0.08);
}

.wcf-type-newsletter .wcf-header {
	text-align: center;
	border-bottom: 0;
	padding-bottom: 0;
	margin-bottom: 22px;
}

.wcf-wrapper.wcf-type-newsletter .wcf-title {
	font-size: 26px;
	color: var(--global-palette2, #171d27);
}

.wcf-type-newsletter .wcf-intro {
	max-width: 360px;
	margin-left: auto;
	margin-right: auto;
}

.wcf-type-newsletter .wcf-grid {
	gap: 14px;
}

.wcf-type-newsletter input[type="text"],
.wcf-type-newsletter input[type="email"] {
	min-height: 48px;
}

.wcf-type-newsletter .wcf-submit {
	min-height: 50px;
}

@media (max-width: 600px) {
	.wcf-type-newsletter {
		padding: 24px 18px;
	}
	.wcf-wrapper.wcf-type-newsletter .wcf-title {
		font-size: 22px;
	}
}

/* Label kept for screen readers; the field shows a placeholder. */
.wcf-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}
