/*
 * WM Web-Check – Frontend-Widget.
 * Gekapselt unter .wmwc. Akzentfarbe = Witte-Rot (#B0402B), Ampeln separat.
 * Token-Ansatz aus wm-form4events-frontend.css übernommen, Akzent auf Rot gesetzt.
 */

.wmwc {
	--wmwc-accent: #B0402B;
	--wmwc-accent-dark: #8f331f;
	--wmwc-green: #2E7D32;
	--wmwc-yellow: #EF9F27;
	--wmwc-red: #C0392B;
	--wmwc-text: #111827;
	--wmwc-muted: #6b7280;
	--wmwc-border: #d9dee8;
	--wmwc-soft: #f7f8fb;
	--wmwc-bg: #ffffff;
	--wmwc-max-width: 760px;
	--wmwc-radius: 20px;
	--wmwc-field-radius: 12px;
	--wmwc-shadow: 0 18px 45px rgba(17, 24, 39, 0.08);
	--wmwc-field-height: 46px;

	width: 100%;
	max-width: var(--wmwc-max-width);
	margin: 24px auto;
	box-sizing: border-box;
	color: var(--wmwc-text);
	font-family: inherit;
}

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

.wmwc-card {
	padding: 34px;
	border: 1px solid #edf0f5;
	border-radius: var(--wmwc-radius);
	background: var(--wmwc-bg);
	box-shadow: var(--wmwc-shadow);
}

/* Einbett-Modus: Schritt 1 ohne eigenen Rahmen, fügt sich in die Sektion ein */
.wmwc.wmwc-layout-embed {
	max-width: none;
	margin: 0;
}

.wmwc.wmwc-layout-embed .wmwc-step-input {
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	border-radius: 0;
}

.wmwc.wmwc-layout-embed .wmwc-headline {
	font-size: clamp(20px, 2.4vw, 26px);
}

.wmwc-card + .wmwc-card,
.wmwc-tiles + .wmwc-card,
.wmwc-card + .wmwc-tiles {
	margin-top: 18px;
}

.wmwc-headline {
	margin: 0 0 10px;
	color: var(--wmwc-text);
	font-size: clamp(22px, 3vw, 30px);
	font-weight: 700;
	line-height: 1.18;
}

.wmwc-sub {
	margin: 0 0 22px;
	color: var(--wmwc-muted);
	font-size: 16px;
	line-height: 1.6;
}

/* URL-Eingabe */
.wmwc-input-row {
	display: flex;
	gap: 12px;
}

.wmwc-url-input {
	flex: 1 1 auto;
	width: 100%;
	min-height: var(--wmwc-field-height);
	padding: 11px 14px;
	border: 1px solid var(--wmwc-border);
	border-radius: var(--wmwc-field-radius);
	background: #fff;
	color: var(--wmwc-text);
	font-size: 15px;
	line-height: 1.4;
	outline: none;
	transition: border-color .18s ease, box-shadow .18s ease;
}

.wmwc-url-input:focus {
	border-color: var(--wmwc-accent);
	box-shadow: 0 0 0 3px rgba(176, 64, 43, .14);
}

/* Buttons */
.wmwc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	padding: 13px 22px;
	border: none;
	border-radius: var(--wmwc-field-radius);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	transition: background .18s ease, transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.wmwc-btn-accent {
	background: var(--wmwc-accent);
	color: #fff;
}

.wmwc-btn-accent:hover,
.wmwc-btn-accent:focus {
	background: var(--wmwc-accent-dark);
	box-shadow: 0 10px 24px rgba(176, 64, 43, .24);
	transform: translateY(-1px);
	outline: none;
}

.wmwc-btn-accent:focus-visible {
	outline: 3px solid rgba(176, 64, 43, .18);
	outline-offset: 3px;
}

.wmwc-btn:disabled,
.wmwc-btn[disabled] {
	opacity: .5;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

.wmwc-btn-cta {
	width: 100%;
	margin-top: 6px;
}

.wmwc-link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--wmwc-accent);
	font-size: 14px;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}

.wmwc-form-error,
.wmwc-lead-error {
	margin: 12px 0 0;
	color: var(--wmwc-red);
	font-size: 14px;
	font-weight: 600;
}

