/* =========================================================================
   Suchprofil card – styles for the onOffice form template "suchprofil.php".
   Shared by every form using that template (Miete, later Kauf, …).
   Everything is scoped under .sp-suchprofil. ":is(#top, :root)" gives the
   rules ID-level specificity to beat Enfold's "#top input…" styles while
   still matching without Enfold, so no !important is needed.
   Fonts: inherited from the site (no extra font files).
   ========================================================================= */

.sp-suchprofil {
	--sp-navy: #063162;
	--sp-navy-hover: #0a3f7c;
	--sp-gold: #cdab4e;
	--sp-gold-soft: rgb(205 171 78 / 0.22);
	--sp-gold-tint: #faf4e4;
	--sp-bg: #faf7f2;
	--sp-surface: #ffffff;
	--sp-text: #1f2937;
	--sp-muted: #8a8f9c;
	--sp-border: #e3e0da;
	--sp-border-strong: #cfcac1;
	--sp-consent-bg: #f4f4f2;
	--sp-error: #c62828;
	--sp-error-soft: rgb(198 40 40 / 0.14);
	--sp-success: #1f7a4d;
	--sp-radius: 12px;
	--sp-card-radius: 24px;

	box-sizing: border-box;
	background: var(--sp-bg);
	padding: 32px 0;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	color: var(--sp-text);
	border-radius: var(--sp-card-radius);
}

.sp-suchprofil *,
.sp-suchprofil *::before,
.sp-suchprofil *::after {
	box-sizing: border-box;
}

/* ---------- card & header ---------- */

.sp-suchprofil .sp-card {
	max-width: 768px;
	margin: 0 auto;
	background: var(--sp-surface);
	border-radius: var(--sp-card-radius);
	box-shadow: 0 1px 2px rgb(6 49 98 / 0.04), 0 12px 40px rgb(6 49 98 / 0.08);
	padding: 24px;
}

:is(#top, :root) .sp-suchprofil .sp-eyebrow {
	margin: 0 0 6px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--sp-gold);
}

:is(#top, :root) .sp-suchprofil .sp-title {
	margin: 0 0 8px;
	padding: 0;
	font-size: 30px;
	line-height: 1.2;
	font-weight: 600;
	letter-spacing: -0.01em;
	text-transform: none;
	color: var(--sp-navy);
}

:is(#top, :root) .sp-suchprofil .sp-note {
	margin: 0;
	font-size: 14px;
	color: var(--sp-muted);
}

.sp-suchprofil .sp-req {
	color: var(--sp-gold);
	font-weight: 600;
}

/* ---------- sections ---------- */

.sp-suchprofil .sp-form {
	margin: 0;
}

.sp-suchprofil .sp-section {
	margin: 0;
	padding: 28px 0 0;
	border: 0;
	border-top: 1px solid var(--sp-border);
	margin-top: 28px;
}

.sp-suchprofil .sp-header + .sp-form .sp-section:first-of-type {
	margin-top: 24px;
}

:is(#top, :root) .sp-suchprofil .sp-section-title {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 20px;
	padding: 0;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	color: var(--sp-navy);
}

.sp-suchprofil .sp-badge {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--sp-gold);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
}

.sp-suchprofil .sp-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 18px 20px;
}

/* ---------- fields ---------- */

.sp-suchprofil .sp-field {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

:is(#top, :root) .sp-suchprofil .sp-field > label {
	display: block;
	margin: 0 0 6px;
	padding: 0;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--sp-navy);
	cursor: pointer;
}

