/* ============================================================================
   CANSADOW4R3 MAFIA — TERMINAL MATRIX LOGIN
   Pixel-accurate recreation matching cyber terminal HUD specifications
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700;800&family=Share+Tech+Mono&display=swap');

:root {
  --bg-dark: #040207;
  --neon-green: #00ff66;
  --neon-green-light: #34d399;
  --neon-green-glow: rgba(0, 255, 102, 0.55);
  --neon-purple: #c084fc;
  --neon-purple-deep: #a855f7;
  --neon-magenta: #e879f9;
  --purple-glow: rgba(168, 85, 247, 0.4);
  --purple-border: rgba(168, 85, 247, 0.28);
  --purple-border-hi: rgba(217, 70, 239, 0.65);
  --card-bg: rgba(8, 4, 15, 0.86);
  --input-bg: rgba(4, 2, 8, 0.75);
  --text-primary: #ffffff;
  --text-muted: #72628b;
  --text-dim: #9d8ab8;
  --text-code: #83729d;
  --grid-dot: rgba(168, 85, 247, 0.08);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: 'JetBrains Mono', 'Share Tech Mono', monospace;
  color: var(--text-dim);
  user-select: none;
}

/* ============================================================================
   WALLPAPER & ETHEREAL GASTLY LAYERS
   ============================================================================ */

.viewport-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

/* Gastly Background Wallpaper with slow floating drift */
.gastly-wallpaper {
  position: absolute;
  inset: -20px;
  background-image: url('../img/wallpaper.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.38;
  filter: contrast(115%) saturate(120%);
  animation: gastlyFloat 14s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gastlyFloat {
  0% {
    transform: scale(1) translate(0, 0);
  }
  50% {
    transform: scale(1.025) translate(-6px, -8px);
  }
  100% {
    transform: scale(1.01) translate(8px, -4px);
  }
}

/* Smoke Canvas Layer */
#smokeCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.85;
  mix-blend-mode: screen;
}

/* Gastly Eyes Interactive Glow Layer */
.gastly-eyes-glow {
  position: absolute;
  left: 38%;
  top: 55%;
  width: 320px;
  height: 180px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
  opacity: 0.55;
  mix-blend-mode: color-dodge;
  transition: opacity 0.4s ease, filter 0.4s ease;
}

.gastly-eyes-glow .eye-flare-left,
.gastly-eyes-glow .eye-flare-right {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(232, 121, 249, 0.7) 40%, rgba(168, 85, 247, 0.3) 70%, transparent 100%);
  filter: blur(14px);
  animation: eyeBlinkGlow 7s ease-in-out infinite;
}

.gastly-eyes-glow .eye-flare-left {
  left: 20px;
  top: 60px;
  width: 80px;
  height: 50px;
}

.gastly-eyes-glow .eye-flare-right {
  left: 120px;
  top: 15px;
  width: 110px;
  height: 80px;
  animation-delay: 0.3s;
}

@keyframes eyeBlinkGlow {
  0%, 100% {
    opacity: 0.4;
    transform: scale(0.95);
  }
  45% {
    opacity: 0.75;
    transform: scale(1.1);
  }
  48% {
    opacity: 0.1;
    transform: scale(0.7);
  }
  51% {
    opacity: 0.9;
    transform: scale(1.15);
  }
  75% {
    opacity: 0.5;
    transform: scale(1);
  }
}

/* Vignette & Matrix Ambient Grid Overlay */
.matrix-grid-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background-image: 
    radial-gradient(circle, rgba(168, 85, 247, 0.15) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0.5;
}

.ambient-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(circle at 50% 50%, rgba(4, 2, 8, 0.55) 0%, rgba(4, 2, 8, 0.88) 70%, #030106 100%);
}

/* Subtle CRT scanline effect */
.scanline-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: linear-gradient(
    rgba(18, 16, 26, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  );
  background-size: 100% 4px;
  opacity: 0.3;
}

/* ============================================================================
   TOP BAR (IP & STATUS)
   ============================================================================ */

