/* ============================================================================
 * DFV Zuschussrechner — plugin-scoped styles.
 *
 * All styles are scoped to .dfvzr-app so they cannot leak into the theme.
 * Design tokens are defined LOCALLY on .dfvzr-app — they intentionally
 * mirror the theme's tokens (so the calc looks at home on the DFV site)
 * but are declared inside the plugin so the calc still looks correct
 * if the theme changes or if used on a different theme entirely.
 * ============================================================================ */

.dfvzr-app {
	/* Color tokens — local to plugin */
	--dfvzr-orange: #CC4400;
	--dfvzr-orange-dark: #A83800;
	--dfvzr-bg: #FFFFFF;
	--dfvzr-bg-alt: #F3F2EF;
	--dfvzr-peach: #FEF0E6;
	--dfvzr-slate: #333C4E;
	--dfvzr-heading: #2A2520;
	--dfvzr-text: #1C1A19;
	--dfvzr-text-light: #5C5450;
	--dfvzr-border: #E8E2D9;
	--dfvzr-blue: #0056A7;
	--dfvzr-success: #2C7A4B;
	--dfvzr-danger: #C8364A;

	/* Surface tokens */
	--dfvzr-radius: 6px;
	--dfvzr-radius-lg: 6px;
	--dfvzr-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
	--dfvzr-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
	--dfvzr-card-shadow: 0 0 0 1px rgba(28, 26, 25, 0.05), 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px -4px rgba(0, 0, 0, 0.08);

	/* Spacing scale */
	--dfvzr-space-xs: 0.5rem;
	--dfvzr-space-sm: 1rem;
	--dfvzr-space-md: 1.5rem;
	--dfvzr-space-lg: 2.5rem;
	--dfvzr-space-xl: 4rem;
	--dfvzr-space-xxl: 6rem;

	/* Typography */
	--dfvzr-font: "Work Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--dfvzr-line-height: 1.55;

	/* Motion */
	--dfvzr-transition: 180ms ease-out;

	/* Container reset — fix the typography baseline */
	font-family: var(--dfvzr-font);
	color: var(--dfvzr-text);
	line-height: var(--dfvzr-line-height);
	font-size: 16px;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Box-sizing for everything inside the plugin container.
   Inheriting box-sizing avoids surprises when the theme uses content-box. */
.dfvzr-app,
.dfvzr-app *,
.dfvzr-app *::before,
.dfvzr-app *::after {
	box-sizing: border-box;
}

/* ============================================================================
 * Form card — the calculator's main surface
 * ============================================================================ */

/* Single-column layout — the form sits in the theme's main content column;
   the section sidebar is provided by the theme, like every other page. */
.dfvzr-layout {
	margin: 0 0 var(--dfvzr-space-xl);
	display: block;
}

.dfvzr-form {
	padding: var(--dfvzr-space-xl) var(--dfvzr-space-lg);
	background: var(--dfvzr-bg);
	border-radius: var(--dfvzr-radius-lg);
	box-shadow: var(--dfvzr-card-shadow);
	min-width: 0;
}

/* Result panel below the form (revealed by the logic phase once enough is entered). */
.dfvzr-result-wrap {
	margin-top: var(--dfvzr-space-lg);
}

@media (max-width: 600px) {
	.dfvzr-form {
		padding: var(--dfvzr-space-lg) var(--dfvzr-space-md);
	}
}

/* ============================================================================
 * Step indicator — 4 numbered circles connected by a thin line
 * ============================================================================ */

.dfvzr-steps {
	list-style: none;
	margin: 0 0 var(--dfvzr-space-xl);
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
}

.dfvzr-step {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--dfvzr-space-xs);
	color: var(--dfvzr-text-light);
	font-size: 0.85rem;
	text-align: center;
}

/* Connecting line: from this step's circle to the next step's circle */
.dfvzr-step:not(:last-child)::after {
	content: '';
	position: absolute;
	top: 17px; /* center of the 36px circle */
	left: calc(50% + 22px);
	right: calc(-50% + 22px);
	height: 2px;
	background: var(--dfvzr-border);
	z-index: 0;
}

.dfvzr-step--done::after {
	background: var(--dfvzr-orange);
}

.dfvzr-step__number {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--dfvzr-bg);
	border: 2px solid var(--dfvzr-border);
	font-weight: 600;
	color: var(--dfvzr-text-light);
	transition: background-color var(--dfvzr-transition), border-color var(--dfvzr-transition), color var(--dfvzr-transition);
}

.dfvzr-step--current .dfvzr-step__number,
.dfvzr-step--done .dfvzr-step__number {
	background: var(--dfvzr-orange);
	border-color: var(--dfvzr-orange);
	color: #fff;
}

