/*
 * Shop Manager: Freemius dialogs (Update License, Send License Key, Change
 * User, Email address update) on the Shop Manager settings and Account pages.
 * Freemius prints them in the footer, outside every plugin wrapper, so they are
 * scoped through the wpkin-sm-fs-page body class (Admin\License::body_class).
 * The SDK's own CSS stays in charge of opening and closing them; these rules only
 * restyle. Same design as the Product Layouts dialogs, in the settings page green.
 */

body.wpkin-sm-fs-page .fs-modal {
	background: rgba(16, 24, 40, 0.55);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

body.wpkin-sm-fs-page .fs-modal .fs-modal-dialog {
	width: 520px;
	margin-left: -260px;
	padding-bottom: 0;
	overflow: hidden;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 24px 48px -12px rgba(16, 24, 40, 0.3);
	font-size: 14px;
	line-height: 1.5;
	color: #101828;
}

body.wpkin-sm-fs-page .fs-modal.active .fs-modal-dialog {
	top: 12%;
	animation: wpkin-sm-fs-pop 0.18s ease;
}

@keyframes wpkin-sm-fs-pop {
	from { opacity: 0; transform: translateY(8px) scale(0.98); }
	to { opacity: 1; transform: none; }
}

/* Header: title in normal case, an icon tile for each dialog */

body.wpkin-sm-fs-page .fs-modal .fs-modal-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 22px 56px 18px 24px;
	background: #ffffff;
	border-bottom: 1px solid #eaecf0;
}

body.wpkin-sm-fs-page .fs-modal .fs-modal-header::before {
	content: "\f112";
	flex: none;
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: dashicons;
	font-size: 20px;
	color: #2fb44b;
	background: #eaf7ed;
	border-radius: 10px;
}

body.wpkin-sm-fs-page .fs-modal-license-key-resend .fs-modal-header::before {
	content: "\f465";
}

body.wpkin-sm-fs-page .fs-modal-change-user .fs-modal-header::before {
	content: "\f110";
}

body.wpkin-sm-fs-page .fs-modal-email-address-update .fs-modal-header::before {
	content: "\f466";
}

body.wpkin-sm-fs-page .fs-modal .fs-modal-header h4 {
	font-size: 17px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0;
	text-transform: none;
	text-shadow: none;
	color: #101828;
}

body.wpkin-sm-fs-page .fs-modal .fs-modal-header .fs-close {
	top: 50%;
	right: 16px;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	color: #667085;
	text-decoration: none;
	border: 0;
	border-radius: 8px;
	transform: translateY(-50%);
	box-shadow: none;
}

body.wpkin-sm-fs-page .fs-modal .fs-modal-header .fs-close:hover {
	color: #101828;
	background: #f2f4f7;
}

body.wpkin-sm-fs-page .fs-modal .fs-modal-header .fs-close:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(47, 180, 75, 0.25);
}

/* Body */

body.wpkin-sm-fs-page .fs-modal .fs-modal-body {
	padding: 20px 24px 22px;
	background: #ffffff;
}

body.wpkin-sm-fs-page .fs-modal .fs-modal-body > div {
	margin-top: 0;
}

body.wpkin-sm-fs-page .fs-modal .fs-modal-body p {
	margin: 0 0 14px;
	font-size: 14px;
	line-height: 1.55;
	color: #475467;
}

body.wpkin-sm-fs-page .fs-modal .fs-modal-body p:empty {
	display: none;
}

body.wpkin-sm-fs-page .fs-modal .fs-modal-body a {
	font-weight: 500;
	color: #248c3a;
	text-decoration: none;
}

body.wpkin-sm-fs-page .fs-modal .fs-modal-body a:hover {
	text-decoration: underline;
}

body.wpkin-sm-fs-page .fs-modal .fs-modal-body a:focus {
	outline: none;
	border-radius: 4px;
	box-shadow: 0 0 0 3px rgba(47, 180, 75, 0.25);
}

/* Error box, shown by Freemius with jQuery .show() */
body.wpkin-sm-fs-page .fs-modal .fs-modal-panel > .notice.inline {
	margin: 0 0 14px;
	padding: 10px 14px;
	background: #fef3f2;
	border: 1px solid #fecdca;
	border-left-width: 4px;
	border-left-color: #d92d20;
	border-radius: 8px;
	box-shadow: none;
}

body.wpkin-sm-fs-page .fs-modal .fs-modal-panel > .notice.inline p {
	margin: 0;
	color: #b42318;
}