.terminal-topbar {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.16);
  background: rgba(4, 2, 8, 0.45);
  backdrop-filter: blur(8px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.status-indicator {
  display: inline-block;
  width: 9px;
  height: 9px;
  background-color: var(--neon-green);
  border-radius: 1px;
  box-shadow: 0 0 10px var(--neon-green), 0 0 20px var(--neon-green-glow);
  animation: indicatorPulse 2.4s ease-in-out infinite;
}

@keyframes indicatorPulse {
  0%, 100% {
    opacity: 1;
    filter: brightness(1);
    box-shadow: 0 0 8px var(--neon-green);
  }
  50% {
    opacity: 0.65;
    filter: brightness(1.25);
    box-shadow: 0 0 15px var(--neon-green), 0 0 25px var(--neon-green);
  }
}

.ip-label {
  color: var(--neon-green);
  font-weight: 700;
}

.ip-address {
  color: var(--neon-green);
  font-weight: 700;
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
}

.topbar-right {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================================================
   CENTER STAGE & TERMINAL CARD
   ============================================================================ */

.terminal-stage {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  flex: 1;
}

.terminal-card-container {
  position: relative;
  width: 100%;
  max-width: 480px;
}

.terminal-card {
  position: relative;
  width: 100%;
  padding: 38px 36px 32px;
  background: var(--card-bg);
  border: 1px solid var(--purple-border);
  border-radius: 4px;
  backdrop-filter: blur(24px) saturate(130%);
  -webkit-backdrop-filter: blur(24px) saturate(130%);
  box-shadow: 
    0 24px 60px -15px rgba(0, 0, 0, 0.9),
    0 0 40px -10px rgba(168, 85, 247, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.terminal-card:hover {
  border-color: rgba(168, 85, 247, 0.42);
  box-shadow: 
    0 28px 70px -12px rgba(0, 0, 0, 0.95),
    0 0 50px -5px rgba(168, 85, 247, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* HUD Corner Marks (+ / brackets) */
.corner-mark {
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
}

.corner-mark.top-left {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--neon-purple);
  border-left: 2px solid var(--neon-purple);
}

.corner-mark.top-right {
  top: -1px;
  right: -1px;
  border-top: 2px solid var(--neon-purple);
  border-right: 2px solid var(--neon-purple);
}

.corner-mark.bottom-left {
  bottom: -1px;
  left: -1px;
  border-bottom: 2px solid var(--neon-purple);
  border-left: 2px solid var(--neon-purple);
}

.corner-mark.bottom-right {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--neon-purple);
  border-right: 2px solid var(--neon-purple);
}

/* ============================================================================
   CARD HEADER & LOGO WITH EFFECTS
   ============================================================================ */

.terminal-header {
  text-align: center;
  margin-bottom: 28px;
}

.terminal-title {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 27px;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  line-height: 1.1;
  margin-bottom: 8px;
}

.brand-title {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
  transition: letter-spacing 0.3s ease;
}

.brand-accent {
  color: var(--neon-purple);
  text-shadow: 
    0 0 10px rgba(192, 132, 252, 0.9),
    0 0 24px rgba(168, 85, 247, 0.7),
    0 0 40px rgba(217, 70, 239, 0.5);
  animation: neonFlicker 6s infinite alternate;
  display: inline-block;
}

@keyframes neonFlicker {
  0%, 100% {
    text-shadow: 
      0 0 10px rgba(192, 132, 252, 0.95),
      0 0 24px rgba(168, 85, 247, 0.75),
      0 0 45px rgba(217, 70, 239, 0.5);
    filter: brightness(1);
  }
  42% {
    text-shadow: 
      0 0 8px rgba(192, 132, 252, 0.8),
      0 0 18px rgba(168, 85, 247, 0.55);
    filter: brightness(0.96);
  }
  43% {
    text-shadow: 
      0 0 14px rgba(255, 255, 255, 1),
      0 0 32px rgba(192, 132, 252, 1),
      0 0 60px rgba(217, 70, 239, 0.85);
    filter: brightness(1.2);
  }
  44% {
    text-shadow: 
      0 0 9px rgba(192, 132, 252, 0.85),
      0 0 20px rgba(168, 85, 247, 0.6);
    filter: brightness(1);
  }
}

.terminal-subtitle {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 500;
}

/* Alert Notification */
.terminal-alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: alertFadeIn 0.3s ease;
}

@keyframes alertFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
   TERMINAL FIELDS & INPUTS WITH CYBER EFFECTS
   ============================================================================ */

.terminal-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.terminal-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field-label-left {
  color: var(--text-dim);
  font-weight: 600;
}

.label-idx {
  color: var(--neon-purple);
  margin-right: 4px;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(192, 132, 252, 0.4);
}

.field-label-right {
  color: var(--text-code);
  font-size: 10px;
  letter-spacing: 0.14em;
}

/* Input Wrapper & Cyber Scanline Animation */
.input-wrapper {
  position: relative;
  width: 100%;
}

.input-wrapper input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--purple-border);
  border-radius: 3px;
  color: #ffffff;
  padding: 13px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.04em;
  outline: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.input-wrapper input::placeholder {
  color: #4b3d63;
  letter-spacing: 0.05em;
  font-weight: 400;
}

/* Dynamic Input Focus Glow & Border Sweep */
.input-wrapper input:hover {
  border-color: rgba(168, 85, 247, 0.45);
}

.input-wrapper input:focus {
  border-color: var(--neon-purple-deep);
  background: rgba(8, 4, 16, 0.9);
  box-shadow: 
    0 0 0 1px rgba(168, 85, 247, 0.6),
    0 0 20px -3px rgba(168, 85, 247, 0.4),
    inset 0 0 12px rgba(168, 85, 247, 0.15);
}

/* Animated accent line beneath active input */
.input-scanline {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, transparent, var(--neon-purple), var(--neon-magenta), transparent);
  transition: width 0.35s ease;
  pointer-events: none;
}

.input-wrapper input:focus ~ .input-scanline {
  width: 100%;
}

/* Password dots styling */
input[type="password"] {
  letter-spacing: 0.18em;
}

/* ============================================================================
   SUBMIT BUTTON (NEON ELECTRIC GREEN + PURPLE ACCENT)
   ============================================================================ */

.terminal-btn-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  margin-top: 8px;
  background: var(--neon-green);
  border: none;
  border-radius: 2px;
  color: #031507;
  font-family: 'JetBrains Mono', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 
    0 0 20px -3px var(--neon-green-glow),
    0 6px 20px rgba(0, 0, 0, 0.6);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

/* The distinct purple bottom accent line from screenshot! */
.terminal-btn-submit::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #9333ea;
  box-shadow: 0 0 8px #c084fc;
  transition: height 0.2s ease, background 0.2s ease;
}

