/*
 * Side "Contact Us" popup (Easy Contact Popup plugin + Contact Form 7 form #1345).
 * Overrides the plugin's inline settings and the older .ecp-* rules in style.css.
 * Also styles validation messages on the homepage form (CF7 #1323, shown on mobile).
 * Enqueued by contact-popup.php (syrow_contact_popup_assets); behaviour lives in contact-popup.js.
 */

/* Honeypot (both forms): off-screen, not display:none (some bots skip hidden fields) */
.scp-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- Homepage form (#1323): validation feedback only ---------- */
.scp-form .wpcf7-form-control-wrap.scp-invalid .wpcf7-form-control,
.scp-form .wpcf7-form-control-wrap .wpcf7-form-control.wpcf7-not-valid {
	border: 2px solid #e5484d !important;
}
.scp-form .wpcf7-form-control-wrap.scp-valid .wpcf7-form-control { border-color: #3fb950 !important; }
.scp-form .scp-error,
.scp-form .scp-suggest {
	display: block;
	margin: 6px 0 0;
	padding: 5px 10px;
	font-size: 13px;
	line-height: 1.4;
	text-align: left;
	border-radius: 4px;
}
.scp-form .scp-error { color: #b3261e; background: #fdecea; }
.scp-form .scp-error:empty { display: none; }
.scp-form .scp-suggest { color: #333; background: #fff; }
.scp-form .scp-suggest[hidden] { display: none; }
.scp-form .scp-suggest button {
	padding: 0;
	border: 0;
	background: none;
	color: #0075b6;
	font: inherit;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}
.scp-form .scp-invalid .wpcf7-not-valid-tip { display: none; }

/* Homepage form (#1323): title (added in contact-popup.php) */
.wpcf7[data-wpcf7-id="1323"] .scp-title {
	margin: 0 0 22px;
	padding: 0 0 12px;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
	text-align: center;
	position: relative;
}
.wpcf7[data-wpcf7-id="1323"] .scp-title::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 48px;
	height: 3px;
	margin-left: -24px;
	border-radius: 3px;
	background: #e2463f;
}

/* Inline forms (#1323 homepage, #2183 service pages): prominent Submit, no Reset */
.wpcf7:is([data-wpcf7-id="1323"], [data-wpcf7-id="2183"]) .reset { display: none !important; } /* fallback; removed server-side */
.wpcf7:is([data-wpcf7-id="1323"], [data-wpcf7-id="2183"]) p.Submit1 { margin: 8px 0 0; padding: 0; }
.wpcf7:is([data-wpcf7-id="1323"], [data-wpcf7-id="2183"]) .wpcf7-submit,
.wpcf7:is([data-wpcf7-id="1323"], [data-wpcf7-id="2183"]) .wpcf7-submit:hover {
	display: block;
	width: 100% !important;
	margin: 0;
	padding: 13px 20px !important;
	font-size: 17px !important;
	font-weight: 600;
	letter-spacing: 0.3px;
	line-height: 1.3 !important;
	color: #fff !important;
	background: linear-gradient(120deg, #1f3fbf 0%, #2f80ed 100%) !important;
	border: 0 !important;
	border-radius: 6px !important;
	box-shadow: 0 8px 20px rgba(10, 30, 110, 0.35) !important;
	cursor: pointer;
	transition: filter 0.15s ease, box-shadow 0.15s ease;
}
.wpcf7:is([data-wpcf7-id="1323"], [data-wpcf7-id="2183"]) .wpcf7-submit:hover { filter: brightness(1.08); }
/* beats style.css "#Submit { width: initial !important }" */
.wpcf7:is([data-wpcf7-id="1323"], [data-wpcf7-id="2183"]) #Submit.wpcf7-submit { width: 100% !important; }
.wpcf7:is([data-wpcf7-id="1323"], [data-wpcf7-id="2183"]) .wpcf7-submit:focus-visible { outline: 3px solid rgba(47, 128, 237, 0.6); outline-offset: 2px; }
.wpcf7:is([data-wpcf7-id="1323"], [data-wpcf7-id="2183"]) .wpcf7-submit:disabled { opacity: 0.7; cursor: wait; }
.wpcf7:is([data-wpcf7-id="1323"], [data-wpcf7-id="2183"]) .wpcf7-submit::after,
.wpcf7:is([data-wpcf7-id="1323"], [data-wpcf7-id="2183"]) .wpcf7-submit::before { display: none !important; }
.wpcf7:is([data-wpcf7-id="1323"], [data-wpcf7-id="2183"]) .wpcf7-spinner { display: block; margin: 10px auto 0; }

:root {
	--scp-brand: #1f3fbf;
	--scp-brand-dark: #142c8f;
	--scp-accent: #2f80ed;
	--scp-text: #1c2434;
	--scp-muted: #6b7489;
	--scp-border: #d8deea;
	--scp-field: #f7f9fc;
	--scp-error: #d93025;
	--scp-error-bg: #fdf2f1;
	--scp-ok: #188038;
	--scp-ok-bg: #edf7ef;
}

/* ---------- Side tab ----------
 * The plugin rotates the tab 270deg around its centre, so the visible edge sits at
 * right + (width - height) / 2. Fixed 140x46 box, offset -47px = flush with the viewport edge
 * (the plugin's -64px pushed ~17px of it under the scrollbar).
 */
.ecp-button.right,
.ecp-button.left {
	width: 140px;
	min-width: 0 !important;
	max-width: none !important;
	height: 46px;
	background: linear-gradient(90deg, #e2463f 0%, #c42f2a 100%) !important;
	box-shadow: 0 -4px 14px rgba(196, 47, 42, 0.35);
	border-radius: 10px 10px 0 0 !important;
	transition: box-shadow 0.2s ease, opacity 0.2s ease;
}
.ecp-button.right { right: -47px !important; }
.ecp-button.left { left: -47px !important; border-radius: 0 0 10px 10px !important; }
.ecp-button a {
	padding: 0 12px !important;
	height: 46px;
	line-height: 46px;
	font-weight: 600;
	letter-spacing: 0.4px;
	font-size: 15px;
	white-space: nowrap;
}
.ecp-button:hover { opacity: 1 !important; box-shadow: 0 -6px 20px rgba(196, 47, 42, 0.5); }

/* ---------- Scrollbars: page + popup body (slim, on-brand) ---------- */
html { scrollbar-width: thin; scrollbar-color: #9aa6c8 #eef1f7; }
#modal .ecp-content { scrollbar-width: thin; scrollbar-color: #c3cbe0 transparent; }
/* Older Safari / Chromium without scrollbar-color */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #eef1f7; }
::-webkit-scrollbar-thumb { background: #9aa6c8; border-radius: 10px; border: 2px solid #eef1f7; }
::-webkit-scrollbar-thumb:hover { background: #1f3fbf; }
#modal .ecp-content::-webkit-scrollbar-track { background: transparent; }
#modal .ecp-content::-webkit-scrollbar-thumb { background: #c3cbe0; border-color: #fff; }

/* ---------- Overlay ---------- */
.ecp-overlay {
	background: rgba(12, 20, 46, 0.6) !important;
	z-index: 999990 !important; /* above Divi's fixed header (99999) */
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}

/* ---------- Modal shell ---------- */
#modal.ecp-modal {
	position: fixed;
	top: 50%;
	left: 50%;
	width: 92vw;
	max-width: 460px;
	min-width: 0;
	text-align: left;
	z-index: 1000000;
}
#modal .ecp-content {
	background: #fff !important;
	color: var(--scp-text) !important;
	border-radius: 16px;
	box-shadow: 0 24px 60px rgba(10, 22, 70, 0.35);
	overflow: hidden;
	max-height: 92vh;
	overflow-y: auto;
	font-family: "Open Sans", Arial, sans-serif;
	font-size: 15px;
}

/* Header */
#modal .ecp-content h3 {
	position: relative;
	margin: 0;
	padding: 20px 60px 20px 26px !important;
	text-align: left !important;
	background: linear-gradient(120deg, var(--scp-brand) 0%, var(--scp-accent) 100%) !important;
	color: #fff !important;
	font-size: 22px !important;
	font-weight: 700;
	line-height: 1.25;
}
/* Close button: replaces the plugin's close.png */
#modal .ecp-content span.ecp-close {
	top: 50% !important;
	right: 16px !important;
	margin-top: -16px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18) none !important;
	transition: background 0.2s ease, transform 0.2s ease;
}
#modal .ecp-content span.ecp-close::before,
#modal .ecp-content span.ecp-close::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 2px;
	background: #fff;
	border-radius: 2px;
}
#modal .ecp-content span.ecp-close::before { transform: translate(-50%, -50%) rotate(45deg); }
#modal .ecp-content span.ecp-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
#modal .ecp-content span.ecp-close:hover,
#modal .ecp-content span.ecp-close:focus-visible {
	background-color: rgba(255, 255, 255, 0.32) !important;
	transform: rotate(90deg);
	outline: none;
}

/* Body */
#modal .ecp-content > div {
	padding: 22px 26px 24px !important;
}
#modal .wpcf7-form p {
	margin: 0 0 12px;
	padding: 0;
}