/* Fields */

body.wpkin-sm-fs-page .fs-modal input[type="text"] {
	box-sizing: border-box;
	height: 40px;
	min-height: 40px;
	margin: 0;
	padding: 0 12px;
	font-size: 14px;
	line-height: normal;
	color: #101828;
	background: #ffffff;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

body.wpkin-sm-fs-page .fs-modal input[type="text"]:focus {
	border-color: #2fb44b;
	outline: none;
	box-shadow: 0 0 0 4px rgba(47, 180, 75, 0.25);
}

body.wpkin-sm-fs-page .fs-modal input[type="text"][readonly] {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12.5px;
	color: #475467;
	background: #f9fafb;
	border-color: #eaecf0;
	box-shadow: none;
}

/*
 * The saved license in Update License. With one license Freemius shows it in a
 * read-only text field (a dropdown only with two or more licenses), which looked
 * like a box to type in. It reads as a choice instead: normal text, no text
 * selection, a pointer, and green when its radio is the selected one.
 */
body.wpkin-sm-fs-page .fs-modal input.fs-available-license-key[readonly] {
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	color: #101828;
	text-overflow: ellipsis;
	cursor: pointer;
	caret-color: transparent;
}

body.wpkin-sm-fs-page .fs-modal input.fs-available-license-key[readonly]::selection {
	background: transparent;
}

body.wpkin-sm-fs-page .fs-modal input.fs-available-license-key[readonly]:focus {
	box-shadow: none;
}

body.wpkin-sm-fs-page .fs-license-options-container tr:has(input[type="radio"]:checked) input.fs-available-license-key {
	color: #1b6b2c;
	background: #eaf7ed;
	border-color: #2fb44b;
}

/* Two or more licenses: Freemius shows a dropdown to pick one. */
body.wpkin-sm-fs-page .fs-modal select.fs-licenses {
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	height: 40px;
	min-height: 40px;
	margin: 0;
	padding: 0 36px 0 12px;
	font-size: 14px;
	font-weight: 500;
	line-height: 38px;
	color: #101828;
	background-color: #ffffff;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
	cursor: pointer;
}

body.wpkin-sm-fs-page .fs-modal select.fs-licenses:hover {
	color: #101828;
	border-color: #2fb44b;
}

body.wpkin-sm-fs-page .fs-modal select.fs-licenses:focus {
	border-color: #2fb44b;
	outline: none;
	box-shadow: 0 0 0 4px rgba(47, 180, 75, 0.25);
}

body.wpkin-sm-fs-page .fs-license-options-container tr:has(input[type="radio"]:checked) select.fs-licenses {
	background-color: #eaf7ed;
	border-color: #2fb44b;
}

body.wpkin-sm-fs-page .fs-modal input[type="radio"],
body.wpkin-sm-fs-page .fs-modal input[type="checkbox"] {
	margin: 0;
	accent-color: #2fb44b;
	border-color: #98a2b3;
}

body.wpkin-sm-fs-page .fs-modal input[type="radio"]:checked {
	border-color: #2fb44b;
}

body.wpkin-sm-fs-page .fs-modal input[type="radio"]:checked::before {
	background-color: #2fb44b;
}

body.wpkin-sm-fs-page .fs-modal input[type="radio"]:focus,
body.wpkin-sm-fs-page .fs-modal input[type="checkbox"]:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(47, 180, 75, 0.25);
}

/* Update License: the saved key and "Other" as two aligned rows */

body.wpkin-sm-fs-page .fs-license-options-container table,
body.wpkin-sm-fs-page .fs-user-change-options-container table {
	border-collapse: separate;
	border-spacing: 0 10px;
	margin: -10px 0 0;
}

body.wpkin-sm-fs-page .fs-license-options-container table td,
body.wpkin-sm-fs-page .fs-user-change-options-container table td {
	padding: 0;
	vertical-align: middle;
}

body.wpkin-sm-fs-page .fs-license-options-container table td:first-child,
body.wpkin-sm-fs-page .fs-user-change-options-container table td:first-child {
	padding-right: 12px;
}

/* Freemius gives this box a fixed 30px height with overflow hidden, which
   cuts off WordPress' 40px inputs. */
body.wpkin-sm-fs-page .fs-license-options-container table .fs-other-license-key-container {
	display: flex;
	align-items: center;
	gap: 10px;
}

body.wpkin-sm-fs-page .fs-license-options-container table .fs-other-license-key-container label {
	float: none;
	top: 0;
	margin: 0;
	font-weight: 500;
	color: #344054;
}

