/* ==========================================================================
   Gravity Forms im Ordination-Look
   Voraussetzung: Formulare → Einstellungen → „Standard-Formular-Theme“ = „Gravity Forms 2.5 Theme“
   (nicht „Orbital“, das bringt eigene Variablen mit hoher Spezifität).

   CSS-Klassen im Formular-Editor (Feld → Darstellung → „Benutzerdefinierte CSS-Klasse“):
     dw-choice-cards     Optionsfelder/Kontrollkästchen als Karten (Dringlichkeit, Wunschtermin)
     dw-choice-segment   Ja/Nein als Umschalter (Vertretungsfall)
   Abschnittsfelder („Section“) werden automatisch als nummerierte Schritte dargestellt.
   ========================================================================== */

.dw-form-card .gform_wrapper.gravity-theme { margin: 0; counter-reset: dw-step; }

.dw-form-card .gform_wrapper.gravity-theme .gform_required_legend {
	font-size: 0.875rem;
	color: var(--dw-c-muted);
	margin: 0 0 8px;
}
.dw-form-card .gform_wrapper.gravity-theme .gfield_required { color: #A0461A; }

.dw-form-card .gform_wrapper.gravity-theme .gform_fields { row-gap: 18px; column-gap: 18px; }

/* Labels */
.dw-form-card .gform_wrapper.gravity-theme .gfield_label,
.dw-form-card .gform_wrapper.gravity-theme legend.gfield_label {
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--wp--preset--color--contrast);
	margin-bottom: 8px;
}
.dw-form-card .gform_wrapper.gravity-theme .gfield_description,
.dw-form-card .gform_wrapper.gravity-theme .ginput_complex label {
	font-size: 0.8125rem;
	color: var(--dw-c-muted);
}

/* Eingabefelder */
.dw-form-card .gform_wrapper.gravity-theme input[type="text"],
.dw-form-card .gform_wrapper.gravity-theme input[type="email"],
.dw-form-card .gform_wrapper.gravity-theme input[type="tel"],
.dw-form-card .gform_wrapper.gravity-theme input[type="number"],
.dw-form-card .gform_wrapper.gravity-theme select,
.dw-form-card .gform_wrapper.gravity-theme textarea {
	width: 100%;
	box-sizing: border-box;
	font: inherit;
	font-size: 1rem;
	color: var(--wp--preset--color--contrast);
	background: #fff;
	border: 1.5px solid var(--dw-c-border-strong);
	border-radius: 12px;
	padding: 13px 14px;
	min-height: 50px;
}
.dw-form-card .gform_wrapper.gravity-theme :is(input, select, textarea):focus {
	outline: 3px solid var(--dw-c-focus);
	border-color: var(--dw-c-accent);
}

/* Abschnitte als nummerierte Schritte */
.dw-form-card .gform_wrapper.gravity-theme .gsection {
	border-bottom: 0;
	border-top: 1px solid var(--dw-c-line-soft);
	padding: 28px 0 0;
	margin-top: 14px;
	counter-increment: dw-step;
}
.dw-form-card .gform_wrapper.gravity-theme .gsection:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.dw-form-card .gform_wrapper.gravity-theme .gsection_title {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 1.25rem;
	font-weight: 800;
	margin: 0;
}
.dw-form-card .gform_wrapper.gravity-theme .gsection_title::before {
	content: counter(dw-step);
	width: 32px;
	height: 32px;
	flex: none;
	border-radius: 50%;
	background: var(--dw-c-dark);
	color: #fff;
	font-size: 0.875rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Auswahl als Karten */
.dw-form-card .gform_wrapper.gravity-theme .dw-choice-cards .gfield_radio,
.dw-form-card .gform_wrapper.gravity-theme .dw-choice-cards .gfield_checkbox {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 10px;
}
.dw-form-card .gform_wrapper.gravity-theme .dw-choice-cards .gchoice {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	padding: 14px 16px;
	background: #fff;
	border: 2px solid var(--dw-c-line);
	border-radius: 14px;
	cursor: pointer;
}
.dw-form-card .gform_wrapper.gravity-theme .dw-choice-cards .gchoice:has(input:checked) {
	background: var(--dw-c-accent-tint);
	border-color: var(--dw-c-accent);
}
.dw-form-card .gform_wrapper.gravity-theme .dw-choice-cards .gchoice:has(input:focus-visible) {
	outline: 3px solid var(--dw-c-focus);
}
.dw-form-card .gform_wrapper.gravity-theme .dw-choice-cards input {
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--dw-c-accent);
	flex: none;
}
.dw-form-card .gform_wrapper.gravity-theme .dw-choice-cards label {
	font-weight: 700;
	font-size: 0.9375rem;
	margin: 0;
	max-width: none;
	cursor: pointer;
}
/* ganze Karte klickbar */
.dw-form-card .gform_wrapper.gravity-theme .dw-choice-cards label::after {
	content: "";
	position: absolute;
	inset: 0;
}

