
:root {
  --neon-cyan: #00f5ff;
  --neon-purple: #bf00ff;
  --neon-pink: #ff006e;
  --neon-gold: #ffd700;
  --neon-blue: #0080ff;
  --bg-deep: #020408;
  --bg-card: rgba(0,10,30,0.85);
  --glass: rgba(0,245,255,0.05);
  --border-glow: rgba(0,245,255,0.3);
  --text-primary: #e8f4ff;
  --text-muted: rgba(232,244,255,0.5);
}

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

body {
  font-family: 'Rajdhani', sans-serif;
  background: var(--bg-deep);
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ── CANVAS BACKGROUND ── */
#bgCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* ── GRID OVERLAY ── */
.grid-overlay {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,245,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,245,255,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 1;
  animation: gridPulse 4s ease-in-out infinite;
}
@keyframes gridPulse {
  0%,100% { opacity:.4; }
  50% { opacity:.8; }
}

/* ── FLOATING COINS ── */
.coin {
  position: fixed;
  border-radius: 50%;
  border: 2px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  animation: floatCoin linear infinite;
  z-index: 2;
  opacity: .6;
}
@keyframes floatCoin {
  0% { transform: translateY(110vh) rotate(0deg); opacity:0; }
  10% { opacity:.6; }
  90% { opacity:.6; }
  100% { transform: translateY(-10vh) rotate(720deg); opacity:0; }
}

/* ── SCANLINES ── */
.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.15) 2px, rgba(0,0,0,0.15) 4px);
  z-index: 2;
  pointer-events: none;
}

/* ── MAIN LOGIN CONTAINER ── */
.login-wrap {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 460px;
  padding: 20px;
}

/* ── LOGO ── */
.logo-area {
  text-align: center;
  margin-bottom: 32px;
  animation: logoReveal 1s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes logoReveal {
  from { opacity:0; transform: scale(.8) translateY(-20px); }
  to { opacity:1; transform: scale(1) translateY(0); }
}

.logo-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  position: relative;
}
.logo-hex {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  clip-path: polygon(50% 0%,100% 25%,100% 75%,50% 100%,0% 75%,0% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: hexSpin 8s linear infinite;
  box-shadow: 0 0 30px var(--neon-cyan), 0 0 60px rgba(0,245,255,.3);
}
@keyframes hexSpin {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}
.logo-hex span {
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 10px #fff;
}

.logo-title {
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple), var(--neon-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 4px;
  text-transform: uppercase;
}
.logo-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--neon-cyan);
  letter-spacing: 6px;
  text-transform: uppercase;
  opacity: .7;
  margin-top: 4px;
}

/* ── CARD ── */
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 20px;
  padding: 40px 36px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 0 0 1px rgba(0,245,255,.1),
    0 20px 80px rgba(0,0,0,.8),
    inset 0 1px 0 rgba(255,255,255,.08);
  animation: cardReveal .8s .3s cubic-bezier(.2,.8,.2,1) both;
  position: relative;
  overflow: hidden;
}
@keyframes cardReveal {
  from { opacity:0; transform: translateY(30px); }
  to { opacity:1; transform: translateY(0); }
}
.card-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--neon-cyan);
  border-style: solid;
  opacity: .8;
}
.corner-tl { top:12px; left:12px; border-width:2px 0 0 2px; }
.corner-tr { top:12px; right:12px; border-width:2px 2px 0 0; }
.corner-bl { bottom:12px; left:12px; border-width:0 0 2px 2px; }
.corner-br { bottom:12px; right:12px; border-width:0 2px 2px 0; }

.card-scan {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  animation: scanLine 3s linear infinite;
}
@keyframes scanLine {
  0% { top: 0; opacity:1; }
  100% { top: 100%; opacity:0; }
}

.login-heading {
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.login-subheading {
  font-size: 13px;
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
  margin-bottom: 32px;
  letter-spacing: 1px;
}

/* ── FORM ── */
.form-group {
  margin-bottom: 20px;
  position: relative;
}
.form-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--neon-cyan);
  letter-spacing: 3px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}
.input-wrap {
  position: relative;
}
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: .6;
  pointer-events: none;
  z-index: 2;
}
.form-input {
  width: 100%;
  background: rgba(0,245,255,0.04);
  border: 1px solid rgba(0,245,255,0.2);
  border-radius: 10px;
  padding: 14px 44px 14px 44px;
  color: var(--text-primary);
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 1px;
  outline: none;
  transition: all .3s ease;
}
.form-input::placeholder { color: rgba(232,244,255,.25); font-size: 14px; }
.form-input:focus {
  border-color: var(--neon-cyan);
  background: rgba(0,245,255,0.07);
  box-shadow: 0 0 0 3px rgba(0,245,255,.1), 0 0 20px rgba(0,245,255,.15);
}
.toggle-pw {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  transition: color .2s;
  z-index: 2;
}
.toggle-pw:hover { color: var(--neon-cyan); }

