/*
 * NGL v2 — the "talk to an expert" dialog (not drawn): the consultation form (Formidable) in a white
 * card, opened by the buttons that name it (data-nglv2-dialog, js/ngl-v2.js). A lab's page, the Labs
 * and inspection pages, and the homepage's closing call to action (since 2026-10-02) have one. Moved
 * out of inner.css then, so the homepage loads only this part.
 */

.nglv2 .nglv2-dialog {
	width: min(480px, 100% - 32px);
	max-width: none;
	max-height: calc(100% - 32px);
	margin: auto;
	padding: 0;
	overflow: visible;
	border: 0;
	background: transparent;
	color: var(--nglv2-ink);
}

.nglv2-dialog::backdrop {
	background: rgba(25, 36, 49, 0.62);
}

.nglv2-dialog[open] {
	animation: nglv2-dialog-in 0.35s var(--nglv2-ease-out);
}

@keyframes nglv2-dialog-in {
	from {
		opacity: 0;
		transform: translate3d(0, 16px, 0) scale(0.98);
	}
}

.nglv2-dialog__box {
	position: relative;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 32px;
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 24px 60px rgba(8, 37, 31, 0.18);
}

.nglv2 .nglv2-dialog__close {
	position: absolute;
	inset-block-start: 16px;
	inset-inline-end: 16px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--nglv2-bg);
	box-shadow: none;
	color: var(--nglv2-ink);
	cursor: pointer;
	transition: background-color 0.25s;
}

.nglv2 .nglv2-dialog__close:hover {
	background: var(--nglv2-soft-green, #e2f5ec); /* set on the inner pages (inner.css), not on the homepage */
}

.nglv2 .nglv2-dialog__close:focus-visible {
	outline: 2px solid var(--nglv2-green);
	outline-offset: 2px;
}

.nglv2 .nglv2-dialog__close .nglv2-icon {
	width: 20px;
	height: 20px;
}

.nglv2 .nglv2-dialog__title {
	padding-inline-end: 44px;
	font-weight: 700;
	font-size: 20px;
	line-height: 1.6;
	color: var(--nglv2-ink);
}

.nglv2 .nglv2-dialog__text {
	margin-top: 8px;
	font-size: 15px;
	line-height: 1.8;
	color: var(--nglv2-grey);
}

.nglv2-dialog__form {
	margin-top: 20px;
}

.nglv2 .nglv2-dialog__form .frm_forms {
	max-width: none;
}

.nglv2 .nglv2-dialog__form :is(input[type="text"], input[type="tel"], input[type="email"], textarea) {
	border-radius: 10px;
	font-family: var(--nglv2-font);
}

/* `.frm_forms` in these selectors outranks Formidable's own style (`.frm_style_rtl.with_frm_style
 * .frm_submit button`: blue, 4px corners), and its fieldset padding and field margins, which left
 * 45px of empty box under the button. */
.nglv2 .nglv2-dialog__form .frm_forms fieldset {
	padding-bottom: 0;
}

.nglv2 .nglv2-dialog__form .frm_forms .frm_submit {
	margin-bottom: 0;
}

.nglv2 .nglv2-dialog__form .frm_forms .frm_button_submit {
	min-width: 140px;
	height: auto;
	min-height: 48px;
	margin: 0;
	padding: 0 28px;
	border: 0;
	border-radius: 12px;
	background: var(--nglv2-green);
	box-shadow: none;
	color: #fff;
	font-family: var(--nglv2-font);
	font-weight: 600;
	font-size: 15px;
	line-height: 48px;
}

.nglv2 .nglv2-dialog__form .frm_forms .frm_button_submit:is(:hover, :focus, :active) {
	background: var(--nglv2-green-dark);
	color: #fff;
}

.nglv2 .nglv2-dialog__form .frm_forms .frm_button_submit:focus-visible {
	outline: 2px solid var(--nglv2-green);
	outline-offset: 3px;
}

html.nglv2-dialog-open {
	overflow: hidden;
}

@media (max-width: 639px) {
	.nglv2 .nglv2-dialog__box {
		padding: 24px 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nglv2-dialog[open] {
		animation: none;
	}
}
