/**
 * TSG Recruitment Form — Social Vibes inspired UI
 * Designed for white container backgrounds (parent Elementor section).
 */

.tsg-recruitment-form {
	--tsg-primary: #7b61ff;
	--tsg-primary-dark: #6348e0;
	--tsg-primary-light: #f3f0ff;
	--tsg-accent: #ff6b9d;
	--tsg-gradient: linear-gradient(135deg, #7b61ff 0%, #9b7dff 45%, #ff6b9d 100%);
	--tsg-text: #1b1b2f;
	--tsg-text-muted: #64748b;
	--tsg-border: #e8ecf4;
	--tsg-border-focus: #7b61ff;
	--tsg-error: #ef4444;
	--tsg-error-bg: #fef2f2;
	--tsg-success: #10b981;
	--tsg-radius: 14px;
	--tsg-radius-sm: 10px;
	--tsg-btn-radius: 999px;
	--tsg-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

	margin: 0 auto;
	width: 100%;
	color: var(--tsg-text);
	font-family: inherit;
	line-height: 1.5;
}

/* Transparent on white parent — no extra card chrome */
.tsg-recruitment-form__form {
	position: relative;
}

.tsg-recruitment-form__honeypot {
	position: absolute;
	left: -9999px;
	height: 0;
	overflow: hidden;
}

/* ——— Compact progress ——— */
.tsg-recruitment-form__progress {
	margin-bottom: 1.5rem;
}

.tsg-recruitment-form__progress-bar {
	height: 6px;
	background: var(--tsg-border);
	border-radius: 3px;
	overflow: hidden;
}

.tsg-recruitment-form__progress-fill {
	height: 100%;
	background: var(--tsg-primary);
	border-radius: 3px;
	transition: width 0.3s ease;
}

.tsg-recruitment-form__progress-text {
	display: block;
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--tsg-text-muted);
}

/* ——— Steps ——— */
.tsg-recruitment-form__steps-wrap {
	position: relative;
	min-height: 200px;
}

.tsg-recruitment-form__step {
	display: none;
	opacity: 0;
	transform: translateX(12px);
}

.tsg-recruitment-form__step--active {
	display: block;
	animation: tsg-step-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.tsg-recruitment-form__step--leaving {
	display: block;
	animation: tsg-step-out 0.25s ease forwards;
}

@keyframes tsg-step-in {
	from {
		opacity: 0;
		transform: translateX(16px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

@keyframes tsg-step-out {
	from {
		opacity: 1;
		transform: translateX(0);
	}
	to {
		opacity: 0;
		transform: translateX(-12px);
	}
}

.tsg-recruitment-form__step-title {
	margin: 0 0 0.35rem;
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--tsg-text);
	line-height: 1.25;
}

.tsg-recruitment-form__step-subtitle {
	margin: 0 0 1.5rem;
	font-size: 0.95rem;
	color: var(--tsg-text-muted);
}

.tsg-recruitment-form__step-title--secondary {
	font-size: 1.15rem;
	margin-top: 1.25rem;
}

.tsg-recruitment-form__label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--tsg-text);
}

.tsg-recruitment-form__input {
	width: 100%;
	padding: 0.9rem 1.1rem;
	border: 1.5px solid var(--tsg-border);
	font-size: 1rem;
	box-sizing: border-box;
	border-radius: var(--tsg-radius-sm);
	background: #fff;
	color: var(--tsg-text);
	transition: border-color var(--tsg-transition);
}

.tsg-recruitment-form__input:hover {
	border-color: #d1d9e6;
}

.tsg-recruitment-form__input:focus {
	outline: none;
	border-color: var(--tsg-border-focus);
}

.tsg-recruitment-form__field {
	margin-bottom: 1.5rem;
}

.tsg-recruitment-form__field--error .tsg-recruitment-form__input,
.tsg-recruitment-form__field--error .iti input {
	border-color: var(--tsg-error);
	background: var(--tsg-error-bg);
}

.tsg-recruitment-form__field--error .tsg-recruitment-form__option-box {
	border-color: var(--tsg-error);
}

.tsg-recruitment-form__field.tsg-recruitment-form__field--shake {
	animation: tsg-shake 0.45s ease;
}

@keyframes tsg-shake {
	0%, 100% { transform: translateX(0); }
	20% { transform: translateX(-6px); }
	40% { transform: translateX(6px); }
	60% { transform: translateX(-4px); }
	80% { transform: translateX(4px); }
}

.tsg-recruitment-form__error {
	display: block;
	margin-top: 0.4rem;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--tsg-error);
	min-height: 1.2em;
}

/* Employment type cards */
.tsg-recruitment-form__options-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.tsg-recruitment-form__option {
	display: block;
	cursor: pointer;
	margin: 0;
}

