:root {
  --bg: #07131a;
  --bg-2: #0d2430;
  --fog: #9eb6c2;
  --line: rgba(158, 182, 194, 0.22);
  --amber: #f0b429;
  --mint: #5eead4;
  --danger: #ff7a6a;
  --font-brand: "Syne", sans-serif;
  --font-body: "Figtree", sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  background: var(--bg);
  color: #e8f1f5;
}

body {
  overflow-x: hidden;
}

.login-atmosphere,
.app-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(94, 234, 212, 0.16), transparent 55%),
    radial-gradient(900px 600px at 88% 10%, rgba(240, 180, 41, 0.14), transparent 50%),
    linear-gradient(165deg, #07131a 0%, #0b1c26 48%, #102833 100%);
}

.login-atmosphere::after,
.app-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 75%);
  opacity: 0.45;
  animation: drift 28s linear infinite;
}

@keyframes drift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(48px);
  }
}

.brand {
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: clamp(2.6rem, 8vw, 5rem);
  line-height: 0.92;
  color: #f4fbff;
}

.login-stage {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem clamp(1.25rem, 4vw, 4rem);
  max-width: 34rem;
  animation: rise 0.7s ease both;
}

.login-stage h1 {
  margin: 0.85rem 0 0;
  font-family: var(--font-brand);
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.lede {
  margin: 0.55rem 0 1.8rem;
  color: var(--fog);
  max-width: 24rem;
}

.login-form {
  display: grid;
  gap: 0.9rem;
  max-width: 22rem;
}

.login-form label,
.controls label {
  display: grid;
  gap: 0.35rem;
}

.login-form span,
.controls span,
.stat-label,
.metric-label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fog);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(7, 19, 26, 0.55);
  color: #f4fbff;
  border-radius: 0;
  padding: 0.85rem 0.95rem;
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(94, 234, 212, 0.7);
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.25);
}

button {
  border: 0;
  cursor: pointer;
  background: var(--amber);
  color: #1a1203;
  font-weight: 600;
  padding: 0.9rem 1.1rem;
  transition: transform 0.18s ease, filter 0.18s ease;
}

button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

button.ghost {
  background: transparent;
  color: var(--fog);
  border: 1px solid var(--line);
  padding: 0.55rem 0.9rem;
}

.error {
  margin: 0;
  color: var(--danger);
  min-height: 1.2em;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem clamp(1rem, 3vw, 2.5rem) 0.5rem;
  animation: rise 0.55s ease both;
}

.brand-lockup .brand {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.user-chip {
  display: inline-block;
  margin-top: 0.35rem;
  color: var(--fog);
  font-size: 0.92rem;
}

.viz {
  padding: 0.5rem clamp(1rem, 3vw, 2.5rem) 2.5rem;
  display: grid;
  gap: 1.25rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.25rem;
  animation: rise 0.65s ease both;
  align-items: end;
}

.controls label {
  min-width: min(100%, 11rem);
}

.controls select {
  min-width: 11rem;
}

.controls-heading {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fog);
}

.check-label {
  min-width: auto !important;
}

.check-label input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--mint);
  margin: 0.55rem 0 0.2rem;
}

.compare-block {
  animation: rise 0.7s ease both;
}

.compare-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
}

.compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  padding: 0.45rem 0.7rem;
  color: var(--fog);
  cursor: pointer;
  user-select: none;
  background: rgba(7, 19, 26, 0.35);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.compare-chip input {
  accent-color: var(--mint);
}

.compare-chip.on {
  color: #f4fbff;
  border-color: rgba(94, 234, 212, 0.55);
  background: rgba(94, 234, 212, 0.08);
}

.compare-chip[disabled] {
  opacity: 0.35;
  pointer-events: none;
}

.compare-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: currentColor;
}

.hero-metric {
  animation: rise 0.75s ease both;
}

.metric-value {
  margin: 0.15rem 0;
  font-family: var(--font-brand);
  font-size: clamp(2.8rem, 9vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.95;
  color: var(--mint);
}

.metric-sub {
  margin: 0;
  color: var(--fog);
}

.chart-shell {
  position: relative;
  min-height: clamp(260px, 46vh, 520px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0 0.25rem;
  animation: rise 0.85s ease both;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  animation: rise 0.95s ease both;
}

.stat-value {
  margin: 0.2rem 0 0;
  font-size: 1.25rem;
  font-weight: 600;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    align-items: center;
  }
}