/* ---------- Fields ---------- */
#modal .scp-label {
	display: block;
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--scp-text);
}
#modal .scp-label .scp-req { color: var(--scp-error); margin-left: 2px; }
#modal .scp-label .scp-opt { color: var(--scp-muted); font-weight: 400; }

#modal .wpcf7-form-control-wrap { display: block; position: relative; }

#modal .wpcf7-form input.wpcf7-form-control:not([type="submit"]),
#modal .wpcf7-form textarea.wpcf7-form-control {
	display: block;
	width: 100% !important;
	box-sizing: border-box;
	margin: 0;
	padding: 11px 14px 11px 42px !important;
	font-size: 15px !important;
	line-height: 1.4;
	color: var(--scp-text) !important;
	background-color: var(--scp-field) !important;
	background-repeat: no-repeat !important;
	background-position: 14px 50% !important;
	background-size: 17px 17px !important;
	border: 1.5px solid var(--scp-border) !important;
	border-radius: 10px !important;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}
#modal .wpcf7-form textarea.wpcf7-form-control {
	height: 96px !important;
	min-height: 90px;
	max-height: 260px;
	resize: vertical;
	background-position: 14px 13px !important;
}
#modal .wpcf7-form .wpcf7-form-control::placeholder { color: #9aa3b5; opacity: 1; }

