/**
 * License popover on WP admin CPT screens (Custom Fonts, Custom Icons).
 * Visuals match Theme Builder (.bdt-tb-license-popover-*).
 */

.bdt-tb-license-popover-root {
	--bdt-tb-popover-radius: 14px;
	--bdt-tb-popover-accent-a: #08aeec;
	--bdt-tb-popover-accent-b: #20e2ad;
	position: absolute;
	inset: 0;
	z-index: 100055;
	pointer-events: none;
	box-sizing: border-box;
}

.bdt-tb-license-popover-root.bdt-tb-license-popover-root--wp-admin {
	position: fixed;
	inset: 0;
	z-index: 100050;
	--bdt-tb-muted: #9da5ae;
	--bdt-tb-text: #515962;
}

.bdt-tb-license-popover-root[hidden] {
	display: none !important;
}

.bdt-tb-license-popover__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.22);
	pointer-events: auto;
	cursor: default;
	outline: none;
	border: none;
	padding: 0;
	margin: 0;
	display: block;
}

.bdt-tb-license-popover {
	position: fixed;
	top: 0;
	left: 0;
	box-sizing: border-box;
	min-width: min(296px, calc(100vw - 48px));
	max-width: min(392px, calc(100vw - 48px));
	pointer-events: auto;
	filter: drop-shadow(0 22px 50px rgba(15, 23, 42, 0.16));
	transition: opacity 0.14s ease, transform 0.14s ease;
}

@media (prefers-reduced-motion: reduce) {
	.bdt-tb-license-popover {
		transition: none;
	}
}

.bdt-tb-license-popover__card {
	position: relative;
	overflow: hidden;
	padding: 20px 22px 18px;
	background: #fff;
	border-radius: var(--bdt-tb-popover-radius);
	box-shadow:
		0 0 0 1px rgba(15, 23, 42, 0.05),
		0 14px 40px rgba(15, 23, 42, 0.1);
	border: none;
}

.bdt-tb-license-popover__head {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 14px;
	margin-bottom: 14px;
}

.bdt-tb-license-popover__lock {
	flex-shrink: 0;
	display: inline-flex;
	width: 40px;
	height: 40px;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	background: linear-gradient(145deg, #8e9aaf 0%, #5c6670 100%);
	color: #fff;
	box-shadow: none;
}

.bdt-tb-license-popover__lock .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
	line-height: 1;
	margin: 0;
}

.bdt-tb-license-popover__title {
	margin: 2px 0 0;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: -0.02em;
	color: #2c3338;
	flex: 1;
}

.bdt-tb-license-popover__desc {
	margin: 0;
	font-size: 13px;
	line-height: 1.55;
	color: var(--bdt-tb-muted);
}

.bdt-tb-license-popover__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
	padding-top: 18px;
	border-top: 1px solid rgba(15, 23, 42, 0.07);
}

.bdt-tb-license-popover__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	padding: 9px 16px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	font-family: inherit;
	transition:
		background 0.15s ease,
		opacity 0.15s ease,
		border-color 0.15s ease,
		box-shadow 0.15s ease,
		transform 0.12s ease;
	box-sizing: border-box;
	line-height: 1.25;
	border: none;
}

.bdt-tb-license-popover__btn:active {
	transform: translateY(0.5px);
}

@media (prefers-reduced-motion: reduce) {
	.bdt-tb-license-popover__btn:active {
		transform: none;
	}
}

.bdt-tb-license-popover__btn--ghost {
	margin-inline-start: auto;
	background: transparent;
	color: #6d7882;
	font-weight: 500;
	padding-inline: 10px;
	box-shadow: none;
}

.bdt-tb-license-popover__btn--ghost:hover,
.bdt-tb-license-popover__btn--ghost:focus {
	background: rgba(15, 23, 42, 0.04);
	color: #3d4349;
	outline: none;
}

.bdt-tb-license-popover__btn--ghost:focus-visible {
	outline: 2px solid var(--bdt-tb-popover-accent-a);
	outline-offset: 2px;
}

.bdt-tb-license-popover__btn--primary {
	background: linear-gradient(
		313deg,
		var(--bdt-tb-popover-accent-a) 0%,
		var(--bdt-tb-popover-accent-b) 100%
	);
	color: #fff !important;
	border: none;
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 6px 16px rgba(8, 174, 236, 0.25);
}

.bdt-tb-license-popover__btn--primary:hover,
.bdt-tb-license-popover__btn--primary:focus {
	opacity: 0.94;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.2) inset,
		0 8px 20px rgba(8, 174, 236, 0.3);
	color: #fff !important;
	outline: none;
}

.bdt-tb-license-popover__btn--primary:focus-visible {
	outline: 2px solid var(--bdt-tb-popover-accent-a);
	outline-offset: 2px;
}

#bdt-tb-license-popover-license,
#bdt-tb-license-popover-license:hover,
#bdt-tb-license-popover-license:focus,
#bdt-tb-license-popover-license:active {
	box-shadow: none;
}

.bdt-tb-license-popover__btn.bdt-tb-license-popover__btn--outline {
	background: #fff;
	color: var(--bdt-tb-text) !important;
	border: 1px solid #d0d7de;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.bdt-tb-license-popover__btn.bdt-tb-license-popover__btn--outline:hover,
.bdt-tb-license-popover__btn.bdt-tb-license-popover__btn--outline:focus {
	background: #f6f8fa;
	border-color: #c3cdd5;
	outline: none;
}

.bdt-tb-license-popover__btn.bdt-tb-license-popover__btn--outline:focus-visible {
	outline: 2px solid var(--bdt-tb-popover-accent-a);
	outline-offset: 2px;
}

@media screen and (max-width: 400px) {
	.bdt-tb-license-popover__actions .bdt-tb-license-popover__btn--primary {
		flex: 1 1 100%;
		order: -2;
	}

	.bdt-tb-license-popover__actions .bdt-tb-license-popover__btn--outline {
		flex: 1 1 auto;
		order: -1;
	}

	.bdt-tb-license-popover__btn--ghost {
		margin-inline-start: 0;
		flex: 1 1 100%;
		text-align: center;
	}
}

/* Locked “Add New” on list screens */
.wrap > a.page-title-action.ep-pack-add-new-license-locked {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	cursor: pointer !important;
	opacity: 0.88;
	position: relative;
	padding-inline-start: 30px !important;
	text-decoration: none !important;
}

.wrap > a.page-title-action.ep-pack-add-new-license-locked:focus {
	box-shadow: 0 0 0 var(--wp-admin-border-width-focus, 1px) var(--wp-admin-theme-color-darker-15, #0a4b78);
	outline: 2px solid transparent;
}

.wrap > a.page-title-action.ep-pack-add-new-license-locked::before {
	content: "\f160";
	font-family: dashicons;
	font-size: 16px;
	width: 18px;
	height: 18px;
	line-height: 1;
	speak: none;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	position: absolute;
	inset-inline-start: 8px;
	top: 50%;
	transform: translateY(-50%);
	opacity: 0.95;
}