/* Ja/Nein als Umschalter */
.dw-form-card .gform_wrapper.gravity-theme .dw-choice-segment .gfield_radio {
	display: inline-flex;
	gap: 4px;
	padding: 4px;
	background: var(--wp--preset--color--base, #F7F5F2);
	border: 1px solid var(--dw-c-line);
	border-radius: 999px;
}
.dw-form-card .gform_wrapper.gravity-theme .dw-choice-segment .gchoice { position: relative; margin: 0; }
.dw-form-card .gform_wrapper.gravity-theme .dw-choice-segment input {
	position: absolute;
	opacity: 0;
	inset: 0;
	margin: 0;
	cursor: pointer;
}
.dw-form-card .gform_wrapper.gravity-theme .dw-choice-segment label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 88px;
	min-height: 44px;
	padding: 0 20px;
	margin: 0;
	border-radius: 999px;
	font-weight: 700;
	font-size: 0.9375rem;
	cursor: pointer;
}
.dw-form-card .gform_wrapper.gravity-theme .dw-choice-segment .gchoice:has(input:checked) label {
	background: var(--dw-c-dark);
	color: #fff;
}
.dw-form-card .gform_wrapper.gravity-theme .dw-choice-segment .gchoice:has(input:focus-visible) label {
	outline: 3px solid var(--dw-c-focus);
}

/* Datenschutz-Checkbox */
.dw-form-card .gform_wrapper.gravity-theme .ginput_container_consent {
	display: flex;
	gap: 12px;
	align-items: flex-start;
}
.dw-form-card .gform_wrapper.gravity-theme .ginput_container_consent input {
	width: 22px;
	height: 22px;
	margin: 1px 0 0;
	accent-color: var(--dw-c-accent);
	flex: none;
}
.dw-form-card .gform_wrapper.gravity-theme .gfield_consent_description,
.dw-form-card .gform_wrapper.gravity-theme .gfield_consent_description_text {
	font-size: 0.8125rem;
	line-height: 1.6;
	color: var(--dw-c-muted);
	border: 0;
	padding: 0;
	max-height: none;
	overflow: visible;
}

.dw-form-card .gform_wrapper.gravity-theme .ginput_container_consent label {
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.5;
	margin: 0;
}
.dw-form-card .gform_wrapper.gravity-theme .gfield--type-consent .gfield_consent_description { margin-top: 12px; }

/* Senden */
.dw-form-card .gform_wrapper.gravity-theme .gform_footer { padding-top: 12px; margin-top: 12px; }
.dw-form-card .gform_wrapper.gravity-theme .gform_footer input[type="submit"],
.dw-form-card .gform_wrapper.gravity-theme .gform_footer button {
	font: inherit;
	font-weight: 700;
	font-size: 1.0625rem;
	background: var(--dw-c-accent);
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 17px 32px;
	cursor: pointer;
}
.dw-form-card .gform_wrapper.gravity-theme .gform_footer :is(input[type="submit"], button):hover {
	background: var(--dw-c-accent-dark);
}

/* Fehler & Bestätigung */
.dw-form-card .gform_wrapper.gravity-theme .gfield_error :is(input, select, textarea) { border-color: #B3261E; }
.dw-form-card .gform_wrapper.gravity-theme .validation_message { color: #B3261E; font-size: 0.875rem; }
.dw-form-card .gform_confirmation_message {
	font-size: 1.0625rem;
	line-height: 1.6;
	padding: 8px 0;
}

@media (max-width: 781px) {
	.dw-form-card .gform_wrapper.gravity-theme .gform_footer :is(input[type="submit"], button) { width: 100%; }
}
