/* XC_VM admin login — HUD Core Access styles. Loaded by Views/admin/login.php. */
:root {
	--red: #ff1744;
	--red-soft: #ff4d63;
	--red-deep: #90001d;
	--red-glow: rgba(255, 23, 68, 0.55);
	--text: #edf1f7;
	--muted: #8a95a6;
	--dim: #6a7484;
	--line: rgba(164, 180, 205, 0.16);

	--font: "Chakra Petch", "Segoe UI", Arial, sans-serif;
	--font-mono: "Share Tech Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html,
body {
	width: 100%;
	min-height: 100%;
	font-family: var(--font);
	background: #05070b;
	color: var(--text);
}

body {
	min-height: 100vh;
	overflow: hidden;
}

/* ===== BACKGROUND ===== */
.background {
	position: fixed;
	inset: 0;
	z-index: 0;
	background:
		linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.32)),
		url("../img/xcvm-login-bg.png") center center / cover no-repeat;
}

.background::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(
		ellipse at center,
		transparent 35%,
		rgba(0, 0, 0, 0.18) 70%,
		rgba(0, 0, 0, 0.5) 100%
	);
}

.grid {
	position: fixed;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	opacity: 0.045;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
	background-size: 80px 80px;
}

/* ===== PAGE ===== */
.page {
	position: relative;
	z-index: 2;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
}

/* ===== LOGIN PANEL ===== */
.stage {
	position: relative;
	width: 466px;
}

.login-panel {
	position: relative;
	width: 100%;
	min-height: 560px;
	padding: 58px 48px 38px;
	background: linear-gradient(
		160deg,
		rgba(17, 23, 34, 0.94) 0%,
		rgba(7, 10, 17, 0.93) 55%,
		rgba(10, 14, 22, 0.95) 100%
	);
	clip-path: polygon(
		26px 0,
		calc(100% - 26px) 0,
		100% 26px,
		100% calc(100% - 58px),
		calc(100% - 58px) 100%,
		58px 100%,
		0 calc(100% - 58px),
		0 26px
	);
	box-shadow:
		0 45px 110px rgba(0, 0, 0, 0.78),
		inset 0 0 0 1px rgba(176, 192, 216, 0.1),
		inset 0 1px 0 rgba(255, 255, 255, 0.05);
	backdrop-filter: blur(16px);
}

.panel-frame {
	position: absolute;
	inset: 7px;
	pointer-events: none;
	border: 1px solid rgba(150, 170, 200, 0.13);
	clip-path: polygon(
		21px 0,
		calc(100% - 21px) 0,
		100% 21px,
		100% calc(100% - 52px),
		calc(100% - 52px) 100%,
		52px 100%,
		0 calc(100% - 52px),
		0 21px
	);
}

.acc-tl,
.acc-tr {
	position: absolute;
	top: 17px;
	width: 22px;
	height: 22px;
	border: 1px solid rgba(164, 180, 205, 0.3);
	pointer-events: none;
}

.acc-tl {
	left: 17px;
	border-right: 0;
	border-bottom: 0;
}

.acc-tr {
	right: 17px;
	border-left: 0;
	border-bottom: 0;
}

/* ===== Glow overlay (not clipped, bloom bleeds freely) ===== */
.panel-glow {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
}

.g-left,
.g-bl,
.g-blh,
.g-br,
.g-brh {
	position: absolute;
	border-radius: 3px;
	box-shadow:
		0 0 5px #ff2d4d,
		0 0 16px 1px rgba(255, 40, 70, 0.75),
		0 0 36px 7px rgba(255, 23, 68, 0.38),
		0 0 64px 14px rgba(255, 23, 68, 0.16);
}

