/*
 * Modern login page (index.php). Loaded after the skin stylesheet and independent of it,
 * so the login screen looks the same whichever skin is the default.
 * Element ids and the wm_* class names toggled by class.login.js are kept as they were.
 */
:root
{
	--ml-font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
	--ml-text: #0f172a;
	--ml-text-2: #475569;
	--ml-muted: #94a3b8;
	--ml-border: #e2e8f0;
	--ml-border-strong: #cbd5e1;
	--ml-primary: #2563eb;
	--ml-primary-dark: #1d4ed8;
	--ml-hero-1: #1e3a8a;
	--ml-hero-2: #2563eb;
	--ml-hero-3: #0ea5e9;
	--ml-surface: #ffffff;
	--ml-bg: #f1f5f9;
}

html, body.ml-body
{
	height: 100%;
}

body.ml-body
{
	margin: 0;
	padding: 0;
	background: var(--ml-bg);
	color: var(--ml-text);
	font: normal 14px/1.5 var(--ml-font);
	-webkit-font-smoothing: antialiased;
}

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

.ml-body .wm_hide
{
	display: none !important;
}

.ml-page
{
	display: flex;
	min-height: 100vh;
}

/* ---- left: brand panel ---- */
.ml-hero
{
	position: relative;
	flex: 1 1 50%;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 48px 56px;
	color: #ffffff;
	background:
		radial-gradient(circle at 85% 15%, rgba(14, 165, 233, .45) 0, rgba(14, 165, 233, 0) 45%),
		radial-gradient(circle at 10% 90%, rgba(99, 102, 241, .45) 0, rgba(99, 102, 241, 0) 50%),
		linear-gradient(135deg, var(--ml-hero-1) 0%, var(--ml-hero-2) 100%);
	overflow: hidden;
}

.ml-hero::after
{
	/* subtle envelope pattern */
	content: "";
	position: absolute;
	right: -80px;
	bottom: -80px;
	width: 420px;
	height: 420px;
	opacity: .08;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2.5'/%3E%3Cpath d='m3.5 7 8.5 6 8.5-6'/%3E%3C/svg%3E") no-repeat center / contain;
	pointer-events: none;
}

.ml-brand
{
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 20px;
	font-weight: 600;
	letter-spacing: .2px;
	color: #ffffff;
	outline: none;
}

.ml-brand-icon
{
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: rgba(255, 255, 255, .16);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}

.ml-brand-icon svg
{
	width: 22px;
	height: 22px;
}

.ml-hero-text h1
{
	margin: 0 0 12px 0;
	font-size: 38px;
	line-height: 1.15;
	font-weight: 700;
	letter-spacing: -.5px;
	max-width: 460px;
}

.ml-hero-text p
{
	margin: 0;
	font-size: 16px;
	color: rgba(255, 255, 255, .82);
	max-width: 440px;
}

.ml-features
{
	list-style: none;
	margin: 28px 0 0 0;
	padding: 0;
}

.ml-features li
{
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 10px 0;
	color: rgba(255, 255, 255, .9);
}

.ml-features li::before
{
	content: "";
	flex: 0 0 20px;
	height: 20px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") no-repeat center / 12px 12px;
}

.ml-hero-foot
{
	font-size: 13px;
	color: rgba(255, 255, 255, .65);
}

/* ---- right: form panel ---- */
.ml-main
{
	flex: 1 1 50%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 24px;
}

.ml-card
{
	width: 100%;
	max-width: 400px;
}

.ml-card h2
{
	margin: 0 0 6px 0;
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -.3px;
}

.ml-card .ml-sub
{
	margin: 0 0 28px 0;
	color: var(--ml-text-2);
}

.ml-field
{
	margin: 0 0 16px 0;
}

.ml-field label
{
	display: block;
	margin: 0 0 6px 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--ml-text-2);
	cursor: default;
}

.ml-body #login_parent
{
	display: flex;
	align-items: center;
	gap: 6px;
}

.ml-body #domain
{
	color: var(--ml-text-2);
	white-space: nowrap;
}

