:root {
  --background: #080b10;
  --panel: rgba(20, 25, 34, 0.94);
  --panel-light: rgba(30, 37, 49, 0.92);
  --border: rgba(255, 255, 255, 0.09);
  --text: #f4f7fb;
  --muted: #929cab;
  --accent: #9df06c;
  --accent-strong: #73df36;
  --blue: #73a6ff;
  --danger: #ff6b79;
  --shadow: 0 25px 70px rgba(0, 0, 0, 0.48);
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--background);
  color: var(--text);
}

body {
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.background-glow {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.18;
  pointer-events: none;
}

.glow-one {
  top: -180px;
  right: -100px;
  background: var(--accent);
}

.glow-two {
  bottom: -180px;
  left: -120px;
  background: var(--blue);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 42px;
}

.brand.compact {
  margin: 0;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  transform: rotate(30deg);
}

.brand-mark span {
  position: absolute;
  width: 21px;
  height: 21px;
  background: var(--accent);
  border-radius: 5px;
  box-shadow: 0 0 22px rgba(157, 240, 108, 0.28);
}

.brand-mark span:nth-child(1) {
  top: 0;
  left: 10px;
}

.brand-mark span:nth-child(2) {
  bottom: 0;
  left: 0;
}

.brand-mark span:nth-child(3) {
  right: 0;
  bottom: 0;
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.7px;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.7px;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: -1.3px;
}

h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.7px;
}

.muted {
  color: var(--muted);
  line-height: 1.55;
}

form {
  display: grid;
  gap: 17px;
  margin-top: 28px;
}

label {
  display: grid;
  gap: 8px;
  color: #c5ccd6;
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  color: var(--text);
  background: #10151d;
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: none;
}

input:focus {
  border-color: rgba(157, 240, 108, 0.7);
  box-shadow: 0 0 0 3px rgba(157, 240, 108, 0.1);
}

.primary-button {
  min-height: 54px;
  margin-top: 5px;
  border: 0;
  border-radius: 15px;
  background: var(--accent);
  color: #091008;
  font-weight: 900;
}

.primary-button:disabled {
  opacity: 0.5;
}

.message {
  min-height: 20px;
  margin: 18px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.app-shell {
  width: 100%;
  max-width: 920px;
  min-height: 100vh;
  margin: auto;
  padding: 25px 22px 110px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.account-button {
  width: 43px;
  height: 43px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--panel-light);
  color: var(--text);
  font-weight: 800;
}

.welcome {
  margin: 55px 0 28px;
}

.welcome .muted {
  margin-bottom: 0;
}

.primary-actions {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 14px;
}

.action-card {
  min-height: 120px;
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 20px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
  color: var(--text);
}

.scan-action {
  color: #091008;
  border-color: transparent;
  background: var(--accent);
}

.action-icon {
  display: grid;
  place-items: center;
  min-width: 49px;
  height: 49px;
  border-radius: 15px;
  background: rgba(255,255,255,0.1);
  font-size: 28px;
}

.scan-action .action-icon {
  background: rgba(9,16,8,0.12);
}

.action-card strong,
.space-list strong {
  display: block;
  font-size: 16px;
}

.action-card small,
.space-list small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.35;
}

.scan-action small {
  color: rgba(9,16,8,0.65);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 15px;
}

.stats-grid article {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
}

.stats-grid span {
  display: block;
  font-size: 27px;
  font-weight: 900;
}

.stats-grid small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.section-heading {
  margin: 38px 0 15px;
}

.space-list {
  display: grid;
  gap: 11px;
}

.space-list button {
  display: grid;
  grid-template-columns: 48px 1fr 20px;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px;
  text-align: left;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
}

.space-list b {
  color: var(--muted);
  font-size: 24px;
}

.space-icon {
  display: grid;
  place-items: center;
  height: 48px;
  border-radius: 14px;
  background: #242c38;
  color: var(--accent);
  font-weight: 900;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 10;
  width: calc(100% - 24px);
  max-width: 720px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 9px;
  transform: translateX(-50%);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(16, 21, 29, 0.97);
  box-shadow: var(--shadow);
}

.bottom-nav button {
  min-height: 50px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--muted);
}

.bottom-nav button span,
.bottom-nav button small {
  display: block;
}

.bottom-nav button span {
  margin-bottom: 4px;
  font-size: 19px;
}

.bottom-nav button.active {
  background: #252e3a;
  color: var(--accent);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 20;
  padding: 13px 18px;
  transform: translateX(-50%);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #202733;
  box-shadow: var(--shadow);
  font-size: 13px;
}

@media (max-width: 620px) {
  .auth-shell {
    align-items: start;
    padding: 14px;
  }

  .auth-card {
    margin-top: 10px;
    padding: 25px 20px;
  }

  .app-shell {
    padding: 20px 15px 105px;
  }

  .welcome {
    margin-top: 42px;
  }

  .primary-actions {
    grid-template-columns: 1fr;
  }

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

  h1 {
    font-size: 30px;
  }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 0 11px;
  border: 1px solid rgba(157, 240, 108, 0.22);
  border-radius: 99px;
  color: var(--accent);
  background: rgba(157, 240, 108, 0.07);
  font-size: 11px;
  font-weight: 900;
}

.connection-status::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
}

.connection-status.offline {
  color: #ffb74f;
  border-color: rgba(255, 183, 79, 0.22);
  background: rgba(255, 183, 79, 0.07);
}

.install-button {
  min-height: 35px;
  padding: 0 13px;
  border: 0;
  border-radius: 11px;
  color: #091008;
  background: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 470px) {
  .connection-status {
    display: none;
  }

  .install-button {
    padding: 0 10px;
  }
}
