:root {
  color-scheme: dark;
  --text: #f6f8fb;
  --muted: rgba(224, 235, 245, 0.70);
  --panel: rgba(15, 22, 27, 0.42);
  --panel-strong: rgba(14, 20, 26, 0.50);
  --glass-highlight: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.18);
  --business: #24945f;
  --business-strong: #176d49;
  --private: #3378c8;
  --private-strong: #235b99;
  --danger: #ba3b46;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.12) 45%, rgba(0, 0, 0, 0.18)),
    url("/tesla-bg.png") center center / cover no-repeat fixed,
    #06100f;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.08), transparent 16%),
    linear-gradient(180deg, rgba(0,0,0,0.10), rgba(0,0,0,0.44));
}

button, input { font: inherit; }
button { cursor: pointer; }
.app {
  position: relative;
  width: min(100%, 580px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 12px; }
.hero {
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.04)),
    rgba(8, 15, 20, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -1px 0 rgba(255,255,255,0.05),
    0 22px 60px rgba(0,0,0,0.34);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}
.heroCopy { min-width: 0; }
.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0; }
h1 { margin: 0; font-size: 36px; line-height: 1.02; letter-spacing: 0; }
.heroSub { margin: 9px 0 0; color: rgba(255,255,255,0.70); font-size: 14px; font-weight: 700; }
.iconButton {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  background: rgba(255,255,255,0.12);
  color: var(--text);
  font-size: 28px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 10px 24px rgba(0,0,0,0.20);
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  margin: 12px 0;
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 18px 44px rgba(0,0,0,0.30);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}
.authRow { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 8px; }
label, .statsHeader span, .statsGrid span { color: var(--muted); font-size: 14px; font-weight: 700; }
input { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: rgba(0,0,0,0.24); color: var(--text); }
.authRow button { border: 0; border-radius: 10px; padding: 0 14px; background: var(--text); color: #11181f; font-weight: 800; }
.switcher { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.modeButton {
  min-height: 152px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: var(--panel-strong);
  color: var(--text);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 16px 38px rgba(0,0,0,0.30);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.modeButton:active { transform: scale(0.985); }
.modeButton span { color: var(--muted); font-weight: 900; display: flex; align-items: center; gap: 8px; }
.modeButton strong { font-size: 32px; line-height: 1; }
.modeIcon { font-style: normal; color: rgba(255,255,255,0.46); }
.modeButton.active[data-mode="firemni"] {
  background:
    linear-gradient(135deg, rgba(36,148,95,0.86), rgba(23,109,73,0.76)),
    rgba(13, 24, 18, 0.34);
  border-color: rgba(255,255,255,0.76);
  color: white;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.24),
    0 0 0 2px rgba(255,255,255,0.24),
    0 18px 42px rgba(31,122,84,0.42);
}
.modeButton.active[data-mode="soukrome"] {
  background:
    linear-gradient(135deg, rgba(51,120,200,0.86), rgba(35,91,153,0.76)),
    rgba(10, 19, 30, 0.34);
  border-color: rgba(255,255,255,0.76);
  color: white;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.24),
    0 0 0 2px rgba(255,255,255,0.24),
    0 18px 42px rgba(44,111,187,0.42);
}
.modeButton.active span { color: rgba(255, 255, 255, 0.78); }
.modeButton.active .modeIcon { color: rgba(255,255,255,0.86); }
.statsHeader { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.statsHeader strong { font-size: 31px; }
.ratioBar {
  display: flex;
  height: 24px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  margin: 15px 0 12px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.30);
}
.ratioBusiness { width: 50%; background: linear-gradient(90deg, var(--business-strong), var(--business)); }
.ratioPrivate { width: 50%; background: linear-gradient(90deg, var(--private), var(--private-strong)); }
.legend { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 999px; margin-right: 6px; }
.dot.business { background: var(--business); }
.dot.private { background: var(--private); }
.statsGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.statsGrid div {
  min-width: 0;
  border-radius: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}
.statsGrid strong { display: block; margin-top: 6px; font-size: 22px; }
.status { min-height: 20px; margin: 12px 2px 0; color: rgba(255,255,255,0.72); font-weight: 800; }
.status.error { color: var(--danger); }

@media (max-width: 420px) {
  .app { padding-left: 12px; padding-right: 12px; }
  h1 { font-size: 31px; }
  .modeButton { min-height: 132px; padding: 14px; }
  .modeButton strong { font-size: 28px; }
}