.terminal-btn-submit:hover {
  filter: brightness(1.08);
  box-shadow: 
    0 0 30px var(--neon-green),
    0 0 50px rgba(0, 255, 102, 0.4);
  transform: translateY(-1px);
}

.terminal-btn-submit:hover::after {
  height: 4px;
  background: #a855f7;
  box-shadow: 0 0 12px #e879f9;
}

.terminal-btn-submit:active {
  transform: translateY(1px);
  filter: brightness(0.96);
}

.btn-check {
  font-size: 15px;
  font-weight: 900;
  transform: translateY(-1px);
}

/* Terminal Warning notice */
.terminal-warning {
  margin-top: 14px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #63537a;
  font-weight: 500;
}

/* Version & Node info row directly under the card */
.card-footer-info {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 480px;
  margin-top: 18px;
  padding: 0 4px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #5d4d73;
  text-transform: uppercase;
}

/* ============================================================================
   BOTTOM BAR (BRAND / COPYRIGHT)
   ============================================================================ */

.terminal-bottombar {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 28px;
  border-top: 1px solid rgba(168, 85, 247, 0.16);
  background: rgba(4, 2, 8, 0.45);
  backdrop-filter: blur(8px);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.bottombar-left {
  color: #d8b4fe;
  font-weight: 600;
}

.bottombar-right {
  color: #5d4d73;
  font-weight: 500;
}

/* ============================================================================
   RESPONSIVE DESIGN (MOBILE / TABLET)
   ============================================================================ */

@media (max-width: 600px) {
  .terminal-topbar {
    padding: 12px 16px;
    font-size: 11px;
  }
  .terminal-card {
    padding: 28px 22px 24px;
  }
  .terminal-title {
    font-size: 22px;
  }
  .terminal-subtitle {
    font-size: 10px;
    letter-spacing: 0.12em;
  }
  .terminal-bottombar {
    padding: 10px 16px;
    font-size: 10px;
  }
  .card-footer-info {
    font-size: 9px;
  }
}
