/* Rank Higher Lead Popup v1.1.0 - blue-first design. Everything is prefixed .rhp- and uses
   !important only on form controls, so theme/Elementor button & input styles cannot break it. */

.rhp-root {
	--rhp-accent: #1f4fd1;   /* main blue (buttons, focus) */
	--rhp-dark: #0f2a7a;     /* deep blue (panel gradient) */
	--rhp-ink: #0f1f4d;
	--rhp-body: #4b5877;
	--rhp-muted: #7a87a8;
	--rhp-line: #d8e0f3;
	--rhp-soft: #f4f7fe;
	--rhp-error: #d63638;
	--rhp-ok: #12b76a;
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	-webkit-text-size-adjust: 100%;
}
.rhp-root[hidden] { display: none !important; }
.rhp-root *, .rhp-root *::before, .rhp-root *::after { box-sizing: border-box; font-family: inherit; }

html.rhp-lock, html.rhp-lock body { overflow: hidden !important; }

.rhp-overlay {
	position: absolute;
	inset: 0;
	background: rgba(9, 20, 66, 0.72);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	animation: rhp-fade 0.2s ease-out;
}

.rhp-dialog {
	position: relative;
	display: grid;
	grid-template-columns: minmax(280px, 0.78fr) 1.22fr;
	width: 100%;
	max-width: 960px;
	max-height: calc(100vh - 40px);
	max-height: calc(100dvh - 40px);
	overflow: hidden;
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 40px 100px -20px rgba(6, 14, 50, 0.6);
	outline: none;
	animation: rhp-pop 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}
@keyframes rhp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rhp-pop { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ================= Left: brand panel ================= */
.rhp-side {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 24px;
	padding: 36px 32px 30px;
	overflow: hidden;
	color: #fff;
	background:
		radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, 0.22), transparent 55%),
		linear-gradient(165deg, var(--rhp-accent), var(--rhp-dark));
}
.rhp-side::before,
.rhp-side::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.14);
	pointer-events: none;
}
.rhp-side::before { width: 340px; height: 340px; right: -150px; top: -130px; }
.rhp-side::after  { width: 220px; height: 220px; right: -90px;  top: -70px; }
.rhp-side-top, .rhp-chat { position: relative; z-index: 1; }

.rhp-logo { display: block; height: 36px; width: auto; max-width: 180px; margin: 0 0 30px; }
.rhp-brand { display: block; margin: 0 0 30px; font-size: 20px; font-weight: 800; color: #fff; }
.rhp-title {
	margin: 0 0 12px !important;
	font-size: 30px !important;
	line-height: 1.15 !important;
	font-weight: 800 !important;
	letter-spacing: -0.02em;
	color: #fff !important;
}
.rhp-sub { margin: 0; font-size: 15px; line-height: 1.55; color: rgba(255, 255, 255, 0.85) !important; }

.rhp-points { list-style: none !important; margin: 26px 0 0 !important; padding: 0 !important; }
.rhp-points li {
	position: relative;
	margin: 0 0 12px !important;
	padding: 0 0 0 30px !important;
	font-size: 14.5px;
	line-height: 1.4;
	color: #fff !important;
	list-style: none !important;
}
.rhp-points li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--rhp-ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.rhp-chat {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.22);
	color: #fff !important;
	text-decoration: none !important;
	transition: background 0.15s, transform 0.15s;
}
.rhp-chat:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-1px); }
.rhp-chat-ic {
	display: grid;
	place-items: center;
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #fff;
	color: #15803d;
}
.rhp-chat-ic svg { width: 22px; height: 22px; }
.rhp-chat-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.rhp-chat-tx small { font-size: 12.5px; color: rgba(255, 255, 255, 0.8); }
.rhp-chat-tx strong { font-size: 16px; font-weight: 800; color: #fff; }

/* ================= Right: form ================= */
.rhp-main {
	min-height: 0;
	padding: 34px 36px 28px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	color: var(--rhp-ink);
	background: #fff;
}

.rhp-x {
	position: absolute !important;
	top: 14px;
	right: 14px;
	z-index: 5;
	display: grid !important;
	place-items: center;
	width: 40px !important;
	height: 40px !important;
	min-height: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--rhp-soft) !important;
	color: var(--rhp-ink) !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, transform 0.15s;
}
.rhp-x:hover { background: var(--rhp-accent) !important; color: #fff !important; transform: rotate(90deg); }

.rhp-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 16px; margin: 0; padding: 0; }
.rhp-full { grid-column: 1 / -1; }

