/*
 * Stellenanzeige Map – Schnell-Bewerbungsformular
 *
 * FARBEN & ANPASSUNG
 * ──────────────────
 * Alle Farben sind über den WordPress-Customizer (Zusätzliches CSS)
 * oder ein Kind-Theme-Stylesheet überschreibbar.
 *
 * Haupt-Grün  :  #4a913f   → ändern via  .sam-form-header, .sam-file-btn, .sam-form-submit { background: … }
 * Formular-BG :  #aeae94   → ändern via  .sam-form-wrap { background: … }
 * Eingabe-Rand:  #4a913f   → ändern via  .sam-form-input, .sam-form-textarea { border-color: … }
 *
 * CSS-KLASSEN-ÜBERSICHT
 * ─────────────────────
 *   .sam-form-wrap            Äußerer Formular-Container (grauer Hintergrund, abgerundete Ecken)
 *   .sam-form-header          Grüne Pill-Kopfzeile mit Stellen-Titel + Standort
 *   .sam-form-header-stelle   Stellen-Titel (fett, weiß)
 *   .sam-form-header-standort Standort-Zeile ("in Ort", kleiner, weiß)
 *   .sam-bewerbungsformular   Das <form>-Element
 *   .sam-form-row             Jede Feldzeile
 *   .sam-form-row--files      Zeile mit den zwei Datei-Buttons (Grid)
 *   .sam-form-row--checkbox   Datenschutz-Zeile
 *   .sam-form-row--submit     Absende-Zeile
 *   .sam-has-error            Fehlerzustand auf .sam-form-row oder .sam-file-field
 *   .sam-sr-only              Visuell versteckte Labels (für Screenreader)
 *   .sam-form-input           Texteingaben (Pill-Form)
 *   .sam-form-textarea        Mehrzeiliges Textfeld
 *   .sam-form-row--files      Container der nebeneinander liegenden Upload-Buttons
 *   .sam-file-field           Container für einen Upload-Button + Hinweistext
 *   .sam-file-btn             Grüner Upload-Button (custom, versteckt den echten file-Input)
 *   .sam-file-plus            Das „+" Zeichen vor dem Button-Label
 *   .sam-file-hint            Kleiner Hinweistext unter dem Button ("PDF, JPEG etc")
 *   .sam-form-label-check     Label-Wrapper für die Datenschutz-Checkbox
 *   .sam-form-check           Die Checkbox self
 *   .sam-check-text           Text neben der Checkbox
 *   .sam-field-error          Fehlermeldung unter einem einzelnen Feld
 *   .sam-form-messages        Globale Statusmeldung (nach dem Absenden)
 *   .sam-form-messages--error Fehlerstatus der globalen Meldung
 *   .sam-form-submit          Absende-Button
 *   .sam-submit-text          Sichtbarer Button-Text
 *   .sam-submit-spinner       Lade-Spinner (reine CSS-Animation)
 *   .sam-is-loading           Zustand des Buttons während des Sendens
 *   .sam-hp-wrap              Honeypot (immer ausgeblendet)
 */

/* ── Honeypot ─────────────────────────────────────────────────────── */
.sam-hp-wrap {
	position: absolute;
	left: -9999px;
	overflow: hidden;
	pointer-events: none;
}

/* ── Screenreader-Only Labels ─────────────────────────────────────── */
.sam-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ── Äußerer Container ────────────────────────────────────────────── */
.sam-form-wrap {
	background: #aeae94;
	border-radius: 16px;
	padding: 0;
	margin: 0;
	box-sizing: border-box;
	display: block;
	width: 100%;
}

/* ── Kopf-Pill: Stellen-Titel + Standort ─────────────────────────── */
.sam-form-header {
	background: #4a913f;
	border-radius: 100px;
	padding: 14px 22px;
	text-align: center;
	margin-bottom: 18px;
}
.sam-form-header-stelle {
	display: block;
	color: #fff;
	font-weight: 700;
	font-size: 1.05em;
	line-height: 1.35;
}
.sam-form-header-standort {
	display: block;
	color: #fff;
	font-size: 0.85em;
	margin-top: 4px;
	opacity: 0.92;
}

/* ── Feldzeilen ───────────────────────────────────────────────────── */
.sam-form-row {
	margin-bottom: 12px;
}
.sam-form-row:last-child {
	margin-bottom: 0;
}