.dfvzr-step--current {
	color: var(--dfvzr-text);
	font-weight: 600;
}

/* ============================================================================
 * Step header — eyebrow + title + lead, top of each step body
 * ============================================================================ */

.dfvzr-step-header {
	margin-bottom: var(--dfvzr-space-lg);
}

.dfvzr-step-header__eyebrow {
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--dfvzr-orange);
	margin: 0 0 var(--dfvzr-space-xs);
}

.dfvzr-step-header__title {
	font-family: var(--dfvzr-font);
	font-size: 1.6rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.2;
	margin: 0 0 var(--dfvzr-space-xs);
	color: var(--dfvzr-text);
}

.dfvzr-step-header__lead {
	color: var(--dfvzr-text-light);
	margin: 0;
	font-size: 1rem;
}

/* ============================================================================
 * Form grid — vertical stack with multi-column rows
 * ============================================================================ */

.dfvzr-form-grid {
	display: flex;
	flex-direction: column;
	gap: var(--dfvzr-space-md);
}

/* Tighter spacing variant — for long lists of similar inputs (Einnahmen) */
.dfvzr-form-grid--tight {
	gap: var(--dfvzr-space-sm);
}

/* 2-column variant — used for income/expense lists on wider layouts */
.dfvzr-form-grid--2col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--dfvzr-space-sm) var(--dfvzr-space-md);
}

@media (max-width: 768px) {
	.dfvzr-form-grid--2col {
		grid-template-columns: 1fr;
	}
}

.dfvzr-row {
	display: grid;
	gap: var(--dfvzr-space-md);
}

.dfvzr-row--2col {
	grid-template-columns: 1fr 1fr;
}

.dfvzr-row--plz-ort {
	grid-template-columns: 120px 1fr;
}

.dfvzr-row--street {
	grid-template-columns: 1fr 130px;
}

/* ============================================================================
 * Field — label + input + (optional) error message
 * ============================================================================ */

.dfvzr-field {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
}

.dfvzr-field__label {
	font-size: 0.92rem;
	font-weight: 500;
	color: var(--dfvzr-text);
}

.dfvzr-field__required {
	color: var(--dfvzr-orange);
	font-weight: 700;
	margin-left: 1px;
}

.dfvzr-field__input {
	width: 100%;
	padding: 0.7rem 0.9rem;
	font-family: var(--dfvzr-font);
	font-size: 1rem;
	color: var(--dfvzr-text);
	background: var(--dfvzr-bg);
	border: 1px solid var(--dfvzr-border);
	border-radius: var(--dfvzr-radius);
	transition: border-color var(--dfvzr-transition), box-shadow var(--dfvzr-transition);
}

.dfvzr-field__input:hover:not(:focus) {
	border-color: #c9c2b7;
}

.dfvzr-field__input:focus {
	outline: none;
	border-color: var(--dfvzr-orange);
	box-shadow: 0 0 0 3px rgba(204, 68, 0, 0.15);
}

.dfvzr-field__error {
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--dfvzr-danger);
	margin: 0.35rem 0 0;
}

/* Checkbox error sits on its own line, indented to align under the label text
   and tucked close to the row above it. */
.dfvzr-field__error--checkbox {
	/* Cancel most of the form-grid flex gap (1.5rem) so the error tucks under
	   the checkbox row, leaving only a small gap. */
	margin-top: calc(var(--dfvzr-space-md) * -1 + 0.35rem);
	margin-left: calc(20px + var(--dfvzr-space-sm));
}

.dfvzr-field--has-error .dfvzr-field__input {
	border-color: var(--dfvzr-danger);
}

.dfvzr-field--has-error .dfvzr-field__input:focus {
	box-shadow: 0 0 0 3px rgba(200, 54, 74, 0.15);
}

.dfvzr-checkbox.dfvzr-field--has-error .dfvzr-checkbox__indicator {
	border-color: var(--dfvzr-danger);
}

/* ============================================================================
 * Pill radio group — binary / short-choice selector (Ja / Nein)
 * ============================================================================ */

.dfvzr-pill-group {
	border: 0;
	padding: 0;
	margin: 0;
	min-width: 0;
}

.dfvzr-pill-group__label {
	display: block;
	font-size: 0.92rem;
	font-weight: 500;
	color: var(--dfvzr-text);
	margin-bottom: 0.2rem;
}

.dfvzr-pill-options {
	display: flex;
	gap: var(--dfvzr-space-md);
}

