/**
 * E-Welt Beratungsformular – E-Welt Design (WordPress Plugin)
 * Primary: #37A9E1 | Schrift: Space Grotesk
 * Alle Styles sind unter .scf gescoped, damit das Theme nicht überschrieben wird.
 */

/* ========== Design Tokens (E-Welt) ========== */
.scf {
	--ewelt-primary: #37A9E1;
	--ewelt-primary-dark: #2d8ab8;
	--ewelt-bg-light: #e8f4fc;
	--ewelt-bg-tint: #d4ebf7;
	--ewelt-text-main: #0e161b;
	--ewelt-text-muted: #507e95;
	--ewelt-border-light: #b8d9ed;
	--ewelt-font: 'Space Grotesk', sans-serif;
}

/* ========== Main Container ========== */
.scf {
	min-height: 0;
	padding: 2rem 1rem 3rem;
	position: relative;
	overflow: hidden;
	font-family: var(--ewelt-font);
	color: var(--ewelt-text-main);
}

.scf-form-only {
	padding: 2rem 1rem 3rem;
	min-height: auto;
}

.scf-form-only::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-image:
		repeating-linear-gradient(0deg, rgba(55, 169, 225, 0.03) 0px, transparent 1px, transparent 40px, rgba(55, 169, 225, 0.03) 41px),
		repeating-linear-gradient(90deg, rgba(55, 169, 225, 0.03) 0px, transparent 1px, transparent 40px, rgba(55, 169, 225, 0.03) 41px);
	z-index: 0;
	pointer-events: none;
	opacity: 0.5;
}

/* ========== Layout ========== */
.scf-container {
	max-width: 560px;
	margin: 0 auto;
	position: relative;
	z-index: 3;
	display: grid;
	grid-template-columns: 1fr;
}

.scf-form-only .scf-container {
	max-width: 560px;
}

.scf-right {
	width: 100%;
}

/* ========== Form Card (E-Welt) ========== */
.scf-card {
	background: rgba(255, 255, 255, 0.95);
	border: 1px solid rgba(55, 169, 225, 0.25);
	border-radius: 1.25rem;
	padding: 2.5rem;
	box-shadow: 0 10px 40px rgba(55, 169, 225, 0.1);
	transition: all 0.3s ease;
}

.scf-card:hover {
	border-color: rgba(55, 169, 225, 0.4);
	box-shadow: 0 16px 48px rgba(55, 169, 225, 0.12);
}

/* ========== Progress Bar ========== */
.scf-progress {
	margin-bottom: 2rem;
}

.scf-progress-bar {
	width: 100%;
	height: 6px;
	background: var(--ewelt-bg-light);
	border-radius: 9999px;
	overflow: hidden;
	margin-bottom: 0.75rem;
}

.scf-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--ewelt-primary), #0ea5e9);
	border-radius: 9999px;
	transition: width 0.4s ease;
	box-shadow: 0 0 12px rgba(55, 169, 225, 0.3);
}

.scf-progress-text {
	text-align: center;
	font-size: 0.8125rem;
	color: var(--ewelt-text-muted);
	font-weight: 600;
}

/* ========== Steps ========== */
.scf-step {
	display: none;
}

.scf-step.active {
	display: block;
	animation: scf-fadeIn 0.3s ease;
}

@keyframes scf-fadeIn {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

.scf-step-title {
	font-size: 1.375rem;
	font-weight: 700;
	color: var(--ewelt-text-main);
	margin-bottom: 1.5rem;
	line-height: 1.3;
}

/* ========== Form Fields ========== */
.scf-field {
	margin-bottom: 1.25rem;
}

.scf-field label {
	display: block;
	color: var(--ewelt-text-main);
	font-size: 0.8125rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 0.5rem;
}

.scf-field label .optional {
	color: var(--ewelt-text-muted);
	font-weight: 500;
	text-transform: none;
	font-size: 0.75rem;
}

.scf input[type="text"],
.scf input[type="email"],
.scf input[type="tel"],
.scf select,
.scf textarea {
	width: 100%;
	padding: 0.75rem 1rem;
	background: var(--ewelt-bg-light);
	border: 1px solid var(--ewelt-border-light);
	border-radius: 0.75rem;
	color: var(--ewelt-text-main);
	font-size: 1rem;
	font-family: var(--ewelt-font);
	transition: border-color 0.2s, box-shadow 0.2s;
}

.scf input:focus,
.scf select:focus,
.scf textarea:focus {
	outline: none;
	border-color: var(--ewelt-primary);
	box-shadow: 0 0 0 3px rgba(55, 169, 225, 0.2);
}

.scf input::placeholder,
.scf textarea::placeholder {
	color: var(--ewelt-text-muted);
}

.scf select {
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%2337A9E1' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1rem center;
	padding-right: 2.75rem;
}

.scf select option {
	background: #fff;
	color: var(--ewelt-text-main);
}

.scf textarea {
	resize: vertical;
	min-height: 100px;
	line-height: 1.6;
}

/* ========== Checkbox Group ========== */
.scf-checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
}

.scf-checkbox {
	display: flex;
	align-items: center;
	cursor: pointer;
	padding: 0.75rem 1rem;
	background: var(--ewelt-bg-light);
	border: 1px solid rgba(55, 169, 225, 0.2);
	border-radius: 0.75rem;
	transition: all 0.2s ease;
}

.scf-checkbox:hover {
	border-color: rgba(55, 169, 225, 0.4);
	background: var(--ewelt-bg-tint);
}

.scf-checkbox input[type="checkbox"] {
	width: 20px;
	height: 20px;
	margin-right: 0.75rem;
	cursor: pointer;
	accent-color: var(--ewelt-primary);
	flex-shrink: 0;
}

