/**
 * Kwik Blocks — Form submission popup.
 *
 * First "Kwik enhancement": a progressive-enhancement modal that mirrors the
 * form's success / error / warning message (the messages set in the Form block
 * settings) into a branded pop-up after submission. Built by form-popup.js;
 * never touches the core submit/fetch logic.
 *
 * Kwikonect brand: success #78b957 / error #cc3333 / warning #e6883c, accent
 * #459bd7, text #1c1a1c. Montserrat for the title only when the site already
 * loads it (no webfont fetched — stays lightweight).
 *
 * @package Kwikonect\KwikBlocks
 */

.kwik-form-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba( 28, 26, 28, 0.55 );
	opacity: 0;
	transition: opacity 0.2s ease;
	-webkit-backdrop-filter: blur( 2px );
	backdrop-filter: blur( 2px );
}

.kwik-form-popup-overlay[hidden] {
	display: none;
}

.kwik-form-popup-overlay.is-open {
	opacity: 1;
}

body.kwik-form-popup-open {
	overflow: hidden;
}

.kwik-form-popup {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 420px;
	padding: 36px 28px 28px;
	border-top: 4px solid var( --kwik-form-popup-accent, #459bd7 );
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 20px 50px rgba( 28, 26, 28, 0.25 );
	text-align: center;
	transform: translateY( 12px ) scale( 0.96 );
	opacity: 0;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.kwik-form-popup-overlay.is-open .kwik-form-popup {
	transform: translateY( 0 ) scale( 1 );
	opacity: 1;
}

.kwik-form-popup__close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #6b6a6b;
	cursor: pointer;
	line-height: 1;
	transition: background 0.15s ease, color 0.15s ease;
}

.kwik-form-popup__close:hover,
.kwik-form-popup__close:focus-visible {
	background: rgba( 28, 26, 28, 0.08 );
	color: #1c1a1c;
	outline: none;
}

.kwik-form-popup__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin: 0 auto 16px;
	border-radius: 50%;
	color: var( --kwik-form-popup-accent, #459bd7 );
	background: var( --kwik-form-popup-accent-soft, rgba( 69, 155, 215, 0.14 ) );
}

.kwik-form-popup__title {
	margin: 0 0 8px;
	color: #1c1a1c;
	font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 1.3rem;
	font-weight: 700;
	line-height: 1.3;
}

.kwik-form-popup__message {
	margin: 0;
	color: #4a484a;
	font-size: 1rem;
	line-height: 1.55;
	word-break: break-word;
}

.kwik-form-popup__message a {
	color: var( --kwik-form-popup-accent, #459bd7 );
}

.kwik-form-popup__message p:last-child {
	margin-bottom: 0;
}

/* Status accents (Kwikonect brand palette). */
.kwik-form-popup--success {
	--kwik-form-popup-accent: #78b957;
	--kwik-form-popup-accent-soft: rgba( 120, 185, 87, 0.16 );
}

.kwik-form-popup--error {
	--kwik-form-popup-accent: #cc3333;
	--kwik-form-popup-accent-soft: rgba( 204, 51, 51, 0.12 );
}

.kwik-form-popup--warning {
	--kwik-form-popup-accent: #e6883c;
	--kwik-form-popup-accent-soft: rgba( 230, 136, 60, 0.16 );
}

@media ( max-width: 480px ) {
	.kwik-form-popup {
		max-width: none;
		padding: 32px 20px 24px;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.kwik-form-popup-overlay,
	.kwik-form-popup {
		transition: none;
	}
}