/* Spinner */
.wmwc-step-loading {
	text-align: center;
}

.wmwc-spinner {
	width: 44px;
	height: 44px;
	margin: 8px auto 18px;
	border: 4px solid rgba(176, 64, 43, .18);
	border-top-color: var(--wmwc-accent);
	border-radius: 50%;
	animation: wmwc-spin .8s linear infinite;
}

@keyframes wmwc-spin {
	to { transform: rotate(360deg); }
}

.wmwc-loading-text {
	margin: 0;
	color: var(--wmwc-muted);
	font-size: 15px;
	font-weight: 600;
}

/* Ergebnis-Kopf */
.wmwc-result-head {
	display: flex;
	align-items: center;
	gap: 28px;
}

.wmwc-score {
	position: relative;
	flex: 0 0 auto;
	width: 132px;
	height: 132px;
}

.wmwc-ring {
	width: 132px;
	height: 132px;
	transform: rotate(-90deg);
}

.wmwc-ring-track {
	fill: none;
	stroke: #eef0f4;
	stroke-width: 10;
}

.wmwc-ring-value {
	fill: none;
	stroke: var(--wmwc-yellow);
	stroke-width: 10;
	stroke-linecap: round;
	transition: stroke-dashoffset 1s ease;
}

[data-wmwc-ring][data-ring-color="green"] .wmwc-ring-value { stroke: var(--wmwc-green); }
[data-wmwc-ring][data-ring-color="yellow"] .wmwc-ring-value { stroke: var(--wmwc-yellow); }
[data-wmwc-ring][data-ring-color="red"] .wmwc-ring-value { stroke: var(--wmwc-red); }

.wmwc-score-num {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	font-weight: 800;
}

.wmwc-score-num span {
	font-size: 34px;
	line-height: 1;
	color: var(--wmwc-text);
}

.wmwc-score-num small {
	color: var(--wmwc-muted);
	font-size: 13px;
	font-weight: 600;
}

.wmwc-result-url {
	margin: 0 0 6px;
	color: var(--wmwc-text);
	font-size: 18px;
	font-weight: 700;
	word-break: break-word;
}

.wmwc-result-line {
	margin: 0;
	color: var(--wmwc-muted);
	font-size: 15px;
	line-height: 1.5;
}

/* Ampel-Kacheln */
.wmwc-tiles {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
}

.wmwc-tile {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 18px;
	border: 1px solid #edf0f5;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 6px 18px rgba(17, 24, 39, .05);
}

.wmwc-tile-dot {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #cbd5e1;
	box-shadow: 0 0 0 4px rgba(203, 213, 225, .25);
}

.wmwc-tile[data-ampel="green"] .wmwc-tile-dot { background: var(--wmwc-green); box-shadow: 0 0 0 4px rgba(46, 125, 50, .16); }
.wmwc-tile[data-ampel="yellow"] .wmwc-tile-dot { background: var(--wmwc-yellow); box-shadow: 0 0 0 4px rgba(239, 159, 39, .18); }
.wmwc-tile[data-ampel="red"] .wmwc-tile-dot { background: var(--wmwc-red); box-shadow: 0 0 0 4px rgba(192, 57, 43, .16); }

.wmwc-tile-name {
	color: var(--wmwc-text);
	font-size: 15px;
	font-weight: 700;
}

.wmwc-tile-desc {
	color: var(--wmwc-muted);
	font-size: 12.5px;
	line-height: 1.45;
}

.wmwc-tile-status {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: 2px;
	padding-top: 10px;
	border-top: 1px solid #eef0f4;
	color: var(--wmwc-text);
	font-size: 13px;
	font-weight: 700;
}

.wmwc-tile-status::before {
	content: "";
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #cbd5e1;
	flex: 0 0 auto;
}

.wmwc-tile[data-ampel="green"] .wmwc-tile-status::before { background: var(--wmwc-green); }
.wmwc-tile[data-ampel="yellow"] .wmwc-tile-status::before { background: var(--wmwc-yellow); }
.wmwc-tile[data-ampel="red"] .wmwc-tile-status::before { background: var(--wmwc-red); }

.wmwc-tile-status:empty {
	display: none;
}

