/*
 * The public submission form (§S).
 *
 * Loaded only on the form page. No media queries — jobs-mobile.css owns those.
 */

.sjb-formpage {
	max-width: var(--sjb-form-max);
	margin: 0 auto;
	padding: 32px 20px 64px;
}

.sjb-formpage__head {
	margin-bottom: 26px;
}

.sjb-formpage__title {
	margin: 0 0 8px;
	font-size: 30px;
}

.sjb-formpage__lede {
	margin: 0;
	color: var(--sjb-text-dim);
}

.sjb-formpage__intro {
	margin-bottom: 10px;
}

/* ===================================================================================
 * Sections
 * =================================================================================== */

.sjb-form__section {
	margin: 0 0 18px;
	padding: 20px;
	border: 1px solid var(--sjb-border);
	border-radius: var(--sjb-radius-card);
	background: var(--sjb-surface);
}

/* A <fieldset> brings its own default box that has to go before the one above shows. */
fieldset.sjb-form__section {
	min-width: 0;
}

.sjb-form__legend {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 4px;
	padding: 0;
	font-size: 17px;
	font-weight: 650;
	color: var(--sjb-text);
}

.sjb-form__step {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--sjb-accent-soft);
	color: var(--sjb-accent-text);
	font-size: 12px;
	font-weight: 700;
}

/*
 * §S: the optional section is collapsed by default. A native <details> — keyboard-operable,
 * correctly announced, and working with JavaScript off, none of which a scripted panel gives
 * for free.
 */
details.sjb-form__section > summary {
	cursor: pointer;
	list-style: none;
}

details.sjb-form__section > summary::-webkit-details-marker {
	display: none;
}

details.sjb-form__section > summary::after {
	content: "";
	width: 8px;
	height: 8px;
	margin-left: auto;
	border-right: 2px solid var(--sjb-text-faint);
	border-bottom: 2px solid var(--sjb-text-faint);
	transform: rotate(45deg) translateY(-2px);
	transition: transform 0.15s ease;
}

details.sjb-form__section[open] > summary::after {
	transform: rotate(-135deg) translateY(-2px);
}

.sjb-form__hint {
	margin: 0 0 16px;
	font-size: 13px;
	color: var(--sjb-text-faint);
}

/* ===================================================================================
 * Fields
 * =================================================================================== */

.sjb-field {
	margin-bottom: 16px;
}

.sjb-field:last-child {
	margin-bottom: 0;
}

.sjb-form .sjb-field__label {
	display: block;
	margin-bottom: 5px;
	font-size: 13px;
	font-weight: 600;
	color: var(--sjb-text-dim);
}

.sjb-req {
	color: var(--sjb-accent-text);
}

.sjb-field__hint {
	margin: 5px 0 0;
	font-size: 12px;
	color: var(--sjb-text-faint);
}

/* §AE: the message is bound to its field with aria-describedby, and it is never colour alone. */
.sjb-field__error {
	display: flex;
	align-items: flex-start;
	gap: 5px;
	margin: 6px 0 0;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--sjb-danger);
}

.sjb-field__error::before {
	content: "!";
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 15px;
	height: 15px;
	margin-top: 1px;
	border-radius: 50%;
	background: var(--sjb-danger);
	color: var(--sjb-bg);
	font-size: 10px;
	font-weight: 700;
}

.sjb-form [aria-invalid="true"] {
	border-color: var(--sjb-danger);
	background: var(--sjb-danger-soft);
}

.sjb-grid2 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.sjb-grid3 {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
}

.sjb-checkgrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 4px;
}

.sjb-check-row {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	font-size: 13.5px;
	color: var(--sjb-text-dim);
	cursor: pointer;
}

.sjb-check-row input {
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
	margin-top: 1px;
	accent-color: var(--sjb-accent);
}

.sjb-check-row--tight {
	margin-top: 7px;
	font-size: 13px;
}

.sjb-consent-note {
	font-size: 13.5px;
	color: var(--sjb-text-dim);
	margin: 0;
}

.sjb-radio {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-right: 16px;
	font-size: 13.5px;
	color: var(--sjb-text-dim);
	cursor: pointer;
}

.sjb-radio input {
	accent-color: var(--sjb-accent);
}

.sjb-file {
	display: block;
	width: 100%;
	padding: 9px;
	border: 1px dashed var(--sjb-border-strong);
	border-radius: var(--sjb-radius);
	background: var(--sjb-surface-2);
	color: var(--sjb-text-dim);
	font: inherit;
	font-size: 13px;
}