/* ── REMEMBER ROW ── */
.form-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.remember-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.remember-wrap input[type=checkbox] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(0,245,255,.4);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: all .2s;
}
.remember-wrap input[type=checkbox]:checked {
  background: var(--neon-cyan);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
}
.remember-wrap input[type=checkbox]:checked::after {
  content: '✓';
  position: absolute;
  top: -2px; left: 2px;
  color: #000;
  font-size: 12px;
  font-weight: 900;
}
.remember-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  color: var(--text-muted);
}
.forgot-link {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--neon-cyan);
  text-decoration: none;
  letter-spacing: 1px;
  opacity: .7;
  transition: opacity .2s;
}
.forgot-link:hover { opacity: 1; }

/* ── LOGIN BUTTON ── */
.btn-login {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue), var(--neon-purple));
  background-size: 200% 200%;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all .3s ease;
  animation: gradShift 3s ease infinite;
}
@keyframes gradShift {
  0%,100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.btn-login::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: rgba(255,255,255,.2);
  transform: skewX(-25deg);
  animation: btnShine 3s ease-in-out infinite;
}
@keyframes btnShine {
  0%,70% { left: -60%; }
  100% { left: 120%; }
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,245,255,.4), 0 0 60px rgba(191,0,255,.3);
}
.btn-login:active { transform: translateY(0); }
.btn-login.loading { pointer-events: none; }
.btn-login .btn-text { display: flex; align-items: center; justify-content: center; gap: 10px; }

/* ── DIVIDER ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
}
.divider-line { flex:1; height:1px; background: rgba(0,245,255,.15); }
.divider-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 2px;
}

/* ── DEMO CREDENTIALS ── */
.demo-creds {
  background: rgba(0,245,255,.05);
  border: 1px solid rgba(0,245,255,.15);
  border-radius: 8px;
  padding: 12px 16px;
  text-align: center;
  margin-top: 20px;
}
.demo-creds p {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  line-height: 1.8;
}
.demo-creds span { color: var(--neon-cyan); }

/* ── ERROR POPUP ── */
.error-popup {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255,0,110,.1);
  border: 1px solid var(--neon-pink);
  border-radius: 12px;
  padding: 16px 20px;
  z-index: 999;
  display: none;
  animation: popIn .3s cubic-bezier(.2,.8,.2,1);
  backdrop-filter: blur(10px);
  max-width: 300px;
  box-shadow: 0 0 30px rgba(255,0,110,.3);
}
.error-popup.show { display: block; }
@keyframes popIn {
  from { transform: translateX(40px) scale(.9); opacity:0; }
  to { transform: translateX(0) scale(1); opacity:1; }
}
.error-popup h4 {
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  color: var(--neon-pink);
  letter-spacing: 2px;
  margin-bottom: 4px;
}
.error-popup p {
  font-size: 13px;
  color: rgba(255,200,200,.8);
  font-family: 'Rajdhani', sans-serif;
}
.error-glitch {
  animation: glitch .4s ease;
}
@keyframes glitch {
  0%,100% { transform: translate(0); filter: none; }
  20% { transform: translate(-3px, 1px); filter: hue-rotate(90deg); }
  40% { transform: translate(3px, -1px); filter: hue-rotate(-90deg); }
  60% { transform: translate(-1px, 2px); }
  80% { transform: translate(1px, -2px); }
}

/* ── STATUS BAR ── */
.status-bar {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 8px #00ff88;
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform: scale(1); }
  50% { opacity:.5; transform: scale(.8); }
}
.status-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 2px;
}

/* ── SUCCESS OVERLAY ── */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,4,8,.9);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}
.success-overlay.show { display: flex; animation: fadeIn .3s ease; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.success-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--neon-cyan);
  border-right-color: var(--neon-purple);
  animation: spin 1s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}
@keyframes spin { to { transform: rotate(360deg); } }
.success-ring span {
  font-family: 'Orbitron', monospace;
  font-size: 24px;
}
.success-text {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  color: var(--neon-cyan);
  letter-spacing: 4px;
  animation: textGlow 1s ease infinite alternate;
}
@keyframes textGlow {
  from { text-shadow: 0 0 10px var(--neon-cyan); }
  to { text-shadow: 0 0 30px var(--neon-cyan), 0 0 60px var(--neon-purple); }
}