#modal .wpcf7-form .wpcf7-form-control:hover { border-color: #b9c3d8 !important; }
#modal .wpcf7-form input.wpcf7-form-control:not([type="submit"]):focus,
#modal .wpcf7-form textarea.wpcf7-form-control:focus {
	outline: none;
	background-color: #fff !important;
	border-color: var(--scp-accent) !important;
	box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.15);
}

/* Field icons */
#modal .cntname1 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E"); }
#modal .cntmail1 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m22 7-10 6L2 7'/%3E%3C/svg%3E"); }
#modal .cntno1 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E"); }
#modal .cntcomt1 { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); }

/* Valid / invalid states (wrap class beats the base field rule's specificity) */
#modal .wpcf7-form .wpcf7-form-control-wrap.scp-valid .wpcf7-form-control { border-color: #9bd3a8 !important; }
#modal .wpcf7-form .wpcf7-form-control-wrap.scp-invalid .wpcf7-form-control,
#modal .wpcf7-form .wpcf7-form-control-wrap .wpcf7-form-control.wpcf7-not-valid {
	border-color: var(--scp-error) !important;
	background-color: var(--scp-error-bg) !important;
}
#modal .wpcf7-form .wpcf7-form-control-wrap.scp-invalid .wpcf7-form-control:focus,
#modal .wpcf7-form .wpcf7-form-control-wrap .wpcf7-form-control.wpcf7-not-valid:focus {
	background-color: #fff !important;
	box-shadow: 0 0 0 4px rgba(217, 48, 37, 0.14) !important;
}