:is(#top, :root) .sp-suchprofil .sp-form .sp-field input:where(:not([type="checkbox"], [type="radio"], [type="hidden"], [type="submit"])),
:is(#top, :root) .sp-suchprofil .sp-form .sp-field textarea,
:is(#top, :root) .sp-suchprofil .sp-form .sp-field select:where(:not(.tomselected)),
:is(#top, :root) .sp-suchprofil .sp-form .sp-field .ts-control {
	display: block;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 12px 16px;
	font-family: inherit;
	font-size: 16px; /* >=16px avoids iOS zoom on focus */
	line-height: 1.4;
	color: var(--sp-text);
	background: var(--sp-surface);
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius);
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

:is(#top, :root) .sp-suchprofil .sp-field textarea {
	min-height: 120px;
	resize: vertical;
}

:is(#top, :root) .sp-suchprofil .sp-field input::placeholder,
:is(#top, :root) .sp-suchprofil .sp-field textarea::placeholder,
:is(#top, :root) .sp-suchprofil .sp-field .ts-control input::placeholder {
	color: var(--sp-muted);
	opacity: 1;
}

:is(#top, :root) .sp-suchprofil .sp-form .sp-field input:where(:not([type="checkbox"], [type="radio"], [type="hidden"], [type="submit"])):hover,
:is(#top, :root) .sp-suchprofil .sp-form .sp-field textarea:hover,
:is(#top, :root) .sp-suchprofil .sp-form .sp-field .ts-control:hover {
	border-color: var(--sp-border-strong);
}

:is(#top, :root) .sp-suchprofil .sp-form .sp-field input:where(:not([type="checkbox"], [type="radio"], [type="hidden"], [type="submit"])):focus,
:is(#top, :root) .sp-suchprofil .sp-form .sp-field textarea:focus,
:is(#top, :root) .sp-suchprofil .sp-form .sp-field .ts-wrapper.focus .ts-control {
	outline: none;
	border-color: var(--sp-gold);
	box-shadow: 0 0 0 4px var(--sp-gold-soft);
}

/* number inputs without spinners */
:is(#top, :root) .sp-suchprofil input[type="number"] {
	-moz-appearance: textfield;
}
.sp-suchprofil input[type="number"]::-webkit-outer-spin-button,
.sp-suchprofil input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ---------- tom-select (onOffice multi/single select) ---------- */

:is(#top, :root) .sp-suchprofil .ts-wrapper {
	width: 100%;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
}

:is(#top, :root) .sp-suchprofil .sp-form .sp-field .ts-control {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	padding: 8px 44px 8px 16px;
	cursor: pointer;
	/* chevron */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23063162' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
}

:is(#top, :root) .sp-suchprofil .sp-form .sp-field .ts-control > input,
:is(#top, :root) .sp-suchprofil .sp-form .sp-field .ts-control > input:hover,
:is(#top, :root) .sp-suchprofil .sp-form .sp-field .ts-control > input:focus {
	flex: 1 1 80px;
	min-width: 80px;
	min-height: 0;
	margin: 0;
	padding: 4px 0;
	border: 0;
	background: none;
	box-shadow: none;
	outline: none;
	font-family: inherit;
	font-size: 16px;
	color: var(--sp-text);
}

/* empty multi-select: show a hint like a placeholder */
:is(#top, :root) .sp-suchprofil .ts-wrapper.multi:not(.has-items) .ts-control > input::placeholder {
	color: var(--sp-muted);
}

:is(#top, :root) .sp-suchprofil .ts-wrapper.multi .ts-control > .item,
:is(#top, :root) .sp-suchprofil .ts-wrapper.single .ts-control > .item {
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 4px 4px 2px 10px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--sp-navy);
	background: #eef2f8;
	border: 1px solid #d6dfec;
	border-radius: 999px;
}

:is(#top, :root) .sp-suchprofil .ts-wrapper.single .ts-control > .item {
	padding: 0;
	background: none;
	border: 0;
	font-size: 16px;
	font-weight: 400;
	color: var(--sp-text);
}

:is(#top, :root) .sp-suchprofil .ts-wrapper.plugin-remove_button .item .remove {
	margin-left: 4px;
	padding: 0 6px;
	border: 0;
	border-radius: 50%;
	color: var(--sp-navy);
	font-size: 16px;
	line-height: 1;
	text-decoration: none;
	opacity: 0.6;
}

:is(#top, :root) .sp-suchprofil .ts-wrapper.plugin-remove_button .item .remove:hover {
	opacity: 1;
	background: rgb(6 49 98 / 0.08);
}

:is(#top, :root) .sp-suchprofil .ts-wrapper.single.plugin-remove_button .item .remove {
	display: none;
}

:is(#top, :root) .sp-suchprofil .ts-dropdown {
	margin-top: 6px;
	padding: 6px;
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius);
	background: var(--sp-surface);
	box-shadow: 0 12px 32px rgb(6 49 98 / 0.12);
	font-family: inherit;
	font-size: 15px;
	color: var(--sp-text);
	z-index: 50;
}

:is(#top, :root) .sp-suchprofil .ts-dropdown .ts-dropdown-content {
	max-height: 280px;
}

:is(#top, :root) .sp-suchprofil .ts-dropdown .option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	border-radius: 8px;
	cursor: pointer;
}

:is(#top, :root) .sp-suchprofil .ts-dropdown .option.active {
	background: var(--sp-gold-tint);
	color: var(--sp-navy);
}

:is(#top, :root) .sp-suchprofil .ts-dropdown .option.selected,
:is(#top, :root) .sp-suchprofil .ts-dropdown .option.ts-checked {
	font-weight: 500;
	color: var(--sp-navy);
}

:is(#top, :root) .sp-suchprofil .ts-dropdown .option input[type="checkbox"] {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--sp-navy);
}

:is(#top, :root) .sp-suchprofil .ts-dropdown .create {
	display: none; /* free text entries make no sense for permitted values */
}

/* ---------- consent ---------- */

.sp-suchprofil .sp-section--consent {
	display: grid;
	gap: 12px;
}

.sp-suchprofil .sp-consent {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: start;
	gap: 4px 14px;
	padding: 16px 18px;
	background: var(--sp-consent-bg);
	border: 1px solid transparent;
	border-radius: var(--sp-radius);
}

:is(#top, :root) .sp-suchprofil .sp-consent input[type="checkbox"] {
	width: 20px;
	height: 20px;
	margin: 2px 0 0;
	accent-color: var(--sp-navy);
	cursor: pointer;
}

:is(#top, :root) .sp-suchprofil .sp-consent input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--sp-gold);
	outline-offset: 3px;
}

:is(#top, :root) .sp-suchprofil .sp-consent label {
	display: block;
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.55;
	color: #4b5563;
	cursor: pointer;
}

:is(#top, :root) .sp-suchprofil .sp-consent label strong {
	font-weight: 600;
}

:is(#top, :root) .sp-suchprofil .sp-consent a {
	color: var(--sp-navy);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.sp-suchprofil .sp-consent .error {
	grid-column: 2;
}

.sp-suchprofil .oo-gdpr-hint-text {
	font-size: 13px;
	color: var(--sp-muted);
}

/* ---------- submit ---------- */

.sp-suchprofil .sp-actions {
	margin-top: 24px;
}

:is(#top, :root) .sp-suchprofil .sp-actions input[type="submit"],
:is(#top, :root) .sp-suchprofil .sp-actions .submit_button {
	display: block;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 14px 24px;
	font-family: inherit;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1.3;
	color: #fff;
	background: var(--sp-navy);
	border: 0;
	border-radius: var(--sp-radius);
	box-shadow: 0 2px 6px rgb(6 49 98 / 0.18);
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

:is(#top, :root) .sp-suchprofil .sp-actions input[type="submit"]:hover,
:is(#top, :root) .sp-suchprofil .sp-actions .submit_button:hover {
	background: var(--sp-navy-hover);
	transform: translateY(-2px);
	box-shadow: 0 10px 22px rgb(6 49 98 / 0.24);
}

:is(#top, :root) .sp-suchprofil .sp-actions input[type="submit"]:active,
:is(#top, :root) .sp-suchprofil .sp-actions .submit_button:active {
	transform: translateY(0);
}

:is(#top, :root) .sp-suchprofil .sp-actions input[type="submit"]:focus-visible,
:is(#top, :root) .sp-suchprofil .sp-actions .submit_button:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px var(--sp-gold-soft), 0 0 0 2px var(--sp-gold) inset;
}

:is(#top, :root) .sp-suchprofil .sp-actions input[type="submit"]:disabled,
:is(#top, :root) .sp-suchprofil .sp-actions .submit_button:disabled {
	opacity: 0.6;
	transform: none;
	cursor: progress;
}

/* ---------- validation & alerts ---------- */

.sp-suchprofil .oo-form .error {
	margin-top: 6px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--sp-error);
}

:is(#top, :root) .sp-suchprofil .oo-form .error p {
	margin: 0;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}

:is(#top, :root) .sp-suchprofil .sp-form .sp-field input:where(:not([type="checkbox"], [type="radio"], [type="hidden"], [type="submit"]))[aria-invalid="true"],
:is(#top, :root) .sp-suchprofil .sp-form .sp-field textarea[aria-invalid="true"],
:is(#top, :root) .sp-suchprofil .sp-form .sp-field--invalid input:where(:not([type="checkbox"], [type="radio"], [type="hidden"], [type="submit"])),
:is(#top, :root) .sp-suchprofil .sp-form .sp-field .ts-wrapper.is-invalid .ts-control {
	border-color: var(--sp-error);
}

:is(#top, :root) .sp-suchprofil .sp-form .sp-field input:where(:not([type="checkbox"], [type="radio"], [type="hidden"], [type="submit"]))[aria-invalid="true"]:focus,
:is(#top, :root) .sp-suchprofil .sp-form .sp-field textarea[aria-invalid="true"]:focus {
	box-shadow: 0 0 0 4px var(--sp-error-soft);
}

.sp-suchprofil .sp-consent.sp-field--invalid,
.sp-suchprofil .sp-consent:has(input[aria-invalid="true"]) {
	border-color: var(--sp-error);
	background: #fdf3f3;
}

.sp-suchprofil .sp-alert {
	margin: 24px 0 0;
	padding: 14px 18px;
	border-radius: var(--sp-radius);
	font-size: 15px;
	line-height: 1.5;
}

.sp-suchprofil .sp-alert--success {
	background: #edf7f1;
	border: 1px solid #b9e0c9;
	color: var(--sp-success);
}

.sp-suchprofil .sp-alert--error {
	background: #fdf3f3;
	border: 1px solid #f1c4c4;
	color: var(--sp-error);
}

/* honeypot injected by onoffice-honeypot.js – must never become visible */
.sp-suchprofil label.message,
.sp-suchprofil input.message {
	display: none !important;
}

/* ---------- responsive ---------- */

@media (min-width: 640px) {
	.sp-suchprofil .sp-grid {
		grid-template-columns: 1fr 1fr;
	}

	.sp-suchprofil .sp-field--full {
		grid-column: 1 / -1;
	}
}

@media (min-width: 768px) {
	.sp-suchprofil {
		padding: 48px 24px;
	}

	.sp-suchprofil .sp-card {
		padding: 40px;
	}

	:is(#top, :root) .sp-suchprofil .sp-title {
		font-size: 36px;
	}
}

@media (max-width: 767px) {
	/* keep the off-white frame but give the card the full width */
	.sp-suchprofil {
		padding: 16px 0;
		background: transparent;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sp-suchprofil * {
		transition: none !important;
	}
}
