/*
 * Groene Moslims Contactformulieren: the public form.
 *
 * The fields themselves (floating labels, icons, focus, errors, the button) get the
 * theme's form design (forms.css / forms.js of the Divi-Child theme), exactly as the
 * other forms on the site. This file only adds what the theme has per plugin: the
 * field grid, the "Naam" group label, help texts, the notice above the form, the
 * thank-you screen and the unsubscribe page. Values follow the theme's (forms.css).
 * ".gmf:not(#_)" has the theme's own weight, so these rules win from its blank slate.
 */

.gmf:not(#_) .gmf-card .gmcf {
	display: block;
	margin: 0;
	padding: 0;
	font-family: var(--gm-font-body, 'Work Sans', system-ui, sans-serif);
	color: var(--gmf-ink, #19332d);
	text-align: left;
}

.gmf:not(#_) .gmf-card .gmcf [hidden],
.gmf:not(#_) .gmf-card .gmcf .gmcf-hp {
	display: none !important;
}

/* Field grid: two columns on a computer, one on a phone -------------------------------- */
.gmf:not(#_) .gmf-card .gmcf .gmcf-grid {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px 16px !important;
	margin: 0 !important;
	padding: 0 !important;
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-full {
	grid-column: 1 / -1;
	margin: 0 !important;
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-half {
	grid-column: span 1;
	margin: 0 !important;
}

/* Naam with its two parts (as the Gravity "Naam" field today) */
.gmf:not(#_) .gmf-card .gmcf .gmcf-group {
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-legend {
	display: block;
	float: none;
	width: auto;
	margin: 0 0 10px !important;
	padding: 0 !important;
	font-family: var(--gm-font-body, 'Work Sans', system-ui, sans-serif);
	font-size: 0.8125rem !important;
	font-weight: 700 !important;
	letter-spacing: 0.08em !important;
	line-height: 1.4;
	text-transform: uppercase !important;
	color: var(--gmf-accent, #2e5c50) !important;
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-pair {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px 16px;
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-req {
	display: inline !important;
	margin-left: 6px !important; /* as Gravity's two nested asterisk spans (3px each in the theme) */
	font-weight: 700 !important;
	color: var(--gmf-danger, #b42318) !important;
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-help {
	margin: 6px 0 0 !important;
	padding: 0 !important;
	font-size: 0.875rem !important;
	line-height: 1.5 !important;
	color: var(--gmf-muted, #4d5f58) !important;
}

/* Tick boxes (a ja/nee field and the consent): the theme's toggle in a sand row */
.gmf:not(#_) .gmf-card .gmcf .gmcf-checklabel {
	display: flex !important;
	align-items: center;
	margin: 0 !important;
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-consent {
	margin: 18px 0 0 !important;
}

/* The button: the same gap above it as between the fields */
.gmf:not(#_) .gmf-card .gmcf .gmcf-actions {
	margin: 18px 0 0 !important;
	padding: 0 !important;
}

/* Notice above the form (errors and information) ------------------------------------------- */
@keyframes gmcf-in {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: none; }
}

.gmf:not(#_) .gmf-card .gmcf :is(.gmcf-notice, .gmcf-closed, .gmcf-noscript) {
	position: relative;
	display: block;
	margin: 0 0 22px !important;
	padding: 16px 20px 16px 56px !important;
	border-radius: var(--gmf-r, 18px);
	background: var(--gm-green-50, #ebf5f2);
	box-shadow: inset 4px 0 0 var(--gmf-brand, #61c3aa);
	font-size: 1rem !important;
	font-weight: 600 !important;
	line-height: 1.5 !important;
	color: var(--gmf-ink, #19332d) !important;
	animation: gmcf-in 0.35s var(--gmf-ease, ease);
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-notice--error {
	background: var(--gmf-danger-bg, #fef3f2);
	box-shadow: inset 4px 0 0 var(--gmf-danger, #b42318);
	color: var(--gmf-danger-ink, #7a1a12) !important;
}

.gmf:not(#_) .gmf-card .gmcf :is(.gmcf-notice, .gmcf-closed, .gmcf-noscript)::before {
	content: "";
	position: absolute;
	top: 17px;
	left: 20px;
	width: 22px;
	height: 22px;
	background: currentColor;
	-webkit-mask: var(--gmf-i-alert) center / contain no-repeat;
	mask: var(--gmf-i-alert) center / contain no-repeat;
}

/* Thank-you screen: the theme's confirmation (check tile, title, text) -------------------- */
@keyframes gmcf-pop {
	0% { opacity: 0; transform: scale(0.6) rotate(-12deg); }
	60% { opacity: 1; transform: scale(1.08) rotate(3deg); }
	100% { transform: scale(1) rotate(0); }
}

@keyframes gmcf-rise {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: none; }
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-done:not([hidden]) {
	position: relative;
	display: flex !important;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 360px;
	margin: 0 !important;
	padding: 128px clamp(8px, 6%, 40px) 12px !important;
	text-align: center;
	text-wrap: balance;
	outline: none;
	animation: gmcf-rise 0.5s var(--gmf-ease, ease);
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-done__icon {
	position: absolute;
	top: 12px;
	left: 50%;
	width: 96px;
	height: 96px;
	margin-left: -48px;
	border-radius: 32px 32px 32px 12px;
	background: var(--gmf-brand, #61c3aa);
	box-shadow: 0 0 0 12px rgba(97, 195, 170, 0.18), 0 24px 40px -20px rgba(25, 51, 45, 0.6);
	animation: gmcf-pop 0.7s var(--gmf-ease, ease) both;
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-done__icon::after {
	content: "";
	position: absolute;
	top: 28px;
	left: 28px;
	width: 40px;
	height: 40px;
	background: var(--gmf-ink, #19332d);
	-webkit-mask: var(--gmf-i-check) center / contain no-repeat;
	mask: var(--gmf-i-check) center / contain no-repeat;
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-done__title {
	margin: 0 0 10px !important;
	padding: 0 !important;
	font-family: var(--gm-font-heading, 'Baloo Da 2', sans-serif) !important;
	font-size: clamp(2rem, 1.6rem + 1.4vw, 2.75rem) !important;
	font-weight: 700 !important;
	line-height: 1.1 !important;
	color: var(--gmf-ink, #19332d) !important;
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-done__text {
	max-width: 460px;
	margin: 0 auto !important;
	padding: 0 !important;
	font-size: 1.125rem !important;
	font-weight: 500 !important;
	line-height: 1.6 !important;
	color: var(--gmf-ink, #19332d) !important;
	white-space: pre-line;
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-done__small {
	margin-top: 14px !important;
	font-size: 1rem !important;
	color: var(--gmf-muted, #4d5f58) !important;
}

/* A link that does not work: the same screen in the error colours */
.gmf:not(#_) .gmf-card .gmcf .gmcf-done--bad .gmcf-done__icon {
	background: var(--gmf-danger-bg, #fef3f2);
	box-shadow: 0 0 0 12px rgba(180, 35, 24, 0.1), 0 24px 40px -20px rgba(122, 26, 18, 0.45);
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-done--bad .gmcf-done__icon::after {
	background: var(--gmf-danger, #b42318);
	-webkit-mask-image: var(--gmf-i-alert);
	mask-image: var(--gmf-i-alert);
}

/* Unsubscribe page: one card, no panel ------------------------------------------------- */
.gmf.gmcf-unsub-wrap {
	grid-template-columns: minmax(0, 1fr);
	max-width: 760px !important;
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-unsub-ask {
	margin: 0 0 4px !important;
	font-family: var(--gm-font-heading, 'Baloo Da 2', sans-serif);
	font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem) !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	color: var(--gmf-ink, #19332d) !important;
}

/* A card without a photo (a form placed with only the shortcode) */
.gmf.gmcf-wrap:not(.gmf--photo) .gmf-panel {
	min-height: 0;
}

/* "Uitschrijven?" under a list's button, and the small form it opens ------------------------- */
.gmf:not(#_) .gmf-card .gmcf .gmcf-switch {
	margin: 14px 0 0 !important;
	text-align: center;
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-switch[hidden] {
	display: none !important;
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-switch__btn {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	margin: 0;
	padding: 6px 12px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	box-shadow: none;
	font: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--gmf-ink-soft, #3e5a52);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-switch__btn:hover {
	color: var(--gmf-ink, #19332d);
	background: rgba(97, 195, 170, 0.12);
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-switch__btn:focus-visible {
	outline: 3px solid #397465;
	outline-offset: 2px;
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-unsubreq__title {
	margin: 0 0 6px !important;
	font-family: var(--gm-font-heading, 'Baloo Da 2', sans-serif);
	font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.75rem) !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	color: var(--gmf-ink, #19332d) !important;
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-unsubreq__title:focus {
	outline: none;
}

.gmf:not(#_) .gmf-card .gmcf .gmcf-unsubreq__intro {
	margin: 0 0 18px !important;
	font-size: 1rem;
	line-height: 1.55;
	color: var(--gmf-ink-soft, #3e5a52);
}

/* Line breaks typed in the panel text and the closed message */
.gmcf-wrap .gmf-panel__text,
.gmcf-closed {
	white-space: pre-line;
}

/* "Geen icoon": the panel without the theme's icon tile */
.gmf-panel.gmcf-noicon .gmf-panel__body::before {
	display: none;
}

/* In a narrow text section (e.g. Groene Moskee) the card keeps its full width, as on /dic/ */
.gmr-section--narrow > .gmf.gmcf-wrap:not(.gmcf-unsub-wrap) {
	max-width: 1180px !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

.gmcf-missing {
	padding: 12px 16px;
	border-radius: 12px;
	background: #fef3f2;
	color: #7a1a12;
	font-weight: 600;
}

/* Phones: one column ----------------------------------------------------------------------- */
@media (max-width: 640px) {
	.gmf:not(#_) .gmf-card .gmcf :is(.gmcf-grid, .gmcf-pair) {
		grid-template-columns: minmax(0, 1fr);
	}

	.gmf:not(#_) .gmf-card .gmcf .gmcf-half {
		grid-column: 1 / -1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gmcf *,
	.gmcf *::before,
	.gmcf *::after {
		animation: none !important;
		transition: none !important;
	}
}