.dfvzr-pill {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.7rem 1.2rem;
	background: var(--dfvzr-bg);
	border: 1px solid var(--dfvzr-border);
	border-radius: var(--dfvzr-radius);
	font-weight: 500;
	color: var(--dfvzr-text);
	cursor: pointer;
	transition: all var(--dfvzr-transition);
	text-align: center;
	position: relative;
}

.dfvzr-pill input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
	width: 0;
	height: 0;
}

.dfvzr-pill:hover {
	background: var(--dfvzr-bg-alt);
	border-color: #c9c2b7;
}

.dfvzr-pill:has(input:checked) {
	background: var(--dfvzr-orange);
	border-color: var(--dfvzr-orange);
	color: #fff;
}

.dfvzr-pill:has(input:focus-visible) {
	box-shadow: 0 0 0 3px rgba(204, 68, 0, 0.18);
}

/* ============================================================================
 * Checkbox — custom-styled, accessible
 * ============================================================================ */

.dfvzr-checkbox {
	display: flex;
	align-items: flex-start;
	gap: var(--dfvzr-space-sm);
	cursor: pointer;
	padding: 0.25rem 0;
	line-height: 1.5;
}

.dfvzr-checkbox input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
	width: 0;
	height: 0;
}

.dfvzr-checkbox__indicator {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	margin-top: 0.1rem;
	background: var(--dfvzr-bg);
	border: 1.5px solid var(--dfvzr-border);
	border-radius: 4px;
	transition: all var(--dfvzr-transition);
	position: relative;
}

.dfvzr-checkbox__indicator::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 1px;
	width: 6px;
	height: 11px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(45deg) scale(0);
	transform-origin: center;
	transition: transform var(--dfvzr-transition);
}

.dfvzr-checkbox:hover .dfvzr-checkbox__indicator {
	border-color: #c9c2b7;
}

.dfvzr-checkbox input:checked + .dfvzr-checkbox__indicator {
	background: var(--dfvzr-orange);
	border-color: var(--dfvzr-orange);
}

.dfvzr-checkbox input:checked + .dfvzr-checkbox__indicator::after {
	transform: rotate(45deg) scale(1);
}

.dfvzr-checkbox input:focus-visible + .dfvzr-checkbox__indicator {
	box-shadow: 0 0 0 3px rgba(204, 68, 0, 0.18);
}

.dfvzr-checkbox__text {
	font-size: 0.95rem;
	color: var(--dfvzr-text);
}

/* ============================================================================
 * Callout — peach card with orange left border for important info
 * ============================================================================ */

.dfvzr-callout {
	background: var(--dfvzr-peach);
	border-left: 4px solid var(--dfvzr-orange);
	border-radius: var(--dfvzr-radius);
	padding: var(--dfvzr-space-md);
	font-size: 0.95rem;
	line-height: 1.55;
}

.dfvzr-callout p {
	margin: 0 0 var(--dfvzr-space-sm);
}

.dfvzr-callout p:last-child {
	margin-bottom: 0;
}

.dfvzr-callout__title {
	color: var(--dfvzr-orange);
}

.dfvzr-callout a {
	color: var(--dfvzr-orange);
	font-weight: 500;
}

/* ============================================================================
 * Section — grouped block of fields with title
 * ============================================================================ */

.dfvzr-section {
	display: flex;
	flex-direction: column;
	gap: var(--dfvzr-space-sm);
}

.dfvzr-section__title {
	font-family: var(--dfvzr-font);
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--dfvzr-text);
	margin: 0;
	padding-bottom: var(--dfvzr-space-xs);
	border-bottom: 1px solid var(--dfvzr-border);
}

.dfvzr-section__lead {
	font-size: 0.92rem;
	color: var(--dfvzr-text-light);
	margin: 0;
}

/* ============================================================================
 * Input with currency / unit suffix
 * ============================================================================ */

.dfvzr-input-with-suffix {
	position: relative;
}

.dfvzr-input-with-suffix__suffix {
	position: absolute;
	right: 0.9rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--dfvzr-text-light);
	pointer-events: none;
	font-size: 1rem;
}

.dfvzr-input-with-suffix .dfvzr-field__input {
	padding-right: 2.2rem;
}

/* ============================================================================
 * Field hint (helper text below input)
 * ============================================================================ */

.dfvzr-field__hint {
	font-size: 0.85rem;
	color: var(--dfvzr-text-light);
	margin: 0;
}

/* ============================================================================
 * Mitreisende / Travelers list
 * ============================================================================ */

.dfvzr-travelers {
	display: flex;
	flex-direction: column;
	gap: var(--dfvzr-space-md);
}

.dfvzr-traveler {
	background: var(--dfvzr-bg-alt);
	border-radius: var(--dfvzr-radius);
	box-shadow: var(--dfvzr-card-shadow);
	padding: var(--dfvzr-space-md);
	display: flex;
	flex-direction: column;
	gap: var(--dfvzr-space-sm);
}

