/* Pipeline Hub Funnel Modal v0.17.2
 * Track B compatible: doesn't rely on native <dialog> top-layer promotion.
 * Explicit fixed-position centering + manually-painted backdrop + Avada-proof close button.
 */

/* Backdrop element painted manually by JS (sibling to the dialog) */
.phub-funnel-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 99998;
	display: none;
}
.phub-funnel-backdrop[data-phub-funnel-backdrop-open] {
	display: block;
}

/* Dialog itself — explicit positioning that works without top-layer */
dialog.phub-funnel-modal {
	display: none;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	max-width: 480px;
	width: 90%;
	box-shadow: 0 20px 60px rgba(0,0,0,0.35);
	z-index: 99999;
	margin: 0;
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}
dialog.phub-funnel-modal[open] {
	display: block;
}
/* Native ::backdrop kept as fallback if top-layer engages on some pages */
dialog.phub-funnel-modal::backdrop {
	background: rgba(0, 0, 0, 0.55);
}

.phub-funnel-modal-inner {
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.phub-funnel-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px;
	border-bottom: 1px solid #eee;
	background: var(--phub-color-primary, #b40101);
	color: #fff;
}
.phub-funnel-modal-header .phub-funnel-modal-title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	color: inherit;
	font-family: inherit;
}

/* Close button — fight Avada/theme button overrides with high specificity + !important */
dialog.phub-funnel-modal .phub-funnel-modal-header button.phub-funnel-modal-close {
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	color: #fff !important;
	font-size: 28px !important;
	line-height: 1 !important;
	cursor: pointer;
	opacity: 0.85;
	padding: 0 6px !important;
	box-shadow: none !important;
	min-width: 0 !important;
	width: auto !important;
	height: auto !important;
}
dialog.phub-funnel-modal .phub-funnel-modal-header button.phub-funnel-modal-close:hover {
	opacity: 1 !important;
	background: transparent !important;
}

.phub-funnel-modal-body {
	padding: 22px;
}
.phub-funnel-modal-body label {
	display: block;
	margin-bottom: 4px;
	font-size: 13px;
	font-weight: 600;
	color: #333;
}
.phub-funnel-modal-body input[type="text"],
.phub-funnel-modal-body input[type="email"],
.phub-funnel-modal-body input[type="password"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	font-size: 14px;
	box-sizing: border-box;
	margin-bottom: 14px;
	background: #fff;
	color: #333;
}
.phub-funnel-modal-body input:focus {
	outline: 0;
	border-color: var(--phub-color-primary, #b40101);
	box-shadow: 0 0 0 2px rgba(180, 1, 1, 0.15);
}
/* Submit button — also fight theme overrides */
dialog.phub-funnel-modal .phub-funnel-modal-body button[type="submit"] {
	width: 100% !important;
	padding: 11px 16px !important;
	background: var(--phub-color-primary, #b40101) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 4px !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	cursor: pointer;
	margin: 0;
}
dialog.phub-funnel-modal .phub-funnel-modal-body button[type="submit"]:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}
dialog.phub-funnel-modal .phub-funnel-modal-body button[type="submit"]:hover:not(:disabled) {
	filter: brightness(1.1);
}
.phub-funnel-modal-body .phub-funnel-remember {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #555;
	margin-bottom: 14px;
}
.phub-funnel-modal-body .phub-funnel-remember input { margin: 0; }
.phub-funnel-modal-body .phub-funnel-secondary-actions {
	margin-top: 14px;
	display: flex;
	justify-content: space-between;
	font-size: 13px;
}
.phub-funnel-modal-body .phub-funnel-secondary-actions a {
	color: var(--phub-color-primary, #b40101);
	text-decoration: none;
}
.phub-funnel-modal-body .phub-funnel-secondary-actions a:hover { text-decoration: underline; }

.phub-funnel-modal-status {
	padding: 10px 22px;
	font-size: 13px;
	min-height: 14px;
	background: #fff;
	color: #555;
}
.phub-funnel-modal-status.phub-status-pending { background: #f5f5f5; color: #555; }
.phub-funnel-modal-status.phub-status-success { background: #e8f5e9; color: #2e7d32; }
.phub-funnel-modal-status.phub-status-error   { background: #fcebeb; color: #8a1a1a; }

/* Body scroll-lock while modal open (added by JS) */
body.phub-funnel-modal-open { overflow: hidden; }

/* v0.17.7: hCaptcha widget container inside modal */
.phub-funnel-modal .phub-funnel-captcha-wrap {
	margin: 12px 0 4px;
	display: flex;
	justify-content: center;
}
.phub-funnel-modal .phub-funnel-captcha-wrap .h-captcha {
	display: inline-block;
}

/* v0.17.7.2 (asset 0-17-8): hCaptcha now invisible — challenge renders as centered overlay, no in-modal widget styling needed. */

/* v0.18.0 → v0.20.5: legacy per-view-id enumeration removed; superseded by class-based .phub-view-active rule (see end of file). Kept comment for changelog trail. */

/* Per-view intro paragraph above forms (lost-password / claim / recovery) */
.phub-funnel-view-intro {
	margin: 0 0 12px 0;
	font-size: 14px;
	line-height: 1.5;
	color: #444;
}

/* Footer links (rotated per active view) */
.phub-funnel-view-footer {
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid #eee;
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	font-size: 13px;
}
.phub-funnel-view-footer a {
	color: var(--phub-color-primary, #b40101);
	text-decoration: none;
	cursor: pointer;
}
.phub-funnel-view-footer a:hover {
	text-decoration: underline;
}
/* v0.18.1 (asset 0-18-1): register / claim-account / forgot-username views layered on view-state engine */

/* v0.19.0 (asset 0-19-0): purchase modal + backend admin */

/* v0.19.0: purchase modal layout — payment view needs more room for the iframe */
dialog.phub-funnel-modal[data-phub-funnel-modal-id="purchase"][data-phub-view-active="payment"] .phub-funnel-modal-inner {
	max-width: 720px;
}
.phub-funnel-payment-frame-wrap {
	background: #fafafa;
	border-radius: 4px;
	overflow: hidden;
}
.phub-purchase-product-details {
	padding: 10px 0;
	font-size: 14px;
	line-height: 1.6;
}

/* v0.20.5 — class-based view activation with !important to win specificity ties
   against any future legacy/competing rules. Class set server-side on the default
   view (PHP) and toggled client-side by the funnel-modal engine (JS). */
/* Default: hide ALL views inside a funnel modal */
dialog.phub-funnel-modal section.phub-funnel-view {
	display: none !important;
}
/* Show only the section that has .phub-view-active class */
dialog.phub-funnel-modal section.phub-funnel-view.phub-view-active {
	display: block !important;
}