/* Gesperrte Sektion */
.wmwc-locked {
	position: relative;
}

.wmwc-locked-head {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	margin-bottom: 22px;
	padding-bottom: 22px;
	border-bottom: 1px solid #edf0f5;
}

.wmwc-lock {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: rgba(176, 64, 43, .1);
	color: var(--wmwc-accent);
}

.wmwc-locked-title {
	margin: 0 0 6px;
	font-size: 19px;
	font-weight: 700;
	color: var(--wmwc-text);
}

.wmwc-locked-text {
	margin: 0;
	color: var(--wmwc-muted);
	font-size: 15px;
	line-height: 1.6;
}

/* Lead-Formular */
.wmwc-lead-form {
	display: grid;
	gap: 18px;
}

.wmwc-fields-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
}

.wmwc-field label {
	display: block;
	margin-bottom: 7px;
	color: var(--wmwc-text);
	font-size: 14px;
	font-weight: 700;
}

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

.wmwc-field input {
	width: 100%;
	min-height: var(--wmwc-field-height);
	padding: 11px 13px;
	border: 1px solid var(--wmwc-border);
	border-radius: var(--wmwc-field-radius);
	background: #fff;
	color: var(--wmwc-text);
	font-size: 15px;
	outline: none;
	transition: border-color .18s ease, box-shadow .18s ease;
}

.wmwc-field input:focus {
	border-color: var(--wmwc-accent);
	box-shadow: 0 0 0 3px rgba(176, 64, 43, .12);
}

.wmwc-consent {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 14px 16px;
	border: 1px solid #edf0f5;
	border-radius: var(--wmwc-field-radius);
	background: var(--wmwc-soft);
	cursor: pointer;
}

.wmwc-consent input[type="checkbox"] {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin-top: 2px;
	accent-color: var(--wmwc-accent);
}

.wmwc-consent-text {
	color: var(--wmwc-muted);
	font-size: 13px;
	line-height: 1.55;
}

.wmwc-consent-text a {
	color: var(--wmwc-accent);
	font-weight: 600;
}

.wmwc-disclaimer {
	margin: 4px 0 0;
	color: #9aa2af;
	font-size: 12px;
	line-height: 1.5;
}

.wmwc-restart {
	margin: 16px 0 0;
	text-align: center;
}

/* Bestätigung / Danke */
.wmwc-step-done,
.wmwc-confirmation {
	text-align: center;
}

.wmwc-done-check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: rgba(46, 125, 50, .12);
	color: var(--wmwc-green);
}

.wmwc-step-done h3 {
	margin: 0 0 10px;
	font-size: clamp(22px, 3vw, 28px);
	color: var(--wmwc-text);
}

.wmwc-step-done p {
	margin: 0 auto;
	max-width: 520px;
	color: var(--wmwc-muted);
	font-size: 16px;
	line-height: 1.6;
}

/* Bestätigungsseite (nach Klick auf Opt-in-Link) */
.wmwc-confirmation {
	padding: 40px 34px;
	border: 1px solid #edf0f5;
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 18px 45px rgba(17, 24, 39, 0.08);
}

.wmwc-confirmation h1 {
	margin: 0 0 12px;
	font-size: clamp(24px, 3vw, 32px);
}

.wmwc-confirmation p {
	margin: 0 0 14px;
	color: #6b7280;
	font-size: 16px;
	line-height: 1.6;
}

.wmwc-btn-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 8px;
	padding: 12px 20px;
	border-radius: 12px;
	background: #B0402B;
	color: #fff !important;
	font-weight: 700;
	text-decoration: none;
}

/* Utility */
.wmwc-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Responsiv */
@media (max-width: 700px) {
	.wmwc-card {
		padding: 24px 20px;
		border-radius: min(var(--wmwc-radius), 16px);
	}

	.wmwc-input-row {
		flex-direction: column;
	}

	.wmwc-btn-accent {
		width: 100%;
	}

	.wmwc-result-head {
		flex-direction: column;
		text-align: center;
		gap: 18px;
	}

	.wmwc-tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wmwc-fields-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 420px) {
	.wmwc-tiles {
		grid-template-columns: 1fr;
	}
}