/* Messages under fields (ours + CF7's server-side tip) */
#modal .scp-error,
#modal .wpcf7-not-valid-tip {
	display: block;
	margin: 6px 0 0 2px;
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--scp-error) !important;
	font-weight: 500;
}
#modal .scp-error:empty,
#modal .scp-suggest[hidden] { display: none; }
#modal .scp-error,
#modal .scp-suggest { padding: 0; background: none; border-radius: 0; }
/* When our message is visible, don't show CF7's duplicate tip */
#modal .scp-invalid .wpcf7-not-valid-tip { display: none; }

#modal .scp-hint {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin: 6px 2px 0;
	font-size: 12px;
	color: var(--scp-muted);
}
#modal .scp-hint .scp-count.scp-over { color: var(--scp-error); font-weight: 600; }
#modal .scp-suggest {
	display: block;
	margin: 6px 0 0 2px;
	font-size: 12.5px;
	color: var(--scp-muted);
}
#modal .scp-suggest button {
	padding: 0;
	border: 0;
	background: none;
	color: var(--scp-accent);
	font: inherit;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}

/* ---------- Submit ---------- */
#modal .wpcf7-form p:has(> .wpcf7-submit),
#modal .wpcf7-form .scp-actions { margin: 20px 0 0; text-align: center; }
#modal .wpcf7-form .wpcf7-submit,
#modal .wpcf7-form .wpcf7-submit:hover {
	display: block;
	width: 100%;
	margin: 0;
	padding: 13px 20px !important;
	font-size: 16px !important;
	font-weight: 600;
	letter-spacing: 0.3px;
	line-height: 1.3 !important;
	color: #fff !important;
	background: linear-gradient(120deg, var(--scp-brand) 0%, var(--scp-accent) 100%) !important;
	border: 0 !important;
	border-radius: 10px !important;
	box-shadow: 0 8px 20px rgba(31, 63, 191, 0.3) !important;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
#modal .wpcf7-form .wpcf7-submit:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 12px 26px rgba(31, 63, 191, 0.38) !important; }
#modal .wpcf7-form .wpcf7-submit:active { transform: translateY(0); }
#modal .wpcf7-form .wpcf7-submit:focus-visible { outline: 3px solid rgba(47, 128, 237, 0.45); outline-offset: 2px; }
#modal .wpcf7-form .wpcf7-submit:disabled { opacity: 0.7; cursor: wait; transform: none; }
/* Divi's arrow icon on .et_pb_button */
#modal .wpcf7-form .wpcf7-submit::after,
#modal .wpcf7-form .wpcf7-submit::before { display: none !important; }
#modal .wpcf7-form .wpcf7-spinner { display: block; margin: 10px auto 0; }

#modal .scp-privacy {
	margin: 12px 0 0;
	font-size: 12px;
	line-height: 1.5;
	color: var(--scp-muted);
	text-align: center;
}

/* ---------- Form-level response ---------- */
#modal .wpcf7 form .wpcf7-response-output {
	margin: 16px 0 0 !important;
	padding: 11px 14px !important;
	border: 0 !important;
	border-left: 4px solid !important;
	border-radius: 8px;
	font-size: 13.5px;
	line-height: 1.45;
	text-align: left;
}
#modal .wpcf7 form.invalid .wpcf7-response-output,
#modal .wpcf7 form.unaccepted .wpcf7-response-output,
#modal .wpcf7 form.payment-required .wpcf7-response-output,
#modal .wpcf7 form.failed .wpcf7-response-output,
#modal .wpcf7 form.aborted .wpcf7-response-output,
#modal .wpcf7 form.spam .wpcf7-response-output {
	color: var(--scp-error);
	background: var(--scp-error-bg);
	border-color: var(--scp-error) !important;
}
#modal .wpcf7 form.sent .wpcf7-response-output {
	color: var(--scp-ok);
	background: var(--scp-ok-bg);
	border-color: var(--scp-ok) !important;
}

/* ---------- Small screens ---------- */
@media (max-height: 640px) {
	#modal .ecp-content h3 { padding-top: 16px !important; padding-bottom: 14px !important; }
	#modal .wpcf7-form textarea.wpcf7-form-control { height: 80px !important; }
}

@media (prefers-reduced-motion: reduce) {
	#modal .ecp-content,
	#modal .wpcf7-form .wpcf7-submit,
	#modal .ecp-content span.ecp-close { transition: none !important; }
}