.tsg-recruitment-form__option input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.tsg-recruitment-form__option-box {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.5rem;
	padding: 1.25rem 1.35rem;
	border: 2px solid var(--tsg-border);
	border-radius: var(--tsg-radius);
	background: #fff;
	transition: border-color var(--tsg-transition), background var(--tsg-transition);
	height: 100%;
	box-sizing: border-box;
}

.tsg-recruitment-form__option:hover .tsg-recruitment-form__option-box {
	border-color: #d1d9e6;
}

.tsg-recruitment-form__option input:focus-visible + .tsg-recruitment-form__option-box {
	outline: 2px solid var(--tsg-primary);
	outline-offset: 2px;
}

.tsg-recruitment-form__option input:checked + .tsg-recruitment-form__option-box {
	border-color: var(--tsg-primary);
	background: #fff;
}

.tsg-recruitment-form__option-icon {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f8fafc;
	color: var(--tsg-text-muted);
	transition: color var(--tsg-transition);
}

.tsg-recruitment-form__option input:checked + .tsg-recruitment-form__option-box .tsg-recruitment-form__option-icon {
	background: #f8fafc;
	color: var(--tsg-primary);
}

.tsg-recruitment-form__option-icon svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.tsg-recruitment-form__option-box strong {
	display: block;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--tsg-text);
}

.tsg-recruitment-form__option-box small {
	display: block;
	font-size: 0.8125rem;
	color: var(--tsg-text-muted);
	line-height: 1.4;
}

/* Yes/No & hours pills */
.tsg-recruitment-form__question {
	padding: 1rem 0;
	border-bottom: 1px solid var(--tsg-border);
}

.tsg-recruitment-form__question:last-of-type {
	border-bottom: none;
}

.tsg-recruitment-form__radio-group {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.tsg-recruitment-form__radio-pill {
	cursor: pointer;
	margin: 0;
}

.tsg-recruitment-form__radio-pill input {
	position: absolute;
	opacity: 0;
}

.tsg-recruitment-form__radio-pill span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 4rem;
	padding: 0.6rem 1.35rem;
	border: 1.5px solid var(--tsg-border);
	border-radius: 999px;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--tsg-text-muted);
	background: #fff;
	transition: all var(--tsg-transition);
}

.tsg-recruitment-form__radio-pill:hover span {
	border-color: #d1d9e6;
}

.tsg-recruitment-form__radio-pill input:checked + span {
	background: var(--tsg-primary);
	border-color: var(--tsg-primary);
	color: #fff;
}

.tsg-recruitment-form__radio-pill input:focus-visible + span {
	outline: 2px solid var(--tsg-primary);
	outline-offset: 2px;
}

.tsg-recruitment-form__hours-group .tsg-recruitment-form__radio-pill span {
	min-width: 3.5rem;
}

/* Age picker */
.tsg-recruitment-form__age-picker {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.35rem;
	background: #f8fafc;
	border: 1.5px solid var(--tsg-border);
	border-radius: var(--tsg-radius);
}

.tsg-recruitment-form__input--age {
	text-align: center;
	flex: 0 0 4rem;
	border: none !important;
	background: transparent !important;
	box-shadow: none !important;
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--tsg-primary);
	padding: 0.5rem;
}

.tsg-recruitment-form__input--age:focus {
	box-shadow: none !important;
}

.tsg-recruitment-form__age-btn {
	width: 44px;
	height: 44px;
	border: none;
	background: #fff;
	font-size: 1.35rem;
	font-weight: 600;
	color: var(--tsg-primary);
	cursor: pointer;
	border-radius: var(--tsg-radius-sm);
	transition: background var(--tsg-transition), transform 0.15s ease;
	line-height: 1;
}

.tsg-recruitment-form__age-btn:hover {
	background: var(--tsg-primary-light);
}

.tsg-recruitment-form__age-btn:active {
	transform: scale(0.95);
}

/* SMS consent */
.tsg-recruitment-form__consent {
	margin-top: 1.25rem;
	padding: 1rem 1.15rem;
	background: #f8fafc;
	border-radius: var(--tsg-radius-sm);
	border: 1px solid var(--tsg-border);
}

.tsg-recruitment-form__checkbox {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	cursor: pointer;
	font-size: 0.875rem;
	color: var(--tsg-text-muted);
	line-height: 1.5;
	margin: 0;
}

.tsg-recruitment-form__checkbox input {
	width: 1.15rem;
	height: 1.15rem;
	margin-top: 0.15rem;
	accent-color: var(--tsg-primary);
	flex-shrink: 0;
	cursor: pointer;
}