.rhp-field { margin: 0; min-width: 0; }
.rhp-field label {
	display: block !important;
	margin: 0 0 7px !important;
	padding: 0 !important;
	font-size: 13.5px !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	color: var(--rhp-ink) !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
}
.rhp-field label span { color: var(--rhp-error); }

/* controls: forced so any theme style (short heights, odd borders) cannot leak in */
.rhp-root .rhp-in {
	display: block !important;
	width: 100% !important;
	max-width: none !important;
	height: 50px !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 15px !important;
	font-size: 15px !important;
	font-weight: 500 !important;
	line-height: 1.3 !important;
	color: var(--rhp-ink) !important;
	background: #fff !important;
	border: 1.5px solid var(--rhp-line) !important;
	border-radius: 10px !important;
	box-shadow: none !important;
	outline: none !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.rhp-root textarea.rhp-in {
	height: auto !important;
	min-height: 118px !important;
	padding: 13px 15px !important;
	line-height: 1.5 !important;
	resize: vertical;
}
.rhp-root .rhp-in::placeholder { color: #93a0c0 !important; opacity: 1; font-weight: 400; }
.rhp-root .rhp-in:hover { border-color: #b7c4e6 !important; }
.rhp-root .rhp-in:focus {
	border-color: var(--rhp-accent) !important;
	box-shadow: 0 0 0 4px rgba(31, 79, 209, 0.16) !important;
}
.rhp-field.is-invalid .rhp-in { border-color: var(--rhp-error) !important; background: #fffafa !important; }
.rhp-field.is-invalid .rhp-in:focus { box-shadow: 0 0 0 4px rgba(214, 54, 56, 0.14) !important; }

.rhp-select { position: relative; }
.rhp-select::after {
	content: "";
	position: absolute;
	right: 17px;
	top: 50%;
	width: 8px;
	height: 8px;
	margin-top: -6px;
	border-right: 2px solid var(--rhp-body);
	border-bottom: 2px solid var(--rhp-body);
	transform: rotate(45deg);
	pointer-events: none;
}
.rhp-root select.rhp-in { padding-right: 42px !important; cursor: pointer; text-overflow: ellipsis; }

.rhp-err { display: none; margin: 6px 0 0 !important; font-size: 12.5px; line-height: 1.35; color: var(--rhp-error) !important; }
.rhp-field.is-invalid .rhp-err { display: block; }

.rhp-formerr {
	display: none;
	margin: 0 0 12px !important;
	padding: 11px 14px;
	font-size: 14px;
	line-height: 1.4;
	color: #8a1f21 !important;
	background: #fdecec;
	border-radius: 10px;
}
.rhp-formerr.is-visible { display: block; }

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

/* ---------- buttons ---------- */
.rhp-root .rhp-btn {
	position: relative;
	display: flex !important;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100% !important;
	height: 54px !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 22px !important;
	font-size: 16px !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	text-decoration: none !important;
	color: #fff !important;
	background: var(--rhp-accent) !important;
	border: 0 !important;
	border-radius: 10px !important;
	box-shadow: 0 10px 22px -10px rgba(31, 79, 209, 0.8) !important;
	cursor: pointer;
	transition: transform 0.12s, box-shadow 0.15s, filter 0.15s;
}
.rhp-root .rhp-btn:hover { filter: brightness(0.92); box-shadow: 0 14px 26px -10px rgba(31, 79, 209, 0.9) !important; }
.rhp-root .rhp-btn:active { transform: translateY(1px); }
.rhp-root .rhp-btn:focus-visible, .rhp-root .rhp-x:focus-visible, .rhp-chat:focus-visible { outline: 3px solid #7f9cf0 !important; outline-offset: 2px; }
.rhp-root .rhp-btn[disabled] { cursor: progress; filter: none; box-shadow: none !important; opacity: 0.92; }

.rhp-spin {
	display: none;
	width: 20px;
	height: 20px;
	border: 3px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: rhp-spin 0.7s linear infinite;
}
.rhp-btn.is-loading .rhp-spin { display: inline-block; }
@keyframes rhp-spin { to { transform: rotate(360deg); } }

.rhp-note {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 12px 0 0 !important;
	font-size: 12.5px;
	line-height: 1.4;
	text-align: center;
	color: var(--rhp-muted) !important;
}
.rhp-note svg { flex: none; }

/* ---------- success ---------- */
.rhp-done {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 380px;
	padding: 24px 4px;
	text-align: center;
	outline: none;
}
.rhp-done[hidden] { display: none !important; }
.rhp-tick {
	display: grid;
	place-items: center;
	width: 76px;
	height: 76px;
	margin: 0 0 22px;
	border-radius: 50%;
	background: var(--rhp-ok);
	color: #fff;
	box-shadow: 0 0 0 10px rgba(18, 183, 106, 0.14);
	animation: rhp-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
.rhp-done h3 { margin: 0 0 10px !important; font-size: 26px !important; line-height: 1.2 !important; font-weight: 800 !important; color: var(--rhp-ink) !important; }
.rhp-done p { margin: 0 !important; max-width: 400px; font-size: 15.5px; line-height: 1.55; color: var(--rhp-body) !important; }
.rhp-done-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 300px; margin-top: 26px; }
.rhp-root .rhp-btn-wa {
	color: #15803d !important;
	background: #fff !important;
	border: 1.5px solid #15803d !important;
	box-shadow: none !important;
}
.rhp-root .rhp-btn-wa:hover { background: #15803d !important; color: #fff !important; filter: none; box-shadow: none !important; }
.rhp-btn-wa svg { width: 20px; height: 20px; flex: none; }
.rhp-done-actions .rhp-btn { height: 50px !important; }

/* ================= Responsive ================= */

/* tablets / small laptops: tighter panel, single-column form so fields never feel cramped */
@media (max-width: 880px) {
	.rhp-dialog { grid-template-columns: minmax(240px, 0.7fr) 1.3fr; }
	.rhp-side { padding: 30px 24px 24px; }
	.rhp-title { font-size: 25px !important; }
	.rhp-main { padding: 30px 26px 24px; }
	.rhp-form { grid-template-columns: 1fr; gap: 14px; }
}

/* phones: bottom sheet with a compact blue header; button stays visible while scrolling */
@media (max-width: 720px) {
	.rhp-root { align-items: flex-end; padding: 0; }
	.rhp-dialog {
		display: flex;
		flex-direction: column;
		max-width: none;
		max-height: 94vh;
		max-height: 94dvh;
		border-radius: 20px 20px 0 0;
		animation: rhp-sheet 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
	}
	@keyframes rhp-sheet { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
	.rhp-side { flex: none; display: block; padding: 20px 66px 18px 20px; }
	.rhp-side::before { width: 220px; height: 220px; right: -90px; top: -90px; }
	.rhp-side::after { display: none; }
	.rhp-logo { height: 28px; margin: 0 0 12px; }
	.rhp-brand { margin: 0 0 10px; font-size: 17px; }
	.rhp-title { margin: 0 0 4px !important; font-size: 21px !important; }
	.rhp-sub { font-size: 13.5px; line-height: 1.45; }
	.rhp-points, .rhp-chat { display: none; }
	.rhp-main { flex: 1 1 auto; padding: 18px 20px 0; }
	.rhp-form { gap: 13px; }
	.rhp-root .rhp-in { font-size: 16px !important; height: 52px !important; } /* 16px stops iOS auto-zoom */
	.rhp-root textarea.rhp-in { min-height: 104px !important; }
	.rhp-x { top: 14px; right: 14px; background: rgba(255, 255, 255, 0.18) !important; color: #fff !important; }
	.rhp-x:hover { background: #fff !important; color: var(--rhp-accent) !important; transform: none; }
	.rhp-submit {
		position: sticky;
		bottom: 0;
		z-index: 2;
		margin: 0 -20px;
		padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
		background: linear-gradient(to top, #fff 82%, rgba(255, 255, 255, 0));
	}
	.rhp-note { margin-top: 8px !important; }
	.rhp-done { min-height: 300px; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
}

/* very small phones */
@media (max-width: 360px) {
	.rhp-side { padding: 16px 58px 14px 16px; }
	.rhp-title { font-size: 19px !important; }
	.rhp-sub { display: none; }
	.rhp-main { padding: 16px 16px 0; }
	.rhp-submit { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
}

/* short landscape screens (phones turned sideways, small laptops): keep it scrollable and compact */
@media (max-height: 640px) and (min-width: 721px) {
	.rhp-root { padding: 12px; }
	.rhp-dialog { max-height: calc(100dvh - 24px); }
	.rhp-side { padding: 22px 24px; gap: 14px; }
	.rhp-logo { height: 30px; margin-bottom: 16px; }
	.rhp-title { font-size: 23px !important; }
	.rhp-points, .rhp-chat { display: none; }
	.rhp-main { padding: 22px 26px 20px; }
	.rhp-form { gap: 12px; }
}
@media (max-height: 520px) and (max-width: 720px) {
	.rhp-sub { display: none; }
	.rhp-dialog { max-height: 100dvh; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.rhp-overlay, .rhp-dialog, .rhp-tick { animation: none !important; }
	.rhp-spin { animation-duration: 1.6s; }
	.rhp-x:hover, .rhp-chat:hover { transform: none; }
}
