/**
 * Block: wp-career-board/job-form (multi-step wizard)
 *
 * 100% token-driven — every spacing, color, radius, shadow, transition
 * resolves to a `--wcb-*` token from assets/css/frontend-tokens.css.
 * Matches the premium-feel pattern shipped on `job-form-simple`:
 *   - Transparent block container (no card chrome)
 *   - Hairline section dividers + uppercase eyebrow labels
 *   - Inputs do the visual work
 *   - Primary CTA with shadow ramp + translateY(-1px) lift on hover
 */

/* ── Step indicator (chip-style, kept functional + clean) ────────────── */
.wcb-steps {
	display: flex;
	align-items: center;
	gap: 0;
	margin-bottom: var(--wcb-space-3xl);
	padding: 0;
	list-style: none;
	flex-wrap: wrap;
}

.wcb-step {
	display: flex;
	align-items: center;
	gap: var(--wcb-space-sm);
	padding: var(--wcb-space-sm) var(--wcb-space-lg);
	border-radius: var(--wcb-radius-full);
	font-size: var(--wcb-text-sm);
	font-weight: var(--wcb-font-medium);
	color: var(--wcb-text-tertiary);
	background: transparent;
	white-space: nowrap;
	transition: background var(--wcb-transition-snappy), color var(--wcb-transition-snappy);
}

.wcb-step__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wcb-space-xl);
	height: var(--wcb-space-xl);
	border-radius: var(--wcb-radius-full);
	font-size: var(--wcb-text-xs);
	font-weight: var(--wcb-font-bold);
	background: var(--wcb-bg-subtle);
	color: var(--wcb-text-secondary);
	flex-shrink: 0;
	transition: background var(--wcb-transition-snappy), color var(--wcb-transition-snappy);
}

