/**
 * Tour Optimization — Login page (wp-login.php), split layout.
 * Colors/font come from the active Elementor Kit via inline custom
 * properties (Login\LoginScreen::enqueue); fallbacks below.
 * UiPress / Microthemer login styles are neutralized under body.tpo-login.
 */

body.login.tpo-login {
	--tpo-login-primary: #2563eb;
	--tpo-login-accent: #1abfc4;
	--tpo-login-text: #1b1b1b;
	--tpo-login-panel: #1e3a8a;
	--tpo-login-overlay: 0.55;
	--tpo-login-muted: color-mix(in srgb, var(--tpo-login-text) 62%, transparent);
	--tpo-login-border: color-mix(in srgb, var(--tpo-login-text) 16%, transparent);
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 100vh;
	margin: 0;
	padding: 32px 0 32px 50%;
	box-sizing: border-box;
	background: color-mix(in srgb, var(--tpo-login-primary) 5%, #f8fafc) !important;
	color: var(--tpo-login-text);
	font-family: var(--tpo-login-font, system-ui), system-ui, -apple-system, "Segoe UI", sans-serif;
}

body.tpo-login *,
body.tpo-login *::before,
body.tpo-login *::after {
	box-sizing: border-box;
}

/* —— Brand panel —— */

.tpo-login-panel {
	position: fixed;
	inset: 0 50% 0 0;
	display: flex;
	align-items: flex-end;
	padding: 56px;
	overflow: hidden;
	background:
		/* Kit Primary → Kit Secondary (Login page "Left panel" color overrides the start). */
		linear-gradient(150deg, var(--tpo-login-panel) 0%, var(--tpo-login-accent) 100%);
	color: #fff;
	isolation: isolate;
}

.tpo-login--has-bg .tpo-login-panel {
	background: var(--tpo-login-bg) center / cover no-repeat, var(--tpo-login-panel);
}

.tpo-login-panel::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	/* Only a soft bottom shade for text contrast — "Overlay strength" scales it. */
	background: linear-gradient(180deg, transparent 35%, color-mix(in srgb, var(--tpo-login-panel) 70%, #0b1b3a) 100%);
	opacity: calc(var(--tpo-login-overlay) * 0.5);
}

.tpo-login-panel__inner {
	max-width: 520px;
}

.tpo-login-panel__site {
	display: inline-block;
	margin: 0 0 16px;
	padding: 6px 14px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
	backdrop-filter: blur(6px);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.02em;
}

body.tpo-login .tpo-login-panel .tpo-login-panel__title,
body.tpo-login .tpo-login-panel .tpo-login-panel__text,
body.tpo-login .tpo-login-panel .tpo-login-panel__site,
body.tpo-login .tpo-login-panel .tpo-login-support__label {
	color: #fff !important;
}

.tpo-login-panel__title {
	margin: 0 0 12px;
	font-size: clamp(1.5rem, 2.4vw, 2.125rem);
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
}

.tpo-login-panel__text {
	margin: 0 0 28px;
	font-size: 1rem;
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.86);
}

/* —— Support contacts —— */

.tpo-login-support__label {
	margin: 0 0 10px;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	opacity: 0.8;
}

.tpo-login-support__list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tpo-login-support__list a,
.tpo-login-support__list > li > span {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px 8px 8px;
	border-radius: 999px;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tpo-login-support__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	font-size: 14px;
}

.tpo-login-support--panel a,
.tpo-login-support--panel li > span {
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
}

.tpo-login-support--panel a:hover,
.tpo-login-support--panel a:focus-visible {
	background: rgba(255, 255, 255, 0.26);
	color: #fff;
}

.tpo-login-support--panel .tpo-login-support__icon {
	background: rgba(255, 255, 255, 0.2);
}

.tpo-login-support--mobile {
	display: none;
}

/* —— UiPress moves #login into its own 300px card with a background image;
   flatten those wrappers so our layout owns the page. —— */

body.tpo-login #uip-login-wrap,
body.tpo-login #uip-login-form-wrap {
	display: block !important;
	width: 100% !important;
	height: auto !important;
	max-height: none !important;
	min-height: 0 !important;
	padding: 0 !important;
	background: none !important;
}

/* Microthemer/UiPress use `#uip-login-wrap #uip-login-form { width: 300px
   !important }` (2 ids) — match that weight plus body.tpo-login to win. */