/* Navigation */
.tsg-recruitment-form__nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--tsg-border);
}

.tsg-recruitment-form__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.9rem 1.75rem;
	border: none;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	border-radius: var(--tsg-btn-radius);
	transition: opacity var(--tsg-transition), background var(--tsg-transition), border-color var(--tsg-transition);
	font-family: inherit;
	min-height: 48px;
	-webkit-appearance: none;
	appearance: none;
}

/* Theme/Elementor often style type=submit differently — keep nav buttons consistent */
.tsg-recruitment-form__nav .tsg-recruitment-form__btn,
.tsg-recruitment-form__nav button.tsg-recruitment-form__btn,
.tsg-recruitment-form__nav button[type="submit"].tsg-recruitment-form__btn {
	border-radius: var(--tsg-btn-radius);
}

.tsg-recruitment-form__btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

.tsg-recruitment-form__btn--primary {
	background: var(--tsg-primary);
	color: #fff;
	margin-left: auto;
}

.tsg-recruitment-form__btn--primary:hover:not(:disabled) {
	background: var(--tsg-primary-dark);
}

.tsg-recruitment-form__btn--secondary {
	background: #fff;
	color: var(--tsg-text);
	border: 1.5px solid var(--tsg-border);
}

.tsg-recruitment-form__btn--secondary:hover:not(:disabled) {
	border-color: var(--tsg-primary);
	color: var(--tsg-primary);
	background: var(--tsg-primary-light);
}

.tsg-recruitment-form__btn-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: tsg-spin 0.7s linear infinite;
	display: none;
}

.tsg-recruitment-form__btn.is-loading .tsg-recruitment-form__btn-spinner {
	display: inline-block;
}

.tsg-recruitment-form__btn.is-loading .tsg-recruitment-form__btn-text {
	opacity: 0.85;
}

@keyframes tsg-spin {
	to { transform: rotate(360deg); }
}

/* Success */
.tsg-recruitment-form__step--success.tsg-recruitment-form__step--active {
	animation: tsg-step-in 0.5s ease forwards;
}

.tsg-recruitment-form__success {
	text-align: center;
	padding: 2.5rem 1rem;
}