body.wpkin-sm-fs-page .fs-license-options-container table .fs-other-license-key-container div {
	flex: 1;
	height: auto;
	overflow: visible;
	top: 0;
}

body.wpkin-sm-fs-page .fs-modal a.show-license-resend-modal {
	margin-top: 4px;
	font-size: 13px;
}

body.wpkin-sm-fs-page .fs-modal .ownership-change-option-container {
	margin-top: 14px;
	padding: 12px 14px;
	background: #f9fafb;
	border: 1px solid #eaecf0;
	border-radius: 8px;
}

body.wpkin-sm-fs-page .fs-modal .ownership-change-option-container label {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* Send License Key and Change User */

body.wpkin-sm-fs-page .fs-modal-license-key-resend .email-address-container {
	overflow: visible;
	padding-right: 0;
}

body.wpkin-sm-fs-page .fs-modal-license-key-resend.fs-freemium label {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
	color: #344054;
}

body.wpkin-sm-fs-page .fs-modal-license-key-resend.fs-freemium input.email-address {
	flex: 1;
	width: auto;
}

body.wpkin-sm-fs-page .fs-modal-license-key-resend .button-container {
	margin-top: 6px;
	text-align: right;
}

body.wpkin-sm-fs-page .fs-user-change-options-container table tr {
	margin-bottom: 0;
}

body.wpkin-sm-fs-page .fs-user-change-options-container table .fs-other-email-address-container > div label {
	padding: 0 10px 0 0;
	font-weight: 500;
	color: #344054;
	vertical-align: middle;
}

body.wpkin-sm-fs-page .fs-modal-email-address-update ul {
	margin: 12px 0 0;
}

body.wpkin-sm-fs-page .fs-modal-email-address-update ul li {
	margin-bottom: 8px;
}

/* Footer and buttons */

body.wpkin-sm-fs-page .fs-modal .fs-modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding: 16px 24px;
	background: #f9fafb;
	border-top: 1px solid #eaecf0;
}

body.wpkin-sm-fs-page .fs-modal .fs-modal-footer > .button,
body.wpkin-sm-fs-page .fs-modal .fs-modal-footer > .button:last-of-type {
	margin: 0;
}

/* Main action last, whatever order Freemius prints the buttons in. */
body.wpkin-sm-fs-page .fs-modal .fs-modal-footer > .button-primary {
	order: 2;
}

body.wpkin-sm-fs-page .fs-modal .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 18px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	color: #101828;
	text-decoration: none;
	background: #ffffff;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
	transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

body.wpkin-sm-fs-page .fs-modal .button:hover {
	color: #248c3a;
	background: #ffffff;
	border-color: #2fb44b;
}

body.wpkin-sm-fs-page .fs-modal .button.button-primary {
	color: #ffffff;
	background: #2fb44b;
	border-color: #2fb44b;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), 0 4px 12px rgba(47, 180, 75, 0.25);
}

body.wpkin-sm-fs-page .fs-modal .button.button-primary:hover {
	color: #ffffff;
	background: #248c3a;
	border-color: #248c3a;
}

body.wpkin-sm-fs-page .fs-modal .button:focus {
	outline: none;
	box-shadow: 0 0 0 4px rgba(47, 180, 75, 0.25);
}

body.wpkin-sm-fs-page .fs-modal .button.disabled,
body.wpkin-sm-fs-page .fs-modal .button:disabled,
body.wpkin-sm-fs-page .fs-modal .button.button-primary.disabled,
body.wpkin-sm-fs-page .fs-modal .button.button-primary:disabled {
	color: #98a2b3 !important;
	background: #f2f4f7 !important;
	border-color: #eaecf0 !important;
	box-shadow: none !important;
	cursor: not-allowed;
}

@media (max-width: 650px) {
	body.wpkin-sm-fs-page .fs-modal .fs-modal-dialog {
		left: 12px;
		width: calc(100% - 24px);
		margin-left: 0;
		padding: 0;
	}

	body.wpkin-sm-fs-page .fs-modal .fs-modal-header,
	body.wpkin-sm-fs-page .fs-modal .fs-modal-body,
	body.wpkin-sm-fs-page .fs-modal .fs-modal-footer {
		padding-left: 16px;
		padding-right: 16px;
	}

	body.wpkin-sm-fs-page .fs-modal .fs-modal-footer {
		flex-direction: column-reverse;
	}
}