body.tpo-login #uip-login-wrap #uip-login-form {
	width: 100% !important;
	max-width: 520px !important;
	margin: 0 auto !important;
	padding: 0 24px !important;
	padding-top: 0 !important;
	background: none !important;
	box-shadow: none !important;
	border: 0 !important;
	backdrop-filter: none !important;
}

body.tpo-login #uip-login-wrap p.submit {
	display: block !important;
	height: auto !important;
	background: none !important;
	border-radius: 0 !important;
	overflow: visible !important;
}

/* Microthemer paints a yellow `p.submit::after` layer on hover. */
body.tpo-login #uip-login-wrap p.submit::before,
body.tpo-login #uip-login-wrap p.submit::after {
	content: none !important;
	display: none !important;
}

/* —— Form column —— */

body.tpo-login #uip-login-wrap #login,
body.tpo-login #login {
	width: 100% !important;
	max-width: 472px;
	margin: 0 auto;
	padding: 44px 44px 36px !important;
	position: static;
	transform: none;
	border: 1px solid var(--tpo-login-border);
	border-radius: 24px;
	background: #fff;
	box-shadow: 0 30px 60px -32px color-mix(in srgb, var(--tpo-login-primary) 45%, rgba(15, 23, 42, 0.35));
}

body.tpo-login #login h1 {
	margin: 0 0 28px;
	text-align: left;
}

body.tpo-login #login h1 a {
	width: 200px;
	height: 60px;
	margin: 0;
	background-image: var(--tpo-login-logo, none);
	background-position: left center;
	background-size: contain;
	background-repeat: no-repeat;
	text-indent: -9999px;
}

.tpo-login-intro {
	margin: 0 0 20px;
}

.tpo-login-intro__title {
	margin: 0 0 6px;
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--tpo-login-text);
}

.tpo-login-intro__sub {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--tpo-login-muted);
}

body.tpo-login #loginform,
body.tpo-login #lostpasswordform,
body.tpo-login #resetpassform,
body.tpo-login #registerform {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	overflow: visible;
}

body.tpo-login #login form p,
body.tpo-login #login form .user-pass-wrap {
	margin-bottom: 18px;
}

body.tpo-login #login label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--tpo-login-text);
}

body.tpo-login #login input[type="text"],
body.tpo-login #login input[type="email"],
body.tpo-login #login input[type="password"] {
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 12px 16px;
	border: 1px solid var(--tpo-login-border);
	border-radius: 12px;
	background: #fff;
	box-shadow: none;
	font-family: inherit;
	font-size: 1rem;
	color: var(--tpo-login-text);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.tpo-login #login input[type="text"]:focus,
body.tpo-login #login input[type="email"]:focus,
body.tpo-login #login input[type="password"]:focus {
	border-color: var(--tpo-login-primary);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--tpo-login-primary) 16%, transparent);
	outline: none;
}

body.tpo-login .wp-pwd {
	position: relative;
}

body.tpo-login .wp-pwd .button.wp-hide-pw {
	top: 50%;
	right: 6px;
	height: 36px;
	min-height: 0;
	margin: 0;
	transform: translateY(-50%);
	border: 0;
	background: none;
	color: var(--tpo-login-muted);
}

body.tpo-login .wp-pwd .button.wp-hide-pw:hover,
body.tpo-login .wp-pwd .button.wp-hide-pw:focus {
	color: var(--tpo-login-primary);
	box-shadow: none;
}

/* "Remember me": core markup is <input> + <label> as siblings (not nested). */
body.tpo-login #login .forgetmenot {
	display: flex;
	align-items: center;
	gap: 10px;
	float: none;
	margin: 0 0 22px !important;
	line-height: 1.4;
}

body.tpo-login #login .forgetmenot label {
	display: inline-block;
	margin: 0 !important;
	padding: 0 !important;
	font-size: 0.875rem;
	font-weight: 500 !important;
	line-height: 1.4;
	color: var(--tpo-login-muted);
	cursor: pointer;
}

body.tpo-login #login input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	flex: none;
	display: inline-block;
	width: 20px;
	height: 20px;
	min-width: 20px;
	margin: 0 !important;
	padding: 0;
	border: 1.5px solid color-mix(in srgb, var(--tpo-login-text) 28%, transparent);
	border-radius: 6px;
	background: #fff;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

body.tpo-login #login input[type="checkbox"]:hover {
	border-color: var(--tpo-login-primary);
}

body.tpo-login #login input[type="checkbox"]:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--tpo-login-primary) 18%, transparent);
}

body.tpo-login #login input[type="checkbox"]:checked {
	border-color: var(--tpo-login-primary);
	background: var(--tpo-login-primary);
}

