/* Zone Game Mall: login page only, in the main site's look. Inner pages use Elastic. */
@font-face { font-family: 'Prompt'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/prompt-400.woff2') format('woff2'); }
@font-face { font-family: 'Prompt'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/prompt-500.woff2') format('woff2'); }
@font-face { font-family: 'Prompt'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/prompt-600.woff2') format('woff2'); }
@font-face { font-family: 'Prompt'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/prompt-700.woff2') format('woff2'); }

:root {
	--zgm-page: #111216;
	--zgm-text: #f0f1f4;
	--zgm-muted: #a0a4af;
	--zgm-layer: rgb(26 17 18 / 0.94);
	--zgm-layer: oklch(0.17 0.014 24 / 0.94);
	--zgm-field: #292a32;
	--zgm-red: #be222d;
	--zgm-red: oklch(0.52 0.19 24);
	--zgm-red-hover: #a50c1f;
	--zgm-red-hover: oklch(0.46 0.18 24);
	--zgm-glow: rgb(190 34 45 / 0.1);
	color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body.zgm-login {
	min-height: 100vh;
	min-height: 100svh;
	background-color: var(--zgm-page);
	background-image:
		radial-gradient(circle at 8% 6%, rgb(190 34 45 / 0.09), transparent 432px),
		radial-gradient(circle at 92% 18%, rgb(160 24 36 / 0.08), transparent 400px);
	color: var(--zgm-text);
	font-family: 'Prompt', 'Noto Sans Thai', system-ui, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

body.zgm-login::before {
	content: '';
	position: fixed;
	inset: 0;
	pointer-events: none;
	background-image:
		linear-gradient(rgb(240 241 244 / 0.03) 1px, transparent 1px),
		linear-gradient(90deg, rgb(240 241 244 / 0.03) 1px, transparent 1px);
	background-size: 44px 44px;
	-webkit-mask-image: linear-gradient(to bottom, #000, transparent 76%);
	mask-image: linear-gradient(to bottom, #000, transparent 76%);
}

.zgm-shell {
	position: relative;
	display: flex;
	min-height: 100vh;
	min-height: 100svh;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 20px;
	padding: 16px;
}

.zgm-card {
	position: relative;
	width: 100%;
	max-width: 448px;
	overflow: hidden;
	padding: 28px 20px 24px;
	border-radius: 32px;
	background: var(--zgm-layer);
	box-shadow: 0 28px 80px -46px rgb(127 29 29 / 0.5);
	text-align: center;
}

.zgm-card-bar {
	position: absolute;
	top: 0;
	left: 64px;
	right: 64px;
	height: 4px;
	background: var(--zgm-red);
}

.zgm-card-glow {
	position: absolute;
	top: -96px;
	right: -96px;
	width: 208px;
	height: 208px;
	border-radius: 50%;
	background: var(--zgm-glow);
	filter: blur(64px);
	pointer-events: none;
}

.zgm-logo {
	position: relative;
	display: block;
	width: 200px;
	height: auto;
	margin: 0 auto 12px;
}

.zgm-card h1 {
	position: relative;
	margin: 0 0 24px;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.zgm-form { position: relative; text-align: left; }

.zgm-form table,
.zgm-form tbody,
.zgm-form tr,
.zgm-form td { display: block; width: 100%; padding: 0; border: 0; }

.zgm-form tr { margin-bottom: 18px; }

.zgm-form td.title { padding-bottom: 8px; }

.zgm-form label {
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
}

.zgm-form input.zgm-input {
	display: block;
	width: 100%;
	height: 44px;
	margin: 0;
	padding: 0 14px;
	border: 0;
	border-radius: 16px;
	background: var(--zgm-field);
	color: var(--zgm-text);
	font: 400 16px/1.4 'Prompt', 'Noto Sans Thai', system-ui, sans-serif;
	outline: none;
	transition: box-shadow 150ms ease;
}

.zgm-form input.zgm-input::placeholder { color: #6f7380; opacity: 1; }

.zgm-form input.zgm-input:focus-visible {
	box-shadow: 0 0 0 2px var(--zgm-red);
}

.zgm-form input.zgm-input:-webkit-autofill {
	-webkit-box-shadow: 0 0 0 40px var(--zgm-field) inset;
	-webkit-text-fill-color: var(--zgm-text);
	caret-color: var(--zgm-text);
}

.zgm-form .formbuttons { margin: 26px 0 0; }

.zgm-form #rcmloginsubmit {
	display: block;
	width: 100%;
	height: 48px;
	border: 0;
	border-radius: 16px;
	background: var(--zgm-red);
	color: #fff;
	font: 600 15px/1 'Prompt', 'Noto Sans Thai', system-ui, sans-serif;
	cursor: pointer;
	transition: background-color 150ms ease;
}

.zgm-form #rcmloginsubmit:hover { background: var(--zgm-red-hover); }

.zgm-form #rcmloginsubmit:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.zgm-back {
	position: relative;
	color: var(--zgm-muted);
	font-size: 13px;
	text-decoration: none;
	transition: color 150ms ease;
}

.zgm-back:hover { color: var(--zgm-text); }

.zgm-back:focus-visible {
	outline: 2px solid var(--zgm-red);
	outline-offset: 4px;
	border-radius: 6px;
}

.zgm-noscript {
	position: fixed;
	bottom: 16px;
	left: 16px;
	right: 16px;
	margin: 0;
	padding: 12px 16px;
	border-radius: 14px;
	background: #3a1418;
	text-align: center;
	font-size: 14px;
}

/* Errors such as a wrong password, shown by Roundcube's script. */
#messagestack {
	position: fixed;
	top: 16px;
	left: 50%;
	z-index: 50;
	width: min(420px, calc(100% - 32px));
	transform: translateX(-50%);
}

#messagestack > div {
	margin-bottom: 8px;
	padding: 12px 16px;
	border-radius: 14px;
	background: #2a2b33;
	color: var(--zgm-text);
	font-size: 14px;
	line-height: 1.45;
	box-shadow: 0 12px 30px -12px rgb(0 0 0 / 0.6);
}

#messagestack > div.error,
#messagestack > div.warning { background: #4a161c; }

#messagestack > div.confirmation { background: #163a27; }

@media (min-width: 640px) {
	.zgm-shell { padding: 40px; }
	.zgm-card { padding: 36px 32px 32px; }
	.zgm-logo { width: 232px; }
	.zgm-card h1 { font-size: 28px; }
}

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

@media (forced-colors: active) {
	.zgm-form input.zgm-input,
	.zgm-form #rcmloginsubmit { border: 1px solid CanvasText; }
}
