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

:root {
  --bg-main: #050810;
  --bg-panel: #0b101c;
  --bg-panel-alt: #0f1624;
  --accent: #27e5ff;
  --accent-soft: rgba(39, 229, 255, 0.35);
  --accent-strong: #ff3d92;
  --text-main: #f7fbff;
  --text-sub: #96a4c2;
  --border-soft: rgba(255, 255, 255, 0.06);
  --shadow-soft: 0 0 40px rgba(0, 0, 0, 0.65);
  --radius-lg: 16px;
  --radius-sm: 8px;
  --transition-fast: 0.2s ease-out;
}

body.hud-body,
body.login-body {
  min-height: 100vh;
  background: radial-gradient(circle at top, #172845 0, #050810 55%);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* HUD LAYOUT */

.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px 8px;
}

.hud-logo {
  font-size: 20px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hud-logo span {
  font-size: 11px;
  color: var(--text-sub);
  margin-left: 10px;
}

.hud-session {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-sub);
}

.hud-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 18px;
  padding: 8px 24px 24px;
}

.hud-panel {
  background: linear-gradient(145deg, rgba(13, 20, 36, 0.98), rgba(7, 11, 22, 0.98));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.hud-panel h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-sub);
  margin-bottom: 10px;
}

.status-panel ul {
  list-style: none;
  font-size: 13px;
}

.status-panel li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  color: var(--text-sub);
}

.status-panel li span:last-child {
  font-size: 11px;
  color: var(--accent);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.6);
}

.dot.ok {
  background: #00ff94;
}

.dot.secure {
  background: #27e5ff;
}

/* QUICK COMMANDS */

.quick-commands {
  margin-top: 16px;
  background: radial-gradient(circle at top left, rgba(39, 229, 255, 0.18), transparent 55%);
}

.quick-commands h3 {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

/* BUTTONS */

.hud-btn {
  flex: 1;
  padding: 7px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-soft);
  background: radial-gradient(circle at top, rgba(39, 229, 255, 0.25), rgba(4, 10, 26, 0.95));
  color: var(--text-main);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.hud-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(39, 229, 255, 0.45);
  border-color: var(--accent);
}

.hud-btn-ghost {
  background: rgba(7, 11, 22, 0.95);
  border-style: dashed;
}

.hud-btn-outline {
  padding-inline: 14px;
  border-radius: 999px;
}

/* RADAR */

.hud-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-container {
  position: relative;
  width: min(420px, 70vw);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(39, 229, 255, 0.18), transparent 60%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.radar-ring {
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(39, 229, 255, 0.38);
}

.ring-outer {
  width: 88%;
  height: 88%;
  border-color: rgba(39, 229, 255, 0.25);
}

.ring-middle {
  width: 62%;
  height: 62%;
}

.ring-inner {
  width: 34%;
  height: 34%;
}

.radar-pulse {
  position: absolute;
  width: 94%;
  height: 94%;
  border-radius: 999px;
  border: 1px solid rgba(39, 229, 255, 0.08);
  box-shadow: 0 0 40px rgba(39, 229, 255, 0.4);
  animation: pulse 3.6s infinite ease-out;
}

.radar-core {
  position: relative;
  width: 26%;
  height: 26%;
  border-radius: 999px;
  background: radial-gradient(circle at center, #27e5ff, #0a1427 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 18px rgba(39, 229, 255, 0.8),
    0 0 80px rgba(0, 0, 0, 0.9);
}

.core-label {
  position: absolute;
  bottom: -58px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-sub);
  text-align: center;
}

/* EVENT LOG + SENSOR GRID */

.right-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.event-log {
  flex: 1;
}

.event-log ul {
  list-style: none;
  max-height: 210px;
  overflow: hidden;
  font-size: 11px;
  color: var(--text-sub);
}

.event-log li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-block: 3px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.event-log time {
  color: var(--accent);
  font-size: 10px;
}

.sensor-grid {
  padding-top: 6px;
}

.sensor-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.sensor-row span:first-child {
  flex: 0 0 90px;
}

.bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(13, 22, 40, 0.9);
  overflow: hidden;
}

.bar .fill {
  height: 100%;
  width: var(--value);
  background: linear-gradient(90deg, #27e5ff, #ff3d92);
  box-shadow: 0 0 16px rgba(39, 229, 255, 0.7);
}

/* LOGIN PAGE */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-shell {
  width: 360px;
  max-width: 92vw;
  background: radial-gradient(circle at top, rgba(39, 229, 255, 0.18), rgba(5, 8, 16, 0.98));
  border-radius: 18px;
  border: 1px solid rgba(39, 229, 255, 0.35);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.85);
  padding: 22px 22px 18px;
  position: relative;
  overflow: hidden;
}

.login-shell::before {
  content: "";
  position: absolute;
  inset: -40%;
  opacity: 0.22;
  background:
    radial-gradient(circle at 0% 0%, rgba(39, 229, 255, 0.4), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(255, 61, 146, 0.32), transparent 55%);
  pointer-events: none;
}

.login-header {
  position: relative;
  text-align: center;
  margin-bottom: 18px;
}

.login-title {
  font-size: 16px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.login-subtitle {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 6px;
}

.login-form {
  position: relative;
  z-index: 1;
}

.field-group {
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.input-shell {
  position: relative;
}

.input-shell input {
  width: 100%;
  padding: 7px 9px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid rgba(39, 229, 255, 0.4);
  background: rgba(3, 7, 16, 0.98);
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.input-shell input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(39, 229, 255, 0.7);
  background: radial-gradient(circle at top, rgba(39, 229, 255, 0.18), rgba(5, 8, 16, 0.98));
  transform: translateY(-1px);
}

.helper-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-sub);
  margin-bottom: 10px;
}

.helper-row span.code-hint {
  color: var(--accent);
  letter-spacing: 0.14em;
}

.login-footer {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  color: var(--text-sub);
}

.login-footer span {
  opacity: 0.85;
}

.status-line {
  font-size: 10px;
  margin-top: 8px;
  min-height: 14px;
}

.status-line.ok {
  color: #00ffbf;
}

.status-line.error {
  color: #ff6b81;
}

/* UTILITIES */

.hidden {
  display: none !important;
}

@keyframes pulse {
  0% {
    transform: scale(0.86);
    opacity: 0.85;
  }
  80% {
    transform: scale(1.02);
    opacity: 0;
  }
  100% {
    transform: scale(1.02);
    opacity: 0;
  }
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .hud-layout {
    grid-template-columns: 1fr;
  }
  .hud-center {
    order: -1;
  }
}