.dfvzr-traveler__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.dfvzr-traveler__title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--dfvzr-text);
}

.dfvzr-row--traveler {
	grid-template-columns: 1fr 1fr 1fr;
}

.dfvzr-add-traveler {
	align-self: flex-start;
}

@media (max-width: 600px) {
	.dfvzr-row--traveler {
		grid-template-columns: 1fr;
	}

	.dfvzr-pill-options {
		flex-direction: column;
	}
}

/* ============================================================================
 * Summary cards — step 4 review (one per previous step)
 * ============================================================================ */

.dfvzr-summary {
	display: flex;
	flex-direction: column;
	gap: var(--dfvzr-space-sm);
}

.dfvzr-summary__card {
	background: var(--dfvzr-bg-alt);
	border-radius: var(--dfvzr-radius);
	box-shadow: var(--dfvzr-card-shadow);
	padding: var(--dfvzr-space-md);
}

.dfvzr-summary__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--dfvzr-space-sm);
	margin-bottom: var(--dfvzr-space-sm);
}

.dfvzr-summary__title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--dfvzr-text);
}

.dfvzr-summary__edit {
	font-size: 0.85rem;
	color: var(--dfvzr-orange);
	text-decoration: none;
	font-weight: 500;
}

.dfvzr-summary__edit:hover {
	text-decoration: underline;
}

.dfvzr-summary__list {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.dfvzr-summary__row {
	display: grid;
	grid-template-columns: 165px 1fr;
	gap: var(--dfvzr-space-sm);
	font-size: 0.92rem;
}

.dfvzr-summary__row dt {
	color: var(--dfvzr-text-light);
}

.dfvzr-summary__row dd {
	margin: 0;
	color: var(--dfvzr-text);
}

@media (max-width: 600px) {
	.dfvzr-summary__row {
		grid-template-columns: 1fr;
		gap: 0.1rem;
	}
}

/* ============================================================================
 * Upload dropzone — multi-file with drag-drop and click
 * ============================================================================ */

/* The dashed box is the CONTAINER; the label is the click-to-add zone at the
   top, and the selected-files list sits below it inside the same border. */
.dfvzr-upload {
	position: relative;
	background: var(--dfvzr-bg-alt);
	border: 2px dashed var(--dfvzr-border);
	border-radius: var(--dfvzr-radius-lg);
	transition: border-color var(--dfvzr-transition), background-color var(--dfvzr-transition);
}

.dfvzr-upload:hover {
	border-color: var(--dfvzr-orange);
	background: var(--dfvzr-peach);
}

.dfvzr-upload:focus-within {
	border-color: var(--dfvzr-orange);
	box-shadow: 0 0 0 3px rgba(204, 68, 0, 0.18);
}

.dfvzr-upload__input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

.dfvzr-upload__label {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--dfvzr-space-xs);
	padding: var(--dfvzr-space-xl) var(--dfvzr-space-lg);
	border-radius: var(--dfvzr-radius-lg);
	cursor: pointer;
	transition: background-color var(--dfvzr-transition);
	text-align: center;
}


.dfvzr-upload__icon {
	color: var(--dfvzr-orange);
}

.dfvzr-upload__text {
	font-size: 1rem;
	color: var(--dfvzr-text);
}

.dfvzr-upload__link {
	color: var(--dfvzr-orange);
	font-weight: 600;
}

.dfvzr-upload__hint {
	font-size: 0.85rem;
	color: var(--dfvzr-text-light);
}

/* ============================================================================
 * Consent list — wider checkbox text for legal copy
 * ============================================================================ */

.dfvzr-consents {
	display: flex;
	flex-direction: column;
	gap: var(--dfvzr-space-sm);
}

.dfvzr-consents .dfvzr-checkbox__text a {
	color: var(--dfvzr-orange);
	font-weight: 500;
}

/* ============================================================================
 * Submit row — step 4 final action
 * ============================================================================ */

.dfvzr-step-nav--submit {
	border-top: 1px solid var(--dfvzr-border);
	padding-top: var(--dfvzr-space-md);
}

.dfvzr-btn--lg {
	padding: 1rem 2rem;
	font-size: 1.05rem;
}

.dfvzr-submit {
	margin-left: auto;
}

/* ============================================================================
 * Result panel — "Möglicher Zuschuss" live calculation display
 * ============================================================================ */

.dfvzr-result {
	background: var(--dfvzr-slate);
	color: #fff;
	border-radius: var(--dfvzr-radius-lg);
	padding: var(--dfvzr-space-lg);
}

