/* Guidos Formulieren – kleuren via theme.json-variabelen met fallback. */
.gfo {
	--gfo-primary: var(--wp--preset--color--primary, #47723a);
	--gfo-primary-dark: #375b2c;
	--gfo-accent: var(--wp--preset--color--accent, #7db912);
	--gfo-soft: #f2f6ee;
	--gfo-soft-2: #e5eedb;
	--gfo-text: var(--wp--preset--color--contrast, #2d2d2d);
	--gfo-muted: #5b605a;
	--gfo-border: #c9cec6;
	--gfo-line: #e3e7df;
	--gfo-error: #b3261e;
	--gfo-radius: 12px;
	--gfo-heading: var(--wp--preset--font-family--heading, inherit);
	color: var(--gfo-text);
	scroll-margin-top: 120px;
	margin-block: 1rem 3rem;
}
.gfo *, .gfo *::before, .gfo *::after { box-sizing: border-box; }
.gfo [hidden] { display: none !important; }
.gfo legend { float: none; width: auto; font-size: inherit; }
.gfo legend + * { clear: none; }
.gfo label { margin: 0; }

.gfo-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.gfo-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.gfo-req { color: var(--gfo-error); }
.gfo-required-note { font-size: 0.9rem; color: var(--gfo-muted); margin: 0 0 1.25rem; }

/* ---------- Opbouw: formulier + samenvatting ---------- */
.gfo-layout { display: block; }
.gfo-form { max-width: 760px; }
.gfo--wizard .gfo-form {
	max-width: none;
	background: #fff;
	border: 1px solid var(--gfo-line);
	border-radius: 20px;
	padding: clamp(1.25rem, 4vw, 2.75rem);
	box-shadow: 0 1px 2px rgba(30, 40, 25, 0.04), 0 12px 40px -12px rgba(30, 40, 25, 0.12);
}
@media (min-width: 1000px) {
	.gfo--wizard.gfo-ready .gfo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2.5rem; align-items: start; }
	.gfo-summary { position: sticky; top: 120px; }
}

/* ---------- Voortgang ---------- */
.gfo-progress { margin: 0 0 2rem; }
.gfo-progress__count { margin: 0 0 0.5rem; font-size: 0.9rem; font-weight: 600; color: var(--gfo-muted); }
.gfo-progress__bar { height: 6px; border-radius: 99px; background: var(--gfo-soft-2); overflow: hidden; }
.gfo-progress__bar span { display: block; height: 100%; background: var(--gfo-primary); border-radius: inherit; transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.gfo-steps { display: flex; gap: 0.25rem; list-style: none; margin: 0.75rem 0 0; padding: 0; }
.gfo-steps__item { flex: 1 1 0; min-width: 0; }
.gfo-steps__btn {
	all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 0.45rem; width: 100%;
	padding: 0.35rem 0.25rem; border-radius: 8px; font-size: 0.82rem; font-weight: 600; line-height: 1.2; color: var(--gfo-muted); cursor: pointer;
}
.gfo-steps__btn:disabled { cursor: default; opacity: 0.55; }
.gfo-steps__btn:not(:disabled):hover { background: var(--gfo-soft); color: var(--gfo-text); }
.gfo-steps__btn:focus-visible { outline: 3px solid var(--gfo-accent); outline-offset: 1px; }
.gfo-steps__n {
	flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
	width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid currentColor; font-size: 0.78rem;
}
.gfo-steps__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gfo-steps__item.is-done .gfo-steps__n { background: var(--gfo-soft-2); border-color: var(--gfo-soft-2); color: var(--gfo-primary-dark); }
.gfo-steps__item.is-active .gfo-steps__btn { color: var(--gfo-text); opacity: 1; }
.gfo-steps__item.is-active .gfo-steps__n { background: var(--gfo-primary); border-color: var(--gfo-primary); color: #fff; }
@media (max-width: 760px) {
	.gfo-steps__label { display: none; }
	.gfo-steps__btn { justify-content: center; }
}
.gfo-form:not(.gfo-js) .gfo-progress { display: none; }

/* ---------- Pagina's ---------- */
.gfo-page { border: 0; margin: 0; padding: 0; min-width: 0; }
.gfo .gfo-page__title { display: block; width: 100%; padding: 0; margin: 0 0 1.5rem; font-family: var(--gfo-heading); font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 700; line-height: 1.15; }
.gfo-page__title:focus { outline: none; }
.gfo-form:not(.gfo-js) .gfo-page + .gfo-page { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--gfo-line); }
.gfo-form:not(.gfo-js) [data-gfo-next], .gfo-form:not(.gfo-js) [data-gfo-prev] { display: none; }

.gfo-fields { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.gfo-field { flex: 1 1 100%; margin: 0 0 1.75rem; padding: 0; border: 0; min-width: 0; }
.gfo-field--half { flex-basis: calc(50% - 0.625rem); }
.gfo-field--third { flex-basis: calc(33.333% - 0.84rem); }
@media (max-width: 640px) {
	.gfo-field--half { flex-basis: 100%; }
	.gfo-field--third { flex-basis: calc(50% - 0.625rem); }
}
.gfo-field--html img { max-width: 100%; height: auto; border-radius: var(--gfo-radius); }

.gfo .gfo-label { display: block; font-weight: 700; margin: 0 0 0.5rem; padding: 0; font-size: 1.05rem; line-height: 1.35; }
.gfo-desc { font-size: 0.92rem; margin: -0.25rem 0 0.6rem; color: var(--gfo-muted); }

/* ---------- Invoer ---------- */
.gfo .gfo-input {
	display: block; width: 100%; min-height: 3.25rem; padding: 0.7rem 0.95rem;
	font: inherit; font-size: 1.05rem; color: var(--gfo-text);
	background: #fff; border: 1.5px solid var(--gfo-border); border-radius: 10px;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.gfo .gfo-input:hover { border-color: #9da49a; }
.gfo .gfo-input:focus { outline: none; border-color: var(--gfo-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gfo-primary) 20%, transparent); }
textarea.gfo-input { min-height: 8rem; resize: vertical; line-height: 1.5; }
.gfo-input::placeholder { color: #8b9188; }

.gfo-affix { position: relative; }
.gfo-affix .gfo-input { padding-right: 2.6rem; }
.gfo-affix__unit { position: absolute; right: 0.95rem; top: 50%; transform: translateY(-50%); color: var(--gfo-muted); font-weight: 600; pointer-events: none; }

.gfo-total {
	flex: 1 1 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
	margin: -0.5rem 0 1.75rem; padding: 0.85rem 1.1rem; border-radius: 10px;
	background: var(--gfo-soft); color: var(--gfo-primary-dark); font-weight: 600;
}
.gfo-total strong { font-size: 1.25rem; }

/* Knoppenrij (segmented) */
.gfo-seg { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.gfo-seg__item { position: relative; }
.gfo-seg__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gfo-seg__label {
	display: inline-flex; align-items: center; justify-content: center; min-width: 3.25rem; min-height: 3.25rem;
	padding: 0.55rem 1.15rem; border: 1.5px solid var(--gfo-border); border-radius: 10px; background: #fff;
	font-weight: 600; cursor: pointer; user-select: none; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.gfo-seg__label:hover { border-color: var(--gfo-primary); background: var(--gfo-soft); }
.gfo-seg__input:checked + .gfo-seg__label { background: var(--gfo-primary); border-color: var(--gfo-primary); color: #fff; }
.gfo-seg__input:focus-visible + .gfo-seg__label { outline: 3px solid var(--gfo-accent); outline-offset: 2px; }
.gfo-seg__input:disabled + .gfo-seg__label { opacity: 0.5; cursor: default; }

/* Fototegels */
.gfo-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.85rem; }
.gfo-tile { position: relative; }
.gfo-tile__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gfo-tile__label {
	position: relative; display: flex; flex-direction: column; height: 100%;
	border: 2px solid var(--gfo-line); border-radius: 14px; overflow: hidden; background: #fff; cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.gfo-tile__label:hover { border-color: #9fbf86; }
.gfo-tile__img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--gfo-soft); }
.gfo-tile__text { padding: 0.75rem 0.9rem; font-weight: 700; line-height: 1.3; }
.gfo-tile__check {
	position: absolute; top: 0.6rem; right: 0.6rem; display: inline-flex; align-items: center; justify-content: center;
	width: 1.75rem; height: 1.75rem; border-radius: 50%; background: #fff; border: 2px solid var(--gfo-border); color: transparent;
}
.gfo-tile__input:checked + .gfo-tile__label { border-color: var(--gfo-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gfo-primary) 22%, transparent); }
.gfo-tile__input:checked + .gfo-tile__label .gfo-tile__check { background: var(--gfo-primary); border-color: var(--gfo-primary); color: #fff; }
.gfo-tile__input:focus-visible + .gfo-tile__label { outline: 3px solid var(--gfo-accent); outline-offset: 2px; }

/* Keuzerondjes / vinkjes */
.gfo-choices { display: grid; gap: 0.6rem; }
.gfo-choices--inline { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; }
.gfo-choice { display: flex; align-items: flex-start; gap: 0.7rem; }
.gfo-choice label { cursor: pointer; line-height: 1.5; }
.gfo-check { width: 1.35rem; height: 1.35rem; margin: 0.12rem 0 0; flex: 0 0 auto; accent-color: var(--gfo-primary); }
.gfo-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.gfo-chips .gfo-choice { position: relative; gap: 0; }
.gfo-chips .gfo-check { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gfo-chips label {
	display: inline-flex; align-items: center; gap: 0.5rem; min-height: 3rem; padding: 0.5rem 1.1rem;
	border: 1.5px solid var(--gfo-border); border-radius: 99px; font-weight: 600; background: #fff;
}
.gfo-chips label::before { content: ""; width: 1rem; height: 1rem; border: 2px solid currentColor; border-radius: 4px; opacity: 0.55; }
.gfo-chips .gfo-check:checked + label { background: var(--gfo-soft); border-color: var(--gfo-primary); color: var(--gfo-primary-dark); }
.gfo-chips .gfo-check:checked + label::before { opacity: 1; background: var(--gfo-primary); border-color: var(--gfo-primary); box-shadow: inset 0 0 0 2px #fff; }
.gfo-chips .gfo-check:focus-visible + label { outline: 3px solid var(--gfo-accent); outline-offset: 2px; }
.gfo-choice--consent { padding: 1rem 1.1rem; border-radius: 10px; background: var(--gfo-soft); }

/* Stappenteller */
.gfo-stepper { display: inline-flex; align-items: stretch; border: 1.5px solid var(--gfo-border); border-radius: 10px; overflow: hidden; background: #fff; }
.gfo-stepper__btn { all: unset; display: inline-flex; align-items: center; justify-content: center; width: 3.25rem; cursor: pointer; color: var(--gfo-primary-dark); background: var(--gfo-soft); }
.gfo-stepper__btn:hover { background: var(--gfo-soft-2); }
.gfo-stepper__btn:focus-visible { outline: 3px solid var(--gfo-accent); outline-offset: -3px; }
.gfo-stepper__input.gfo-input { width: 4.5rem; text-align: center; border: 0; border-radius: 0; font-weight: 700; }
.gfo-stepper__input.gfo .gfo-input:focus { box-shadow: inset 0 0 0 2px var(--gfo-primary); }
.gfo-stepper:focus-within { border-color: var(--gfo-primary); }

/* Naam en adres */
.gfo-subfields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem 1rem; }
.gfo-sub--choices, .gfo-sub--wide { grid-column: 1 / -1; }
@media (max-width: 520px) { .gfo-subfields { grid-template-columns: minmax(0, 1fr); } }
.gfo-sublabel { display: block; font-size: 0.92rem; font-weight: 600; margin-bottom: 0.3rem; }

/* Uploads */
.gfo-drop__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gfo-drop__area {
	display: flex; flex-direction: column; align-items: center; gap: 0.35rem; text-align: center;
	padding: 1.75rem 1.25rem; border: 2px dashed #b8c4ae; border-radius: 14px; background: var(--gfo-soft);
	cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.gfo-drop__area:hover, .gfo-drop.is-dragging .gfo-drop__area { border-color: var(--gfo-primary); background: var(--gfo-soft-2); }
.gfo-drop__input:focus-visible + .gfo-drop__area { outline: 3px solid var(--gfo-accent); outline-offset: 2px; }
.gfo-drop__icon { color: var(--gfo-primary); }
.gfo-drop__text strong { color: var(--gfo-primary-dark); text-decoration: underline; text-underline-offset: 0.15em; }
.gfo-drop__hint { font-size: 0.85rem; color: var(--gfo-muted); }
.gfo-drop__file { display: flex; align-items: center; gap: 0.9rem; padding: 0.75rem; border: 1.5px solid var(--gfo-line); border-radius: 14px; background: #fff; }
.gfo-drop__thumb {
	flex: 0 0 3.5rem; width: 3.5rem; height: 3.5rem; border-radius: 8px; overflow: hidden; background: var(--gfo-soft-2);
	display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: var(--gfo-primary-dark);
}
.gfo-drop__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gfo-drop__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gfo-drop__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gfo-drop__size { font-size: 0.85rem; color: var(--gfo-muted); }
.gfo-field--fileupload[data-reveal-after] { margin-top: -0.75rem; }

/* Uitklapbare uitleg */
.gfo-help { border-radius: 12px; background: var(--gfo-soft); }
.gfo-help summary { display: flex; align-items: center; gap: 0.6rem; padding: 0.85rem 1rem; cursor: pointer; font-weight: 600; color: var(--gfo-primary-dark); list-style: none; }
.gfo-help summary::-webkit-details-marker { display: none; }
.gfo-help summary::before { content: "i"; display: inline-flex; align-items: center; justify-content: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--gfo-primary); color: #fff; font-size: 0.8rem; font-style: italic; font-family: Georgia, serif; }
.gfo-help summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; line-height: 1; }
.gfo-help[open] summary::after { content: "–"; }
.gfo-help summary:focus-visible { outline: 3px solid var(--gfo-accent); outline-offset: 2px; border-radius: 12px; }
.gfo-help__body { padding: 0 1rem 1rem; }
.gfo-help__body img { width: 100%; height: auto; border-radius: 8px; display: block; margin-bottom: 0.5rem; }

/* ---------- Fouten en meldingen ---------- */
.gfo-field.has-error .gfo-input, .gfo-input[aria-invalid="true"] { border-color: var(--gfo-error); }
.gfo-field.has-error .gfo-seg__label, .gfo-field.has-error .gfo-tile__label, .gfo-field.has-error .gfo-drop__area { border-color: var(--gfo-error); }
.gfo-error { display: flex; gap: 0.4rem; color: var(--gfo-error); font-size: 0.92rem; font-weight: 600; margin: 0.5rem 0 0; }
.gfo-error::before { content: "!"; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: var(--gfo-error); color: #fff; font-size: 0.75rem; margin-top: 0.1rem; }
.gfo-alert { padding: 1rem 1.25rem; border-radius: 12px; margin: 0 0 1.5rem; }
.gfo-alert p { margin: 0 0 0.4rem; font-size: 1rem; }
.gfo-alert p:last-child { margin-bottom: 0; }
.gfo-alert--error { background: #fdecea; color: #5f1410; }
.gfo-alert--success { background: var(--gfo-soft); color: #23400f; }
.gfo-alert__small { font-size: 0.875rem !important; }
.gfo-alert:focus { outline: 2px solid currentColor; outline-offset: 2px; }
.gfo-draft { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.75rem 1rem; margin: 0 0 1.5rem; border-radius: 10px; background: #fff7e2; color: #4d3900; font-size: 0.95rem; }
.gfo-draft p { margin: 0; }

/* ---------- Knoppen ---------- */
.gfo-nav { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; margin-top: 0.75rem; padding-top: 1.5rem; border-top: 1px solid var(--gfo-line); }
.gfo-nav .gfo-btn:only-child, .gfo-nav [data-gfo-next], .gfo-nav .gfo-btn--submit { margin-left: auto; }
.gfo-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
	min-height: 3.25rem; padding: 0.75rem 1.75rem; margin: 0;
	font: inherit; font-weight: 700; font-size: 1.05rem; color: #fff; background: var(--gfo-primary);
	border: 2px solid var(--gfo-primary); border-radius: 10px; cursor: pointer; transition: background 0.2s, border-color 0.2s;
}
.gfo-btn:hover { background: var(--gfo-primary-dark); border-color: var(--gfo-primary-dark); }
.gfo-btn:focus-visible { outline: 3px solid var(--gfo-accent); outline-offset: 2px; }
.gfo-btn--secondary { background: #fff; color: var(--gfo-primary-dark); border-color: var(--gfo-border); }
.gfo-btn--secondary:hover { background: var(--gfo-soft); border-color: var(--gfo-primary); }
.gfo-btn--submit { padding-inline: 2.25rem; }
.gfo-btn[disabled] { opacity: 0.7; cursor: progress; }
.gfo-link { all: unset; color: var(--gfo-primary-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 0.15em; cursor: pointer; }
.gfo-link:focus-visible { outline: 3px solid var(--gfo-accent); outline-offset: 2px; border-radius: 4px; }

@media (max-width: 640px) {
	/* Knoppen altijd binnen duimbereik. */
	.gfo-js .gfo-nav {
		position: sticky; bottom: 0; z-index: 5; margin: 0.75rem calc(-1 * clamp(1.25rem, 4vw, 2.75rem)) calc(-1 * clamp(1.25rem, 4vw, 2.75rem));
		padding: 0.85rem clamp(1.25rem, 4vw, 2.75rem); background: rgba(255, 255, 255, 0.96); border-radius: 0 0 20px 20px;
		box-shadow: 0 -8px 20px -12px rgba(0, 0, 0, 0.2);
	}
	.gfo-js .gfo-nav .gfo-btn { flex: 1 1 auto; padding-inline: 1rem; }
}

/* ---------- Samenvatting ---------- */
.gfo-summary { margin-top: 1.5rem; }
@media (min-width: 1000px) { .gfo-summary { margin-top: 0; } }
.gfo-summary__details { border-radius: 20px; background: var(--gfo-soft); }
.gfo-summary__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; cursor: pointer; list-style: none; }
.gfo-summary__head::-webkit-details-marker { display: none; }
.gfo-summary__title { font-family: var(--gfo-heading); font-weight: 700; font-size: 1.25rem; }
.gfo-summary__short { font-weight: 700; color: var(--gfo-primary-dark); }
.gfo-summary__details[open] .gfo-summary__short { display: none; }
@media (min-width: 1000px) { .gfo-summary__head { cursor: default; pointer-events: none; } }
.gfo-summary__body { padding: 0 1.5rem 1.25rem; }
.gfo-summary__total { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 1rem; padding: 0.85rem 1rem; border-radius: 12px; background: #fff; }
.gfo-summary__total strong { font-size: 1.35rem; color: var(--gfo-primary-dark); }
.gfo-summary__group { padding: 0.85rem 0; border-top: 1px solid var(--gfo-soft-2); }
.gfo-summary__group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.gfo-summary__group h3 { margin: 0; font-size: 0.95rem; font-weight: 700; font-family: inherit; }
.gfo-summary__group.is-current h3::after { content: " (nu bezig)"; font-weight: 500; color: var(--gfo-muted); }
.gfo-summary__group .gfo-link { font-size: 0.88rem; }
.gfo-summary__group dl { margin: 0.5rem 0 0; font-size: 0.92rem; line-height: 1.35; }
.gfo-summary__group dt { color: var(--gfo-muted); margin-top: 0.45rem; }
.gfo-summary__group dd { margin: 0.05rem 0 0; font-weight: 600; overflow-wrap: anywhere; }
.gfo-summary__empty { margin: 0.35rem 0 0; font-size: 0.9rem; color: var(--gfo-muted); }

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