.ml-body .wm_input, .ml-body .wm_input_focus,
.ml-body .wm_advanced_input, .ml-body .wm_advanced_input_focus
{
	width: 100%;
	height: 44px;
	padding: 0 14px;
	font: normal 15px var(--ml-font) !important;
	color: var(--ml-text);
	background: var(--ml-surface);
	border: 1px solid var(--ml-border-strong);
	border-radius: 10px;
	outline: none;
	letter-spacing: normal;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.ml-body .wm_input_focus, .ml-body .wm_advanced_input_focus,
.ml-body .wm_input:focus, .ml-body .wm_advanced_input:focus
{
	border-color: var(--ml-primary);
	box-shadow: 0 0 0 4px rgba(37, 99, 235, .15);
}

.ml-body .wm_password_input
{
	letter-spacing: 2px;
}

.ml-row
{
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 4px 0 22px 0;
	font-size: 13px;
	color: var(--ml-text-2);
}

.ml-check
{
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.ml-check input
{
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--ml-primary);
}

.ml-check label
{
	margin: 0;
	cursor: pointer;
}

.ml-body a.wm_reg
{
	color: var(--ml-primary);
	font-size: 13px;
	text-decoration: none;
}

.ml-body a.wm_reg:hover
{
	text-decoration: underline;
}

.ml-body #submit.wm_button
{
	width: 100%;
	height: 46px;
	padding: 0 16px;
	font: 600 15px var(--ml-font);
	color: #ffffff;
	background: var(--ml-primary);
	border: 0;
	border-radius: 10px;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
	transition: background-color .15s ease, transform .05s ease;
}

.ml-body #submit.wm_button:hover
{
	background: var(--ml-primary-dark);
}

.ml-body #submit.wm_button:active
{
	transform: translateY(1px);
}

.ml-body #submit.wm_button:focus-visible
{
	outline: 3px solid rgba(37, 99, 235, .4);
	outline-offset: 2px;
}

/* advanced login (server settings) */
.ml-body #advanced_fields
{
	margin: 0 0 16px 0;
	padding: 0;
	border: 1px solid var(--ml-border);
	border-radius: 10px;
	background: #f8fafc;
}

.ml-body #advanced_fields table
{
	width: 100%;
	border-collapse: separate;
	border-spacing: 6px;
	font-size: 13px;
	color: var(--ml-text-2);
}

.ml-body #advanced_fields .wm_advanced_input, .ml-body #advanced_fields .wm_advanced_input_focus
{
	height: 34px;
	padding: 0 8px;
	font-size: 13px !important;
	border-radius: 8px;
}

.ml-body #inc_port, .ml-body #out_port
{
	width: 64px;
}

.ml-body #inc_protocol
{
	width: 80px;
}

/* error and status messages */
.ml-body .wm_login_error
{
	margin: 0 0 20px 0;
	padding: 12px 14px 12px 42px;
	font-size: 14px;
	color: #991b1b;
	background: #fef2f2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v6M12 16.5v.5'/%3E%3C/svg%3E") no-repeat 14px center / 18px 18px;
	border: 1px solid #fecaca;
	border-radius: 10px;
	text-align: left;
	width: auto;
}

.ml-body .wm_information
{
	position: fixed;
	top: 16px;
	right: 16px;
	z-index: 20;
	background: var(--ml-text);
	color: #ffffff;
	border: 0;
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, .25);
}

.ml-body .wm_information .wm_info_message
{
	padding: 10px 16px !important;
	color: #ffffff;
	font: 500 14px var(--ml-font);
}

.ml-body .wm_tip
{
	position: absolute;
	z-index: 30;
	font: normal 13px var(--ml-font);
}

.ml-body .wm_tip_arrow
{
	width: 8px;
	background: none;
}

.ml-body .wm_tip_info
{
	padding: 8px 12px;
	color: #ffffff;
	background: var(--ml-text);
	border: 0;
	border-radius: 8px;
	box-shadow: 0 6px 16px rgba(15, 23, 42, .2);
}

/* progress table that check-mail-at-login appends into #content */
.ml-body #content > table:not(.ml-layout)
{
	margin: 24px auto 0 auto;
}

/* ---- e-mail client setup links ---- */
.ml-setup
{
	margin: 32px 0 0 0;
	padding: 20px 0 0 0;
	border-top: 1px solid var(--ml-border);
}

.ml-setup h3
{
	margin: 0 0 10px 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--ml-text-2);
	text-transform: uppercase;
	letter-spacing: .5px;
}

.ml-chips
{
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ml-chips a
{
	display: inline-block;
	padding: 6px 12px;
	font-size: 13px;
	color: var(--ml-text-2);
	text-decoration: none;
	background: var(--ml-surface);
	border: 1px solid var(--ml-border);
	border-radius: 999px;
	transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.ml-chips a:hover
{
	color: var(--ml-primary);
	border-color: var(--ml-primary);
}

.ml-chips a.ml-active
{
	color: #ffffff;
	background: var(--ml-primary);
	border-color: var(--ml-primary);
}

/* ---- partners ---- */
.ml-partners
{
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin: 40px 0 0 0;
}

.ml-partners img
{
	display: block;
	height: 26px;
	width: auto;
	filter: grayscale(1);
	opacity: .55;
	transition: filter .2s ease, opacity .2s ease;
}

.ml-partners a:hover img
{
	filter: none;
	opacity: 1;
}

/* ---- responsive ---- */
@media (max-width: 900px)
{
	.ml-page
	{
		flex-direction: column;
	}

	.ml-hero
	{
		flex: 0 0 auto;
		padding: 24px;
	}

	.ml-hero-text, .ml-hero-foot, .ml-hero::after
	{
		display: none;
	}

	.ml-main
	{
		justify-content: flex-start;
		padding: 32px 16px 40px 16px;
	}
}

@media (prefers-reduced-motion: reduce)
{
	.ml-body *
	{
		transition: none !important;
	}
}
