/**
 * 4System Whereby Helper – Frontend-Styles für den Shortcode.
 *
 * Branding-Werte (Farben, Border-Radius, Schatten, Font, Logo) werden
 * ab v1.5.0 als Inline-CSS aus dem Branding-Tab gesetzt. Die Defaults
 * unten sorgen dafür, dass das Layout auch ohne Branding-Konfiguration
 * funktional bleibt (z. B. wenn das Inline-CSS aus irgendeinem Grund
 * nicht ausgeliefert wird).
 */

/* CSS-Variablen-Defaults – können in Session D von Branding-Settings überschrieben werden. */
.fs-whereby {
	--fs-whereby-primary:    #0073aa;
	--fs-whereby-secondary:  #005177;
	--fs-whereby-card-bg:    #ffffff;
	--fs-whereby-text:       #1d2327;
	--fs-whereby-radius:     8px;
	--fs-whereby-shadow:     0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
	--fs-whereby-font:       inherit;

	color: var(--fs-whereby-text);
	font-family: var(--fs-whereby-font);
	box-sizing: border-box;
	width: 100%;
}

.fs-whereby *,
.fs-whereby *::before,
.fs-whereby *::after {
	box-sizing: inherit;
}

/* ------------------------------------------------------------------
 * Logo (optional, ab v1.5.0)
 * --------------------------------------------------------------- */

.fs-whereby__logo {
	display: block;
	margin: 0 0 12px;
	max-height: 60px;
	width: auto;
}

.fs-whereby--loggedout .fs-whereby__logo {
	margin-left: auto;
	margin-right: auto;
}

/* ------------------------------------------------------------------
 * Single-Embed
 * --------------------------------------------------------------- */

.fs-whereby--single .fs-whereby__iframe {
	display: block;
	width: 100%;
	border: 0;
	border-radius: var(--fs-whereby-radius);
	box-shadow: var(--fs-whereby-shadow);
}

.fs-whereby__toolbar {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
	flex-wrap: wrap;
}

/* ------------------------------------------------------------------
 * Multi: Auswahlkarten
 * --------------------------------------------------------------- */

.fs-whereby__cards {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

@media (min-width: 768px) {
	.fs-whereby__cards {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.fs-whereby__cards {
		grid-template-columns: repeat(3, 1fr);
	}
}

.fs-whereby__card {
	background: var(--fs-whereby-card-bg);
	border-radius: var(--fs-whereby-radius);
	box-shadow: var(--fs-whereby-shadow);
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.fs-whereby__card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.06);
}

.fs-whereby__card-title {
	font-size: 1.15rem;
	margin: 0;
	color: var(--fs-whereby-text);
}

.fs-whereby__card button,
.fs-whereby__copy-invite,
.fs-whereby__login-button {
	display: inline-block;
	background: var(--fs-whereby-primary);
	color: #fff;
	border: 0;
	padding: 10px 16px;
	border-radius: calc(var(--fs-whereby-radius) / 2);
	cursor: pointer;
	font: inherit;
	text-decoration: none;
	transition: background 0.15s ease;
}

.fs-whereby__card button:hover,
.fs-whereby__copy-invite:hover,
.fs-whereby__login-button:hover {
	background: var(--fs-whereby-secondary);
}

.fs-whereby__card-invite {
	background: transparent !important;
	color: var(--fs-whereby-primary) !important;
	border: 1px solid var(--fs-whereby-primary) !important;
}

.fs-whereby__card-invite:hover {
	background: var(--fs-whereby-primary) !important;
	color: #fff !important;
}

.fs-whereby__card-error {
	color: #b32d2e;
	font-size: 0.9rem;
	margin: 0;
}

/* ------------------------------------------------------------------
 * Multi: Eingebettetes iframe + Zurück-Link
 * --------------------------------------------------------------- */

.fs-whereby__embed {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.fs-whereby__embed[hidden] {
	display: none;
}

.fs-whereby__back {
	align-self: flex-start;
	color: var(--fs-whereby-primary);
	text-decoration: none;
	padding: 6px 0;
	font-weight: 600;
}

.fs-whereby__back:hover {
	text-decoration: underline;
}

/* Update v1.8.0: Toolbar im Multi-Embed (Zurück-Link + End-Session-Button + Toast). */
.fs-whereby__embed-toolbar {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.fs-whereby__embed .fs-whereby__iframe {
	width: 100%;
	border: 0;
	border-radius: var(--fs-whereby-radius);
	box-shadow: var(--fs-whereby-shadow);
}

/* Update v1.8.0: Sitzung-beenden-Button (Single + Multi).
   Optisch deutlich „destruktiv" gegenüber dem Standard-Primary,
   damit Hosts nicht versehentlich klicken. */
.fs-whereby__end-session {
	display: inline-block;
	background: #b32d2e;
	color: #fff;
	border: 0;
	padding: 10px 16px;
	border-radius: calc(var(--fs-whereby-radius) / 2);
	cursor: pointer;
	font: inherit;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.fs-whereby__end-session:hover {
	background: #8a1f20;
}

.fs-whereby__end-session:disabled {
	cursor: not-allowed;
	opacity: 0.65;
}

.fs-whereby__end-session[hidden] {
	display: none;
}

/* ------------------------------------------------------------------
 * Toast / Copy-Feedback
 * --------------------------------------------------------------- */

.fs-whereby__toast {
	display: inline-block;
	min-height: 1em;
	font-size: 0.9rem;
	color: #46b450;
	transition: opacity 0.4s ease;
	opacity: 0;
}

.fs-whereby__toast.is-visible {
	opacity: 1;
}

.fs-whereby__toast.is-error {
	color: #b32d2e;
}

/* ------------------------------------------------------------------
 * Logged-out / kein Projekt
 * --------------------------------------------------------------- */

.fs-whereby--loggedout {
	padding: 24px;
	background: var(--fs-whereby-card-bg);
	border-radius: var(--fs-whereby-radius);
	box-shadow: var(--fs-whereby-shadow);
	text-align: center;
}

.fs-whereby--loggedout .fs-whereby__notice p {
	margin: 0 0 12px;
}

.fs-whereby__login-actions {
	margin: 16px 0 0;
}
