/* ============================================================
   PflegeBrücke — onboarding (chooser + wizard + verify)
   Built with the same design tokens as the rest of the site.
   ============================================================ */

/* ============================================================
   Page shell
   ============================================================ */
.onboard {
	padding: clamp(var(--space-10), 6vw, var(--space-16)) 0 clamp(var(--space-12), 8vw, var(--space-20));
	background: var(--surface-canvas);
	min-height: 70vh;
}

.onboard__head {
	margin-bottom: var(--space-10);
}

.onboard__title {
	font-family: var(--font-display);
	font-weight: 500;
	font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: var(--ink-primary);
	margin: 0;
}

.onboard__lede {
	font-size: var(--text-lg);
	line-height: 1.55;
	color: var(--ink-secondary);
	max-width: 60ch;
	margin: 0;
}

.onboard__backlink {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	color: var(--ink-tertiary);
	font-size: var(--text-sm);
	text-decoration: none;
	margin-bottom: var(--space-6);
	transition: color 180ms cubic-bezier(0.23, 1, 0.32, 1),
		gap 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.onboard__backlink:hover {
	color: var(--brand-700);
	gap: calc(var(--space-2) + 2px);
}

.onboard__login {
	margin-top: var(--space-10);
	text-align: center;
	color: var(--ink-tertiary);
	font-size: var(--text-sm);
}
.onboard__login a {
	color: var(--brand-700);
	font-weight: 500;
	text-decoration: none;
}
.onboard__login a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ============================================================
   Role chooser
   ============================================================ */
.role-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-5);
}
@media (min-width: 720px) {
	.role-grid {
		grid-template-columns: 1fr 1fr;
	}
}

.role-card {
	display: flex;
	flex-direction: column;
	gap: var(--space-5);
	padding: var(--space-8);
	background: var(--surface-raised);
	border: 1px solid var(--border-default);
	border-radius: var(--radius-lg);
	color: var(--ink-primary);
	text-decoration: none;
	box-shadow: var(--shadow-xs);
	transition:
		transform 240ms cubic-bezier(0.23, 1, 0.32, 1),
		box-shadow 240ms cubic-bezier(0.23, 1, 0.32, 1),
		border-color 240ms cubic-bezier(0.23, 1, 0.32, 1);
}
@media (hover: hover) and (pointer: fine) {
	.role-card:hover {
		transform: translateY(-3px);
		box-shadow: var(--shadow-lg);
		border-color: var(--brand-200);
	}
	.role-card:hover .role-card__cta {
		background: var(--brand-700);
	}
	.role-card:hover .role-card__cta svg {
		transform: translateX(3px);
	}
}
.role-card:active {
	transform: translateY(-1px);
	transition-duration: 100ms;
}

.role-card__icon {
	width: 56px;
	height: 56px;
	border-radius: var(--radius-md);
	background: var(--brand-50);
	color: var(--brand-700);
	display: flex;
	align-items: center;
	justify-content: center;
}
.role-card--accent .role-card__icon {
	background: rgba(232, 165, 95, 0.18);
	color: #9d6128;
}

.role-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
}

.role-card__label {
	font-size: var(--text-xs);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ink-tertiary);
}

.role-card__title {
	font-family: var(--font-display);
	font-size: var(--text-3xl);
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--ink-primary);
	margin: 0;
}

.role-card__desc {
	color: var(--ink-secondary);
	line-height: 1.55;
	margin: 0;
}

.role-card__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	color: var(--ink-secondary);
	font-size: var(--text-sm);
}
.role-card__list li {
	display: flex;
	gap: var(--space-2);
}
.role-card__list li::before {
	content: "";
	flex-shrink: 0;
	width: 6px;
	height: 6px;
	margin-top: 8px;
	border-radius: 50%;
	background: var(--brand-500);
}
.role-card--accent .role-card__list li::before {
	background: #cf8b3e;
}

