/**
 * Styles für das mehrstufige HRworks-Bewerbungsformular.
 * Eigene Datei (statt style-index.css des Karten-Blocks), damit die Styles
 * überall laden, wo der Formular-Block eingesetzt wird.
 */

.ifjob-form {
	--ifjob-accent: var(--wp--preset--color--cta, #9cc416);
	--ifjob-radius: var(--wp-preset--border-radius--small, 10px);
	max-width: 680px;
	background: #fff;
	border-radius: calc(var(--ifjob-radius) * 1.5);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.07);
	padding: clamp(1.25rem, 4vw, 2.5rem);
	box-sizing: border-box;
}

/* --- Fortschritt: nummerierte Kreise mit Verbindungslinie --- */

.ifjob-form__progress {
	display: flex;
	justify-content: space-between;
	margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
	position: relative;
	counter-reset: ifjob-step;
}

.ifjob-form__progress::before {
	content: '';
	position: absolute;
	top: 1.1rem;
	left: 12%;
	right: 12%;
	height: 3px;
	background: #ececec;
	border-radius: 3px;
	z-index: 0;
}

.ifjob-form__progress-step {
	position: relative;
	z-index: 1;
	flex: 1;
	text-align: center;
	font-size: var(--wp--preset--font-size--small, 0.85rem);
	color: #9a9a9a;
	transition: color 0.25s ease;
}

.ifjob-form__progress-step::before {
	content: attr(data-num);
	display: block;
	width: 2.2rem;
	height: 2.2rem;
	line-height: 2.2rem;
	margin: 0 auto 0.4rem;
	border-radius: 50%;
	background: #f1f1f1;
	color: #9a9a9a;
	font-weight: bold;
	transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.ifjob-form__progress-step.is-active {
	color: inherit;
	font-weight: bold;
}

.ifjob-form__progress-step.is-active::before {
	background: var(--ifjob-accent);
	color: #fff;
	transform: scale(1.08);
}

/* --- Schritte --- */

.ifjob-form__step {
	display: none;
	border: 0;
	padding: 0;
	margin: 0;
}

.ifjob-form__step.is-active {
	display: block;
	animation: ifjob-step-in 0.35s ease both;
}

@keyframes ifjob-step-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.ifjob-form__step legend {
	font-size: var(--wp--preset--font-size--medium, 1.35rem);
	font-weight: bold;
	margin-bottom: 0.35rem;
}

.ifjob-form__hint,
.ifjob-form__jobinfo {
	color: #777;
	font-size: var(--wp--preset--font-size--small, 0.9rem);
	margin: 0 0 1.25rem;
}

.ifjob-form__jobinfo {
	display: inline-block;
	background: color-mix(in srgb, var(--ifjob-accent) 14%, #fff);
	color: inherit;
	border-radius: 99px;
	padding: 0.35rem 1rem;
	font-weight: bold;
}

/* --- Mehrspaltige Feldzeilen --- */

.ifjob-form__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 1.25rem;
}

.ifjob-form__row--wide-narrow {
	grid-template-columns: 2.5fr 1fr;
}

.ifjob-form__row--narrow-wide {
	grid-template-columns: 1fr 2.5fr;
}

@media (max-width: 600px) {
	.ifjob-form__row,
	.ifjob-form__row--wide-narrow,
	.ifjob-form__row--narrow-wide {
		grid-template-columns: 1fr;
	}
}

/* --- Felder --- */

.ifjob-form__field {
	margin: 0 0 1.15rem;
}

.ifjob-form__field label {
	display: block;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small, 0.9rem);
	margin-bottom: 0.3rem;
}

.ifjob-form__field input:not([type='checkbox']):not([type='file']),
.ifjob-form__field select,
.ifjob-form__field textarea {
	width: 100%;
	padding: 0.7rem 0.9rem;
	border: 1.5px solid #e2e2e2;
	border-radius: var(--ifjob-radius);
	background: #fafafa;
	box-sizing: border-box;
	font: inherit;
	transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.ifjob-form__field input:not([type='checkbox']):not([type='file']):focus,
.ifjob-form__field select:focus,
.ifjob-form__field textarea:focus {
	outline: none;
	background: #fff;
	border-color: var(--ifjob-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--ifjob-accent) 22%, transparent);
}

.ifjob-form__field ::placeholder {
	color: #b5b5b5;
}

.ifjob-form__note {
	display: block;
	margin-top: 0.3rem;
	font-size: 0.8rem;
	color: #8a8a8a;
	font-weight: normal;
}

