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

:root {
	--bg: #06080d;
	--card-bg: rgba(13, 17, 24, 0.95);
	--border: rgba(255, 255, 255, 0.08);
	--border2: rgba(255, 255, 255, 0.14);
	--gold: #ffe600;
	--gold-glow: rgba(255, 230, 0, 0.4);
	--cyan: #00f0ff;
	--cyan-glow: rgba(0, 240, 255, 0.45);
	--green: #39ff14;
	--green-glow: rgba(57, 255, 20, 0.45);
	--red: #ff0055;
	--red-glow: rgba(255, 0, 85, 0.45);
	--dim: #94a3b8;
	--dim2: #64748b;
	--f-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	--f-mono: ui-monospace, 'Cascadia Code', 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', Menlo, Consolas, 'Courier New', monospace;
	--f-display: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bg);
	font-family: var(--f-sans);
	color: #f8fafc;
	overflow: hidden;
	position: relative;
	perspective: 1200px;
}

/* Background Cyber Canvas */
#cyber-canvas {
	position: absolute;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	pointer-events: none;
	z-index: 0;
	opacity: 0.75;
}

/* Ambient Pulse Light */
.ambient-glow {
	position: absolute;
	width: 650px;
	height: 650px;
	border-radius: 50%;
	filter: blur(100px);
	pointer-events: none;
	z-index: 1;
	opacity: 0.22;
	animation: ambientBreathe 6s ease-in-out infinite alternate;
}

@keyframes ambientBreathe {
	0% { transform: scale(0.85); opacity: 0.15; }
	100% { transform: scale(1.15); opacity: 0.3; }
}

.ambient-cyan { background: radial-gradient(circle, var(--cyan) 0%, transparent 70%); }
.ambient-green { background: radial-gradient(circle, var(--green) 0%, transparent 70%); }
.ambient-red { background: radial-gradient(circle, var(--red) 0%, transparent 70%); }

/* Unified Auth Card (Exact 360px width & 530px height matching across ALL gates) */
.auth-card {
	background: var(--card-bg);
	border: 1px solid var(--border);
	border-radius: 20px;
	padding: 24px 22px 22px;
	width: 360px;
	height: 530px;
	max-width: 94vw;
	max-height: 94vh;
	text-align: center;
	backdrop-filter: blur(30px);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), inset 0 0 24px rgba(255, 255, 255, 0.02);
	position: relative;
	z-index: 10;
	transform-style: preserve-3d;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	gap: 6px;
	animation: cardUnfold 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-body-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* 3D Smooth Unfold / Fold Transitions */
@keyframes cardUnfold {
	0% {
		transform: perspective(1200px) rotateX(-75deg) translateY(50px) scale(0.75);
		opacity: 0;
		filter: blur(14px);
	}
	100% {
		transform: perspective(1200px) rotateX(0deg) translateY(0) scale(1);
		opacity: 1;
		filter: blur(0);
	}
}

@keyframes cardFoldOutAnim {
	0% {
		transform: perspective(1200px) rotateX(0deg) translateY(0) scale(1);
		opacity: 1;
		filter: blur(0);
	}
	40% {
		transform: perspective(1200px) rotateX(-20deg) translateY(10px) scale(1.02);
		opacity: 0.9;
		filter: blur(2px) brightness(1.3);
	}
	100% {
		transform: perspective(1200px) rotateX(85deg) translateY(-80px) scale(0.45);
		opacity: 0;
		filter: blur(20px) brightness(3);
	}
}

