/**
 * Home — Demo popup
 */

/* Demo popup */
.l1-popup[hidden] { display: none !important; }
.l1-popup {
	position: fixed;
	inset: 0;
	z-index: 1200;
	display: grid;
	place-items: center;
	padding: 1.25rem;
}
.l1-popup-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(12, 18, 34, 0.55);
	backdrop-filter: blur(4px);
}
.l1-popup-dialog {
	position: relative;
	z-index: 1;
	width: min(560px, 100%);
	max-height: min(90vh, 720px);
	overflow: auto;
	background: #fff;
	border-radius: 22px;
	padding: 1.6rem 1.5rem 1.4rem;
	box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
	border: 1px solid var(--l1-line);
}
.l1-popup-close {
	position: absolute;
	top: 0.85rem;
	right: 0.85rem;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: var(--l1-soft);
	color: var(--l1-ink);
	display: grid;
	place-items: center;
	cursor: pointer;
}
.l1-popup-close:hover { background: #e8edf5; }

/* Popup form uses the same form styling as the demo section (.l1-contact-form), without the card frame */
.l1-popup-dialog .l1-popup-form {
	height: auto;
	padding: 0;
	margin-top: 1rem;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

/* ── "Contact popup" CF7 form (form-row / form-column markup) — same look as the demo form ── */
.l1-popup-form .wpcf7 p { margin: 0; }
.l1-popup-form .form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.85rem 1rem;
	margin: 0 0 0.85rem;
}
.l1-popup-form .form-row > .form-column { min-width: 0; padding: 0; width: auto; max-width: none; }
.l1-popup-form .form-row br,
.l1-popup-form .full-width > .form-column > br { display: none; }
.l1-popup-form .full-width { margin: 0 0 0.85rem; }
@media (max-width: 575.98px) {
	.l1-popup-form .form-row { grid-template-columns: 1fr; }
}

/* Quiz: question + answer side by side */
.l1-popup-form .quiz-column label {
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	column-gap: 0.75rem;
}
.l1-popup-form .wpcf7-quiz-label {
	font-size: 0.86rem;
	font-weight: 700;
	color: var(--l1-ink);
	white-space: nowrap;
}


/* Consent checkbox */
.l1-popup-form label:has(.wpcf7-acceptance) {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	font-size: 0.74rem;
	font-weight: 400;
	line-height: 1.5;
	color: var(--l1-muted);
}
.l1-popup-form .wpcf7-acceptance .wpcf7-list-item { margin: 0; }
.l1-popup-form .wpcf7-acceptance input[type="checkbox"] {
	width: 18px;
	height: 18px;
	margin: 0.1rem 0 0;
	accent-color: var(--l1-purple, #1636b5);
	flex: none;
}

/* Submit row: neutralise Bootstrap's .btn on the wrapper div */
.l1-popup-form div.btn {
	display: block;
	width: 100%;
	padding: 0;
	margin: 0.25rem 0 0;
	border: 0;
	background: none;
	box-shadow: none;
	text-align: center;
	font: inherit;
	cursor: default;
}
.l1-popup-form div.btn .wpcf7-spinner { margin: 0.5rem auto 0; display: block; }
.l1-popup-form .wpcf7-response-output {
	margin: 0.75rem 0 0 !important;
	border-radius: 12px;
	font-size: 0.82rem;
}
.l1-popup-form .wpcf7-not-valid-tip { font-size: 0.72rem; font-weight: 500; margin-top: 0.25rem; }
.l1-popup-form label:has(.wpcf7-acceptance) > .wpcf7-form-control-wrap {
	display: inline-flex;
	width: auto;
	flex: none;
}

/* ── Small screens: compact popup so the whole form fits without a scrollbar ── */
@media (max-width: 575.98px) {
	.l1-popup { padding: 0.75rem; }
	.l1-popup-dialog {
		max-height: calc(100dvh - 1.5rem);
		padding: 1.05rem 1rem 1rem;
		border-radius: 18px;
	}
	.l1-popup-close { top: 0.6rem; right: 0.6rem; }
	.l1-popup-dialog .l1-contact-badge { display: none; }
	.l1-popup-dialog .l1-contact-heading { font-size: 1.35rem; margin: 0 2.25rem 0.2rem 0; }
	.l1-popup-dialog .l1-contact-form-lead { font-size: 0.78rem; margin: 0; line-height: 1.4; }
	.l1-popup-form { margin-top: 0.7rem; }

	/* keep two fields per row */
	.l1-popup-form .form-row { grid-template-columns: 1fr 1fr; gap: 0.55rem 0.6rem; margin-bottom: 0.55rem; }
	.l1-popup-form .full-width { margin-bottom: 0.55rem; }
	.l1-popup-form .wpcf7 label { font-size: 0.7rem; gap: 0.22rem; }
	.l1-popup-form .wpcf7 input[type="text"],
	.l1-popup-form .wpcf7 input[type="email"],
	.l1-popup-form .wpcf7 input[type="tel"],
	.l1-popup-form .wpcf7 input[type="url"] {
		height: 38px !important;
		border-radius: 10px !important;
		padding: 0 0.7rem !important;
		font-size: 16px !important; /* stops iOS zooming into the field */
	}
	.l1-popup-form .wpcf7-quiz-label { font-size: 0.8rem; }
	.l1-popup-form label:has(.wpcf7-acceptance) { font-size: 0.66rem; line-height: 1.4; gap: 0.5rem; }
	.l1-popup-form .wpcf7-acceptance input[type="checkbox"] { width: 16px; height: 16px; }
	.l1-popup-form .wpcf7-submit { padding: 0.75rem 1.25rem !important; margin-top: 0.1rem !important; }
}
@media (max-width: 575.98px) {
	/* hero-form-fields markup: keep two fields per row in the popup */
	.l1-popup-form .hero-form-fields { grid-template-columns: 1fr 1fr; gap: 0.55rem 0.6rem; }
}
/* Desktop popup: a little tighter so the longer form fits without a scrollbar on laptop screens */
@media (min-width: 576px) {
	.l1-popup-dialog { max-height: min(94vh, 760px); padding-top: 1.35rem; padding-bottom: 1.2rem; }
	.l1-popup-form { margin-top: 0.75rem; }
	.l1-popup-form .hero-form-fields { gap: 0.65rem 1rem; }
	.l1-popup-form .wpcf7 input:is([type="text"], [type="email"], [type="tel"], [type="url"]) { height: 42px !important; }
}