.role-card__cta {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	margin-top: auto;
	padding: var(--space-3) var(--space-5);
	background: var(--brand-500);
	color: white;
	border-radius: var(--radius-sm);
	font-weight: 500;
	font-size: var(--text-base);
	transition: background 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.role-card__cta svg {
	transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.role-card--accent .role-card__cta {
	background: #b56f1f;
}
@media (hover: hover) and (pointer: fine) {
	.role-card--accent:hover .role-card__cta {
		background: #8c5413;
	}
}

/* ============================================================
   Wizard — progress indicator
   ============================================================ */
.wizard-progress {
	list-style: none;
	margin: 0 0 var(--space-10);
	padding: 0;
	display: flex;
	gap: var(--space-2);
	counter-reset: wizard-step;
	position: relative;
}

.wizard-progress__step {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-2);
	padding-top: var(--space-3);
	position: relative;
	color: var(--ink-tertiary);
	font-size: var(--text-sm);
	transition: color 240ms cubic-bezier(0.23, 1, 0.32, 1);
}
.wizard-progress__step::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 3px;
	border-radius: 2px;
	background: var(--surface-sunken);
	transition: background 240ms cubic-bezier(0.23, 1, 0.32, 1);
}

.wizard-progress__step.is-current,
.wizard-progress__step.is-done {
	color: var(--ink-primary);
}
.wizard-progress__step.is-current::before {
	background: var(--brand-500);
}
.wizard-progress__step.is-done::before {
	background: var(--brand-500);
}

.wizard-progress__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--surface-sunken);
	color: var(--ink-tertiary);
	font-size: var(--text-sm);
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	transition: background 240ms cubic-bezier(0.23, 1, 0.32, 1),
		color 240ms cubic-bezier(0.23, 1, 0.32, 1);
}
.wizard-progress__step.is-current .wizard-progress__num {
	background: var(--brand-500);
	color: white;
	box-shadow: var(--shadow-focus);
}
.wizard-progress__step.is-done .wizard-progress__num {
	background: var(--brand-500);
	color: white;
}

.wizard-progress__label {
	font-weight: 500;
}
@media (max-width: 640px) {
	.wizard-progress__label {
		display: none;
	}
}

/* ============================================================
   Wizard — form & steps
   ============================================================ */
.wizard {
	background: var(--surface-raised);
	border: 1px solid var(--border-default);
	border-radius: var(--radius-lg);
	padding: clamp(var(--space-6), 4vw, var(--space-10));
	box-shadow: var(--shadow-sm);
}

.wizard-step {
	display: flex;
	flex-direction: column;
	gap: var(--space-5);
}

/* Animation when step appears */
.wizard-step:not([hidden]) {
	animation: wizardStepIn 320ms cubic-bezier(0.23, 1, 0.32, 1) both;
}
@keyframes wizardStepIn {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
@media (prefers-reduced-motion: reduce) {
	.wizard-step:not([hidden]) {
		animation: none;
	}
}

.wizard-step__head {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	margin-bottom: var(--space-2);
}

.wizard-step__title {
	font-family: var(--font-display);
	font-size: var(--text-2xl);
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--ink-primary);
	margin: 0;
}

.wizard-step__hint {
	color: var(--ink-secondary);
	line-height: 1.55;
	margin: 0;
}

.wizard-grid {
	display: grid;
	gap: var(--space-4);
	grid-template-columns: 1fr;
}
@media (min-width: 600px) {
	.wizard-grid--2 {
		grid-template-columns: 1fr 1fr;
	}
	.wizard-grid--3 {
		grid-template-columns: 1fr 1fr 1fr;
	}
}

/* ============================================================
   Form fields
   ============================================================ */
.field {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
}

.field__label {
	font-size: var(--text-sm);
	font-weight: 500;
	color: var(--ink-primary);
}

.field__hint {
	font-size: var(--text-xs);
	color: var(--ink-tertiary);
}

.field__error {
	font-size: var(--text-xs);
	color: #b3261e;
	min-height: 1.1em;
}
.field__error:empty {
	display: none;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="tel"],
