/* ===================================
   Global (non-login pages)
   =================================== */
body {
  font-size: 16px;
  background-color: #0d161b;
}

.form-holder {
  margin-bottom: 1.5rem;
}

.error-message {
  color: #dc3545;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 500;
}

h2 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* ===================================
   Cortex Design System -- Variables
   =================================== */
:root {
  --cortex-bg: #0d161b;
  --cortex-surface: rgba(20, 22, 27, 0.65);
  --cortex-border: rgba(175, 0, 0, 0.18);
  --cortex-cyan: #af0000;
  --cortex-blue: #7c0000;
  --cortex-purple: #e24646;
  --cortex-glow: 0 0 20px rgba(175, 0, 0, 0.35);
  --cortex-text: #f4f4f4;
  --cortex-text-muted: #8599a9;
  --cortex-danger: #ff8c42;
  --cortex-font-brand: 'Orbitron', sans-serif;
  --cortex-font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --cortex-radius: 16px;
}

/* ===================================
   Cortex Theme -- Shared Dark Body
   =================================== */
body.login-page,
body.cortex-app {
  margin: 0;
  padding: 0;
  background-color: var(--cortex-bg);
  color: var(--cortex-text);
  font-family: var(--cortex-font-body);
}

body.login-page {
  overflow: hidden;
}

/* Animated gradient background layer */
body.login-page::before,
body.cortex-app::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
          radial-gradient(ellipse 600px 600px at 20% 50%, rgba(175, 0, 0, 0.06), transparent),
          radial-gradient(ellipse 400px 400px at 80% 20%, rgba(226, 70, 70, 0.06), transparent),
          radial-gradient(ellipse 500px 500px at 60% 80%, rgba(124, 0, 0, 0.04), transparent),
          linear-gradient(180deg, #0d161b 0%, #1a0808 50%, #0d161b 100%);
  animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0%   { opacity: 1; }
  100% { opacity: 0.7; }
}

/* ===================================
   Login Page -- Neural Canvas
   =================================== */
#neural-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}


.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--cortex-text-muted);
  transition: color 0.3s;
  pointer-events: none;
}

.input-wrapper:focus-within .input-icon {
  color: var(--cortex-cyan);
}


/* ===================================
   Cortex App -- Navbar
   =================================== */
.cortex-navbar {
  background: rgba(13, 22, 27, 0.8) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--cortex-border) !important;
  position: relative;
  z-index: 10;
}

.cortex-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--cortex-font-brand);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
}

.cortex-nav-wordmark {
  background: linear-gradient(135deg, var(--cortex-cyan), var(--cortex-blue), var(--cortex-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cortex-nav-icon {
  display: inline-block;
  width: 25px;
  height: 25px;
  background-image: url('/2card-transparent.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 0 4px rgba(175, 0, 0, 0.8))
          drop-shadow(0 0 10px rgba(175, 0, 0, 0.5));
  animation: navIconPulse 3s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes navIconPulse {
  0%, 100% {
    filter: drop-shadow(0 0 4px rgba(175, 0, 0, 0.8))
            drop-shadow(0 0 10px rgba(175, 0, 0, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 7px rgba(175, 0, 0, 1))
            drop-shadow(0 0 18px rgba(175, 0, 0, 0.8));
  }
}

.cortex-navbar .nav-link {
  color: var(--cortex-text-muted) !important;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: color 0.3s;
}

.cortex-navbar .nav-link:hover {
  color: var(--cortex-cyan) !important;
}

/* ===================================
   Cortex App -- Footer
   =================================== */
.cortex-footer {
  border-top-color: var(--cortex-border) !important;
  color: var(--cortex-text-muted);
  position: relative;
  z-index: 2;
}

.cortex-footer a {
  color: var(--cortex-cyan);
  text-decoration: none;
  transition: color 0.3s;
}

.cortex-footer a:hover {
  color: var(--cortex-purple);
}

/* ===================================
   Cortex App -- Content
   =================================== */
.cortex-app h2 {
  color: var(--cortex-text);
  font-family: var(--cortex-font-brand);
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* ===================================
   Cortex -- Global loader overlay
   =================================== */
.cortex-loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 22, 27, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.cortex-loader-overlay.is-visible {
  display: flex;
}

.cortex-loader-overlay .decision-tree-cell {
  min-height: auto;
}