.auth-card.card-fold-out {
	animation: cardFoldOutAnim 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

.auth-card.shake {
	animation: cardShake 0.45s ease-in-out;
}

@keyframes cardShake {
	0%, 100% { transform: translateX(0); }
	20%, 60% { transform: translateX(-10px); }
	40%, 80% { transform: translateX(10px); }
}

/* Glowing Pulsing Borders */
.card-gate-1 {
	border-color: rgba(0, 240, 255, 0.35);
	box-shadow: 0 0 35px rgba(0, 240, 255, 0.2), inset 0 0 20px rgba(0, 240, 255, 0.08);
	animation: cardUnfold 0.55s cubic-bezier(0.16, 1, 0.3, 1) both, cyanGlowPulse 4s infinite ease-in-out alternate;
}

.card-gate-2 {
	border-color: rgba(57, 255, 20, 0.35);
	box-shadow: 0 0 35px rgba(57, 255, 20, 0.2), inset 0 0 20px rgba(57, 255, 20, 0.08);
	animation: cardUnfold 0.55s cubic-bezier(0.16, 1, 0.3, 1) both, greenGlowPulse 4s infinite ease-in-out alternate;
}

.card-gate-3 {
	border-color: rgba(255, 0, 85, 0.35);
	box-shadow: 0 0 35px rgba(255, 0, 85, 0.2), inset 0 0 20px rgba(255, 0, 85, 0.08);
	animation: cardUnfold 0.55s cubic-bezier(0.16, 1, 0.3, 1) both, redGlowPulse 4s infinite ease-in-out alternate;
}

@keyframes cyanGlowPulse {
	0% { box-shadow: 0 0 25px rgba(0, 240, 255, 0.18), inset 0 0 15px rgba(0, 240, 255, 0.06); border-color: rgba(0, 240, 255, 0.3); }
	100% { box-shadow: 0 0 45px rgba(0, 240, 255, 0.38), inset 0 0 25px rgba(0, 240, 255, 0.16); border-color: rgba(0, 240, 255, 0.65); }
}

@keyframes greenGlowPulse {
	0% { box-shadow: 0 0 25px rgba(57, 255, 20, 0.18), inset 0 0 15px rgba(57, 255, 20, 0.06); border-color: rgba(57, 255, 20, 0.3); }
	100% { box-shadow: 0 0 45px rgba(57, 255, 20, 0.38), inset 0 0 25px rgba(57, 255, 20, 0.16); border-color: rgba(57, 255, 20, 0.65); }
}

@keyframes redGlowPulse {
	0% { box-shadow: 0 0 25px rgba(255, 0, 85, 0.18), inset 0 0 15px rgba(255, 0, 85, 0.06); border-color: rgba(255, 0, 85, 0.3); }
	100% { box-shadow: 0 0 45px rgba(255, 0, 85, 0.38), inset 0 0 25px rgba(255, 0, 85, 0.16); border-color: rgba(255, 0, 85, 0.65); }
}

/* Electric Top Arc */
.electric-arc {
	position: absolute;
	top: -1px;
	left: 10%;
	right: 10%;
	height: 2px;
	border-radius: 2px;
}

.arc-cyan {
	background: linear-gradient(90deg, transparent, var(--cyan), #fff, var(--cyan), transparent);
	box-shadow: 0 0 20px var(--cyan);
}

.arc-green {
	background: linear-gradient(90deg, transparent, var(--green), #fff, var(--green), transparent);
	box-shadow: 0 0 20px var(--green);
}

.arc-red {
	background: linear-gradient(90deg, transparent, var(--red), #fff, var(--red), transparent);
	box-shadow: 0 0 20px var(--red);
}

/* Brand Logo (Exact replica of index.php) */
.brand-logo-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-decoration: none;
	width: 100%;
	margin-bottom: 14px;
	user-select: none;
	position: relative;
}

.brand-logo-container.scramble-blind {
	filter: brightness(0) contrast(3) !important;
	opacity: 0.99;
}

.sidebar-brand-glow {
	position: absolute;
	top: -10px;
	left: 15px;
	right: 15px;
	height: 55px;
	background: radial-gradient(ellipse, rgba(255, 230, 0, 0.55) 0%, rgba(0, 240, 255, 0.25) 50%, transparent 80%);
	filter: blur(16px);
	pointer-events: none;
	z-index: 1;
}

@keyframes logoSurge {
	0%, 100% { transform: rotate(-4deg) scale(1); filter: drop-shadow(0 0 16px rgba(255, 230, 0, 0.85)); }
	50% { transform: rotate(-5deg) scale(1.03); filter: drop-shadow(0 0 28px rgba(255, 230, 0, 1)) drop-shadow(0 0 45px rgba(0, 240, 255, 0.65)); }
}

.noname-plaque {
	background: #ffe600;
	padding: 6px 24px;
	border-radius: 9px;
	border: 2px solid #000;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 0 22px rgba(255, 230, 0, 0.85), 0 0 38px rgba(255, 230, 0, 0.4);
	animation: logoSurge 3s infinite ease-in-out;
	position: relative;
	z-index: 2;
}

.noname-plaque span {
	font-family: var(--f-display);
	font-size: 20px;
	font-weight: 900;
	color: #000;
	letter-spacing: -0.05em;
	text-transform: lowercase;
	line-height: 1;
}

.ecommerce-letters-wrap {
	display: flex;
	justify-content: space-between;
	width: 100%;
	max-width: 190px;
	margin-top: 8px;
	font-family: var(--f-mono);
	font-size: 15px;
	font-weight: 900;
	letter-spacing: 1px;
	text-transform: uppercase;
	position: relative;
	z-index: 2;
}

.ecommerce-letter {
	display: inline-block;
	transition: all 0.2s ease;
}

/* Gate Badges & Progress Dots */
.gate-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 9px;
	font-weight: 900;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	padding: 4px 10px;
	border-radius: 6px;
	margin-bottom: 8px;
}

.gate-status-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	display: inline-block;
}

.badge-cyan {
	border: 1px solid rgba(0, 240, 255, 0.4);
	background: rgba(0, 240, 255, 0.12);
	color: var(--cyan);
	text-shadow: 0 0 10px var(--cyan);
}
.badge-cyan .gate-status-dot {
	background: var(--cyan);
	box-shadow: 0 0 8px var(--cyan);
}

.badge-green {
	border: 1px solid rgba(57, 255, 20, 0.4);
	background: rgba(57, 255, 20, 0.12);
	color: var(--green);
	text-shadow: 0 0 10px var(--green);
}
.badge-green .gate-status-dot {
	background: var(--green);
	box-shadow: 0 0 8px var(--green);
}

.badge-red {
	border: 1px solid rgba(255, 0, 85, 0.4);
	background: rgba(255, 0, 85, 0.12);
	color: var(--red);
	text-shadow: 0 0 10px var(--red);
}
.badge-red .gate-status-dot {
	background: var(--red);
	box-shadow: 0 0 8px var(--red);
}

.phase-dots {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin-bottom: 8px;
}

.phase-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	transition: all 0.25s;
}