.scf-checkbox span {
	color: var(--ewelt-text-main);
	font-size: 0.9375rem;
	font-weight: 500;
	user-select: none;
}

.scf-checkbox.checked {
	background: rgba(55, 169, 225, 0.1);
	border-color: var(--ewelt-primary);
	box-shadow: 0 0 0 1px rgba(55, 169, 225, 0.2);
}

.scf-checkbox.checked span {
	font-weight: 600;
}

/* ========== Consent Checkbox ========== */
.scf-consent {
	display: flex;
	align-items: flex-start;
	cursor: pointer;
	padding: 1rem;
	background: var(--ewelt-bg-light);
	border: 1px solid rgba(55, 169, 225, 0.2);
	border-radius: 0.75rem;
	transition: all 0.2s ease;
}

.scf-consent:hover {
	border-color: rgba(55, 169, 225, 0.4);
}

.scf-consent input[type="checkbox"] {
	width: 20px;
	height: 20px;
	margin-right: 0.75rem;
	margin-top: 0.15rem;
	cursor: pointer;
	flex-shrink: 0;
	accent-color: var(--ewelt-primary);
}

.scf-consent span {
	color: var(--ewelt-text-muted);
	font-size: 0.875rem;
	line-height: 1.5;
	user-select: none;
}

.scf-consent.checked {
	background: rgba(55, 169, 225, 0.08);
	border-color: var(--ewelt-primary);
}

.scf-consent.checked span {
	color: var(--ewelt-text-main);
}

/* ========== Navigation Buttons ========== */
.scf-navigation {
	display: flex;
	gap: 1rem;
	margin-top: 1.75rem;
}

.scf-btn {
	flex: 1;
	padding: 0.875rem 1.5rem;
	border-radius: 0.75rem;
	font-size: 0.9375rem;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: var(--ewelt-font);
}

.scf-btn-back {
	background: #fff;
	color: var(--ewelt-text-muted);
	border: 2px solid var(--ewelt-border-light);
}

.scf-btn-back:hover:not(:disabled) {
	border-color: var(--ewelt-primary);
	color: var(--ewelt-primary);
	transform: translateY(-1px);
}

.scf-btn-back:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.scf-btn-next,
.scf-btn-submit {
	background: linear-gradient(135deg, var(--ewelt-primary) 0%, #0ea5e9 100%);
	color: #fff;
	border: none;
	box-shadow: 0 2px 12px rgba(55, 169, 225, 0.35);
}

.scf-btn-next:hover:not(:disabled),
.scf-btn-submit:hover:not(:disabled) {
	background: linear-gradient(135deg, var(--ewelt-primary-dark) 0%, #0284c7 100%);
	box-shadow: 0 4px 16px rgba(55, 169, 225, 0.4);
	transform: translateY(-1px);
	color: #fff;
}

.scf-btn-next:disabled,
.scf-btn-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ========== Messages ========== */
.scf-msg {
	margin-top: 1.25rem;
	padding: 1rem 1.25rem;
	border-radius: 0.75rem;
	text-align: center;
	font-weight: 600;
	font-size: 0.9375rem;
}

.scf-msg.success {
	background: rgba(55, 169, 225, 0.12);
	border: 1px solid rgba(55, 169, 225, 0.4);
	color: var(--ewelt-primary-dark);
}

.scf-msg.error {
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.4);
	color: #b91c1c;
}

/* ========== Loading State ========== */
.scf-btn.loading {
	position: relative;
	color: transparent;
}

.scf-btn.loading::after {
	content: "";
	position: absolute;
	width: 20px;
	height: 20px;
	top: 50%;
	left: 50%;
	margin-left: -10px;
	margin-top: -10px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-radius: 50%;
	border-top-color: #fff;
	animation: scf-spinner 0.8s linear infinite;
}

@keyframes scf-spinner {
	to { transform: rotate(360deg); }
}

/* ========== Scrollbar ========== */
.scf textarea::-webkit-scrollbar {
	width: 6px;
}

.scf textarea::-webkit-scrollbar-track {
	background: var(--ewelt-bg-light);
	border-radius: 3px;
}

.scf textarea::-webkit-scrollbar-thumb {
	background: rgba(55, 169, 225, 0.4);
	border-radius: 3px;
}

.scf textarea::-webkit-scrollbar-thumb:hover {
	background: var(--ewelt-primary);
}

/* ========== Focus Visible ========== */
.scf *:focus-visible {
	outline: 2px solid var(--ewelt-primary);
	outline-offset: 2px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
	.scf,
	.scf-form-only {
		padding: 1.5rem 0.75rem 2rem;
	}

	.scf-card {
		padding: 1.75rem 1.25rem;
		border-radius: 1rem;
	}

	.scf-step-title {
		font-size: 1.25rem;
	}

	.scf-field {
		margin-bottom: 1rem;
	}

	.scf input[type="text"],
	.scf input[type="email"],
	.scf input[type="tel"],
	.scf select,
	.scf textarea {
		padding: 0.7rem 0.875rem;
		font-size: 0.9375rem;
	}

	.scf-checkbox,
	.scf-radio {
		padding: 0.65rem 0.875rem;
	}

	.scf-consent {
		padding: 0.875rem;
	}

	.scf-navigation {
		gap: 0.75rem;
		margin-top: 1.5rem;
		flex-direction: column;
	}

	.scf-btn {
		padding: 0.875rem 1.25rem;
		font-size: 0.9rem;
		width: 100%;
	}
}

@media (max-width: 480px) {
	.scf-card {
		padding: 1.5rem 1rem;
	}

	.scf-field label {
		font-size: 0.75rem;
	}

	.scf-checkbox span,
	.scf-radio span {
		font-size: 0.875rem;
	}

	.scf-consent span {
		font-size: 0.8125rem;
	}
}