.dfvzr-result__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--dfvzr-space-sm);
	margin-bottom: var(--dfvzr-space-sm);
}

.dfvzr-result__label {
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.75);
	margin: 0;
}

.dfvzr-result__badge {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	padding: 0.25rem 0.7rem;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 600;
	white-space: nowrap;
}

.dfvzr-result__amount {
	margin: 0 0 var(--dfvzr-space-xs);
	display: flex;
	align-items: baseline;
	gap: 0.3rem;
	font-family: var(--dfvzr-font);
	color: #fff;
	flex-wrap: wrap;
}

.dfvzr-result__currency {
	font-size: 1.3rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.75);
}

.dfvzr-result__value {
	font-size: 2.4rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1;
}

.dfvzr-result__per {
	font-size: 0.95rem;
	color: rgba(255, 255, 255, 0.75);
	font-weight: 500;
	margin-left: 0.4rem;
}

.dfvzr-result__note {
	font-size: 0.85rem;
	color: rgba(255, 255, 255, 0.65);
	margin: 0;
	line-height: 1.5;
}

/* ============================================================================
 * Buttons (plugin-local, self-contained)
 * ============================================================================ */

.dfvzr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.7rem 1.4rem;
	font-family: var(--dfvzr-font);
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	border-radius: var(--dfvzr-radius);
	border: 1px solid transparent;
	cursor: pointer;
	transition: background-color var(--dfvzr-transition), border-color var(--dfvzr-transition), color var(--dfvzr-transition);
	text-decoration: none;
}

.dfvzr-btn--primary {
	background: var(--dfvzr-orange);
	color: #fff;
	border-color: var(--dfvzr-orange);
}

.dfvzr-btn--primary:hover {
	background: var(--dfvzr-orange-dark);
	border-color: var(--dfvzr-orange-dark);
}

.dfvzr-btn--secondary {
	background: transparent;
	color: var(--dfvzr-text);
	border-color: var(--dfvzr-border);
}

.dfvzr-btn--secondary:hover {
	background: var(--dfvzr-bg-alt);
}

.dfvzr-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ============================================================================
 * Step navigation — back/next row at the bottom of each step
 * ============================================================================ */

.dfvzr-step-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: var(--dfvzr-space-md);
	padding-top: var(--dfvzr-space-md);
	border-top: 1px solid var(--dfvzr-border);
}

.dfvzr-step-nav__next {
	margin-left: auto;
}

/* ============================================================================
 * Responsive
 * ============================================================================ */

@media (max-width: 600px) {
	.dfvzr-row--2col,
	.dfvzr-row--plz-ort {
		grid-template-columns: 1fr;
	}

	.dfvzr-step__label {
		font-size: 0.7rem;
	}

	.dfvzr-step-nav__next {
		width: 100%;
	}

	.dfvzr-step-header__title {
		font-size: 1.35rem;
	}
}
/* ============================================================================
 * Logic-phase additions: clickable step indicators + traveler remove button
 * ============================================================================ */

.dfvzr-step--clickable {
	cursor: pointer;
}

