#bm-custom-login-settings-page {
	iframe {
		aspect-ratio: 7 / 5;
		transition: opacity 0.1s ease-in-out;
		width: 100%;
	}

	.tsc-settings-tabs,
	.tsc-settings-tabs .components-tab-panel__tabs {
		max-width: 1600px;
	}

	.tsc-settings-tabs {
		.tsc-settings-tabs__wrapper {
			width: 100%;
		}

		.tsc-settings-sidebar {
			width: 50%;
			max-width: 600px;
		}
	}
}

@supports (zoom: 1) {
	#bm-custom-login-settings-page iframe {
		zoom: 65%;
	}
}

/**
 * Preview panel
 */
.bm-custom-login-settings-page__preview-panel {
	line-height: 0;
	margin-top: 1rem !important;
	position: sticky;
	top: calc(145px + 1rem);
	z-index: 2000;

	.tsc-waiting-indicator {
		padding: 12px 16px;
	}

	.components-notice {
		line-height: 1.4;
	}
}

.bm-custom-login-settings-page__preview {
	position: relative;
}

.bm-custom-login-settings-page__preview-reload-wrapper {
	align-items: center;
	display: flex;
	height: 100%;
	justify-content: center;
	left: 0;
	position: absolute;
	top: 0;
	width: 100%;
}

/**
 * Templates panel
 */
.bm-custom-login-settings-page__templates {
	container: bm-custom-login-templates / inline-size;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	position: relative;

	// Invisible filler to prevent space-between from spreading items in incomplete last rows.
	&::after {
		content: "";
		width: calc((100% - 1rem) / 2); // Match the 2 columns item width.
	}

	@container bm-custom-login-templates (width > 650px) {
		&::after {
			width: calc((100% - 2rem) / 3); // Match the 3 columns item width.
		}
	}
}

.components-notice + .bm-custom-login-settings-page__templates {
	margin-top: 1rem;
}

.bm-custom-login-settings-page__templates-overlay {
	--wp-components-color-accent-darker-10: #111;
	--wp-components-color-accent: #262626;
	align-items: center;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 1) 97%);
	content: "";
	display: flex;
	height: 100%;
	justify-content: center;
	left: 0;
	position: absolute;
	top: 0;
	width: 100%;
}

.bm-custom-login-settings-page__template {
	background-color: #fff;
	border-radius: 2px;
	border: 1px solid #e0e0e0;
	display: flex;
	flex-direction: column;
	margin-top: 1rem;
	overflow: hidden;
	padding: 0;
	width: calc((100% - 1rem) / 2); // 2 columns layout.

	&:nth-child(1),
	&:nth-child(2) {
		margin-top: 0;
	}

	img {
		border-bottom: 1px solid #e0e0e0;
		display: block;
		width: 100%;
	}

	@container bm-custom-login-templates (width > 650px) {
		width: calc((100% - 2rem) / 3); // Switch to 3 columns on bigger screens.

		&:nth-child(3) {
			margin-top: 0;
		}
	}

	@container bm-custom-login-templates (width < 651px) {
		&:not(.bm-custom-login-settings-page__template--pro):nth-child(5),
		&:not(.bm-custom-login-settings-page__template--pro):nth-child(6) {
			display: none;
		}
	}
}

.bm-custom-login-settings-page__template-info {
	display: flex;
	flex-direction: column;
	flex: 1;
	justify-content: space-between;
	padding: 1rem;

	h3 {
		font-size: 13px;
		margin: 0 0 1rem;
		padding: 0;
	}
}

.bm-custom-login-settings-page__template-actions {
	align-items: center;
	display: flex;
	gap: 0.5rem;

	svg {
		fill: #307d07;
		transition: opacity 0.5s ease-out;

		&.is-fading-out {
			opacity: 0;
		}
	}
}