/* Replace core's dashicon tick with a centered CSS check. */
body.tpo-login #login input[type="checkbox"]:checked::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 6px;
	width: 5px;
	height: 10px;
	margin: 0;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	float: none;
}

body.tpo-login #login .submit {
	float: none;
	margin: 0;
	padding: 0;
}

body.tpo-login #login .button-primary {
	float: none;
	width: 100%;
	min-height: 54px;
	margin: 0;
	padding: 14px 20px;
	border: 0;
	border-radius: 12px;
	background: var(--tpo-login-primary);
	box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--tpo-login-primary) 70%, transparent);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
	text-shadow: none;
	transition: filter 0.15s ease, transform 0.15s ease;
}

body.tpo-login #login .button-primary:hover,
body.tpo-login #login .button-primary:focus {
	background: var(--tpo-login-primary);
	filter: brightness(1.07);
	transform: translateY(-1px);
	color: #fff;
}

body.tpo-login #login .message,
body.tpo-login #login .notice,
body.tpo-login #login #login_error {
	margin: 0 0 18px;
	padding: 12px 14px;
	border: 0;
	border-left: 4px solid var(--tpo-login-primary);
	border-radius: 10px;
	background: color-mix(in srgb, var(--tpo-login-primary) 7%, #fff);
	box-shadow: none;
	font-size: 0.875rem;
}

body.tpo-login #login #login_error,
body.tpo-login #login .notice-error {
	border-left-color: #dc2626;
	background: #fef2f2;
}

body.tpo-login #nav,
body.tpo-login #backtoblog {
	margin: 16px 0 0;
	padding: 0;
	font-size: 0.875rem;
	text-align: left;
}

body.tpo-login #nav a,
body.tpo-login #backtoblog a {
	color: var(--tpo-login-muted);
	text-decoration: none;
}

body.tpo-login #nav a:hover,
body.tpo-login #backtoblog a:hover {
	color: var(--tpo-login-primary);
}

body.tpo-login .privacy-policy-page-link,
body.tpo-login .language-switcher {
	text-align: left;
	max-width: 472px;
	margin: 16px auto 0;
	padding: 0 24px;
	width: 100%;
}

/* —— Tablet / mobile: panel becomes a top band —— */

@media (max-width: 900px) {
	body.login.tpo-login {
		justify-content: flex-start;
		height: auto !important;
		padding: 0 0 32px;
	}

	.tpo-login-panel {
		position: relative;
		inset: auto;
		align-items: flex-end;
		min-height: 180px;
		margin-bottom: 28px;
		padding: 28px 24px;
	}

	.tpo-login-panel__text,
	.tpo-login-support--panel {
		display: none;
	}

	.tpo-login-panel__title {
		margin: 0;
		font-size: 1.25rem;
	}

	.tpo-login-panel__site {
		margin-bottom: 10px;
	}

	body.tpo-login #uip-login-wrap #uip-login-form {
		padding: 0 16px !important;
	}

	/* UiPress moves the panel inside its 16px-padded form box — bleed it
	   back to the screen edges. */
	#uip-login-form .tpo-login-panel {
		margin-left: -16px;
		margin-right: -16px;
	}

	body.tpo-login #uip-login-wrap #login,
	body.tpo-login #login {
		padding: 28px 22px 24px !important;
		border-radius: 20px;
	}

	.tpo-login-intro__title {
		font-size: 1.375rem;
	}

	.tpo-login-support--mobile {
		display: block;
		width: 100%;
		max-width: 472px;
		margin: 28px auto 0;
		padding: 18px 24px 0;
		border-top: 1px solid var(--tpo-login-border);
	}

	.tpo-login-support--mobile .tpo-login-support__label {
		color: var(--tpo-login-muted);
	}

	.tpo-login-support--mobile a,
	.tpo-login-support--mobile li > span {
		border: 1px solid var(--tpo-login-border);
		background: #fff;
		color: var(--tpo-login-text);
	}

	.tpo-login-support--mobile a:hover {
		border-color: var(--tpo-login-primary);
		color: var(--tpo-login-primary);
	}

	.tpo-login-support--mobile .tpo-login-support__icon {
		background: color-mix(in srgb, var(--tpo-login-primary) 10%, #fff);
		color: var(--tpo-login-primary);
	}
}

@media (max-width: 380px) {
	body.tpo-login #login,
	.tpo-login-support--mobile {
		padding-left: 16px;
		padding-right: 16px;
	}
}
