/* Orion "New Project" popup.
 *
 * The popup's layout, typography, spacing, colours and responsive widths
 * all live in the Elementor document itself
 * (includes/admin/elementor/popups/new-project.json) so they stay
 * editable in the builder. What's left here is only the two things
 * Elementor has no control for:
 *
 *   1. the overlay's backdrop blur, and
 *   2. the Contact Form 7 fields, which are rendered by CF7 rather than
 *      by an Elementor widget.
 *
 * Breakpoints mirror index.html's Tailwind config:
 * sm=640 md=769 lg=992 xl=1199 1xl=1380 2xl=1752.
 */

/* index.html's overlay is bg-[#000000B2] backdrop-blur-sm. The colour is
   set natively in the popup's Overlay style settings; blur has no
   Elementor control. Matched on the popup that owns this form rather
   than a hardcoded post ID, which changes on every import. */
.elementor-popup-modal:has(.orion-npp__form) {
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

/* Elementor mounts .dialog-close-button as a sibling of
   .dialog-widget-content under the full-viewport modal (flex row), which
   parks the X beside the card. JS relocates it into .dialog-widget-content
   (see orion-new-project-popup.js) so this column stack matches reference
   .newsletter: close full-width above the white card, px-4 shell.

   Elementor also paints fixed px widths onto #… .dialog-message (735px even
   on mobile). Reference puts max-width on the OUTER shell and lets the card
   be width:100% inside px-4 — override both here. Match via .orion-npp__form
   because Elementor's `classes` setting is not always on an ancestor of
   .dialog-close-button. */
.elementor-popup-modal:has(.orion-npp__form) .dialog-widget-content {
	/* reference .newsletter: w-full max-w-[735px] … px-4 */
	width: 100% !important;
	max-width: 735px !important;
	margin-left: auto !important;
	margin-right: auto !important;
	background: transparent !important;
	padding: 0 16px !important;
	box-shadow: none !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	position: relative !important;
	/* reference: max-h-[calc(100vh-60px)] overflow-y-auto; sm:overflow-hidden */
	max-height: calc(100vh - 60px) !important;
	overflow-x: hidden !important;
	overflow-y: auto !important;
	box-sizing: border-box !important;
}

@media (min-width: 640px) {
	.elementor-popup-modal:has(.orion-npp__form) .dialog-widget-content {
		overflow: hidden !important;
	}
}

@media (min-width: 992px) {
	.elementor-popup-modal:has(.orion-npp__form) .dialog-widget-content {
		max-width: 770px !important;
	}
}

@media (min-width: 1199px) {
	.elementor-popup-modal:has(.orion-npp__form) .dialog-widget-content {
		max-width: 850px !important;
	}
}

@media (min-width: 1380px) {
	.elementor-popup-modal:has(.orion-npp__form) .dialog-widget-content {
		max-width: 920px !important;
	}
}

@media (min-width: 1752px) {
	.elementor-popup-modal:has(.orion-npp__form) .dialog-widget-content {
		max-width: 992px !important;
	}
}

/* Beat Elementor's #elementor-popup-modal-N .dialog-message { width:735px }. */
.elementor-popup-modal:has(.orion-npp__form) .dialog-message {
	padding: 0 !important;
	order: 2;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	height: auto !important;
	box-sizing: border-box !important;
}

/* Outside close button — reference:
   <button class="text-[#FFFFFF99] hover:text-white z-50 w-full">
     <svg class="ml-auto mr-0" width="24" height="24">…</svg>
   </button>
   Full-width bar above the card, custom X (not Elementor's eicon).
   The ~6px gap under the X comes from the reference button's inline-block
   line box; recreate it with margin-bottom. */
.elementor-popup-modal:has(.orion-npp__form) .dialog-close-button {
	position: relative;
	top: auto;
	right: auto;
	left: auto;
	bottom: auto;
	inset: auto;
	width: 100%;
	max-width: none;
	height: 24px;
	margin: 0 0 6px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	order: 1;
	align-self: stretch;
	z-index: 50;
	color: rgba(255, 255, 255, 0.6);
	background: transparent;
	box-shadow: none;
	transform: none;
	font-size: 0;
	line-height: 0;
	float: none;
}

.elementor-popup-modal:has(.orion-npp__form) .dialog-close-button:hover,
.elementor-popup-modal:has(.orion-npp__form) .dialog-close-button:focus {
	color: #ffffff;
}

/* Hide Elementor's default eicon-close glyph; JS also swaps in the
   reference SVG, but keep this as a fallback. */
.elementor-popup-modal:has(.orion-npp__form) .dialog-close-button .e-font-icon-svg,
.elementor-popup-modal:has(.orion-npp__form) .dialog-close-button i {
	display: none;
}

/* Reference X path (24×24) via ::after when the real SVG is not yet injected. */
.elementor-popup-modal:has(.orion-npp__form) .dialog-close-button:not(:has(.orion-npp__close-icon))::after {
	content: "";
	display: block;
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 10.943L5.807 4.75L4.75 5.807L10.943 12L4.75 18.193L5.807 19.25L12 13.057L18.193 19.25L19.25 18.193L13.057 12L19.25 5.807L18.193 4.75L12 10.943Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 10.943L5.807 4.75L4.75 5.807L10.943 12L4.75 18.193L5.807 19.25L12 13.057L18.193 19.25L19.25 18.193L13.057 12L19.25 5.807L18.193 4.75L12 10.943Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.elementor-popup-modal:has(.orion-npp__form) .dialog-close-button .orion-npp__close-icon {
	display: block;
	width: 24px;
	height: 24px;
	margin-left: auto;
	margin-right: 0;
	flex-shrink: 0;
}

.elementor-popup-modal:has(.orion-npp__form) .dialog-close-button .orion-npp__close-icon path {
	fill: currentColor;
	fill-opacity: 1;
}

/* White card must not spill past the px-4 shell. */
.elementor-popup-modal:has(.orion-npp__form) .elementor-element-npp-root-000001 {
	width: 100%;
	max-width: 100%;
}

/* Media column needs a positioning context for the absolute badge widget. */
.orion-npp .elementor-element-npp-media-0001 {
	position: relative;
}

/* Badge pill: reference bg-primary-900/18 + backdrop-blur-xs. */
.orion-npp .elementor-element-npp-badge-0001 .elementor-heading-title {
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

/* Offer date span — reference font-medium text-primary-900. */
.orion-npp .orion-npp__offer-text strong {
	font-weight: 500;
	color: var(--orion-primary);
}

/* --------------------------------------------------------------------
   Contact Form 7 fields
   index.html: xl:space-y-5 space-y-3 on the form, and
   "p w-full xl:px-3 px-2 2xl:py-[10px] py-2 border focus:border-primary-900"
   on each input.
   -------------------------------------------------------------------- */
.orion-npp__form .wpcf7-form p,
.orion-npp__form .wpcf7-form > div {
	margin: 0 0 12px;
}

.orion-npp__form .wpcf7-form p:last-child,
.orion-npp__form .wpcf7-form > div:last-child {
	margin-bottom: 0;
}

.orion-npp__form input.wpcf7-form-control:not([type="submit"]) {
	width: 100%;
	padding: 8px;
	border: 1px solid #000;
	border-radius: 0;
	background: #fff;
	color: #000;
	font-family: "Lexend", sans-serif;
	font-weight: 300;
	font-size: 14px;
	line-height: 23px;
}

.orion-npp__form input.wpcf7-form-control:not([type="submit"]):focus {
	border-color: var(--orion-primary);
	outline: none;
}

/* intl-tel-input — match reference phone field (shared layout in orion-intl-tel-input.css). */
.orion-npp__form .iti {
	width: 100%;
	display: block;
}

.orion-npp__form .iti input.wpcf7-form-control {
	padding-left: 70px;
}

.orion-npp__form .iti__flag-container {
	width: 100%;
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	padding: 8px;
	box-sizing: border-box;
	z-index: 2;
	pointer-events: none;
}

.orion-npp__form .iti__flag-container .iti__selected-flag {
	pointer-events: auto;
	display: flex;
	align-items: center;
	height: 100%;
	width: 55px;
	border-right: 1px solid rgba(0, 0, 0, 0.3);
	background: transparent;
}

/* The submit button already carries .btn .btn-primary (set on the CF7
   shortcode), so Tailwind supplies its type scale, padding and colours.
   Only index.html's !w-full is missing. */
.orion-npp__form input[type="submit"].wpcf7-submit {
	width: 100%;
}

.orion-npp__form .wpcf7-not-valid-tip,
.orion-npp__form .orion-field-error {
	display: block;
	margin-top: 8px;
	font-family: "Lexend", sans-serif;
	font-size: 13px;
	line-height: 150%;
	color: #dc3232;
}

.orion-npp__form .wpcf7-form-control-wrap {
	display: block;
	width: 100%;
}

.orion-npp__form .wpcf7-response-output {
	margin: 12px 0 0;
	font-family: "Lexend", sans-serif;
	font-size: 14px;
	text-align: center;
}

@media (min-width: 992px) {
	.orion-npp__form input.wpcf7-form-control:not([type="submit"]) {
		font-size: 15px;
		line-height: 25px;
	}
}

@media (min-width: 1199px) {
	.orion-npp__form .wpcf7-form p,
	.orion-npp__form .wpcf7-form > div {
		margin-bottom: 20px;
	}

	.orion-npp__form input.wpcf7-form-control:not([type="submit"]) {
		padding: 8px 12px;
		line-height: 26px;
	}
}

@media (min-width: 1380px) {
	.orion-npp__form input.wpcf7-form-control:not([type="submit"]) {
		line-height: 28px;
	}
}

@media (min-width: 1752px) {
	.orion-npp__form input.wpcf7-form-control:not([type="submit"]) {
		padding: 10px 12px;
		font-size: 18px;
		line-height: 32px;
	}
}