.wcb-step--active {
	background: var(--wcb-primary, #2563eb);
	color: var(--wcb-on-primary, #fff);
	font-weight: var(--wcb-font-semibold);
}

.wcb-step--active .wcb-step__num {
	background: rgba(255, 255, 255, 0.2);
	color: var(--wcb-on-primary, #fff);
}

.wcb-step--done {
	background: var(--wcb-success-bg-soft);
	color: var(--wcb-success-fg);
}

.wcb-step--done .wcb-step__num {
	background: var(--wcb-success);
	color: var(--wcb-on-primary, #fff);
	font-size: 0;
}

.wcb-step--done .wcb-step__num::before {
	content: '\2713';
	font-size: var(--wcb-text-xs);
}

.wcb-step__connector {
	flex: 1;
	min-width: var(--wcb-space-sm);
	height: 1px;
	background: var(--wcb-border, #e2e8f0);
}

/* ── Form step panel — transparent, no card chrome ───────────────────── */
.wcb-form-step {
	display: none;
	flex-direction: column;
	gap: var(--wcb-space-3xl);
	padding: 0;
	background: transparent;
	border: 0;
	box-shadow: none;
}

.wcb-form-step--show {
	display: flex;
}

/* (0,2,1) prefix beats the parent `.wcb-form-step--show { display: flex }`
 * rule above on specificity. */
[class*="wp-block-wp-career-board"] .wcb-form-steps--hidden {
	display: none;
}

/* Section title behaves like the simple-form eyebrow. */
.wcb-form-step__title {
	font-size: var(--wcb-text-xs);
	font-weight: var(--wcb-font-bold);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wcb-text-tertiary, #94a3b8);
	margin: 0 0 var(--wcb-space-xs);
	padding: 0;
	border: 0;
}

/* ── Fields ──────────────────────────────────────────────────────────── */
.wcb-form-field {
	display: flex;
	flex-direction: column;
	gap: var(--wcb-space-xs);
	min-width: 0;
}

.wcb-form-label {
	font-size: var(--wcb-text-sm);
	font-weight: var(--wcb-font-semibold);
	color: var(--wcb-contrast, #0f172a);
	display: flex;
	align-items: center;
	gap: var(--wcb-space-xs);
}

.wcb-required {
	color: var(--wcb-danger);
	font-weight: var(--wcb-font-bold);
	margin-inline-start: 2px; /* hairline gap */
}

.wcb-form-hint {
	font-size: var(--wcb-text-xs);
	color: var(--wcb-text-tertiary);
}

.wcb-field {
	width: 100%;
	padding: var(--wcb-space-md) var(--wcb-space-lg);
	border: 1px solid var(--wcb-border, #e2e8f0);
	border-radius: var(--wcb-radius-md);
	font-size: var(--wcb-text-base);
	line-height: var(--wcb-leading-tight);
	font-family: inherit;
	color: var(--wcb-contrast, #0f172a);
	background: var(--wcb-base, #fff);
	transition: border-color var(--wcb-transition-fast), box-shadow var(--wcb-transition-fast), background var(--wcb-transition-fast);
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	min-width: 0;
}

.wcb-field:hover {
	border-color: var(--wcb-text-tertiary, #94a3b8);
}

/* No `outline: none` on plain `:focus` - modern browsers default to no
 * visible focus ring on mouse click and `:focus-visible` below adds an
 * explicit outline for keyboard users. Older browsers without
 * `:focus-visible` keep the browser-default outline, which is the
 * correct fallback. */
.wcb-field:focus {
	border-color: var(--wcb-primary, #2563eb);
	box-shadow: var(--wcb-shadow-focus);
}

.wcb-field:focus-visible {
	outline: 2px solid var(--wcb-primary, #2563eb);
	outline-offset: 2px;
	border-color: var(--wcb-primary, #2563eb);
	box-shadow: var(--wcb-shadow-focus);
}

.wcb-field::placeholder {
	color: var(--wcb-text-tertiary);
	opacity: 0.7;
}

textarea.wcb-field {
	resize: vertical;
	min-height: 200px; /* component-specific dimension */
	line-height: var(--wcb-leading-normal);
}

/* ── 2-col grid for paired fields / taxonomy selects ─────────────────── */
.wcb-form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wcb-space-lg);
	align-items: start;
}

/* ── 4-col salary row (currency, min, max, period) — matches simple form ─*/
.wcb-salary-row {
	display: grid;
	grid-template-columns: 1.4fr minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
	gap: var(--wcb-space-sm);
	align-items: stretch;
}

@media (max-width: 720px) {
	.wcb-salary-row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.wcb-field-group {
	display: flex;
	flex-direction: column;
	gap: var(--wcb-space-xs);
	min-width: 0;
}

.wcb-field-group__label {
	font-size: var(--wcb-text-xs);
	font-weight: var(--wcb-font-medium);
	color: var(--wcb-text-secondary);
}

/* ── Checkbox ────────────────────────────────────────────────────────── */
.wcb-checkbox-label {
	display: inline-flex;
	align-items: center;
	gap: var(--wcb-space-sm);
	cursor: pointer;
	font-size: var(--wcb-text-base);
	font-weight: var(--wcb-font-medium);
	color: var(--wcb-contrast, #0f172a);
	user-select: none;
}

.wcb-checkbox-label input[type="checkbox"] {
	width: var(--wcb-icon-md);
	height: var(--wcb-icon-md);
	cursor: pointer;
	flex-shrink: 0;
	accent-color: var(--wcb-primary, #2563eb);
	margin: 0;
}

/* ── Nav row ─────────────────────────────────────────────────────────── */
.wcb-form-nav {
	display: flex;
	align-items: center;
	gap: var(--wcb-space-md);
	padding-top: var(--wcb-space-sm);
	border: 0;
}

.wcb-form-nav--right {
	justify-content: flex-end;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.wcb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--wcb-space-xs);
	min-width: 160px; /* component-specific button width */
	padding: var(--wcb-space-md) var(--wcb-space-2xl);
	border: 0;
	border-radius: var(--wcb-radius-md);
	font-size: var(--wcb-text-md);
	font-weight: var(--wcb-font-semibold);
	font-family: inherit;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: transform var(--wcb-transition-fast), box-shadow var(--wcb-transition-fast), background var(--wcb-transition-fast);
	white-space: nowrap;
	box-sizing: border-box;
	text-decoration: none;
}

.wcb-btn--primary {
	background: var(--wcb-primary, #2563eb);
	color: var(--wcb-on-primary, #fff);
	box-shadow: var(--wcb-shadow-sm);
	margin-inline-start: auto;
}

.wcb-btn--primary:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: var(--wcb-shadow-md);
}

.wcb-btn--primary:active:not(:disabled) {
	transform: translateY(0);
}

.wcb-btn--ghost {
	background: transparent;
	color: var(--wcb-text-secondary);
	box-shadow: none;
	border: 1px solid var(--wcb-border, #e2e8f0);
}

.wcb-btn--ghost:hover:not(:disabled) {
	background: var(--wcb-bg-subtle);
	color: var(--wcb-contrast, #0f172a);
}

.wcb-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ── Spinner ─────────────────────────────────────────────────────────── */
.wcb-spinner {
	animation: wcb-spin 0.75s linear infinite;
}

@keyframes wcb-spin {
	from { transform: rotate(0deg); }
	to   { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.wcb-spinner {
		animation: none !important;
	}
}

.wcb-btn__spinner {
	display: none;
	align-items: center;
	gap: var(--wcb-space-xs);
}

.wcb-is-submitting .wcb-btn__label {
	display: none;
}

.wcb-is-submitting .wcb-btn__spinner {
	display: inline-flex;
}

/* ── Preview card (kept as a defined panel — distinct from form sections) ─*/
.wcb-preview-card {
	display: flex;
	flex-direction: column;
	gap: var(--wcb-space-lg);
	padding: var(--wcb-space-2xl);
	border: 1px solid var(--wcb-border, #e2e8f0);
	border-radius: var(--wcb-radius-xl);
	background: var(--wcb-bg-subtle);
}

.wcb-preview-card__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--wcb-space-lg);
}

.wcb-preview-card__title-wrap {
	flex: 1;
	min-width: 0;
}

.wcb-preview-card__title {
	font-size: var(--wcb-text-lg);
	font-weight: var(--wcb-font-bold);
	color: var(--wcb-contrast, #0f172a);
	margin: 0 0 var(--wcb-space-xs);
}

.wcb-preview-card__badges {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wcb-space-xs);
}

.wcb-preview-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wcb-space-md) var(--wcb-space-2xl);
	padding-top: var(--wcb-space-md);
	border-top: 1px solid var(--wcb-border, #e2e8f0);
}

.wcb-preview-card .wcb-cbadge {
	display: none;
	text-transform: capitalize;
}

.wcb-preview-card .wcb-cbadge--show {
	display: inline-flex;
}

.wcb-preview-card__company {
	display: none;
	font-size: var(--wcb-text-base);
	color: var(--wcb-text-secondary);
	font-weight: var(--wcb-font-medium);
	margin: 0;
}

.wcb-preview-card__company--show {
	display: block;
}

.wcb-preview-meta-item {
	display: none;
	align-items: center;
	gap: var(--wcb-space-xs);
	font-size: var(--wcb-text-base);
	color: var(--wcb-text-secondary);
}

.wcb-preview-meta-item--show {
	display: inline-flex;
}

.wcb-preview-meta-item__url {
	word-break: break-all;
	font-size: var(--wcb-text-xs);
}

/* ── Notice + error ──────────────────────────────────────────────────── */
.wcb-form-notice {
	font-size: var(--wcb-text-base);
	color: var(--wcb-text-secondary);
	background: var(--wcb-bg-subtle);
	border: 1px solid var(--wcb-border, #e2e8f0);
	border-radius: var(--wcb-radius-md);
	padding: var(--wcb-space-md) var(--wcb-space-lg);
	margin: 0;
}

.wcb-form-error {
	display: none;
	color: var(--wcb-danger);
	background: var(--wcb-danger-bg);
	border: 1px solid var(--wcb-danger-border);
	border-radius: var(--wcb-radius-md);
	padding: var(--wcb-space-md) var(--wcb-space-lg);
	font-size: var(--wcb-text-base);
	font-weight: var(--wcb-font-medium);
	margin: 0;
}

.wcb-form-error--show {
	display: block;
}

/* ── Label row (label + AI button side by side) ──────────────────────── */
.wcb-form-label-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wcb-space-md);
}

.wcb-ai-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--wcb-space-xs);
	padding: var(--wcb-space-xs) var(--wcb-space-md);
	font-size: var(--wcb-text-xs);
	font-weight: var(--wcb-font-semibold);
	color: var(--wcb-primary, #2563eb);
	background: var(--wcb-primary-soft);
	border: 1px solid var(--wcb-info-border);
	border-radius: var(--wcb-radius-full);
	cursor: pointer;
	transition: background var(--wcb-transition-snappy);
}

.wcb-ai-btn:hover {
	background: var(--wcb-primary-ring);
}

.wcb-ai-btn:disabled {
	opacity: 0.6;
	cursor: wait;
}

/* ── Credit banner ───────────────────────────────────────────────────── */
.wcb-credit-banner {
	display: none;
	align-items: center;
	gap: var(--wcb-space-md);
	padding: var(--wcb-space-md) var(--wcb-space-lg);
	border-radius: var(--wcb-radius-md);
	font-size: var(--wcb-text-sm);
	margin-bottom: var(--wcb-space-xl);
	background: var(--wcb-info-bg-soft);
	border: 1px solid var(--wcb-info-border);
	color: var(--wcb-info-fg);
}

.wcb-credit-banner--show {
	display: flex;
}

.wcb-credit-banner--warn {
	background: var(--wcb-warning-bg-soft);
	border-color: var(--wcb-warning-border);
	color: var(--wcb-warning-fg);
}

.wcb-credit-banner__link {
	font-weight: var(--wcb-font-semibold);
	color: inherit;
	white-space: nowrap;
}

/* `.wcb-hidden` lives in `assets/css/frontend-components.css` globally. */

/* ── Success ─────────────────────────────────────────────────────────── */
.wcb-form-success {
	display: none;
	align-items: flex-start;
	gap: var(--wcb-space-lg);
	padding: var(--wcb-space-2xl);
	background: var(--wcb-success-bg-soft);
	border: 1px solid var(--wcb-success-border);
	border-radius: var(--wcb-radius-xl);
	margin-bottom: var(--wcb-space-2xl);
}

.wcb-form-success--show {
	display: flex;
}

.wcb-form-success__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--wcb-space-3xl);
	height: var(--wcb-space-3xl);
	border-radius: var(--wcb-radius-full);
	background: var(--wcb-success);
	color: var(--wcb-on-primary, #fff);
	font-size: var(--wcb-text-md);
	font-weight: var(--wcb-font-bold);
	flex-shrink: 0;
}

.wcb-form-success__icon svg {
	width: 22px;
	height: 22px;
}

.wcb-form-success__title {
	font-size: var(--wcb-text-md);
	font-weight: var(--wcb-font-bold);
	color: var(--wcb-success-fg);
	margin: 0 0 var(--wcb-space-xs);
}

.wcb-form-success__link {
	display: inline-block;
	font-size: var(--wcb-text-base);
	color: var(--wcb-success-fg);
	font-weight: var(--wcb-font-semibold);
	text-decoration: underline;
	margin-inline-end: var(--wcb-space-md);
}

.wcb-form-success__reset {
	display: inline-flex;
	align-items: center;
	padding: var(--wcb-space-sm) var(--wcb-space-lg);
	margin-top: var(--wcb-space-sm);
	background: transparent;
	border: 1.5px solid var(--wcb-success-border);
	border-radius: var(--wcb-radius-md);
	color: var(--wcb-success-fg);
	font-size: var(--wcb-text-base);
	font-weight: var(--wcb-font-semibold);
	cursor: pointer;
	transition: background var(--wcb-transition-fast), color var(--wcb-transition-fast);
}

.wcb-form-success__reset:hover {
	background: var(--wcb-success);
	color: var(--wcb-on-primary, #fff);
}

.wcb-form-success__reset:focus-visible {
	background: var(--wcb-success);
	color: var(--wcb-on-primary, #fff);
	outline: 2px solid var(--wcb-primary, #2563eb);
	outline-offset: 2px;
}

@media ( max-width: 640px ) {
	.wcb-form-success {
		flex-direction: column;
		align-items: stretch;
	}

	.wcb-form-success__reset {
		width: 100%;
		justify-content: center;
	}
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
	.wcb-step__label {
		display: none;
	}

	.wcb-step {
		padding: var(--wcb-space-xs) var(--wcb-space-md);
	}
}

@media (max-width: 640px) {
	.wcb-form-grid,
	.wcb-salary-row {
		grid-template-columns: minmax(0, 1fr);
	}

	.wcb-form-nav {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.wcb-btn {
		width: 100%;
		min-width: 0;
	}

	.wcb-btn--primary {
		margin-inline-start: 0;
	}
}

/* ── Honeypot (anti-spam) ────────────────────────────────────────────── */
.wcb-hp-wrap {
	position: absolute;
	left: -10000px; /* off-screen honeypot */
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