.tsg-recruitment-form__success-icon {
	width: 72px;
	height: 72px;
	margin: 0 auto 1.5rem;
	border-radius: 50%;
	background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	animation: tsg-success-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

.tsg-recruitment-form__success-icon svg {
	width: 36px;
	height: 36px;
	color: var(--tsg-success);
}

@keyframes tsg-success-pop {
	from {
		transform: scale(0);
		opacity: 0;
	}
	to {
		transform: scale(1);
		opacity: 1;
	}
}

.tsg-recruitment-form__success-title {
	margin: 0 0 0.75rem;
	font-size: 1.65rem;
	font-weight: 700;
	color: var(--tsg-text);
	letter-spacing: -0.02em;
}

.tsg-recruitment-form__success-message {
	margin: 0 auto;
	max-width: 420px;
	color: var(--tsg-text-muted);
	line-height: 1.65;
	font-size: 1rem;
}

/* intl-tel-input — do not override padding-left; library sets it for separateDialCode */
.tsg-recruitment-form .iti {
	width: 100%;
	display: block;
}

.tsg-recruitment-form .iti__country-container {
	z-index: 2;
}

.tsg-recruitment-form .iti input.iti__tel-input,
.tsg-recruitment-form .iti .tsg-recruitment-form__tel {
	width: 100%;
	padding-top: 0.9rem;
	padding-bottom: 0.9rem;
	padding-right: 1.1rem;
	border: 1.5px solid var(--tsg-border);
	border-radius: var(--tsg-radius-sm);
	font-size: 1rem;
	line-height: 1.4;
	background: #fff;
	color: var(--tsg-text);
}

.tsg-recruitment-form .iti input.iti__tel-input:focus,
.tsg-recruitment-form .iti .tsg-recruitment-form__tel:focus {
	outline: none;
	border-color: var(--tsg-border-focus);
}

.tsg-recruitment-form__field--error .iti input.iti__tel-input,
.tsg-recruitment-form__field--error .iti .tsg-recruitment-form__tel {
	border-color: var(--tsg-error);
	background: var(--tsg-error-bg);
}

/* Global notice */
.tsg-recruitment-form__notice {
	padding: 0.85rem 1rem;
	border-radius: var(--tsg-radius-sm);
	background: var(--tsg-error-bg);
	color: var(--tsg-error);
	font-size: 0.875rem;
	font-weight: 500;
	margin-bottom: 1rem;
	display: none;
}

.tsg-recruitment-form__notice.is-visible {
	display: block;
	animation: tsg-step-in 0.3s ease;
}

/* ——— Mobile: compact layout ——— */
@media (max-width: 640px) {
	.tsg-recruitment-form__progress {
		margin-bottom: 1rem;
	}

	.tsg-recruitment-form__progress-text {
		margin-top: 0.35rem;
		font-size: 0.8125rem;
	}

	.tsg-recruitment-form__steps-wrap {
		min-height: 0;
	}

	.tsg-recruitment-form__step-title {
		font-size: 1.2rem;
		margin-bottom: 0.25rem;
	}

	.tsg-recruitment-form__step-subtitle {
		font-size: 0.8125rem;
		margin-bottom: 1rem;
		line-height: 1.4;
	}

	.tsg-recruitment-form__step-title--secondary {
		font-size: 1rem;
		margin-top: 0.75rem;
	}

	.tsg-recruitment-form__field {
		margin-bottom: 1rem;
	}

	.tsg-recruitment-form__input {
		padding: 0.75rem 0.9rem;
		font-size: 16px; /* prevents iOS zoom on focus */
	}

	.tsg-recruitment-form__label {
		font-size: 0.8125rem;
		margin-bottom: 0.35rem;
	}

	/* Step 1: full-width stacked cards (readable tap targets) */
	.tsg-recruitment-form__step[data-step="1"] .tsg-recruitment-form__step-subtitle {
		margin-bottom: 0.75rem;
	}

	.tsg-recruitment-form__step[data-step="1"] .tsg-recruitment-form__field {
		margin-bottom: 0.5rem;
	}

	.tsg-recruitment-form__options-grid {
		grid-template-columns: 1fr;
		gap: 0.65rem;
	}

	.tsg-recruitment-form__option-box {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5rem;
		padding: 1rem 1.1rem;
		border-width: 2px;
		border-radius: var(--tsg-radius-sm);
	}

	.tsg-recruitment-form__option-icon {
		width: 40px;
		height: 40px;
		border-radius: 10px;
	}

	.tsg-recruitment-form__option-icon svg {
		width: 20px;
		height: 20px;
	}

	.tsg-recruitment-form__option-box strong {
		font-size: 1rem;
		line-height: 1.25;
	}

	.tsg-recruitment-form__option-box small {
		font-size: 0.8125rem;
		line-height: 1.35;
	}

	.tsg-recruitment-form__question {
		padding: 0.65rem 0;
	}

	.tsg-recruitment-form__radio-pill span {
		padding: 0.45rem 0.9rem;
		font-size: 0.8125rem;
		min-width: 0;
	}

	.tsg-recruitment-form__hours-group {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 0.4rem;
		width: 100%;
	}

	.tsg-recruitment-form__hours-group .tsg-recruitment-form__radio-pill {
		flex: 1;
	}

	.tsg-recruitment-form__hours-group .tsg-recruitment-form__radio-pill span {
		width: 100%;
		padding-left: 0.25rem;
		padding-right: 0.25rem;
	}

	.tsg-recruitment-form__age-picker {
		max-width: 100%;
	}

	.tsg-recruitment-form__age-btn {
		width: 40px;
		height: 40px;
	}

	.tsg-recruitment-form__consent {
		padding: 0.75rem 0.85rem;
	}

	.tsg-recruitment-form__checkbox {
		font-size: 0.8125rem;
	}

	.tsg-recruitment-form .iti input.iti__tel-input,
	.tsg-recruitment-form .iti .tsg-recruitment-form__tel {
		padding-top: 0.75rem;
		padding-bottom: 0.75rem;
		font-size: 16px;
	}

	.tsg-recruitment-form__nav {
		margin-top: 1.25rem;
		padding-top: 1rem;
		gap: 0.5rem;
	}

	.tsg-recruitment-form__btn {
		padding: 0.75rem 1.25rem;
		min-height: 44px;
		font-size: 0.9375rem;
	}

	.tsg-recruitment-form__success {
		padding: 1.5rem 0.5rem;
	}

	.tsg-recruitment-form__success-icon {
		width: 56px;
		height: 56px;
		margin-bottom: 1rem;
	}

	.tsg-recruitment-form__success-title {
		font-size: 1.35rem;
	}
}

@media (max-width: 480px) {
	.tsg-recruitment-form__nav {
		flex-direction: column-reverse;
	}

	.tsg-recruitment-form__btn--primary,
	.tsg-recruitment-form__btn--secondary {
		width: 100%;
		margin-left: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tsg-recruitment-form__step--active,
	.tsg-recruitment-form__step--leaving,
	.tsg-recruitment-form__field--shake,
	.tsg-recruitment-form__success-icon {
		animation: none;
		opacity: 1;
		transform: none;
	}
}