/* ===================================================================================
 * The full-description rich text editor
 *
 * Progressive enhancement: `.sjb-richtext__field` is a plain textarea and is the thing that
 * actually submits. With JavaScript off, the toolbar stays `hidden` and the reader just types
 * into it — the field this replaces since 2026-08-01. With JavaScript on, jobs-form-richtext.js
 * hides the textarea, inserts a contenteditable region next to it and keeps the two in sync, so
 * `sjb_clean_prose()`'s existing allow-list (p, br, strong, b, em, i, ul, ol, li) is the only
 * thing that ever reaches the database either way.
 * =================================================================================== */

.sjb-richtext {
	border: 1px solid var(--sjb-border);
	border-radius: var(--sjb-radius);
	overflow: hidden;
}

.sjb-richtext__toolbar {
	display: flex;
	gap: 2px;
	padding: 5px;
	border-bottom: 1px solid var(--sjb-border);
	background: var(--sjb-surface-2);
}

.sjb-richtext__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border: 1px solid transparent;
	border-radius: 6px;
	background: none;
	color: var(--sjb-text-dim);
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}

.sjb-richtext__btn:hover {
	background: var(--sjb-surface);
	color: var(--sjb-text);
}

.sjb-richtext__btn.is-active {
	border-color: var(--sjb-accent-line);
	background: var(--sjb-accent-soft);
	color: var(--sjb-accent-text);
}

.sjb-richtext .sjb-richtext__field {
	border: 0;
	border-radius: 0;
}

/* The `hidden` attribute jobs-form-richtext.js sets once it has replaced this textarea with
   the contenteditable region below has no `!important` in the UA stylesheet, so it loses to
   any author rule that touches `display` — including the block one three lines up. Restated
   explicitly, after it, so the textarea actually disappears instead of sitting underneath the
   editor and quietly stealing the next click. */
.sjb-richtext__field[hidden] {
	display: none;
}

.sjb-richtext__editor {
	min-height: 140px;
	max-height: 360px;
	padding: 9px 12px;
	background: var(--sjb-surface-2);
	color: var(--sjb-text);
	font: inherit;
	font-size: 14px;
	line-height: 1.5;
	overflow-y: auto;
}

.sjb-richtext__editor p {
	margin: 0 0 0.8em;
}

.sjb-richtext__editor p:last-child {
	margin-bottom: 0;
}

.sjb-richtext__editor ul,
.sjb-richtext__editor ol {
	margin: 0 0 0.8em;
	padding-left: 22px;
}

/* ⚠️ The honeypot. Hidden from sight and from the tab order, but not `type="hidden"` —
   a bot that skips hidden inputs would sail straight past it. */
.sjb-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ===================================================================================
 * Employer tiles (§T)
 * =================================================================================== */

.sjb-tiles {
	min-width: 0;
	margin: 0 0 16px;
	padding: 0;
	border: 0;
}

.sjb-tiles__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	margin-top: 7px;
}

.sjb-tile {
	position: relative;
	display: block;
	cursor: pointer;
}

/* The radio itself is what carries the state, the semantics and the keyboard behaviour;
   it is simply moved out of sight rather than replaced by a div. */
.sjb-tile__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.sjb-tile__body {
	display: flex;
	flex-direction: column;
	gap: 5px;
	height: 100%;
	padding: 14px;
	border: 1px solid var(--sjb-border);
	border-radius: var(--sjb-radius-card);
	background: var(--sjb-surface-2);
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.sjb-tile__input:checked + .sjb-tile__body {
	border-color: var(--sjb-accent-line);
	background: var(--sjb-accent-soft);
}

.sjb-tile__input:focus-visible + .sjb-tile__body {
	outline: 2px solid var(--sjb-focus);
	outline-offset: 2px;
}

.sjb-tile__icon {
	color: var(--sjb-text-faint);
}

.sjb-tile__input:checked + .sjb-tile__body .sjb-tile__icon {
	color: var(--sjb-accent-text);
}

.sjb-tile__name {
	font-size: 14px;
	font-weight: 650;
	color: var(--sjb-text);
}

.sjb-tile__text {
	font-size: 12px;
	color: var(--sjb-text-faint);
	line-height: 1.4;
}

/*
 * Which extra field is shown follows the chosen tile. `:has()` does it with no JavaScript at
 * all; jobs-form-map.js also sets a class as a fallback for browsers without it. Either way
 * the inputs are always present in the form, so nothing depends on this working.
 */
.sjb-employerfields > [data-sjb-when] {
	display: none;
}

.sjb-form:has(.sjb-tile__input[value="company"]:checked) [data-sjb-when="company"],
.sjb-form:has(.sjb-tile__input[value="private"]:checked) [data-sjb-when="private"],
.sjb-form:has(.sjb-tile__input[value="anonymous"]:checked) [data-sjb-when="anonymous"] {
	display: block;
}

.sjb-form.sjb-employer-company [data-sjb-when="company"],
.sjb-form.sjb-employer-private [data-sjb-when="private"],
.sjb-form.sjb-employer-anonymous [data-sjb-when="anonymous"] {
	display: block;
}

/* ===================================================================================
 * The location picker (§U)
 * =================================================================================== */

.sjb-combo {
	position: relative;
	display: flex;
	align-items: center;
}

.sjb-combo__icon {
	position: absolute;
	left: 11px;
	color: var(--sjb-text-faint);
	pointer-events: none;
}

.sjb-combo__input {
	padding-left: 36px;
}

.sjb-combo__list {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 4px);
	/* Above everything Leaflet puts in its own stacking range — not just the panes (tiles
	   200, the canton overlay 400, the marker 600, popups 700) but its zoom control too
	   (`.leaflet-top`/`.leaflet-bottom`, z-index 1000). `.sjb-formmap` is a plain static box
	   with no stacking context of its own, so those elements compete with this list directly
	   instead of being contained beneath it — 1000 alone tied the zoom control and lost the
	   tie-break to DOM order, leaving it painted over the suggestions. */
	z-index: 1100;
	max-height: 260px;
	margin: 0;
	padding: 4px;
	overflow-y: auto;
	list-style: none;
	background: var(--sjb-surface);
	border: 1px solid var(--sjb-border-strong);
	border-radius: var(--sjb-radius);
	box-shadow: var(--sjb-shadow-lg);
}