/* ── Eingabefelder (Pill) ─────────────────────────────────────────── */
.sam-form-input,
.sam-form-textarea {
	display: block;
	width: 100%;
	padding: 11px 18px;
	border: 2px solid #4a913f;
	border-radius: 100px;
	font-size: 0.95em;
	color: #4a913f;
	background: #fff;
	box-sizing: border-box;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.sam-form-input::placeholder,
.sam-form-textarea::placeholder {
	color: #4a913f;
	opacity: 1;
}
.sam-form-input:focus,
.sam-form-textarea:focus {
	outline: none;
}

/* Textarea: abgerundeter, nicht pill-förmig */
.sam-form-textarea {
	border-radius: 14px;
	resize: vertical;
	min-height: 120px;
}

/* ── Datei-Uploads: nebeneinander ─────────────────────────────────── */
.sam-form-row--files {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 12px;
}
@media (max-width: 459px) {
	.sam-form-row--files {
		grid-template-columns: 1fr;
	}
}
.sam-file-field {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 5px;
}

/* Button – gleicher Look wie Eingabefelder */
.sam-file-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #fff;
	color: #4a913f;
	border: 2px solid #4a913f;
	border-radius: 100px;
	padding: 9px 16px;
	font-size: 0.9em;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
	white-space: nowrap;
}
.sam-file-btn:hover {
	background: #4a913f;
	color: #fff;
}
.sam-file-plus {
	font-size: 1.25em;
	font-weight: 900;
	line-height: 1;
}
/* Echter file-Input verstecken */
.sam-file-btn input[type="file"] {
	display: none;
}
.sam-file-hint {
	font-size: 0.78em;
	color: #fff;
	padding-left: 4px;
}

/* Fehlerzustand file-field */
.sam-file-field.sam-has-error .sam-file-btn {
	outline: 2px solid #cc1818;
}

/* ── Datenschutz-Checkbox ─────────────────────────────────────────── */
.sam-form-row--checkbox {
	margin-top: 6px;
}
.sam-form-label-check {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	cursor: pointer;
}
.sam-form-check {
	/* Theme-Overrides: sicherstellen, dass die Checkbox sichtbar bleibt */
	display: inline-block !important;
	position: static !important;
	opacity: 1 !important;
	visibility: visible !important;
	appearance: checkbox !important;
	-webkit-appearance: checkbox !important;
	clip: auto !important;
	clip-path: none !important;
	transform: none !important;
	flex-shrink: 0;
	margin-top: 2px;
	accent-color: #4a913f;
	width: 16px;
	height: 16px;
	min-width: 16px;
	cursor: pointer;
}
.sam-check-text {
	font-size: 0.82em;
	color: #fff;
	line-height: 1.5;
}
.sam-check-text a {
	color: #fff;
	text-decoration: underline;
}

/* ── Fehlermeldungen ──────────────────────────────────────────────── */
.sam-field-error {
	display: none;
	font-size: 0.82em;
	color: #cc1111;
	margin-top: 4px;
	padding: 0 2px;
	font-weight: 600;
}
.sam-has-error .sam-field-error {
	display: block;
}
.sam-has-error .sam-form-input,
.sam-has-error .sam-form-textarea {
	border-color: #cc1111 !important;
}
.sam-has-error .sam-file-btn {
	border: 2px solid #cc1111 !important;
}
.sam-form-messages {
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 0.9em;
	margin-top: 10px;
}
.sam-form-messages:empty {
	display: none;
}
.sam-form-messages--error {
	background: rgba(180, 0, 0, 0.2);
	color: #fff;
}

/* ── Absende-Button ───────────────────────────────────────────────── */
.sam-form-row--submit {
	display: flex;
	justify-content: flex-end;
	margin-top: 18px;
}
.sam-form-submit {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #4a913f;
	color: #fff;
	border: none;
	border-radius: 100px;
	padding: 13px 30px;
	font-size: 1em;
	font-weight: 700;
	text-transform: none;
	cursor: pointer;
	transition: background 0.15s;
}
.sam-form-submit:hover {
	background: #356e2d;
}
.sam-form-submit:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

/* Lade-Spinner */
.sam-submit-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: sam-spin 0.7s linear infinite;
	flex-shrink: 0;
}
.sam-is-loading .sam-submit-spinner {
	display: inline-block;
}
@keyframes sam-spin {
	to { transform: rotate(360deg); }
}