.g-left {
	left: -2px;
	top: 150px;
	width: 5px;
	height: 162px;
	background: linear-gradient(90deg, #5c0010, #ff4d63 42%, #ffe1e4 50%, #ff4d63 58%, #5c0010);
}

.g-bl {
	left: -1px;
	bottom: 57px;
	width: 82px;
	height: 6px;
	z-index: 2;
	transform-origin: left bottom;
	transform: rotate(45deg);
	background: linear-gradient(180deg, #5c0010, #ff4d63 42%, #ffe1e4 50%, #ff4d63 58%, #5c0010);
}

.g-blh {
	left: 57px;
	bottom: -1px;
	width: 56px;
	height: 5px;
	background: linear-gradient(90deg, #ff4d63 0%, #c0102a 55%, #5c0010 100%);
}

.g-br {
	right: -1px;
	bottom: 57px;
	width: 82px;
	height: 6px;
	z-index: 2;
	transform-origin: right bottom;
	transform: rotate(-45deg);
	background: linear-gradient(180deg, #5c0010, #ff4d63 42%, #ffe1e4 50%, #ff4d63 58%, #5c0010);
}

.g-brh {
	right: 57px;
	bottom: -1px;
	width: 56px;
	height: 5px;
	background: linear-gradient(270deg, #ff4d63 0%, #c0102a 55%, #5c0010 100%);
}

.g-top {
	position: absolute;
	top: -3px;
	right: 70px;
	width: 104px;
	height: 26px;
	background: linear-gradient(180deg, #ff92a0 0%, #ff2d4d 45%, #a8001e 100%);
	clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
	box-shadow:
		0 0 10px #ff2d4d,
		0 0 28px 4px rgba(255, 40, 70, 0.7),
		0 0 54px 10px rgba(255, 23, 68, 0.32);
}

.g-top::after {
	content: "";
	position: absolute;
	left: 8px;
	right: 14px;
	top: 3px;
	height: 3px;
	background: rgba(255, 220, 225, 0.7);
	filter: blur(0.5px);
}

.g-ticks {
	position: absolute;
	left: 11px;
	top: 320px;
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.g-ticks i {
	width: 10px;
	height: 2px;
	background: #ff2d4d;
	box-shadow: 0 0 6px rgba(255, 40, 70, 0.85);
}

.g-plus {
	position: absolute;
	width: 11px;
	height: 11px;
}

.g-plus::before,
.g-plus::after {
	content: "";
	position: absolute;
	background: #ff2d4d;
	box-shadow: 0 0 6px #ff2d4d;
}

.g-plus::before {
	left: 50%;
	top: 0;
	width: 1.5px;
	height: 100%;
	transform: translateX(-50%);
}

.g-plus::after {
	top: 50%;
	left: 0;
	height: 1.5px;
	width: 100%;
	transform: translateY(-50%);
}

.g-plus.p1 {
	top: 300px;
	right: 16px;
}

.g-plus.p2 {
	bottom: 128px;
	right: 48px;
}

/* ---- More HUD edge bars along the panel border (45° bends) ---- */
/* Neutral straight runs. */
.e {
	position: absolute;
	background: rgba(156, 174, 202, 0.3);
	border-radius: 2px;
	pointer-events: none;
}
.e-topl {
	top: -1px;
	left: 34px;
	width: 96px;
	height: 4px;
}
.e-topr {
	top: -1px;
	right: 186px;
	width: 64px;
	height: 4px;
}
.e-lv1 {
	left: -1px;
	top: 38px;
	width: 4px;
	height: 78px;
}
.e-rv1 {
	right: -1px;
	top: 40px;
	width: 4px;
	height: 96px;
}
.e-rv2 {
	right: -1px;
	bottom: 132px;
	width: 4px;
	height: 76px;
}
.e-botl {
	bottom: -1px;
	left: 134px;
	width: 78px;
	height: 4px;
}

/* Glowing 45° diagonal brackets on the top chamfers. */
.g-tl,
.g-tr {
	position: absolute;
	width: 40px;
	height: 5px;
	border-radius: 3px;
	background: linear-gradient(180deg, #5c0010, #ff4d63 42%, #ffe1e4 50%, #ff4d63 58%, #5c0010);
	box-shadow:
		0 0 5px #ff2d4d,
		0 0 16px 1px rgba(255, 40, 70, 0.75),
		0 0 34px 6px rgba(255, 23, 68, 0.3);
}
.g-tl {
	left: -1px;
	top: 27px;
	transform-origin: left center;
	transform: rotate(-45deg);
}
.g-tr {
	right: -1px;
	top: 27px;
	transform-origin: right center;
	transform: rotate(45deg);
}

/* ===== LOGO ===== */
.panel-logo {
	text-align: center;
	margin-bottom: 40px;
}

.panel-logo-main {
	font-size: 52px;
	font-weight: 700;
	letter-spacing: 4px;
	line-height: 1;
	background: linear-gradient(180deg, #ffffff 0%, #d6dce7 42%, #8b93a4 54%, #eef1f6 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
	word-break: break-word;
}

.panel-title {
	margin-top: 16px;
	color: var(--muted);
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 9px;
	text-transform: uppercase;
	text-align: center;
	padding-left: 9px;
}

/* ===== ALERT ===== */
.panel-alert {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 20px;
	padding: 11px 14px;
	border: 1px solid rgba(255, 23, 68, 0.5);
	background: rgba(255, 23, 68, 0.1);
	color: #ffd7dd;
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.4px;
	clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.panel-alert svg {
	width: 18px;
	height: 18px;
	flex: none;
	color: var(--red);
}

/* ===== INPUTS ===== */
.form-group {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.input-wrapper {
	position: relative;
}

.input-wrapper input {
	width: 100%;
	height: 58px;
	padding: 0 52px 0 70px;
	outline: none;
	border: 1px solid rgba(150, 168, 196, 0.16);
	border-top-color: rgba(200, 215, 235, 0.22);
	background:
		linear-gradient(90deg, rgba(0, 0, 0, 0.36) 0, rgba(0, 0, 0, 0.36) 52px, transparent 52px),
		linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 40%), rgba(12, 17, 26, 0.82);
	color: #eef2f8;
	font-family: var(--font);
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0.5px;
	clip-path: polygon(
		14px 0,
		calc(100% - 14px) 0,
		100% 14px,
		100% calc(100% - 14px),
		calc(100% - 14px) 100%,
		14px 100%,
		0 calc(100% - 14px),
		0 14px
	);
	transition:
		border-color 0.25s ease,
		background 0.25s ease;
}

.input-wrapper input::placeholder {
	color: #6f7a8c;
}

.input-wrapper input:focus {
	border-color: rgba(255, 23, 68, 0.6);
	background:
		linear-gradient(90deg, rgba(0, 0, 0, 0.36) 0, rgba(0, 0, 0, 0.36) 52px, transparent 52px),
		linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 40%), rgba(16, 20, 30, 0.9);
}

.input-wrapper::before {
	content: "";
	position: absolute;
	top: 8px;
	bottom: 8px;
	right: 12px;
	width: 40%;
	background-image: radial-gradient(rgba(185, 200, 224, 0.2) 1px, transparent 1.5px);
	background-size: 6px 6px;
	opacity: 0.6;
	pointer-events: none;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 60%);
	mask-image: linear-gradient(90deg, transparent, #000 60%);
}

.input-wrapper::after {
	content: "";
	position: absolute;
	left: -2px;
	top: 50%;
	transform: translateY(-50%);
	width: 2px;
	height: 30px;
	border-radius: 2px;
	background: linear-gradient(180deg, #ff4d63, #ffe1e4 50%, #ff4d63);
	box-shadow:
		0 0 6px #ff2d4d,
		0 0 16px 1px rgba(255, 40, 70, 0.7),
		0 0 30px 4px rgba(255, 23, 68, 0.3);
	pointer-events: none;
}

.input-wrapper:focus-within::after {
	box-shadow:
		0 0 8px #ff2d4d,
		0 0 22px 2px rgba(255, 40, 70, 0.9),
		0 0 42px 7px rgba(255, 23, 68, 0.42);
}

.input-icon {
	position: absolute;
	top: 50%;
	left: 18px;
	transform: translateY(-50%);
	width: 19px;
	height: 19px;
	color: #9ca8ba;
	opacity: 0.85;
	pointer-events: none;
	z-index: 1;
}

.input-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.input-icon::after {
	content: "";
	position: absolute;
	top: -5px;
	bottom: -5px;
	right: -15px;
	width: 1px;
	background: rgba(255, 255, 255, 0.12);
}

.input-wrapper:focus-within .input-icon {
	color: var(--red);
	opacity: 1;
}

.show-password {
	position: absolute;
	top: 50%;
	right: 15px;
	transform: translateY(-50%);
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border: 0;
	background: transparent;
	color: #8c98aa;
	cursor: pointer;
	z-index: 1;
	transition: color 0.2s ease;
}

.show-password:hover {
	color: #eef2f8;
}

.show-password svg {
	width: 19px;
	height: 19px;
	display: block;
}

.show-password .eye-off {
	display: none;
}

.show-password.revealed .eye-on {
	display: none;
}

.show-password.revealed .eye-off {
	display: block;
}

/* ===== reCAPTCHA ===== */
.recaptcha-wrap {
	display: flex;
	justify-content: center;
	margin-top: 20px;
}

/* ===== LOGIN BUTTON ===== */
.login-button {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	width: 100%;
	height: 60px;
	margin-top: 26px;
	border: 1px solid var(--red);
	background: linear-gradient(
		90deg,
		rgba(255, 23, 68, 0.44) 0%,
		rgba(255, 23, 68, 0.16) 55%,
		rgba(255, 23, 68, 0.04) 100%
	);
	color: #f5f6fa;
	cursor: pointer;
	font-family: var(--font-mono);
	font-size: 14px;
	letter-spacing: 6px;
	text-transform: uppercase;
	clip-path: polygon(
		16px 0,
		calc(100% - 20px) 0,
		100% 50%,
		calc(100% - 20px) 100%,
		0 100%,
		0 16px
	);
	box-shadow:
		0 0 30px rgba(255, 23, 68, 0.32),
		inset 0 0 20px rgba(255, 23, 68, 0.14),
		inset 0 1px 0 rgba(255, 255, 255, 0.18);
	overflow: hidden;
	transition:
		background 0.25s ease,
		box-shadow 0.25s ease,
		transform 0.15s ease;
}

.login-button:hover:not(:disabled) {
	background: linear-gradient(90deg, rgba(255, 23, 68, 0.58), rgba(255, 23, 68, 0.12));
	box-shadow:
		0 0 42px rgba(255, 23, 68, 0.5),
		inset 0 0 26px rgba(255, 23, 68, 0.2);
	transform: translateY(-1px);
}

.login-button:active:not(:disabled) {
	transform: translateY(0);
}

.login-button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.login-button::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	right: 0;
	width: 130px;
	pointer-events: none;
	background: repeating-linear-gradient(
		115deg,
		rgba(255, 255, 255, 0.14) 0 2px,
		transparent 2px 15px
	);
	-webkit-mask-image: linear-gradient(90deg, transparent, #000);
	mask-image: linear-gradient(90deg, transparent, #000);
	opacity: 0.6;
}

.login-button .arrow {
	font-size: 18px;
	color: #fff;
}

/* ===== FOOTER ===== */
.panel-divider {
	display: block;
	height: 1px;
	margin-top: 24px;
	background: linear-gradient(90deg, rgba(150, 168, 196, 0.28), transparent 80%);
}

.panel-foot {
	margin-top: 32px;
	text-align: center;
	font-family: var(--font-mono);
	font-size: 17px;
	letter-spacing: 1px;
	color: var(--dim);
}

.panel-foot a {
	color: var(--muted);
	text-decoration: none;
}

.panel-foot a:hover {
	color: var(--red-soft);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 540px) {
	body {
		overflow: auto;
	}

	.stage {
		width: 100%;
	}

	.login-panel {
		min-height: auto;
		padding: 48px 24px 32px;
	}

	.panel-logo-main {
		font-size: 40px;
	}

	.g-left {
		top: 130px;
		height: 120px;
	}
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
	outline: 2px solid var(--red-soft);
	outline-offset: 2px;
}

/* ===== Living / shimmering animation ===== */
@media (prefers-reduced-motion: no-preference) {
	/* Slow hue drift across the whole glow layer — the frame "переливается". */
	@keyframes xcHueShift {
		0%,
		100% {
			filter: hue-rotate(-8deg);
		}
		50% {
			filter: hue-rotate(12deg);
		}
	}
	.panel-glow {
		animation: xcHueShift 9s ease-in-out infinite;
	}

	/* Breathing glow intensity, phase-staggered per bar for an organic feel. */
	@keyframes xcBreath {
		0%,
		100% {
			opacity: 0.72;
		}
		50% {
			opacity: 1;
		}
	}
	.g-left {
		animation: xcBreath 3.6s ease-in-out infinite;
	}
	.g-bl {
		animation: xcBreath 4.4s ease-in-out infinite 0.2s;
	}
	.g-br {
		animation: xcBreath 4.1s ease-in-out infinite 0.8s;
	}
	.g-blh {
		animation: xcBreath 3.1s ease-in-out infinite 0.5s;
	}
	.g-brh {
		animation: xcBreath 3.3s ease-in-out infinite 1.1s;
	}
	.g-tl {
		animation: xcBreath 3.9s ease-in-out infinite 0.3s;
	}
	.g-tr {
		animation: xcBreath 4.2s ease-in-out infinite 0.9s;
	}
	.g-ticks i {
		animation: xcBreath 2.6s ease-in-out infinite;
	}
	.g-plus {
		animation: xcBreath 3.4s ease-in-out infinite 0.4s;
	}

	/* Top indicator block — slower status-beacon pulse. */
	@keyframes xcBeacon {
		0%,
		100% {
			opacity: 0.85;
		}
		50% {
			opacity: 1;
		}
	}
	.g-top {
		animation: xcBeacon 2.8s ease-in-out infinite;
	}

	/* Field accent bars gently pulse too. */
	.input-wrapper::after {
		animation: xcBreath 3.7s ease-in-out infinite;
	}
}