.sjb-combo__list[hidden] {
	display: none;
}

.sjb-combo__option {
	padding: 9px 11px;
	border-radius: 6px;
	font-size: 13.5px;
	color: var(--sjb-text-dim);
	cursor: pointer;
}

.sjb-combo__option[aria-selected="true"],
.sjb-combo__option:hover {
	background: var(--sjb-accent-soft);
	color: var(--sjb-text);
}

.sjb-combo__option small {
	display: block;
	font-size: 11.5px;
	color: var(--sjb-text-faint);
}

.sjb-formmap {
	margin-top: 12px;
}

.sjb-formmap[hidden] {
	display: none;
}

.sjb-formmap__canvas {
	height: 260px;
	border: 1px solid var(--sjb-border);
	border-radius: var(--sjb-radius-card);
	overflow: hidden;
}

.sjb-formmap__note {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 8px 0 0;
	font-size: 12.5px;
	color: var(--sjb-text-faint);
}

.sjb-precision {
	min-width: 0;
	margin: 12px 0 0;
	padding: 0;
	border: 0;
}

.sjb-precision legend {
	padding: 0;
	margin-bottom: 4px;
}

/* ===================================================================================
 * Submit, errors, and the thank-you page
 * =================================================================================== */

.sjb-form__submit {
	margin-top: 22px;
	text-align: center;
}

.sjb-form__note {
	margin: 10px 0 0;
	font-size: 12.5px;
	color: var(--sjb-text-faint);
}

.sjb-formerrors {
	margin: 0 0 20px;
	padding: 16px 18px;
	border: 1px solid var(--sjb-danger);
	border-radius: var(--sjb-radius-card);
	background: var(--sjb-danger-soft);
}

.sjb-formerrors__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 8px;
	font-size: 15px;
	color: var(--sjb-danger);
}

.sjb-formerrors__list {
	margin: 0;
	padding-left: 20px;
	font-size: 13.5px;
	color: var(--sjb-text-dim);
}

.sjb-formerrors__list a {
	color: var(--sjb-text);
}

.sjb-formerrors p {
	margin: 0;
	color: var(--sjb-text-dim);
}

.sjb-formdone {
	max-width: 560px;
	margin: 40px auto;
	padding: 34px 28px;
	border: 1px solid var(--sjb-accent-line);
	border-radius: var(--sjb-radius-card);
	background: var(--sjb-accent-soft);
	text-align: center;
}

.sjb-formdone__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 62px;
	height: 62px;
	margin-bottom: 14px;
	border-radius: 50%;
	background: var(--sjb-accent);
	color: var(--sjb-text-on-accent);
}

.sjb-formdone__title {
	margin: 0 0 10px;
	font-size: 22px;
}

.sjb-formdone__text {
	color: var(--sjb-text-dim);
}

.sjb-formdone__ref code {
	padding: 3px 9px;
	border-radius: 6px;
	background: var(--sjb-surface);
	font-family: var(--sjb-font-num);
	font-size: 14px;
	letter-spacing: 0.08em;
}

.sjb-formdone__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 20px 0 0;
}
