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

:root {
  --primary: #00f0ff;
  --primary-dark: #00a8b3;
  --secondary: #7b2dff;
  --accent: #ff00aa;
  --success: #00ff88;
  --warning: #ffaa00;
  --bg-dark: #0a0a0f;
  --bg-darker: #050508;
  --text: #ffffff;
  --text-muted: #6b7280;
  --glow-primary: 0 0 20px rgba(0, 240, 255, 0.5);
  --outlook: #0078D4;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: 0;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(123, 45, 255, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0, 240, 255, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 0, 170, 0.05) 0%, transparent 70%);
  z-index: 1;
}

#neural-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  opacity: 0.4;
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 1;
  animation: float 10s ease-in-out infinite;
}

.orb-1 {
  width: 300px;
  height: 300px;
  background: var(--primary);
  top: -100px;
  right: -100px;
  opacity: 0.12;
}

.orb-2 {
  width: 250px;
  height: 250px;
  background: var(--secondary);
  bottom: -50px;
  left: -50px;
  opacity: 0.15;
  animation-delay: -3s;
}

.orb-3 {
  width: 150px;
  height: 150px;
  background: var(--accent);
  top: 50%;
  left: 50%;
  opacity: 0.08;
  animation-delay: -6s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
}

.particles {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--primary);
  border-radius: 50%;
  animation: particleFloat 12s ease-in-out infinite;
}

@keyframes particleFloat {
  0%, 100% { opacity: 0; transform: translateY(100vh) scale(0); }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-100vh) scale(1); }
}

/* Top bar */
.top-bar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(0, 240, 255, 0.12);
  backdrop-filter: blur(10px);
  background: rgba(5, 5, 8, 0.55);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-mark {
  width: 22px;
  height: 22px;
  color: var(--primary);
  display: grid;
  place-items: center;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
}

.live-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: var(--success);
  border: 1px solid rgba(0, 255, 136, 0.4);
  background: rgba(0, 255, 136, 0.1);
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
}

.sys-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.header-signin {
  justify-self: end;
}

.btn-outlook-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outlook-ghost:hover {
  border-color: rgba(0, 120, 212, 0.6);
  background: rgba(0, 120, 212, 0.12);
}

.outlook-icon {
  width: 16px;
  height: 16px;
}

.container {
  position: relative;
  z-index: 10;
  height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 1.5rem 4rem 2rem;
  gap: 3rem;
}

.left-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  text-align: center;
}

.right-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 520px;
  justify-self: center;
  width: 100%;
}

/* HUD */
.hud-container {
  position: relative;
  width: 260px;
  height: 260px;
}

.hud-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.hud-ring-outer {
  width: 100%;
  height: 100%;
  animation: rotateClockwise 20s linear infinite;
}

.hud-ring-middle {
  width: 90%;
  height: 90%;
  animation: rotateCounterClockwise 15s linear infinite;
}

@keyframes rotateClockwise {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes rotateCounterClockwise {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(-360deg); }
}

.hud-ring svg {
  width: 100%;
  height: 100%;
}

.ring-track {
  fill: none;
  stroke: rgba(0, 240, 255, 0.1);
  stroke-width: 2;
}

.ring-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 1194;
  stroke-dashoffset: 300;
  filter: drop-shadow(0 0 10px var(--primary));
}

.ring-inner-track {
  fill: none;
  stroke: rgba(123, 45, 255, 0.1);
  stroke-width: 1;
  stroke-dasharray: 10 5;
}

.ring-dashed {
  fill: none;
  stroke: rgba(0, 240, 255, 0.2);
  stroke-width: 1;
  stroke-dasharray: 20 10;
}

.data-points .data-point {
  fill: var(--primary);
  filter: drop-shadow(0 0 5px var(--primary));
  animation: dataPulse 2s ease-in-out infinite;
}

.data-point:nth-child(odd) {
  animation-delay: -1s;
}

@keyframes dataPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.hud-hexagon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 55%;
  height: 55%;
  animation: hexPulse 4s ease-in-out infinite;
}

.hud-hexagon svg {
  width: 100%;
  height: 100%;
}

.hex-outline {
  fill: none;
  stroke: var(--secondary);
  stroke-width: 2;
  filter: drop-shadow(0 0 10px var(--secondary));
  opacity: 0.5;
}

.hex-inner {
  fill: rgba(123, 45, 255, 0.05);
  stroke: var(--secondary);
  stroke-width: 1;
  opacity: 0.3;
}

@keyframes hexPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
  50% { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
}

.hud-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
}

.core-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border: 2px solid var(--primary);
  border-radius: 50%;
  animation: corePulseAnim 2s ease-out infinite;
}

.core-pulse::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border: 2px solid var(--accent);
  border-radius: 50%;
  animation: corePulseAnim 2s ease-out infinite 0.5s;
}

@keyframes corePulseAnim {
  0% { width: 50px; height: 50px; opacity: 1; }
  100% { width: 100px; height: 100px; opacity: 0; }
}

.core-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--bg-darker), var(--bg-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.3), inset 0 0 20px rgba(0, 240, 255, 0.1);
}

.core-icon {
  color: var(--primary);
  width: 24px;
  height: 24px;
}