.field input[type="date"],
.field select,
.field textarea {
	width: 100%;
	padding: 0 var(--space-4);
	height: 44px;
	background: var(--surface-raised);
	border: 1px solid var(--border-default);
	border-radius: var(--radius-sm);
	color: var(--ink-primary);
	font-family: inherit;
	font-size: var(--text-base);
	transition:
		border-color 180ms cubic-bezier(0.23, 1, 0.32, 1),
		box-shadow 180ms cubic-bezier(0.23, 1, 0.32, 1);
}
.field textarea {
	height: auto;
	padding: var(--space-3) var(--space-4);
	resize: vertical;
	min-height: 96px;
	line-height: 1.5;
}
.field select {
	appearance: none;
	background-image:
		linear-gradient(45deg, transparent 50%, var(--ink-tertiary) 50%),
		linear-gradient(135deg, var(--ink-tertiary) 50%, transparent 50%);
	background-position:
		calc(100% - 18px) 19px,
		calc(100% - 13px) 19px;
	background-size: 5px 5px;
	background-repeat: no-repeat;
	padding-right: var(--space-10);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
	outline: none;
	border-color: var(--brand-500);
	box-shadow: var(--shadow-focus);
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
	border-color: #b3261e;
}
.field.is-invalid input:focus,
.field.is-invalid select:focus,
.field.is-invalid textarea:focus {
	box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.18);
}

/* ============================================================
   Checkboxes & radios
   ============================================================ */
.checkbox {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	font-size: var(--text-sm);
	color: var(--ink-secondary);
	cursor: pointer;
	user-select: none;
}
.checkbox input[type="checkbox"] {
	flex-shrink: 0;
	appearance: none;
	width: 18px;
	height: 18px;
	border: 1.5px solid var(--border-strong);
	border-radius: 4px;
	background: var(--surface-raised);
	cursor: pointer;
	transition:
		background 180ms cubic-bezier(0.23, 1, 0.32, 1),
		border-color 180ms cubic-bezier(0.23, 1, 0.32, 1);
	position: relative;
}
.checkbox input[type="checkbox"]:checked {
	background: var(--brand-500);
	border-color: var(--brand-500);
}
.checkbox input[type="checkbox"]:checked::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 5px;
	height: 10px;
	border: solid white;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.checkbox input[type="checkbox"]:focus-visible {
	outline: none;
	box-shadow: var(--shadow-focus);
}
.checkbox input[type="checkbox"]:active {
	transform: scale(0.9);
	transition-duration: 100ms;
}

.checkbox--block {
	display: flex;
	align-items: flex-start;
	padding: var(--space-3) var(--space-4);
	border-radius: var(--radius-sm);
	background: var(--surface-sunken);
	font-size: var(--text-sm);
	line-height: 1.5;
	color: var(--ink-secondary);
}
.checkbox--block input[type="checkbox"] {
	margin-top: 1px;
}
.checkbox--block a {
	color: var(--brand-700);
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.checkbox-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: var(--space-3);
}

/* Radio cards (one of N) */
.radio-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-3);
}
@media (min-width: 600px) {
	.radio-grid {
		grid-template-columns: 1fr 1fr;
	}
}

.radio-card {
	display: flex;
	gap: var(--space-3);
	padding: var(--space-4);
	border: 1px solid var(--border-default);
	border-radius: var(--radius-sm);
	background: var(--surface-raised);
	cursor: pointer;
	transition:
		border-color 200ms cubic-bezier(0.23, 1, 0.32, 1),
		background 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.radio-card input[type="radio"] {
	margin: 4px 0 0;
	flex-shrink: 0;
	accent-color: var(--brand-500);
}
.radio-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
}
.radio-card__title {
	font-weight: 500;
	color: var(--ink-primary);
	font-size: var(--text-base);
}
.radio-card__desc {
	color: var(--ink-tertiary);
	font-size: var(--text-sm);
	line-height: 1.4;
}

.radio-card:has(input[type="radio"]:checked) {
	border-color: var(--brand-500);
	background: var(--brand-50);
}
@media (hover: hover) and (pointer: fine) {
	.radio-card:hover {
		border-color: var(--brand-300);
	}
}

/* Fieldsets */
.field--checkboxes,
.field--radios {
	border: none;
	margin: 0;
	padding: 0;
}
.field--checkboxes legend,
.field--radios legend {
	margin-bottom: var(--space-3);
	padding: 0;
}

/* ============================================================
   Upload list
   ============================================================ */
.upload-list {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
}