.phase-dot.complete {
	background: #39ff14;
	box-shadow: 0 0 10px rgba(57, 255, 20, 0.6);
}

.subtitle {
	font-size: 11px;
	color: var(--dim);
	margin-bottom: 8px;
	letter-spacing: 0.3px;
}

#error {
	color: var(--red);
	font-size: 11px;
	font-weight: 700;
	min-height: 16px;
	margin-bottom: 4px;
	text-shadow: 0 0 10px var(--red);
}

/* Gate 1: PIN Pad with Crisp Glass Buttons */
.pin-dots {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin-bottom: 12px;
}

.pin-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 1.5px solid rgba(0, 240, 255, 0.35);
	background: transparent;
	transition: all 0.2s ease;
}

.pin-dot.filled {
	background: var(--cyan);
	border-color: var(--cyan);
	box-shadow: 0 0 14px var(--cyan);
	transform: scale(1.15);
}

.auth-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	margin-bottom: 4px;
}

.k-btn {
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid rgba(0, 240, 255, 0.25);
	border-radius: 10px;
	color: #ffffff;
	font-family: var(--f-sans);
	font-size: 22px;
	font-weight: 800;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.15s ease;
	user-select: none;
	text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.k-btn:hover {
	background: rgba(0, 240, 255, 0.16);
	border-color: var(--cyan);
	color: #00f0ff;
	box-shadow: 0 0 16px var(--cyan-glow);
	transform: translateY(-2px);
}

.k-btn:active {
	transform: translateY(1px);
}

.k-act {
	font-size: 13px;
	font-weight: 900;
	letter-spacing: 1px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	border: none;
	cursor: pointer;
	transition: all 0.15s ease;
}

.k-clr {
	background: rgba(255, 0, 85, 0.18);
	border: 1px solid rgba(255, 0, 85, 0.4);
	color: #ff0055;
	text-shadow: 0 0 10px rgba(255, 0, 85, 0.6);
}

.k-clr:hover:not(:disabled) {
	background: rgba(255, 0, 85, 0.35);
	box-shadow: 0 0 18px var(--red);
	transform: translateY(-2px);
}

.k-ent {
	background: linear-gradient(135deg, #00f0ff, #0284c7);
	border: 1px solid var(--cyan);
	color: #000000;
	font-weight: 900;
	box-shadow: 0 0 18px var(--cyan-glow);
}

.k-ent:hover:not(:disabled) {
	filter: brightness(1.15);
	box-shadow: 0 0 28px var(--cyan);
	transform: translateY(-2px);
}

.k-act:disabled {
	opacity: 0.25;
	cursor: not-allowed;
	filter: grayscale(1);
	box-shadow: none !important;
}

/* Gate 2: Form & Fields with subtle Binary background */
.gate2-form-wrap {
	position: relative;
	background: rgba(0, 0, 0, 0.35);
	border: 1px solid rgba(57, 255, 20, 0.15);
	border-radius: 14px;
	padding: 24px 18px 20px;
	overflow: hidden;
	margin-top: 10px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.binary-bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	user-select: none;
	overflow: hidden;
	z-index: 0;
}

.binary-bg canvas {
	display: block;
	width: 100%;
	height: 100%;
}

.field {
	width: 100%;
	padding: 15px 16px;
	background: rgba(10, 15, 22, 0.92);
	border: 1px solid rgba(57, 255, 20, 0.3);
	border-radius: 10px;
	color: #fff;
	font-family: var(--f-sans);
	font-size: 14px;
	margin-bottom: 14px;
	outline: none;
	position: relative;
	z-index: 1;
	transition: all 0.2s;
}

.field:focus {
	border-color: var(--green);
	box-shadow: 0 0 18px var(--green-glow);
	background: rgba(57, 255, 20, 0.06);
}

.submit-btn {
	width: 100%;
	padding: 15px;
	border-radius: 10px;
	border: none;
	font-size: 12px;
	font-weight: 900;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	cursor: pointer;
	position: relative;
	z-index: 1;
	transition: all 0.2s;
	margin-top: 8px;
}

.submit-btn-green {
	background: linear-gradient(135deg, #39ff14, #15803d);
	color: #000;
	box-shadow: 0 0 18px var(--green-glow);
}

.submit-btn-green:hover {
	filter: brightness(1.15);
	box-shadow: 0 0 28px rgba(57, 255, 20, 0.7);
}

/* Gate 3: Red Heartbeat & Mutating Pulse Nodes */
.v-dots {
	display: flex;
	gap: 10px;
	justify-content: center;
	margin-bottom: 14px;
}

.v-dot {
	width: 13px;
	height: 13px;
	border-radius: 50%;
	border: 1.5px solid rgba(255, 0, 85, 0.35);
	background: transparent;
	transition: all 0.2s;
}

.v-dot.filled {
	background: var(--red);
	border-color: var(--red);
	box-shadow: 0 0 14px var(--red);
	transform: scale(1.2);
}

@keyframes heartbeatPulse {
	0%, 100% { transform: scale(1); box-shadow: 0 0 8px rgba(255, 0, 85, 0.25); }
	14% { transform: scale(1.08); box-shadow: 0 0 18px rgba(255, 0, 85, 0.55); }
	28% { transform: scale(0.96); box-shadow: 0 0 10px rgba(255, 0, 85, 0.3); }
	42% { transform: scale(1.12); box-shadow: 0 0 24px rgba(255, 0, 85, 0.75); }
	70% { transform: scale(1); box-shadow: 0 0 8px rgba(255, 0, 85, 0.25); }
}

.g3-btn {
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid rgba(255, 0, 85, 0.3);
	color: #ffffff;
	font-family: var(--f-sans);
	font-size: 22px;
	font-weight: 800;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	cursor: pointer;
	text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
	animation: heartbeatPulse 3.5s infinite ease-in-out;
}

.g3-btn:nth-child(even) {
	animation-delay: 0.4s;
}
.g3-btn:nth-child(3n) {
	animation-delay: 0.8s;
}

.g3-btn:hover {
	border-color: var(--red);
	color: var(--red);
	box-shadow: 0 0 20px var(--red);
	transform: translateY(-2px);
}

.g3-btn.active-click {
	background: rgba(255, 0, 85, 0.35);
	border-color: var(--red);
	color: #fff;
	box-shadow: 0 0 24px var(--red);
	animation: none;
}

.subnet-locked {
	background: rgba(255, 0, 85, 0.08);
	border: 1px solid rgba(255, 0, 85, 0.3);
	border-radius: 10px;
	padding: 20px 14px;
	color: var(--red);
	font-size: 11px;
	font-weight: 800;
	line-height: 1.5;
	letter-spacing: 0.5px;
	text-shadow: 0 0 10px var(--red);
}
