/* ======================================================================
 * FB pencere standardı
 *
 * One component, four variants, two shapes: a centred window on desktop,
 * a bottom sheet on phones. Every popup this plugin prints uses this
 * shell — only the badge, the copy and the buttons change.
 *
 * Two rules that matter more than the rest:
 *
 *   1. Nothing is ever bordered in white. The edge is an inset ring
 *      (`inset 0 0 0 1px`), not a `border`. A border sits outside the
 *      fill and catches light; a ring is part of the surface.
 *
 *   2. Opened windows are focused so screen readers land inside them,
 *      but a focus ring is never drawn on a container nobody tabbed to.
 * ==================================================================== */

.fbmg-scrim {
	--fbmg-shell: #12141e;
	--fbmg-shell-2: #0e1017;
	--fbmg-sunk: #0b0d14;
	--fbmg-edge: rgba(255, 255, 255, 0.07);
	--fbmg-edge-2: rgba(255, 255, 255, 0.04);
	--fbmg-ink: #f1f3f9;
	--fbmg-ink2: #a6acbf;
	--fbmg-ink3: #6b7183;
	--fbmg-violet: #6c5ce7;
	--fbmg-ok: #28c08a;
	--fbmg-grad: linear-gradient(90deg, #6c5ce7 0%, #a33bc9 52%, #d6004a 100%);
	--fbmg-r: 20px;
	--fbmg-r-in: 13px;
	--fbmg-r-btn: 11px;
	--fbmg-pad: 24px;

	position: fixed;
	inset: 0;
	z-index: 100000;
	background: radial-gradient(120% 90% at 50% 0%, rgba(20, 10, 40, 0.72), rgba(5, 6, 10, 0.88));
	backdrop-filter: blur(8px) saturate(0.9);
	display: grid;
	place-items: center;
	padding: 56px 18px 24px;
	overflow-y: auto;
}

.fbmg-scrim[hidden],
.fbmg-scrim.fbmg-closed { display: none; }

.fbmg-modal {
	position: relative;
	width: 100%;
	max-width: 460px;
	background: linear-gradient(180deg, var(--fbmg-shell) 0%, var(--fbmg-shell-2) 100%);
	border: 0;
	border-radius: var(--fbmg-r);
	overflow: hidden;
	max-height: calc(100vh - 84px);
	overflow-y: auto;
	box-shadow:
		inset 0 0 0 1px var(--fbmg-edge),
		inset 0 1px 0 rgba(255, 255, 255, 0.055),
		0 34px 80px rgba(0, 0, 0, 0.6),
		0 6px 20px rgba(0, 0, 0, 0.4);
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--fbmg-ink);
	line-height: 1.55;
	animation: fbmg-rise 0.28s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.fbmg-modal:focus,
.fbmg-modal:focus-visible { outline: none; }

@keyframes fbmg-rise { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fbmg-modal { animation: none; } }

.fbmg-modal * { box-sizing: border-box; }

.fbmg-top { height: 3px; background: var(--fbmg-grad); }

.fbmg-x {
	position: absolute;
	top: 13px;
	right: 13px;
	z-index: 6;
	width: 31px;
	height: 31px;
	border-radius: 10px;
	border: 0;
	cursor: pointer;
	padding: 0;
	background: rgba(10, 12, 19, 0.66);
	backdrop-filter: blur(8px);
	display: grid;
	place-items: center;
	box-shadow: inset 0 0 0 1px var(--fbmg-edge);
}

.fbmg-x svg { width: 14px; height: 14px; stroke: #c9cedd; fill: none; stroke-width: 2; stroke-linecap: round; }
.fbmg-x:hover { background: rgba(10, 12, 19, 0.92); }

/* ---------------- media ---------------- */

.fbmg-video {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #0a0c13;
	overflow: hidden;
	box-shadow: inset 0 -1px 0 var(--fbmg-edge-2);
}

.fbmg-thumb {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(60% 70% at 30% 30%, rgba(108, 92, 231, 0.34), transparent 70%),
		radial-gradient(50% 60% at 75% 70%, rgba(214, 0, 74, 0.26), transparent 70%),
		#0c0f16;
}

.fbmg-grid {
	position: absolute;
	inset: 0;
	opacity: 0.42;
	background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
	                  linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
	background-size: 42px 42px;
}

.fbmg-play {
	position: absolute;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	width: 54px; height: 54px;
	border-radius: 99px;
	border: 0;
	cursor: pointer;
	padding: 0;
	background: var(--fbmg-grad);
	display: grid;
	place-items: center;
	box-shadow: 0 10px 28px rgba(108, 92, 231, 0.42);
}

.fbmg-play svg { width: 19px; height: 19px; fill: #fff; margin-left: 3px; }
.fbmg-play:hover { filter: brightness(1.08); }

.fbmg-vmeta { position: absolute; left: 13px; bottom: 11px; display: flex; align-items: center; gap: 8px; }
.fbmg-dot { width: 23px; height: 23px; border-radius: 7px; flex: none; display: grid; place-items: center; font-size: 9px; font-weight: 800; color: #fff; background: var(--fbmg-grad); }
.fbmg-vmeta b { font-size: 11.5px; font-weight: 700; display: block; line-height: 1.2; }
.fbmg-vmeta em { font-style: normal; font-size: 9.5px; color: var(--fbmg-ink3); font-family: ui-monospace, Menlo, monospace; }

.fbmg-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.fbmg-unmute {
	position: absolute;
	left: 12px; bottom: 12px;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 7px 12px !important;
	border: 0 !important;
	border-radius: 99px !important;
	cursor: pointer;
	background: rgba(10, 12, 19, 0.82) !important;
	backdrop-filter: blur(8px);
	color: #f1f3f9 !important;
	font-size: 12px !important;
	font-weight: 600;
	line-height: 1 !important;
	box-shadow: inset 0 0 0 1px var(--fbmg-edge);
}

.fbmg-unmute:hover { background: rgba(10, 12, 19, 0.95) !important; }
.fbmg-unmute svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- body ---------------- */

.fbmg-body { padding: var(--fbmg-pad); text-align: center; }

.fbmg-badge {
	width: 48px; height: 48px;
	border-radius: 15px;
	margin: 0 auto 13px;
	position: relative;
	z-index: 3;
	display: grid;
	place-items: center;
	background: var(--fbmg-grad);
	box-shadow: 0 9px 26px rgba(163, 59, 201, 0.38);
}

.fbmg-video + .fbmg-body .fbmg-badge {
	margin-top: -48px;
	box-shadow: 0 9px 26px rgba(163, 59, 201, 0.38), 0 0 0 5px var(--fbmg-shell);
}

.fbmg-badge svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.fbmg-badge.is-err { background: linear-gradient(90deg, #e2536b, #d6004a); box-shadow: 0 9px 26px rgba(214, 0, 74, 0.38); }
.fbmg-video + .fbmg-body .fbmg-badge.is-err { box-shadow: 0 9px 26px rgba(214, 0, 74, 0.38), 0 0 0 5px var(--fbmg-shell); }

.fbmg-badge.is-ok { background: linear-gradient(90deg, #28c08a, #12a57a); box-shadow: 0 9px 26px rgba(40, 192, 138, 0.3); }
.fbmg-video + .fbmg-body .fbmg-badge.is-ok { box-shadow: 0 9px 26px rgba(40, 192, 138, 0.3), 0 0 0 5px var(--fbmg-shell); }

.fbmg-body h2 { margin: 0 0 7px; font-size: 19.5px; font-weight: 800; letter-spacing: -0.022em; line-height: 1.25; color: var(--fbmg-ink); }
.fbmg-lead { margin: 0 auto 16px; font-size: 13.5px; color: var(--fbmg-ink2); max-width: 42ch; line-height: 1.55; }

/* reference number, email address — same chip either way */
.fbmg-ref,
.fbmg-mail {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: ui-monospace, Menlo, monospace;
	font-size: 11.5px;
	color: var(--fbmg-ink);
	background: var(--fbmg-sunk);
	border: 0;
	border-radius: 9px;
	padding: 7px 12px;
	margin: 0 0 16px;
	box-shadow: inset 0 0 0 1px var(--fbmg-edge);
}

.fbmg-ref strong { color: var(--fbmg-ink); }
.fbmg-mail svg { width: 13px; height: 13px; stroke: var(--fbmg-violet); fill: none; stroke-width: 1.9; }

/* ---------------- steps ----------------
   Number and title on one line, note directly beneath: about a quarter
   shorter than giving each row two blocks. */

.fbmg-steps {
	text-align: left;
	background: var(--fbmg-sunk);
	border: 0;
	border-radius: var(--fbmg-r-in);
	padding: 5px 15px;
	margin-bottom: 18px;
	box-shadow: inset 0 0 0 1px var(--fbmg-edge);
}

.fbmg-st { display: flex; gap: 10px; padding: 9px 0; box-shadow: inset 0 -1px 0 var(--fbmg-edge-2); }
.fbmg-st:last-child { box-shadow: none; }

.fbmg-n {
	width: 19px; height: 19px;
	border-radius: 99px;
	flex: none;
	display: grid;
	place-items: center;
	font-size: 10px;
	font-weight: 700;
	background: #1b1f2b;
	color: var(--fbmg-ink2);
	border: 0;
	margin-top: 1px;
	box-shadow: inset 0 0 0 1px var(--fbmg-edge);
}

.fbmg-st.is-done .fbmg-n { background: var(--fbmg-ok); color: #08110d; box-shadow: none; }
.fbmg-st b { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.fbmg-st p { margin: 1px 0 0; font-size: 11.5px; color: var(--fbmg-ink3); line-height: 1.4; }

/* ---------------- actions ---------------- */

.fbmg-acts { display: flex; flex-direction: column; gap: 8px; }

.fbmg-btn {
	font: inherit;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	border-radius: var(--fbmg-r-btn);
	padding: 12px 16px;
	border: 0;
	background: #171b26;
	color: var(--fbmg-ink);
	display: block;
	width: 100%;
	text-align: center;
	text-decoration: none;
	box-shadow: inset 0 0 0 1px var(--fbmg-edge);
}

.fbmg-btn:hover { background: #1c2130; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
.fbmg-p { background: var(--fbmg-grad); box-shadow: 0 7px 20px rgba(108, 92, 231, 0.3); color: #fff; }
.fbmg-p:hover { filter: brightness(1.08); }

.fbmg-foot {
	padding: 12px var(--fbmg-pad) 18px;
	text-align: center;
	font-size: 11px;
	color: var(--fbmg-ink3);
	line-height: 1.55;
	box-shadow: inset 0 1px 0 var(--fbmg-edge-2);
}

.fbmg-foot a { color: #9e8cff; text-decoration: none; }

/* ======================================================================
 * Theme isolation.
 *
 * The window is injected into the live page, so the theme's own link and
 * button rules apply to it — which once turned the primary button's label
 * purple and "Kapat" red. Anchors and buttons are reset inside the scrim
 * and the colours reasserted at higher specificity.
 *
 * !important is deliberate: this markup is a guest in someone else's
 * stylesheet, and losing a colour battle means unreadable text on a
 * confirmation screen.
 * ==================================================================== */

.fbmg-scrim a,
.fbmg-scrim button {
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none !important;
	transition: none;
}

.fbmg-scrim a::after, .fbmg-scrim a::before,
.fbmg-scrim button::after, .fbmg-scrim button::before { content: none; }

.fbmg-scrim .fbmg-btn,
.fbmg-scrim a.fbmg-btn,
.fbmg-scrim button.fbmg-btn,
.fbmg-scrim .fbmg-btn:link,
.fbmg-scrim .fbmg-btn:visited {
	color: #f1f3f9 !important;
	background: #171b26 !important;
	border: 0 !important;
}

.fbmg-scrim .fbmg-btn:hover,
.fbmg-scrim .fbmg-btn:focus,
.fbmg-scrim .fbmg-btn:active { color: #fff !important; background: #1c2130 !important; }

.fbmg-scrim .fbmg-btn.fbmg-p,
.fbmg-scrim a.fbmg-btn.fbmg-p,
.fbmg-scrim button.fbmg-btn.fbmg-p,
.fbmg-scrim .fbmg-btn.fbmg-p:link,
.fbmg-scrim .fbmg-btn.fbmg-p:visited,
.fbmg-scrim .fbmg-btn.fbmg-p:hover,
.fbmg-scrim .fbmg-btn.fbmg-p:focus,
.fbmg-scrim .fbmg-btn.fbmg-p:active {
	color: #fff !important;
	background: linear-gradient(90deg, #6c5ce7 0%, #a33bc9 52%, #d6004a 100%) !important;
	border: 0 !important;
	text-shadow: none;
}

.fbmg-scrim .fbmg-x,
.fbmg-scrim button.fbmg-x,
.fbmg-scrim .fbmg-x:hover,
.fbmg-scrim .fbmg-x:focus { border: 0 !important; color: #c9cedd !important; }

.fbmg-scrim .fbmg-play, .fbmg-scrim button.fbmg-play { border: 0 !important; }

.fbmg-scrim .fbmg-body h2 { color: #f1f3f9 !important; }
.fbmg-scrim .fbmg-lead { color: #a6acbf !important; }
.fbmg-scrim .fbmg-st b { color: #f1f3f9 !important; }
.fbmg-scrim .fbmg-st p { color: #6b7183 !important; }
.fbmg-scrim .fbmg-foot { color: #6b7183 !important; }

/* Keyboard focus must survive the resets above. */
.fbmg-scrim .fbmg-btn:focus-visible,
.fbmg-scrim .fbmg-x:focus-visible,
.fbmg-scrim .fbmg-play:focus-visible {
	outline: 2px solid #6c5ce7 !important;
	outline-offset: 2px !important;
}

/* ======================================================================
 * Phones: a bottom sheet, not a shrunken window.
 *
 * Anchored to the bottom where a thumb reaches, full width, rounded only
 * at the top. Touch targets grow here rather than shrink.
 * ==================================================================== */

@media (max-width: 560px) {
	.fbmg-scrim { --fbmg-pad: 18px; padding: 0; place-items: end; }

	.fbmg-modal {
		max-width: none;
		border-radius: 22px 22px 0 0;
		max-height: 90vh;
		animation: fbmg-sheet 0.32s cubic-bezier(0.2, 0.7, 0.3, 1);
	}

	@keyframes fbmg-sheet { from { transform: translateY(100%); } to { transform: none; } }

	.fbmg-top { display: none; }

	/* Grab handle, so it reads as a sheet rather than a stuck window. */
	.fbmg-modal::before {
		content: "";
		position: absolute;
		top: 8px; left: 50%;
		transform: translateX(-50%);
		width: 38px; height: 4px;
		border-radius: 99px;
		background: rgba(255, 255, 255, 0.18);
		z-index: 7;
	}

	.fbmg-x { top: 15px; right: 12px; }
	.fbmg-body { padding: 22px 18px 20px; }
	.fbmg-body h2 { font-size: 18.5px; }
	.fbmg-lead { font-size: 13px; margin-bottom: 14px; }
	.fbmg-btn { padding: 14px 16px; font-size: 14px; }
	.fbmg-foot { padding: 11px 18px 24px; }
	.fbmg-steps { padding: 4px 13px; }
}

@media print { .fbmg-scrim { display: none; } }

/* Step body wrapper — keeps a long title from pushing the number out. */
.fbmg-sb { min-width: 0; }

/* The button added to fb-tutorials' lock overlay. Sits beside its own two
   rather than introducing a third style. */
.fbmg-trigger {
	font: inherit;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	border-radius: 11px;
	padding: 11px 18px;
	border: 0;
	background: rgba(108, 92, 231, 0.14);
	color: #c7b6ff;
	box-shadow: inset 0 0 0 1px rgba(108, 92, 231, 0.4);
}

.fbmg-trigger:hover { background: rgba(108, 92, 231, 0.24); color: #fff; box-shadow: inset 0 0 0 1px rgba(108, 92, 231, 0.7); }
.fbmg-trigger:focus-visible { outline: 2px solid #6c5ce7; outline-offset: 2px; }
