/* Tocco-Widget-Container — generisches Wrapping fuer iframe-basierte Widgets. */
.tocco-widget-wrap {
	margin: 22px 0;
	padding: 0;
	background: #ffffff;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	overflow: hidden;
	position: relative;
}

/* Loading-Skeleton: subtile animierte Linien bevor iframe lädt */
.tocco-widget-wrap::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, transparent, rgba(0,0,0,0.04), transparent);
	background-size: 200% 100%;
	animation: tocco-skeleton 1.4s ease-in-out infinite;
	pointer-events: none;
	z-index: 1;
	opacity: 0.7;
	transition: opacity 0.4s;
}
.tocco-widget-wrap:has(iframe[data-loaded="true"])::before { opacity: 0; }

@keyframes tocco-skeleton {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

.tocco-widget-iframe {
	position: relative;
	z-index: 2;
}

.tocco-widget-iframe {
	display: block;
	width: 100%;
	border: 0;
	background: #ffffff;
}

/* Login-spezifisch: voller Tocco-Wrapper im iframe scrollbar */
.tocco-widget-login {
	border: 0;
	border-radius: 0;
	background: transparent;
	margin: 12px 0 22px;
	overflow: hidden;
}

.tocco-widget-iframe-login {
	min-height: 720px;
	width: 100%;
}

/* Login-Backup-Actions: manueller "Weiter"-Button + Hinweis-Text */
.tocco-widget-login-actions {
	margin-top: 18px;
	padding: 14px 0;
	border-top: 1px solid #e5e5e5;
	text-align: center;
}

.tocco-widget-login-hint {
	font-size: 14px;
	color: #666;
	margin: 0 0 12px;
}

.tocco-widget-login-continue {
	background: var(--ssb-red, #df4034);
	color: #fff;
	border: 0;
	padding: 11px 26px;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	border-radius: 3px;
	transition: opacity 0.15s;
}
.tocco-widget-login-continue:hover { opacity: 0.9; }

/* Pending-Marker (Widget mit unbekanntem Slug) */
.tocco-widget-pending {
	padding: 18px 22px;
	background: #fafafa;
	color: #666;
	font-style: italic;
}
.tocco-widget-pending-msg {
	margin: 0;
}

/* Legacy Selector (alte Pages mit `.tocco-widget-container`) */
.tocco-widget-container {
	margin: 22px 0;
	background: transparent;
}
.tocco-widget-container iframe {
	display: block;
	width: 100%;
	border: 0;
}

/* === Login Full-Screen (Production-Style: iframe als primary UI) === */
.tocco-widget-login-fullscreen {
	border: 0;
	border-radius: 0;
	background: transparent;
	margin: 0 0 22px;
	padding: 0;
	overflow: visible;
}
.tocco-widget-login-fullscreen::before {
	display: none; /* kein Skeleton — iframe ist Hauptinhalt, hat eigene Tocco-Loading-UI */
}
.tocco-widget-login-fullscreen .tocco-widget-iframe-login {
	display: block;
	width: 100%;
	min-height: 720px;
	height: calc(100vh - 240px); /* Header + Footer + Margin abziehen */
	max-height: 1000px;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	background: #fff;
}
@media (max-width: 768px) {
	.tocco-widget-login-fullscreen .tocco-widget-iframe-login {
		height: calc(100vh - 180px);
		min-height: 600px;
	}
}

/* Kleiner Fallback-Klappblock unter dem iframe — nicht aufdringlich */
.tocco-login-fallback-info {
	margin-top: 14px;
	padding: 0;
	background: transparent;
	border: 0;
	font-size: 13px;
}
.tocco-login-fallback-info > summary {
	padding: 8px 14px;
	color: #777;
	cursor: pointer;
	user-select: none;
	list-style: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #f5f5f5;
	border-radius: 3px;
	transition: background 0.15s;
}
.tocco-login-fallback-info > summary:hover { background: #ececec; }
.tocco-login-fallback-info > summary::before {
	content: "▸";
	font-size: 11px;
	transition: transform 0.15s;
	display: inline-block;
}
.tocco-login-fallback-info[open] > summary::before {
	transform: rotate(90deg);
}
.tocco-login-fallback-info > summary::-webkit-details-marker { display: none; }
.tocco-login-fallback-info-body {
	padding: 10px 14px 14px;
	color: #555;
	line-height: 1.5;
	max-width: 720px;
}
.tocco-login-fallback-info-body p {
	margin: 0 0 12px;
}

/* === [Legacy] Login-Card (vor v1.10 — bleibt für Übergangs-Konfigurationen) === */
.tocco-widget-login-card {
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	background: #fff;
	margin: 22px 0;
	padding: 0;
	overflow: hidden;
}
.tocco-widget-login-card::before {
	display: none;
}

.tocco-login-card-inner {
	padding: 28px 28px 24px;
	text-align: center;
}

.tocco-login-card-title {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 10px;
	color: #1a1a1a;
}

.tocco-login-card-desc {
	font-size: 15px;
	color: #555;
	margin: 0 auto 20px;
	max-width: 520px;
	line-height: 1.5;
}

.tocco-login-popup-btn,
.tocco-login-redirect-btn {
	display: inline-block;
	background: var(--ssb-red, #df4034);
	color: #fff !important;
	text-decoration: none !important;
	border: 0;
	padding: 14px 36px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	border-radius: 4px;
	transition: opacity 0.15s, transform 0.05s;
	letter-spacing: 0.2px;
}
.tocco-login-popup-btn:hover,
.tocco-login-redirect-btn:hover { opacity: 0.92; color: #fff !important; }
.tocco-login-popup-btn:active,
.tocco-login-redirect-btn:active { transform: translateY(1px); }
.tocco-login-popup-btn:disabled,
.tocco-login-redirect-btn.is-redirecting {
	opacity: 0.6;
	cursor: progress;
	pointer-events: none;
}
.tocco-login-redirect-btn.is-redirecting::after {
	content: " \2026"; /* … */
}

/* Info-Klappblock: "Was tun wenn ich nicht automatisch zurückgeleitet werde?" */
.tocco-login-info {
	margin-top: 22px;
	background: #f5f5f5;
	border-radius: 4px;
	overflow: hidden;
}
.tocco-login-info > summary {
	padding: 10px 18px;
	font-size: 13px;
	color: #555;
	cursor: pointer;
	user-select: none;
	list-style: none;
	display: flex;
	align-items: center;
	gap: 6px;
}
.tocco-login-info > summary::before {
	content: "▸";
	font-size: 11px;
	transition: transform 0.15s;
	display: inline-block;
}
.tocco-login-info[open] > summary::before {
	transform: rotate(90deg);
}
.tocco-login-info > summary::-webkit-details-marker { display: none; }

.tocco-login-info-body {
	padding: 6px 18px 16px;
	font-size: 13px;
	color: #444;
	line-height: 1.5;
	text-align: left;
}
.tocco-login-info-body p { margin: 6px 0; }
.tocco-login-info-return-link {
	display: inline-block;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12px;
	background: #fff;
	padding: 6px 10px;
	border-radius: 3px;
	border: 1px solid #ddd;
	color: var(--ssb-red, #df4034) !important;
	margin-top: 4px;
	word-break: break-all;
}
.tocco-login-info-return-link:hover { background: #fafafa; }

/* === Waiting-State (während Tocco-Login im neuen Tab läuft) === */
.tocco-login-waiting {
	padding: 12px 0;
	text-align: center;
}
.tocco-login-waiting-spinner {
	width: 44px;
	height: 44px;
	border: 4px solid #f0f0f0;
	border-top-color: var(--ssb-red, #df4034);
	border-radius: 50%;
	margin: 0 auto 18px;
	animation: tocco-spin 0.9s linear infinite;
}
@keyframes tocco-spin {
	0%   { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}
.tocco-login-waiting-title {
	font-size: 20px;
	font-weight: 600;
	color: #1a1a1a;
	margin: 0 0 10px;
}
.tocco-login-waiting-desc {
	font-size: 14px;
	color: #555;
	margin: 0 auto 22px;
	max-width: 480px;
	line-height: 1.5;
}
.tocco-login-waiting-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
}
.tocco-login-waiting-finish {
	background: var(--ssb-red, #df4034);
	color: #fff;
	border: 0;
	padding: 11px 22px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	border-radius: 4px;
	transition: opacity 0.15s;
}
.tocco-login-waiting-finish:hover { opacity: 0.92; }
.tocco-login-waiting-cancel {
	background: transparent;
	color: #777;
	border: 1px solid #ddd;
	padding: 11px 22px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	border-radius: 4px;
	transition: background 0.15s;
}
.tocco-login-waiting-cancel:hover { background: #f5f5f5; }

.tocco-login-card-hint {
	font-size: 13px;
	color: #777;
	margin: 16px auto 0;
	max-width: 540px;
	line-height: 1.45;
}

/* Fallback-iframe in <details> */
.tocco-login-fallback {
	border-top: 1px solid #efefef;
	background: #fafafa;
}
.tocco-login-fallback > summary {
	padding: 12px 28px;
	font-size: 13px;
	color: #666;
	cursor: pointer;
	user-select: none;
	list-style: none;
	display: flex;
	align-items: center;
	gap: 6px;
}
.tocco-login-fallback > summary::before {
	content: "▸";
	font-size: 11px;
	transition: transform 0.15s;
	display: inline-block;
}
.tocco-login-fallback[open] > summary::before {
	transform: rotate(90deg);
}
.tocco-login-fallback > summary::-webkit-details-marker { display: none; }

.tocco-login-fallback-warning {
	margin: 0 28px 14px;
	padding: 10px 14px;
	background: #fff8e1;
	border-left: 3px solid #f0b400;
	font-size: 13px;
	color: #5d4500;
	line-height: 1.45;
	border-radius: 0 3px 3px 0;
}

.tocco-login-fallback .tocco-widget-iframe-login {
	margin: 0 28px 14px;
	width: calc(100% - 56px);
	border: 1px solid #e5e5e5;
}

.tocco-login-fallback .tocco-widget-login-actions {
	padding: 14px 28px 18px;
	border-top: 0;
}
