/**
 * DOCtrac Enterprise Login Stylesheet
 * High-performance, GPU-accelerated CSS with Zero Render-Blocking Dependencies
 */

:root {
	--primary-dark: #071527;
	--primary-navy: #0e2a47;
	--primary-blue: #1b4d7e;
	--accent-cyan: #38bdf8;
	--accent-cyan-glow: rgba(56, 189, 248, 0.25);
	--accent-indigo: #6366f1;
	--text-main: #0f172a;
	--text-muted: #64748b;
	--border-color: #e2e8f0;
	--bg-light: #f8fafc;
	--input-focus-ring: rgba(14, 42, 71, 0.12);
}

*, *::before, *::after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body, html {
	height: 100%;
	font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	background: #f1f5f9;
	color: var(--text-main);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* ── Keyframe Animations ── */
@keyframes fadeInUp {
	from { opacity: 0; transform: translateY(20px); }
	to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
	from { opacity: 0; transform: scale(0.97); }
	to   { opacity: 1; transform: scale(1); }
}
@keyframes floatSubtle {
	0%, 100% { transform: translateY(0px) rotate(0deg); }
	50%      { transform: translateY(-6px) rotate(1deg); }
}
@keyframes pulseGlow {
	0%, 100% { opacity: 0.35; transform: scale(1); }
	50%      { opacity: 0.65; transform: scale(1.06); }
}
@keyframes btnSpin {
	0%   { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}
@keyframes dotPulse {
	0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
	40%           { opacity: 1; transform: scale(1.2); }
}
@keyframes inputShake {
	10%, 90%      { transform: translateX(-2px); }
	20%, 80%      { transform: translateX(3px); }
	30%, 50%, 70% { transform: translateX(-4px); }
	40%, 60%      { transform: translateX(4px); }
}

.login-wrapper {
	display: flex;
	min-height: 100vh;
	width: 100vw;
	position: relative;
	overflow-x: hidden;
}

/* ══════════════════════════════════════════════════════
   LEFT BRAND / HERO PANEL
   ══════════════════════════════════════════════════════ */
.login-brand-panel {
	flex: 1.15;
	background: linear-gradient(145deg, #05111e 0%, #0a1f36 28%, #0f2d4e 58%, #163e68 82%, #1b4f80 100%);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: center;
	padding: 48px 56px;
	position: relative;
	overflow: hidden;
	color: #ffffff;
	contain: layout style paint;
}

/* Ambient Aurora Glows */
.brand-glow-1 {
	position: absolute;
	top: -10%;
	left: -10%;
	width: 550px;
	height: 550px;
	background: radial-gradient(circle, rgba(56, 189, 248, 0.16) 0%, rgba(56, 189, 248, 0) 70%);
	border-radius: 50%;
	filter: blur(40px);
	animation: pulseGlow 10s ease-in-out infinite alternate;
	pointer-events: none;
	will-change: transform, opacity;
}

.brand-glow-2 {
	position: absolute;
	bottom: -12%;
	right: -10%;
	width: 500px;
	height: 500px;
	background: radial-gradient(circle, rgba(99, 102, 241, 0.14) 0%, rgba(99, 102, 241, 0) 70%);
	border-radius: 50%;
	filter: blur(40px);
	animation: pulseGlow 12s ease-in-out infinite alternate-reverse;
	pointer-events: none;
	will-change: transform, opacity;
}

/* Grid Matrix */
.brand-grid-overlay {
	position: absolute;
	inset: 0;
	background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
	background-size: 32px 32px;
	opacity: 0.7;
	pointer-events: none;
}

.brand-top-badge {
	position: relative;
	z-index: 2;
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 30px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.5px;
	color: #bae6fd;
	text-transform: uppercase;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.brand-top-badge .badge-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #38bdf8;
	box-shadow: 0 0 8px #38bdf8;
}

.brand-content {
	position: relative;
	z-index: 2;
	text-align: center;
	max-width: 540px;
	margin: auto 0;
	animation: fadeInScale 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Vector Graphic Illustration ── */
.brand-illustration-wrapper {
	position: relative;
	width: 100%;
	max-width: 380px;
	margin: 0 auto 36px;
}

.brand-illustration {
	width: 100%;
	height: auto;
	max-height: 240px;
	filter: drop-shadow(0 25px 35px rgba(0, 0, 0, 0.35));
	animation: floatSubtle 7s ease-in-out infinite;
	will-change: transform;
}

.brand-content h1 {
	font-size: 36px;
	font-weight: 800;
	color: #ffffff;
	margin-bottom: 14px;
	letter-spacing: -0.8px;
	line-height: 1.15;
}

.brand-content h1 .brand-accent {
	background: linear-gradient(135deg, #38bdf8 0%, #7dd3fc 50%, #e0f2fe 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.brand-content .brand-tagline {
	font-size: 15px;
	color: #94a3b8;
	line-height: 1.65;
	font-weight: 400;
	max-width: 440px;
	margin: 0 auto;
}

/* ── Feature Pills ── */
.brand-features {
	margin-top: 36px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
}

.brand-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.09);
	border-radius: 9999px;
	color: #e2e8f0;
	font-size: 12.5px;
	font-weight: 500;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s ease, border-color 0.25s ease;
}

.brand-pill:hover {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(56, 189, 248, 0.4);
	color: #ffffff;
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.brand-pill svg {
	width: 15px;
	height: 15px;
	stroke: #38bdf8;
	fill: none;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex-shrink: 0;
}

.brand-footer-text {
	position: relative;
	z-index: 2;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.4);
	letter-spacing: 0.3px;
}

/* ══════════════════════════════════════════════════════
   RIGHT LOGIN FORM PANEL
   ══════════════════════════════════════════════════════ */
.login-form-panel {
	flex: 0.95;
	min-width: 440px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 56px 48px;
	background: #ffffff;
	position: relative;
	box-shadow: -12px 0 40px rgba(0, 0, 0, 0.04);
}

.login-form-container {
	width: 100%;
	max-width: 380px;
	animation: fadeInUp 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Logo */
.login-logo-wrapper {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 32px;
}

.login-logo-wrapper img {
	max-height: 46px;
	width: auto;
	object-fit: contain;
	transition: transform 0.25s ease;
}

.login-logo-wrapper img:hover {
	transform: scale(1.02);
}

/* Header & Subtitle */
.login-header-group {
	text-align: left;
	margin-bottom: 28px;
}

.login-header-group h2 {
	font-size: 24px;
	font-weight: 700;
	color: #0f172a;
	letter-spacing: -0.5px;
	margin-bottom: 6px;
}

.login-header-group p {
	font-size: 14px;
	color: #64748b;
	line-height: 1.5;
	font-weight: 400;
}

/* Form Fields */
.form-group-custom {
	margin-bottom: 20px;
	position: relative;
}

.form-label-custom {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 13px;
	font-weight: 600;
	color: #334155;
	margin-bottom: 8px;
	letter-spacing: 0.2px;
}

.input-container {
	position: relative;
	display: flex;
	align-items: center;
}

.input-icon-left {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	stroke: #94a3b8;
	fill: none;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: stroke 0.2s ease;
	pointer-events: none;
	z-index: 2;
}

.input-control-custom {
	width: 100%;
	height: 48px;
	padding: 12px 14px 12px 42px;
	border: 1.5px solid #e2e8f0;
	border-radius: 10px;
	font-size: 14px;
	font-family: inherit;
	color: #0f172a;
	background: #f8fafc;
	transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
	outline: none;
}

.input-control-custom.has-toggle {
	padding-right: 44px;
}

.input-control-custom:focus {
	border-color: #0f2d4e;
	background: #ffffff;
	box-shadow: 0 0 0 3.5px rgba(15, 45, 78, 0.1);
}

.input-control-custom.input-error {
	border-color: #ef4444 !important;
	background: #fff5f5 !important;
	box-shadow: 0 0 0 3.5px rgba(239, 68, 68, 0.15) !important;
	animation: inputShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.input-container:focus-within .input-icon-left {
	stroke: #0f2d4e;
}

.input-control-custom::placeholder {
	color: #94a3b8;
	font-weight: 400;
}

/* Password Visibility Button */
.password-toggle-btn {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: none;
	padding: 6px;
	color: #94a3b8;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	transition: color 0.2s ease, background 0.2s ease;
	z-index: 3;
}

.password-toggle-btn:hover {
	color: #0f2d4e;
	background: rgba(0, 0, 0, 0.04);
}

.password-toggle-btn svg {
	width: 18px;
	height: 18px;
	stroke: currentColor;
	fill: none;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Caps Lock Alert */
.caps-warning {
	display: none;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: #b45309;
	background: #fef3c7;
	border: 1px solid #fde68a;
	padding: 6px 10px;
	border-radius: 6px;
	margin-top: 6px;
	animation: fadeInUp 0.2s ease-out;
}

.caps-warning.active {
	display: flex;
}

.caps-warning svg {
	width: 14px;
	height: 14px;
	stroke: currentColor;
	fill: none;
	stroke-width: 2;
	flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════
   SIGN IN BUTTON & BEAUTIFUL LOADING ANIMATION
   ══════════════════════════════════════════════════════ */
.btn-signin {
	width: 100%;
	height: 48px;
	margin-top: 10px;
	background: linear-gradient(135deg, #0a1f36 0%, #0f2d4e 50%, #163e68 100%);
	color: #ffffff;
	border: none;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.3px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
	position: relative;
	overflow: hidden;
	box-shadow: 0 4px 14px rgba(10, 31, 54, 0.22);
}

.btn-signin::before {
	content: '';
	position: absolute;
	top: 0; left: -100%;
	width: 100%; height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
	transition: left 0.6s ease;
}

.btn-signin:hover::before {
	left: 100%;
}

.btn-signin:hover {
	background: linear-gradient(135deg, #05111e 0%, #0a1f36 50%, #0f2d4e 100%);
	box-shadow: 0 8px 22px rgba(10, 31, 54, 0.35);
	transform: translateY(-1.5px);
}

.btn-signin:active {
	transform: translateY(0);
	box-shadow: 0 2px 8px rgba(10, 31, 54, 0.2);
}

.btn-signin.submitting {
	background: linear-gradient(135deg, #05111e 0%, #0a1f36 50%, #0f2d4e 100%);
	box-shadow: 0 4px 14px rgba(10, 31, 54, 0.22);
	transform: none;
}

/* Spinner */
.btn-spinner {
	display: none;
	width: 20px;
	height: 20px;
	border: 2.5px solid rgba(255, 255, 255, 0.25);
	border-top-color: #38bdf8;
	border-right-color: #ffffff;
	border-radius: 50%;
	animation: btnSpin 0.75s cubic-bezier(0.4, 0, 0.2, 1) infinite;
	flex-shrink: 0;
}

.btn-signin.submitting .btn-spinner {
	display: inline-block;
}

.btn-signin.submitting .btn-arrow-icon {
	display: none;
}

/* Text Switching */
.btn-text-default {
	display: inline-flex;
	align-items: center;
}

.btn-text-loading {
	display: none;
	align-items: center;
}

.btn-signin.submitting .btn-text-default {
	display: none;
}

.btn-signin.submitting .btn-text-loading {
	display: inline-flex;
}

/* Loading Dots */
.loading-dots {
	display: inline-flex;
	align-items: center;
	margin-left: 2px;
}

.loading-dots span {
	animation: dotPulse 1.4s infinite both;
	font-size: 18px;
	line-height: 1;
}
.loading-dots span:nth-child(2) {
	animation-delay: 0.2s;
}
.loading-dots span:nth-child(3) {
	animation-delay: 0.4s;
}

/* Links */
.login-nav-links {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 24px;
}

.forgot-pwd-link {
	font-size: 13.5px;
	color: #1b4f80;
	text-decoration: none;
	font-weight: 600;
	transition: color 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.forgot-pwd-link:hover {
	color: #0a1f36;
	text-decoration: underline;
}

/* Security Badge */
.security-trust-badge {
	margin-top: 36px;
	padding-top: 20px;
	border-top: 1px solid #f1f5f9;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-size: 12px;
	color: #94a3b8;
	font-weight: 500;
}

.security-trust-badge svg {
	width: 14px;
	height: 14px;
	stroke: #10b981;
	fill: none;
	stroke-width: 2;
}

/* Decorative Accent Border */
.login-form-panel::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 3px;
	height: 100%;
	background: linear-gradient(180deg, #38bdf8 0%, #163e68 50%, #0a1f36 100%);
}

/* Autofill Normalization */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus {
	-webkit-box-shadow: 0 0 0 1000px #f8fafc inset !important;
	-webkit-text-fill-color: #0f172a !important;
	transition: background-color 5000s ease-in-out 0s;
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE DESIGN BREAKPOINTS
   ══════════════════════════════════════════════════════ */
@media (max-width: 980px) {
	.login-wrapper {
		background: linear-gradient(145deg, #05111e 0%, #0a1f36 50%, #0f2d4e 100%);
		align-items: center;
		justify-content: center;
		padding: 24px;
	}
	.login-brand-panel {
		display: none;
	}
	.login-form-panel {
		flex: none;
		width: 100%;
		max-width: 440px;
		min-width: unset;
		border-radius: 16px;
		box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
		padding: 44px 32px;
	}
	.login-form-panel::before {
		display: none;
	}
}

@media (max-width: 480px) {
	.login-wrapper {
		padding: 16px;
	}
	.login-form-panel {
		padding: 32px 20px;
		border-radius: 12px;
	}
	.login-header-group h2 {
		font-size: 21px;
	}
	.native-toast-container {
		right: 16px !important;
		bottom: 16px !important;
		width: calc(100% - 32px) !important;
	}
}

/* ══════════════════════════════════════════════════════
   HIGH-PERFORMANCE ZERO-DEPENDENCY NATIVE TOAST ENGINE
   ══════════════════════════════════════════════════════ */
.native-toast-container {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: 380px;
	width: calc(100% - 48px);
	pointer-events: none;
}

.native-toast {
	pointer-events: auto;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px;
	border-radius: 12px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-left-width: 4px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
	font-family: inherit;
	position: relative;
	overflow: hidden;
	opacity: 0;
	transform: translateY(16px) scale(0.97);
	transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
	will-change: transform, opacity;
}

.native-toast.show {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.native-toast.hide {
	opacity: 0;
	transform: translateY(10px) scale(0.95);
}

/* Types */
.native-toast.toast-error {
	border-left-color: #ef4444;
}
.native-toast.toast-error .toast-icon {
	color: #ef4444;
}
.native-toast.toast-error .toast-progress {
	background: #ef4444;
}

.native-toast.toast-success {
	border-left-color: #10b981;
}
.native-toast.toast-success .toast-icon {
	color: #10b981;
}
.native-toast.toast-success .toast-progress {
	background: #10b981;
}

.native-toast.toast-warning {
	border-left-color: #f59e0b;
}
.native-toast.toast-warning .toast-icon {
	color: #f59e0b;
}
.native-toast.toast-warning .toast-progress {
	background: #f59e0b;
}

.native-toast.toast-info {
	border-left-color: #38bdf8;
}
.native-toast.toast-info .toast-icon {
	color: #0284c7;
}
.native-toast.toast-info .toast-progress {
	background: #38bdf8;
}

/* Elements */
.toast-icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	margin-top: 1px;
}

.toast-icon svg {
	width: 100%;
	height: 100%;
	stroke: currentColor;
	fill: none;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.toast-content {
	flex: 1;
	min-width: 0;
}

.toast-title {
	font-size: 13.5px;
	font-weight: 700;
	color: #0f172a;
	margin-bottom: 2px;
	letter-spacing: -0.2px;
}

.toast-msg {
	font-size: 12.5px;
	color: #475569;
	line-height: 1.45;
	font-weight: 400;
	word-break: break-word;
}

.toast-close {
	background: transparent;
	border: none;
	padding: 4px;
	margin-left: auto;
	margin-top: -2px;
	margin-right: -4px;
	color: #94a3b8;
	cursor: pointer;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.15s ease, background 0.15s ease;
	flex-shrink: 0;
}

.toast-close:hover {
	color: #0f172a;
	background: rgba(0, 0, 0, 0.05);
}

.toast-close svg {
	width: 14px;
	height: 14px;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.toast-progress {
	position: absolute;
	bottom: 0;
	left: 0;
	height: 2.5px;
	width: 100%;
	opacity: 0.45;
	transform-origin: left;
	animation: toastProgress 4.5s linear forwards;
}

@keyframes toastProgress {
	from { transform: scaleX(1); }
	to   { transform: scaleX(0); }
}
