/* VEYS Formulare – nutzt die Farben des Themes, mit Ersatzwerten */
.veys-form, .veys-form *, .veys-form *::before, .veys-form *::after { box-sizing: border-box; }
.veys-form {
	--f-primary: var(--wp--preset--color--primary, #1f2d3d);
	--f-accent: var(--wp--preset--color--accent, #b8935a);
	--f-on-accent: var(--wp--preset--color--on-accent, #1f2d3d);
	--f-soft: var(--wp--preset--color--accent-soft, #f4ece0);
	--f-border: var(--wp--preset--color--border, #d9dde1);
	--f-muted: var(--wp--preset--color--muted, #5a6570);
	--f-bg: var(--wp--preset--color--base, #fff);
	--f-error: #b3261e;
	background: var(--f-bg);
	border: 1px solid var(--f-border);
	border-radius: 16px;
	padding: clamp(20px, 3.5vw, 36px);
	display: grid;
	gap: 18px;
	scroll-margin-top: 110px;
}
.veys-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 16px; }
.veys-form legend {
	font-family: var(--wp--preset--font-family--heading, inherit);
	font-weight: 700; font-size: 1.25rem; color: var(--f-primary);
	margin-bottom: 14px; padding: 0;
}
.veys-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.veys-field { display: grid; gap: 6px; min-width: 0; }
.veys-field.is-full { grid-column: 1 / -1; }
@media (max-width: 560px) { .veys-grid { grid-template-columns: 1fr; } }

.veys-field label { font-weight: 600; font-size: .92rem; color: var(--f-primary); }
.veys-field label span { color: var(--wp--preset--color--accent-text, var(--f-accent)); }
.veys-form input[type="text"], .veys-form input[type="email"], .veys-form input[type="tel"],
.veys-form input[type="number"], .veys-form select, .veys-form textarea {
	width: 100%; font: inherit; font-size: 1rem; color: inherit;
	background: var(--f-bg);
	border: 1.5px solid var(--f-border); border-radius: 8px;
	padding: 11px 13px; min-height: 48px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.veys-form textarea { min-height: 110px; resize: vertical; }
.veys-form :is(input, select, textarea):focus {
	outline: none; border-color: var(--f-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--f-accent) 25%, transparent);
}
.veys-form .is-invalid :is(input, select, textarea), .veys-form :is(input, select, textarea).is-invalid { border-color: var(--f-error); }
.veys-field-error { color: var(--f-error); font-size: .85rem; margin: 0; }

/* Auswahlkarten */
.veys-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .veys-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.veys-choice { position: relative; cursor: pointer; }
.veys-choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.veys-choice span {
	display: flex; align-items: center; justify-content: center; text-align: center;
	min-height: 64px; padding: 10px; border-radius: 10px;
	border: 1.5px solid var(--f-border); font-weight: 600; font-size: .95rem; line-height: 1.3;
	transition: border-color .15s ease, background-color .15s ease;
}
.veys-choice:hover span { border-color: var(--f-accent); }
.veys-choice input:checked + span { border-color: var(--f-accent); background: var(--f-soft); box-shadow: inset 0 0 0 1px var(--f-accent); }
.veys-choice input:focus-visible + span { outline: 2px solid var(--f-accent); outline-offset: 2px; }

/* Einwilligung */
.veys-consent { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: .9rem; color: var(--f-muted); }
.veys-consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--f-accent); }

/* Navigation */
.veys-nav { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.veys-btn {
	font: inherit; font-family: var(--wp--preset--font-family--heading, inherit); font-weight: 700; font-size: .95rem;
	border-radius: 8px; padding: 13px 24px; min-height: 48px; cursor: pointer;
	background: var(--f-accent); color: var(--f-on-accent); border: 2px solid var(--f-accent);
}
.veys-btn:hover { filter: brightness(1.06); }
.veys-btn--ghost { background: transparent; color: var(--f-primary); border-color: var(--f-border); }
@media (max-width: 560px) { .veys-nav { flex-direction: column-reverse; } .veys-btn { width: 100%; } }

.veys-hint { font-size: .85rem; color: var(--f-muted); margin: 0; }
.veys-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Schritte (nur mit JavaScript) */
.veys-progress { display: none; }
.veys-form--steps.is-js .veys-progress { display: grid; gap: 8px; }
.veys-progress__bar { display: block; height: 6px; border-radius: 99px; background: var(--f-border); position: relative; overflow: hidden; }
.veys-progress__bar::after {
	content: ""; position: absolute; inset: 0 auto 0 0; width: var(--veys-progress, 20%);
	background: var(--f-accent); border-radius: inherit; transition: width .25s ease;
}
.veys-progress__label { font-size: .82rem; color: var(--f-muted); font-weight: 600; }
.veys-form--steps.is-js .veys-step:not(.is-active) { display: none; }
.veys-form--steps:not(.is-js) [data-veys-prev], .veys-form--steps:not(.is-js) [data-veys-next] { display: none; }
.veys-form--steps:not(.is-js) .veys-step + .veys-step { border-top: 1px solid var(--f-border); padding-top: 22px; }

/* Meldungen */
.veys-form-msg { border-radius: 12px; padding: 16px 18px; font-size: .98rem; }
.veys-form-msg.is-error { background: #fbeceb; color: var(--f-error); border: 1px solid #f0c4c1; }
.veys-form-msg.is-success {
	background: var(--wp--preset--color--accent-soft, #f4ece0);
	border: 1px solid var(--wp--preset--color--accent, #b8935a);
	padding: clamp(20px, 3vw, 32px); scroll-margin-top: 110px;
}
.veys-form-msg.is-success p { margin: 0 0 6px; }
.veys-form-msg:focus { outline: none; }
.veys-form-msg__title { font-family: var(--wp--preset--font-family--heading, inherit); font-weight: 700; font-size: 1.2rem; color: var(--wp--preset--color--primary, #1f2d3d); }

@media (prefers-reduced-motion: reduce) { .veys-progress__bar::after { transition: none; } }

@media (max-width: 640px) { .veys-choice span { font-size: .88rem; min-height: 58px; } }

/* ==================================================================
   Klick-Strecke (Bewertung, Suchauftrag)
   ================================================================== */
.veys-wiz { gap: 0; padding: clamp(20px, 4vw, 44px); box-shadow: 0 18px 50px -28px rgba(0, 21, 51, .35); }
.veys-wiz .veys-form-msg.is-error { margin-bottom: 18px; }

/* Kopf: Zurück + Fortschritt (nur mit JavaScript) */
.veys-wiz__top { display: none; }
.veys-wiz.is-js .veys-wiz__top {
	display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 18px;
	margin-bottom: clamp(22px, 3.5vw, 34px);
}
.veys-wiz__back {
	font: inherit; font-size: .9rem; font-weight: 600; color: var(--f-primary);
	background: none; border: 0; padding: 8px 4px; cursor: pointer; border-radius: 6px; min-height: 40px;
}
.veys-wiz__back:hover { color: var(--wp--preset--color--accent-text, var(--f-primary)); }
.veys-wiz__back:focus-visible { outline: 2px solid var(--f-accent); outline-offset: 2px; }
.veys-wiz__back[hidden] { display: block; visibility: hidden; }
.veys-wiz .veys-progress { display: grid; gap: 8px; justify-items: end; }
.veys-wiz .veys-progress__label { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.veys-wiz .veys-progress__label i { font-style: normal; }
.veys-progress__of[hidden] { display: none; }
.veys-wiz .veys-progress__bar { width: 100%; height: 4px; background: color-mix(in srgb, var(--f-border) 80%, transparent); }
.veys-wiz .veys-progress__bar::after { width: var(--veys-progress, 6%); transition: width .35s ease; }
.veys-wiz__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; }

/* Schritte */
.veys-wiz .veys-step { gap: 18px; }
.veys-wiz .veys-step__q {
	font-family: var(--wp--preset--font-family--heading, inherit);
	font-size: clamp(1.3rem, 2.6vw, 1.7rem); line-height: 1.25; font-weight: 700; letter-spacing: -.01em;
	color: var(--f-primary); margin: 0 0 4px; padding: 0; outline: none; max-width: 30ch;
}
.veys-wiz .veys-step__hint { margin-top: -10px; font-size: .92rem; }
.veys-wiz.is-js .veys-step:not(.is-active) { display: none; }
.veys-wiz.is-js.is-ready .veys-step.is-active { animation: veys-in .32s ease both; }
@keyframes veys-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.veys-wiz:not(.is-js) .veys-step + .veys-step { border-top: 1px solid var(--f-border); padding-top: 28px; margin-top: 28px; }
.veys-wiz:not(.is-js) .veys-step__nav :is([data-veys-next]) { display: none; }

/* Kacheln */
.veys-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.veys-tiles--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.veys-tiles--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.veys-tile { position: relative; cursor: pointer; display: block; }
.veys-tile input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.veys-tile__box {
	position: relative; height: 100%;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
	min-height: 68px; padding: 16px 12px; border-radius: 14px;
	background: var(--f-bg); border: 1.5px solid var(--f-border);
	transition: border-color .15s ease, background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.veys-tiles--icons .veys-tile__box { min-height: 128px; padding: 20px 12px 18px; }
.veys-tiles--6 .veys-tile__box { min-height: 60px; padding: 12px 6px; }
.veys-tile__icon { width: 44px; height: 44px; color: var(--f-primary); flex: none; margin-bottom: 4px; transition: color .15s ease; }
.veys-tile__label { font-weight: 600; font-size: 1rem; line-height: 1.3; color: var(--f-primary); hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; max-width: 100%; }
.veys-tile__sub { font-size: .8rem; line-height: 1.3; color: var(--f-muted); }
.veys-tile:hover .veys-tile__box { border-color: var(--f-accent); transform: translateY(-2px); box-shadow: 0 10px 24px -16px rgba(0, 21, 51, .45); }
.veys-tile input:focus-visible + .veys-tile__box { outline: 2px solid var(--f-primary); outline-offset: 3px; }
.veys-tile input:checked + .veys-tile__box {
	border-color: var(--f-accent); background: var(--f-soft);
	box-shadow: inset 0 0 0 1px var(--f-accent);
}
.veys-tile input:checked + .veys-tile__box::after {
	content: ""; position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border-radius: 50%;
	background: var(--f-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%23002653' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.veys-step--multi .veys-tile__box { padding-top: 18px; }
.veys-tiles.is-invalid .veys-tile__box { border-color: color-mix(in srgb, var(--f-error) 55%, var(--f-border)); }

/* Navigation im Schritt */
.veys-step__nav { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 6px; }
.veys-step__nav:empty { display: none; }
.veys-btn--link {
	background: none; border-color: transparent; color: var(--f-muted); font-weight: 600; padding-inline: 10px;
	text-decoration: underline; text-underline-offset: 3px;
}
.veys-btn--link:hover { color: var(--f-primary); filter: none; }
.veys-btn--submit { padding-inline: 32px; }

/* Eingabe mit Einheit */
.veys-unit { position: relative; display: block; }
.veys-unit input { padding-right: 48px; -moz-appearance: textfield; appearance: textfield; }
.veys-unit input::-webkit-outer-spin-button, .veys-unit input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.veys-unit__label { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--f-muted); font-weight: 600; pointer-events: none; }
.veys-field--narrow { max-width: 240px; }
.veys-field[hidden] { display: none; }

/* Zusammenfassung vor dem Absenden */
.veys-summary { background: var(--f-soft); border-radius: 12px; padding: 14px 16px; }
.veys-summary__title { margin: 0 0 8px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--f-muted); }
.veys-summary__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.veys-summary__list button {
	font: inherit; font-size: .85rem; color: var(--f-primary); cursor: pointer;
	background: var(--f-bg); border: 1px solid var(--f-border); border-radius: 99px; padding: 5px 12px;
}
.veys-summary__list button:hover { border-color: var(--f-accent); }

/* Vertrauen */
.veys-wiz-trust {
	list-style: none; margin: clamp(22px, 3vw, 30px) 0 0; padding: 18px 0 0; border-top: 1px solid var(--f-border);
	display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; font-size: .85rem; color: var(--f-muted);
}
.veys-wiz-trust li::before { content: "✓"; color: var(--wp--preset--color--accent-text, var(--f-accent)); font-weight: 700; margin-right: 6px; }

/* Erfolg */
.veys-form-msg__check {
	display: block; width: 48px; height: 48px; border-radius: 50%; margin-bottom: 12px;
	background: var(--f-accent, #c6ac5b) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%23002653' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 28px no-repeat;
	background-color: var(--wp--preset--color--accent, #c6ac5b);
}

@media (max-width: 640px) {
	.veys-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.veys-tiles--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.veys-tiles--icons .veys-tile__box { min-height: 112px; }
	.veys-tile__label { font-size: .95rem; }
	.veys-wiz .veys-step__nav { flex-direction: column-reverse; align-items: stretch; }
	.veys-field--narrow { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
	.veys-wiz.is-js.is-ready .veys-step.is-active { animation: none; }
	.veys-tile__box, .veys-wiz .veys-progress__bar::after { transition: none; }
	.veys-tile:hover .veys-tile__box { transform: none; }
}

/* ==================================================================
   2.2.0 – Fortschritt über die volle Breite, Bestätigungs-Häkchen
   ================================================================== */
.veys-wiz.is-js .veys-wiz__top {
	grid-template-columns: auto 1fr;
	grid-template-areas: "back label" "bar bar";
	row-gap: 10px;
}
.veys-wiz .veys-progress { display: contents; }
.veys-wiz__back { grid-area: back; justify-self: start; }
.veys-wiz .veys-progress__label { grid-area: label; justify-self: end; }
.veys-wiz .veys-progress__bar { grid-area: bar; }

.veys-check { margin-top: 4px; padding: 14px 16px; border-radius: 10px; background: color-mix(in srgb, var(--f-accent) 10%, transparent); color: var(--f-text, inherit); }
.veys-check.is-invalid { outline: 2px solid #b32d2e; }
