/*
 * bst.software-kontakt – modernes Formular-Layout.
 * Autoload nur auf Seiten mit Shortcode (siehe Plugin-Bootstrap).
 */

.bst-contact-e {
	--bst-accent: #2563eb;
	--bst-accent-dark: #1d4ed8;
	--bst-ring: rgba(37, 99, 235, .22);
	--bst-border: #e2e6ec;
	--bst-input: #f8fafc;
	--bst-text: #1f2937;
	--bst-muted: #6b7280;
	--bst-error: #dc2626;
	--bst-error-bg: #fef2f2;
	--bst-success: #16a34a;
	--bst-success-bg: #f0fdf4;

	max-width: 620px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--bst-text);
	line-height: 1.5;
}

.bst-contact-form {
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	padding: 0;
}

/* Kontaktformular (eigenständig): #eee-Fläche. Nicht das Kaufanfrage-Formular
   (hat seine Spalten schon) und nicht die Erfolgsansicht. */
.bst-contact-form:not(.bst-kauf-form) {
	background: #eee;
	padding: 20px;
	border-radius: 10px;
}

.bst-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.bst-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	grid-column: span 1;
}

.bst-field.bst-cols-full { grid-column: span 2; }
.bst-field.bst-cols-half { grid-column: span 1; }

/* PLZ-Feld schmaler (kurze Eingabe) */
.bst-field.bst-zip input { max-width: 120px; }

/* Rechnungsanschrift-Zeile: feineres Raster, damit PLZ schmal und Ort breit wird.
   4 Spalten: halb = 2, voll = alle, PLZ = 1, Ort = 3. */
.bst-row-billing { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bst-row-billing .bst-field.bst-cols-half { grid-column: span 2; }
.bst-row-billing .bst-field.bst-cols-full { grid-column: 1 / -1; }
.bst-row-billing .bst-field.bst-zip { grid-column: span 1; }
.bst-row-billing .bst-field.bst-ort { grid-column: span 3; }
.bst-row-billing .bst-field.bst-zip input { max-width: none; }

/* Blöcke außerhalb des .bst-row-Grids (Sicherheitsfrage, Einwilligung): gleicher Abstand wie die Grid-Gap (16px) */
.bst-field.bst-block { margin-top: 16px; }

.bst-field > label {
	font-size: .875rem;
	font-weight: 600;
	color: var(--bst-text);
}

.bst-req { color: var(--bst-error); }

.bst-field input[type="text"],
.bst-field input[type="email"],
.bst-field input[type="tel"],
.bst-field input[type="number"],
.bst-field input[type="url"],
.bst-field select,
.bst-field textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--bst-border);
	background: var(--bst-input);
	border-radius: 10px;
	padding: 11px 13px;
	font-size: 1rem;
	color: var(--bst-text);
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.bst-field textarea { resize: vertical; min-height: 120px; }

.bst-contact-form .bst-field input:focus,
.bst-contact-form .bst-field textarea:focus {
	outline: none;
	border-color: var(--bst-border);
	background: #f3e3b8;
	box-shadow: 0 0 0 3px rgba(184, 226, 243, .5);
}

/* Dropdowns bleiben beim Aufklappen weiß */
.bst-contact-form .bst-field select:focus {
	outline: none;
	border-color: var(--bst-border);
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(184, 226, 243, .5);
}

.bst-field-error input,
.bst-field-error textarea,
.bst-field-error select {
	border-color: var(--bst-error);
}

.bst-field-error .bst-error-msg {
	display: inline-block;
	font-size: .8125rem;
	color: var(--bst-error);
}

/* Checkbox / Einwilligung */
.bst-checkbox {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-size: .875rem;
	color: var(--bst-text);
	font-weight: 400;
	cursor: pointer;
}

.bst-checkbox input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	width: 28px;
	height: 28px;
	margin-top: 2px;
	border: 2px solid #b8e2f3;
	border-radius: 6px;
	background: #ffffff;
	cursor: pointer;
	flex: 0 0 auto;
	position: relative;
	transition: background .15s ease, border-color .15s ease;
}

.bst-checkbox input[type="checkbox"]:checked {
	background: #b8e2f3;
	border-color: #b8e2f3;
}

.bst-checkbox input[type="checkbox"]:checked::after {
	content: "";
	position: absolute;
	left: 9px;
	top: 4px;
	width: 7px;
	height: 14px;
	border: solid #000000;
	border-width: 0 3px 3px 0;
	transform: rotate(45deg);
}

.bst-checkbox input[type="checkbox"]:focus-visible {
	outline: 2px solid #b8e2f3;
	outline-offset: 2px;
}

.bst-consent { padding: 10px 0; }

/* Honeypot: unsichtbar, aber im DOM vorhanden */
.bst-hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
	margin: 0;
	padding: 0;
	font-size: 0;
	opacity: 0;
	pointer-events: none;
}

/* Button-Zeile: volle Breite (der Submit-Button soll die ganze Zeile füllen) */
.bst-row.bst-cols-full { grid-template-columns: 1fr; }

/* Kaufanfrage: Captcha-Feld und Button halbbreit wie die linke Spalte
   (Spaltenbreite = calc(50% - 14px) wegen des 28px-Gaps). */
.bst-kauf-e .bst-captcha-block { width: calc(50% - 14px); }
.bst-kauf-e .bst-row.bst-cols-full { width: calc(50% - 14px); }