.dfvzr-traveler__remove {
	appearance: none;
	border: none;
	background: none;
	width: 1.75rem;
	height: 1.75rem;
	padding: 0;
	font-family: var(--dfvzr-font);
	font-size: 1.4rem;
	line-height: 1;
	color: var(--dfvzr-text-light);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.dfvzr-traveler__remove:hover {
	background: rgba(200, 54, 74, 0.1);
	color: var(--dfvzr-danger);
}

.dfvzr-traveler__remove:focus-visible {
	outline: 2px solid var(--dfvzr-danger);
	outline-offset: 2px;
}
/* ============================================================================
 * Eligibility gate (step 1): block notice + reveal + locked Ort field
 * ============================================================================ */

.dfvzr-callout--block {
	background: rgba(200, 54, 74, 0.07);
	border-left-color: var(--dfvzr-danger);
}

.dfvzr-callout--block .dfvzr-callout__title {
	color: var(--dfvzr-danger);
}

.dfvzr-callout--block a {
	color: var(--dfvzr-danger);
}

/* Wrapper for the personal fields, revealed once "Nein" is chosen. Inherits
   the form grid so spacing matches the rest of the step. */
.dfvzr-reveal {
	display: flex;
	flex-direction: column;
	gap: var(--dfvzr-space-md);
}

.dfvzr-reveal[hidden] {
	display: none;
}

.dfvzr-field__input--locked {
	background: var(--dfvzr-bg-alt);
	color: var(--dfvzr-text-light);
	cursor: not-allowed;
}

.dfvzr-field__input--locked:hover,
.dfvzr-field__input--locked:focus {
	border-color: var(--dfvzr-border);
	box-shadow: none;
}
/* ============================================================================
 * Step 4 documents: required-list, warning, selected files, submit note
 * ============================================================================ */

/* Arrow bullets, matching the site's content lists (orange → marker). */
.dfvzr-doc-list {
	list-style: none;
	margin: 0 0 var(--dfvzr-space-md);
	padding-left: 0;
	color: var(--dfvzr-text);
	font-size: 0.95rem;
	line-height: 1.6;
}

.dfvzr-doc-list li {
	position: relative;
	padding-left: 1.6rem;
	margin-bottom: 0.4rem;
}

.dfvzr-doc-list li::before {
	content: "\2192";
	position: absolute;
	left: 0;
	color: var(--dfvzr-orange);
	font-weight: 700;
}

.dfvzr-upload__files {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.dfvzr-upload__files:not(:empty) {
	padding: 0 var(--dfvzr-space-md) var(--dfvzr-space-md);
}

.dfvzr-upload__file {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
	background: var(--dfvzr-bg);
	border: 1px solid var(--dfvzr-border);
	border-radius: var(--dfvzr-radius);
	font-size: 0.9rem;
	color: var(--dfvzr-text);
	word-break: break-all;
}

.dfvzr-upload__file::before {
	content: '';
	flex-shrink: 0;
	width: 1rem;
	height: 1rem;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235C5450' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E") no-repeat center / contain;
}

.dfvzr-upload__file-name {
	flex: 1;
	min-width: 0;
	word-break: break-all;
}

.dfvzr-upload__file-size {
	flex-shrink: 0;
	color: var(--dfvzr-text-light);
	font-size: 0.8rem;
	white-space: nowrap;
}

.dfvzr-upload__remove {
	flex-shrink: 0;
	appearance: none;
	border: none;
	background: none;
	width: 1.5rem;
	height: 1.5rem;
	padding: 0;
	font-size: 1.25rem;
	line-height: 1;
	color: var(--dfvzr-text-light);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.dfvzr-upload__remove:hover {
	background: rgba(200, 54, 74, 0.1);
	color: var(--dfvzr-danger);
}

.dfvzr-upload__remove:focus-visible {
	outline: 2px solid var(--dfvzr-danger);
	outline-offset: 2px;
}

.dfvzr-submit-note {
	margin-bottom: var(--dfvzr-space-md);
}
/* PLZ + Bezirk row + custom select arrow (moved inward from the edge) */
.dfvzr-row--plz-bezirk {
	grid-template-columns: 130px 1fr;
}

.dfvzr-field__select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	padding-right: 2.75rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235C5450' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.9rem center;
	background-size: 15px;
	cursor: pointer;
}
/* --- Submission success panel ------------------------------------------- */
.dfvzr-success {
	text-align: center;
	padding: var(--dfvzr-space-md) 0;
}
.dfvzr-success__icon {
	width: 4rem;
	height: 4rem;
	margin: 0 auto var(--dfvzr-space-md);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2rem;
	color: #fff;
	background: var(--dfvzr-success);
	border-radius: 50%;
}
.dfvzr-success__title {
	margin: 0 0 var(--dfvzr-space-sm);
	color: var(--dfvzr-heading);
}
.dfvzr-success__number {
	font-size: 1.15rem;
	margin: 0 0 var(--dfvzr-space-md);
}
.dfvzr-success__number strong {
	color: var(--dfvzr-orange);
}
.dfvzr-success p {
	max-width: 46ch;
	margin-left: auto;
	margin-right: auto;
	color: var(--dfvzr-text-light);
}
.dfvzr-submit.is-loading {
	opacity: 0.7;
	cursor: progress;
}
/* Success — what-happens-next steps + contact */
.dfvzr-success__subtitle {
	margin: var(--dfvzr-space-lg) 0 var(--dfvzr-space-sm);
	color: var(--dfvzr-heading);
	font-size: 1.05rem;
}
.dfvzr-success__steps {
	text-align: left;
	max-width: 46ch;
	margin: 0 auto var(--dfvzr-space-md);
	padding-left: 1.2rem;
}
.dfvzr-success__steps li {
	margin-bottom: var(--dfvzr-space-sm);
	color: var(--dfvzr-text-light);
}
.dfvzr-success__steps li strong {
	display: block;
	color: var(--dfvzr-text);
}
.dfvzr-success__contact {
	margin-top: var(--dfvzr-space-md);
	font-size: 0.95rem;
}
/* Headings use slate to match the site-wide heading colour (2 Jul 2026) */
.dfvzr-step-header__title,
.dfvzr-section__title,
.dfvzr-traveler__title,
.dfvzr-summary__title {
	color: var(--dfvzr-heading);
}

/* --------------------------------------------------------------------------
   BATCH 1 (Aug 2026): token overflow + tap targets
   -------------------------------------------------------------------------- */

/* A grid item whose track is sized from min-content needs `anywhere` plus
   min-width:0; `break-word` alone will not let the track shrink. Both of these
   were HIGH findings: a long e-mail in the step 4 summary, and the applicant's
   own address on the confirmation screen, each pushing the entire page into
   horizontal scroll. */
@media (max-width: 1024px) {
	.dfvzr-summary__row dd {
		min-width: 0;
		overflow-wrap: anywhere;
	}

	.dfvzr-success {
		overflow-wrap: anywhere;
	}

	/* Pseudo-element hit areas: 44px targets without moving the controls. */
	.dfvzr-traveler__remove,
	.dfvzr-upload__remove {
		position: relative;
	}
	.dfvzr-traveler__remove::after,
	.dfvzr-upload__remove::after {
		content: '';
		position: absolute;
		top: 50%;
		left: 50%;
		width: 44px;
		height: 44px;
		transform: translate(-50%, -50%);
	}

	.dfvzr-summary__edit {
		position: relative;
	}
	.dfvzr-summary__edit::after {
		content: '';
		position: absolute;
		top: 50%;
		left: -0.5rem;
		right: -0.5rem;
		height: 44px;
		transform: translateY(-50%);
	}

	.dfvzr-checkbox {
		padding: 0.7rem 0;
	}
}

/* --------------------------------------------------------------------------
   BATCH 2 (Aug 2026): the remaining Zuschussrechner HIGH findings
   The other two (a long e-mail in the step 4 summary, and the applicant's own
   address on the confirmation screen) are already handled by the token-overflow
   rules in batch 1 above.
   -------------------------------------------------------------------------- */

/* 1. Step navigation. .dfvzr-step-nav is flex with justify-content:space-between
   and NO flex-wrap, and .dfvzr-submit adds margin-left:auto on top of
   .dfvzr-btn--lg's 2rem side padding. Measured at 320px: the row's clientWidth
   is 222 against a scrollWidth of 275, and "Antrag absenden" renders with its
   right edge at 323.8 while the card ends at 296 - so documentElement itself
   scrolls sideways. Also fixes the Weiter button pushing past the card on
   steps 2 and 3 at 320px, which was filed separately. */
@media (max-width: 600px) {
	.dfvzr-step-nav {
		flex-wrap: wrap;
		gap: var(--dfvzr-space-sm);
	}

	.dfvzr-step-nav__back {
		width: 100%;
	}

	.dfvzr-step-nav__next,
	.dfvzr-submit {
		width: 100%;
		margin-left: 0;
	}
}

/* 2. Uploaded file rows. The row's fixed siblings (16px icon, a nowrap size
   chip, a 24px remove button, three 8px gaps) plus 24px + 12px of nested side
   padding leave the filename a measured 38px at 320px, and `word-break:
   break-all` then splits it every three or four characters: a 331px-tall row
   reading "Buch / ungs / best / aetig / ung-". Giving the name its own full
   width row and swapping break-all for overflow-wrap fixes both. */
@media (max-width: 600px) {
	.dfvzr-upload__files:not(:empty) {
		padding: 0 var(--dfvzr-space-sm) var(--dfvzr-space-sm);
	}

	.dfvzr-upload__file {
		flex-wrap: wrap;
		row-gap: 0.25rem;
	}

	.dfvzr-upload__file-name {
		flex: 1 1 100%;
		min-width: 0;
		word-break: normal;
		overflow-wrap: anywhere;
	}

	.dfvzr-upload__file::before {
		order: 1;
	}

	.dfvzr-upload__file-size {
		order: 2;
		margin-right: auto;
	}

	.dfvzr-upload__remove {
		order: 3;
	}
}

/* 3. Result panel head. Flex, space-between, no wrap, and the Foerderstufe
   badge is white-space:nowrap. At 320px the head has 142px of content width
   against a 216px scrollWidth, so a 108px badge renders from x196 to x305 while
   the slate panel ends at 271: a third of the pill sits on the white card
   outside the dark box. */
@media (max-width: 600px) {
	.dfvzr-result__head {
		flex-wrap: wrap;
		row-gap: var(--dfvzr-space-xs);
	}
}

/* Step changes must not land behind the sticky site header.
   dfvzr.js scrolls with block:'start' twice - root (.dfvzr-app) after every
   Weiter, and formEl (.dfvzr-form) after a successful submit - while
   .site-header is position:sticky;top:0. Measured sticky header height: 111.6px
   at 375 portrait, 92px at 768-1024, 60px on landscape phones. Without a
   scroll margin the progress indicator lands underneath it every time.
   Only the two elements that are actually scroll targets are listed, so the
   block:'center' scrolls (first error, inline notice) are left alone. */
@media (max-width: 1024px) {
	.dfvzr-app,
	.dfvzr-app .dfvzr-form {
		scroll-margin-top: 140px;
	}
}

/* Landscape phones have a 60px header but only ~375px of height, so the
   portrait value would spend a quarter of the screen on clearance. */
@media (max-width: 1024px) and (max-height: 500px) {
	.dfvzr-app,
	.dfvzr-app .dfvzr-form {
		scroll-margin-top: 80px;
	}
}

/* ============================================================================
 * Zuschussrechner: the last of the narrow-width findings (Aug 2026)
 * All scoped to phones. The form is the page where a mistake costs an
 * application, so each of these was measured before and after.
 * ============================================================================ */

/* PLZ + Bezirk. The row is `130px 1fr`, so at 320px the Bezirk select gets 66px
   against a max-content need of 281px for "Charlottenburg-Wilmersdorf". A select
   cannot scroll, so the longest Bezirk names were simply unreadable. Stacking
   gives the select the full column; the ellipsis is the honest fallback for the
   narrowest phones, and the tighter arrow padding below 380 buys back 15px. */
@media (max-width: 600px) {
	.dfvzr-row--plz-bezirk {
		grid-template-columns: 1fr;
	}

	.dfvzr-field__select {
		text-overflow: ellipsis;
	}
}

@media (max-width: 380px) {
	.dfvzr-field__select {
		padding-left: 0.6rem;
		padding-right: 2.1rem;
		background-position: right 0.6rem center;
	}
}

/* Result panel. 40px of side padding on a 320px screen leaves 142px of text,
   and the 2.4rem amount overflows its own line by about 10px. */
@media (max-width: 600px) {
	.dfvzr-result {
		padding: var(--dfvzr-space-md);
	}

	.dfvzr-result__value {
		font-size: 2rem;
	}
}

/* Step indicator. `repeat(4, 1fr)` looks even but 1fr floors at min-content, so
   the four tracks size themselves from their labels: 72.08 / 60.30 / 64.58 /
   36.00px at 320, which makes the connector lines between them misalign.
   minmax(0, 1fr) removes that floor; the labels then need permission to wrap,
   and German compounds need hyphens to do it tidily. */
@media (max-width: 600px) {
	.dfvzr-steps {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.dfvzr-step__label {
		overflow-wrap: anywhere;
		hyphens: auto;
	}
}

/* Traveller rows. The 3-column layout collapses to 1 at <=600, which leaves
   601-720 with three cramped columns and the Geburtsdatum date field clipped:
   a date input has a fixed intrinsic width and will not shrink. iPhone SE and
   iPhone 8 in landscape (667x375) sit exactly in this band. Two up, with the
   date on its own full-width row. */
@media (min-width: 601px) and (max-width: 720px) {
	.dfvzr-row--traveler {
		grid-template-columns: 1fr 1fr;
	}

	.dfvzr-row--traveler > .dfvzr-field:last-child {
		grid-column: 1 / -1;
	}
}

/* Upload dropzone. 4rem/2.5rem of padding is desktop spacing: at 320px it
   leaves a 138px text column inside a 325px-tall box. */
@media (max-width: 600px) {
	.dfvzr-upload__label {
		padding: var(--dfvzr-space-lg) var(--dfvzr-space-md);
	}
}

/* The eligibility blocker carries the site-wide warning triangle (same shape
   as the theme .notice--warning / .dfv-hinweis, recoloured to the danger red).
   Neutral peach info callouts deliberately stay icon-less. */
.dfvzr-callout--block {
	position: relative;
	padding-left: 48px;
}
.dfvzr-callout--block::before {
	content: "";
	position: absolute;
	left: 16px;
	top: calc(var(--dfvzr-space-md) + 1px);
	width: 22px;
	height: 22px;
	background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23C8364A'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M10.29%203.86%201.82%2018a2%202%200%200%200%201.71%203h16.94a2%202%200%200%200%201.71-3L13.71%203.86a2%202%200%200%200-3.42%200z'/%3E%3Cline%20x1='12'%20y1='9'%20x2='12'%20y2='13'/%3E%3Cline%20x1='12'%20y1='17'%20x2='12.01'%20y2='17'/%3E%3C/svg%3E") no-repeat center / contain;
}
@media (max-width: 480px) {
	.dfvzr-callout--block { padding-left: 40px; }
	.dfvzr-callout--block::before { left: 10px; top: 17px; }
}