.ifjob-form__field--referrer[hidden] {
	display: none;
}

.ifjob-form__field--checkbox label {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	font-weight: normal;
	font-size: var(--wp--preset--font-size--small, 0.9rem);
	line-height: 1.5;
}

.ifjob-form__field--checkbox input {
	margin-top: 0.2rem;
	flex-shrink: 0;
	width: 1.1rem;
	height: 1.1rem;
	accent-color: var(--ifjob-accent);
}

/* --- Datei-Upload als Dropzone --- */

.ifjob-form__dropzone {
	display: block;
	text-align: center;
	border: 2px dashed #d5d5d5;
	border-radius: var(--ifjob-radius);
	padding: 1.5rem 1rem;
	cursor: pointer;
	background: #fafafa;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.ifjob-form__dropzone:hover,
.ifjob-form__dropzone:focus-within {
	border-color: var(--ifjob-accent);
	background: color-mix(in srgb, var(--ifjob-accent) 6%, #fff);
}

.ifjob-form__dropzone.has-files {
	border-style: solid;
	border-color: var(--ifjob-accent);
	background: color-mix(in srgb, var(--ifjob-accent) 8%, #fff);
}

.ifjob-form__dropzone input[type='file'] {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
}

.ifjob-form__dropzone-text {
	display: block;
	font-weight: bold;
}

.ifjob-form__dropzone-hint {
	display: block;
	color: #999;
	font-size: var(--wp--preset--font-size--small, 0.85rem);
	margin-top: 0.2rem;
}

.ifjob-form__dropzone-files {
	display: block;
	margin-top: 0.6rem;
	font-size: var(--wp--preset--font-size--small, 0.85rem);
	color: #666;
	word-break: break-word;
}

/* --- Navigation --- */

.ifjob-form__nav {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 1.5rem;
}

.ifjob-form__nav .ifjob-form__next,
.ifjob-form__nav .ifjob-form__submit {
	margin-left: auto;
}

.ifjob-form__nav .button {
	border-radius: 99px;
	padding: 0.65rem 1.6rem;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ifjob-form__nav .button:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.ifjob-form__prev {
	background: transparent !important;
	color: inherit !important;
	box-shadow: none !important;
	text-decoration: underline;
}

.ifjob-form__submit:disabled {
	opacity: 0.6;
	cursor: wait;
	transform: none !important;
}

/* Honeypot: für Menschen unsichtbar, für Bots ein normales Feld */
.ifjob-form__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* --- Statusmeldung --- */

.ifjob-form__message {
	font-weight: bold;
}

.ifjob-form__message:not(:empty) {
	margin-top: 1.25rem;
	padding: 0.9rem 1.1rem;
	border-radius: var(--ifjob-radius);
}

.ifjob-form__message.is-success {
	color: #1a7a2e;
	background: #eaf7ec;
}

.ifjob-form__message.is-error {
	color: #b32d2e;
	background: #fdeeee;
}

/* --- Modal (Formular wird bei Klick auf "Jetzt bewerben" nachgeladen) --- */

.ifjob-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	overflow-y: auto;
	padding: clamp(1rem, 4vh, 3rem) 1rem;
}

.ifjob-modal[hidden] {
	display: none;
}

.ifjob-modal__backdrop {
	position: fixed;
	inset: 0;
	background: rgba(20, 25, 15, 0.55);
	backdrop-filter: blur(2px);
}

.ifjob-modal__dialog {
	position: relative;
	z-index: 1;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	width: 100%;
	max-width: 760px;
	padding: clamp(1.25rem, 4vw, 2rem);
	animation: ifjob-modal-in 0.25s ease both;
}

@keyframes ifjob-modal-in {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.ifjob-modal__close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	width: 2.4rem;
	height: 2.4rem;
	border: 0;
	border-radius: 50%;
	background: #f1f1f1;
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease;
}

.ifjob-modal__close:hover {
	background: #e2e2e2;
}

.ifjob-modal__loading {
	text-align: center;
	color: #888;
	padding: 2rem 0;
	margin: 0;
}

/* Formular im Modal: keine doppelte Karten-Optik */
.ifjob-modal .ifjob-form {
	box-shadow: none;
	padding: 0;
	max-width: none;
}

body.ifjob-modal-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.ifjob-modal__dialog {
		animation: none;
	}
}

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
	.ifjob-form__step.is-active {
		animation: none;
	}
	.ifjob-form__nav .button:hover {
		transform: none;
	}
}