.core-icon svg {
  width: 100%;
  height: 100%;
}

.hud-scanner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  transform-origin: center;
  animation: scannerRotate 3s linear infinite;
  opacity: 0.5;
}

@keyframes scannerRotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.system-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.main-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.35rem, 3.2vw, 2.15rem);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.title-line {
  display: block;
  letter-spacing: 0.08em;
}

.title-line.accent {
  font-size: 1.35em;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 5s ease infinite;
  background-size: 200% auto;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

.tagline {
  font-size: 1rem;
  color: var(--text-muted);
}

.tagline .highlight {
  color: var(--primary);
  font-weight: 600;
  text-shadow: var(--glow-primary);
}

.login-error {
  color: #ff6b8a;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  max-width: 360px;
  line-height: 1.4;
}

.cta-form {
  margin-top: 0.35rem;
}

.btn-outlook-primary {
  padding: 0.95rem 1.75rem;
  background: linear-gradient(135deg, #0078D4, var(--secondary));
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0 24px rgba(0, 120, 212, 0.35);
}

.btn-outlook-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 32px rgba(0, 240, 255, 0.45);
}

/* System status panel */
.system-status {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 4px;
  padding: 1.25rem;
  backdrop-filter: blur(10px);
  position: relative;
  clip-path: polygon(
    0 12px, 12px 0, calc(100% - 12px) 0, 100% 12px,
    100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px)
  );
}

.system-status::before,
.system-status::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--primary);
  opacity: 0.7;
}

.system-status::before {
  top: 6px;
  left: 6px;
  border-right: none;
  border-bottom: none;
}

.system-status::after {
  bottom: 6px;
  right: 6px;
  border-left: none;
  border-top: none;
}

.status-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 240, 255, 0.1);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: statusBlink 1s ease-in-out infinite;
  box-shadow: 0 0 10px var(--success);
}

@keyframes statusBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--primary);
}

.status-id {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.terminal-output {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-align: left;
  margin-bottom: 1rem;
}

.terminal-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0;
  opacity: 0;
  transform: translateX(-10px);
  animation: terminalFadeIn 0.3s ease forwards;
}

.terminal-line:nth-child(1) { animation-delay: 0.2s; }
.terminal-line:nth-child(2) { animation-delay: 0.55s; }
.terminal-line:nth-child(3) { animation-delay: 0.9s; }
.terminal-line:nth-child(4) { animation-delay: 1.25s; }
.terminal-line:nth-child(5) { animation-delay: 1.6s; }
.terminal-line:nth-child(6) { animation-delay: 1.95s; }

@keyframes terminalFadeIn {
  to { opacity: 1; transform: translateX(0); }
}

.terminal-prompt {
  color: var(--primary);
  font-weight: bold;
}

.terminal-text {
  color: var(--text-muted);
  flex: 1;
}

.terminal-status {
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.terminal-status.success {
  background: rgba(0, 255, 136, 0.2);
  color: var(--success);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.terminal-status.waiting {
  background: transparent;
  color: var(--warning);
  border: 1px solid rgba(255, 170, 0, 0.45);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 0.75rem;
  background: rgba(0, 240, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(0, 240, 255, 0.1);
}

.stat-box {
  text-align: center;
  padding: 0.5rem 0;
}

.stat-number {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.stat-number.blink {
  color: var(--success);
  animation: statusBlink 1s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.stat-box .stat-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.progress-item {
  text-align: left;
}

.progress-item.full-width {
  grid-column: 1 / -1;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.progress-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.progress-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  color: var(--primary);
}

.progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar.large {
  position: relative;
  height: 8px;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px var(--primary);
}

.progress-fill.secondary {
  background: var(--secondary);
  box-shadow: 0 0 10px var(--secondary);
}

.progress-fill.accent {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.progress-fill.gradient {
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
}

.progress-segments {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
}

.progress-segments span {
  flex: 1;
  border-right: 2px solid rgba(10, 10, 15, 0.55);
}

.progress-segments span:last-child {
  border-right: none;
}

.scan-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.3;
  z-index: 100;
  animation: scanLine 4s linear infinite;
  pointer-events: none;
}

@keyframes scanLine {
  0% { top: -2px; }
  100% { top: 100%; }
}

.corner {
  position: fixed;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  z-index: 100;
  pointer-events: none;
}

.corner-tl { top: 15px; left: 15px; border-right: none; border-bottom: none; }
.corner-tr { top: 15px; right: 15px; border-left: none; border-bottom: none; }
.corner-bl { bottom: 15px; left: 15px; border-right: none; border-top: none; }
.corner-br { bottom: 15px; right: 15px; border-left: none; border-top: none; }

::selection {
  background: var(--primary);
  color: var(--bg-dark);
}

@media (max-width: 960px) {
  html, body {
    overflow: auto;
  }

  .top-bar {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    justify-items: center;
    text-align: center;
  }

  .header-signin {
    justify-self: center;
  }

  .container {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 120px);
    padding: 1.5rem;
    gap: 2rem;
  }

  .right-panel {
    max-width: 100%;
  }

  .hud-container {
    width: 200px;
    height: 200px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .progress-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .btn-outlook-primary {
    width: 100%;
  }

  .cta-form {
    width: 100%;
  }
}