/* Captcha */
.bst-captcha-head {
	display: flex;
	align-items: stretch;
	gap: 10px;
}

.bst-captcha-head input[type="text"] { flex: 1; }

.bst-captcha-row {
	display: flex;
	align-items: stretch;
	gap: 10px;
}

.bst-captcha-prompt {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 90px;
	padding: 0 14px;
	background: var(--bst-input);
	border: 1px solid var(--bst-border);
	border-radius: 10px;
	font-weight: 700;
	font-size: 1.075rem;
	color: var(--bst-text);
	white-space: nowrap;
	user-select: none;
}

.bst-captcha-row input[type="text"] { flex: 1; }

.bst-captcha-refresh {
	width: 46px;
	border: 1px solid var(--bst-border);
	background: #ffffff;
	border-radius: 10px;
	font-size: 1.2rem;
	cursor: pointer;
	color: var(--bst-muted);
	transition: color .15s ease, border-color .15s ease, transform .15s ease;
}

.bst-captcha-refresh:hover { color: var(--bst-accent); border-color: var(--bst-accent); }
.bst-captcha-refresh:active { transform: rotate(90deg); }

.bst-hint {
	margin: 4px 0 0;
	font-size: .8rem;
	color: var(--bst-muted);
}

/* Submit-Button: sandfarben, Hover helles Blau (wie die Kaufanfrage-Schaltfläche im Galerie-Modal) */
.bst-btn {
	width: 100%;
	border: 1px solid #e6cd8c;
	background: #f3e3b8;
	color: #4a3b17;
	font-size: 1rem;
	font-weight: 600;
	padding: 13px 20px;
	border-radius: 6px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
	cursor: pointer;
	transition: background .15s ease, transform .05s ease, box-shadow .15s ease, border-color .15s ease;
}

.bst-btn:hover { background: #b8e2f3; border-color: #b8e2f3; }
.bst-btn:active { transform: translateY(1px); }

/* Hinweise */
.bst-notice {
	border-radius: 10px;
	padding: 12px 16px;
	margin-bottom: 18px;
	font-size: .9rem;
	font-weight: 500;
}

.bst-notice-error { background: var(--bst-error-bg); color: var(--bst-error); border: 1px solid #fecaca; }

/* Erfolgsanzeige */
.bst-success {
	background: var(--bst-success-bg);
	border: 1px solid #bbf7d0;
	border-radius: 16px;
	padding: 28px;
	text-align: center;
	color: var(--bst-success);
	font-weight: 500;
}

.bst-success-icon {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	margin: 0 auto 12px;
	background: var(--bst-success);
	color: #fff;
	border-radius: 50%;
	font-size: 1.5rem;
}

/* Responsive: 1 Spalte auf kleinen Screens */
@media (max-width: 560px) {
	.bst-row { grid-template-columns: 1fr; }
	.bst-field,
	.bst-field.bst-cols-full,
	.bst-field.bst-cols-half { grid-column: span 1; }
	.bst-row-billing { grid-template-columns: 1fr; }
	.bst-row-billing .bst-field,
	.bst-row-billing .bst-field.bst-cols-full,
	.bst-row-billing .bst-field.bst-cols-half,
	.bst-row-billing .bst-field.bst-zip,
	.bst-row-billing .bst-field.bst-ort { grid-column: 1 / -1; }
	.bst-captcha-row { flex-wrap: wrap; }
}

/* Kontaktseite: zwei Spalten (Formular | Text), auf schmalen Screens gestapelt */
.one_half.last strong { font-weight: 700; }
@media (max-width: 767px) {
	.one_half,
	.one_half.last {
		float: none;
		width: 100%;
		margin-right: 0;
		clear: both;
	}
	.bst-contact-e { max-width: 100%; }
}

/* ---------------------------------------------------------------------
 * Kaufanfrage-Formular: zweispaltig + Accordion (Lieferanschrift)
 * ------------------------------------------------------------------- */
.bst-kauf-e { max-width: none; }

.bst-kauf-columns {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 28px;
	align-items: start;
}

.bst-kauf-col-main,
.bst-kauf-col-side {
	background: #eee;
	padding: 20px;
	border-radius: 10px;
}

.bst-kauf-sub {
	margin: 50px 0 10px;
	font-size: 24px;
	font-weight: 700;
	color: var(--bst-text);
	padding-bottom: 6px;
	border-bottom: 1px solid var(--bst-border);
}

.bst-kauf-accordion {
	border: 1px solid var(--bst-border);
	border-radius: 10px;
	background: #ffffff;
	overflow: hidden;
}

.bst-kauf-accordion > summary {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	list-style: none;
	padding: 13px 16px;
	font-weight: 600;
	color: var(--bst-text);
}

.bst-kauf-accordion > summary::-webkit-details-marker { display: none; }

.bst-kauf-accordion > summary::before {
	content: "\25B8"; /* ▸ */
	display: inline-block;
	transition: transform .15s ease;
}

.bst-kauf-accordion[open] > summary::before { transform: rotate(90deg); }
.bst-kauf-accordion[open] > summary { border-bottom: 1px solid var(--bst-border); }
.bst-kauf-accordion .bst-row { padding: 16px; }
.bst-kauf-accordion .bst-block { margin-top: 0; }

@media (max-width: 860px) {
	.bst-kauf-columns { grid-template-columns: 1fr; }
	.bst-kauf-e .bst-captcha-block,
	.bst-kauf-e .bst-row.bst-cols-full { width: 100%; }
}