.upload-row {
	display: flex;
	align-items: center;
	gap: var(--space-4);
	padding: var(--space-4);
	background: var(--surface-canvas);
	border: 1px solid var(--border-default);
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition:
		border-color 200ms cubic-bezier(0.23, 1, 0.32, 1),
		background 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
@media (hover: hover) and (pointer: fine) {
	.upload-row:hover {
		border-color: var(--brand-300);
		background: var(--brand-50);
	}
}

.upload-row__icon {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: var(--radius-sm);
	background: var(--surface-raised);
	border: 1px solid var(--border-default);
	color: var(--ink-tertiary);
	display: flex;
	align-items: center;
	justify-content: center;
}

.upload-row__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.upload-row__title {
	font-weight: 500;
	color: var(--ink-primary);
	font-size: var(--text-base);
}
.upload-row__hint {
	color: var(--ink-tertiary);
	font-size: var(--text-xs);
}

.upload-row__actions {
	flex-shrink: 0;
}

.upload-row[data-uploaded="1"] .upload-row__icon {
	background: var(--brand-500);
	color: white;
	border-color: var(--brand-500);
}
.upload-row[data-uploaded="1"] .upload-row__status {
	background: var(--brand-50);
	color: var(--brand-700);
}

/* ============================================================
   Wizard actions
   ============================================================ */
.wizard-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--space-3);
	margin-top: var(--space-6);
	padding-top: var(--space-6);
	border-top: 1px solid var(--border-subtle);
}

.terms-block {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	margin-top: var(--space-4);
}

/* Busy state for buttons */
.btn[data-busy-state="1"] [data-default] {
	display: none;
}
.btn[data-busy-state="1"] [data-busy] {
	display: inline;
}

/* ============================================================
   Wizard "done" state
   ============================================================ */
.wizard-done {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: var(--space-4);
	padding: var(--space-6) 0;
	animation: wizardStepIn 360ms cubic-bezier(0.23, 1, 0.32, 1) both;
}

.wizard-done__icon {
	width: 88px;
	height: 88px;
	border-radius: 50%;
	background: var(--brand-50);
	color: var(--brand-700);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 0 0 8px rgba(31, 114, 104, 0.06);
}

.wizard-done__title {
	font-family: var(--font-display);
	font-size: var(--text-3xl);
	line-height: 1.15;
	color: var(--ink-primary);
	margin: 0;
}

.wizard-done__lede {
	color: var(--ink-secondary);
	font-size: var(--text-lg);
	line-height: 1.55;
	max-width: 48ch;
	margin: 0;
}

.wizard-done__sender {
	color: var(--ink-tertiary);
	font-size: var(--text-sm);
	margin: 0;
}
.wizard-done__sender strong {
	color: var(--ink-primary);
	font-weight: 500;
}

.wizard-done__actions {
	margin-top: var(--space-3);
}

.wizard-done__hint {
	color: var(--ink-tertiary);
	font-size: var(--text-sm);
	margin: 0;
}
.wizard-done__hint:empty {
	display: none;
}

/* ============================================================
   Toast — top-of-form errors
   ============================================================ */
.wizard-toast {
	margin-bottom: var(--space-5);
	padding: var(--space-3) var(--space-4);
	border-radius: var(--radius-sm);
	background: rgba(179, 38, 30, 0.08);
	border: 1px solid rgba(179, 38, 30, 0.18);
	color: #8a1d18;
	font-size: var(--text-sm);
	animation: wizardStepIn 200ms cubic-bezier(0.23, 1, 0.32, 1) both;
}

/* ============================================================
   Verify endpoint
   ============================================================ */
.verify-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: var(--space-4);
	padding: clamp(var(--space-8), 6vw, var(--space-12)) var(--space-6);
	background: var(--surface-raised);
	border: 1px solid var(--border-default);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
}

.verify-state__icon {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(179, 38, 30, 0.1);
	color: #b3261e;
}
.verify-state__icon--brand {
	background: var(--brand-50);
	color: var(--brand-700);
}

.verify-state__title {
	font-family: var(--font-display);
	font-size: var(--text-3xl);
	line-height: 1.15;
	color: var(--ink-primary);
	margin: 0;
}

.verify-state__msg {
	color: var(--ink-secondary);
	font-size: var(--text-lg);
	line-height: 1.55;
	max-width: 48ch;
	margin: 0;
}

.verify-state__hint {
	color: var(--ink-tertiary);
	font-size: var(--text-sm);
	max-width: 48ch;
	margin: 0;
}

.verify-state__actions {
	display: flex;
	gap: var(--space-3);
	flex-wrap: wrap;
	justify-content: center;
	margin-top: var(--space-2);
}
