/* Сайт продукта florkassa.ru: «Графит» (тёмная тема, по умолчанию) и «Аврора» (светлая).
   Тема — атрибут data-theme на <html>, его ставит theme.js. Цвета только через токены ниже. */

:root,
:root[data-theme='dark'] {
  color-scheme: dark;

  --bg: #08090b;
  --aurora-1: rgb(226 69 126 / 28%);
  --aurora-2: rgb(109 74 255 / 32%);
  --aurora-3: rgb(79 163 255 / 14%);
  --aurora-4: rgb(60 203 155 / 14%);
  --aurora-5: rgb(255 140 120 / 18%);

  --text: #edeef0;
  --muted: #9aa0aa;
  --line: rgb(255 255 255 / 8%);
  --line-soft: rgb(255 255 255 / 5%);

  --surface: rgb(255 255 255 / 3.5%);
  --surface-border: rgb(255 255 255 / 8%);
  --header-bg: rgb(8 9 11 / 65%);
  --window-frame: rgb(255 255 255 / 4%);
  --window: #0e1013;
  --window-active: rgb(160 139 255 / 14%);
  --window-active-text: #d6ccff;
  --track: rgb(255 255 255 / 7%);
  --phone: #121419;

  --btn-primary-bg: #edeef0;
  --btn-primary-text: #08090b;
  --btn-glow: 0 0 40px -6px rgb(160 139 255 / 60%);
  --btn-outline: rgb(255 255 255 / 14%);
  --btn-ghost-hover: rgb(255 255 255 / 6%);

  --grad: linear-gradient(90deg, #ff8ab5, #a08bff 60%, #7fb8ff);
  --kicker: #a08bff;
  --pill-tag-text: #0b0716;

  --warn-bg: rgb(255 138 181 / 7%);
  --warn-border: rgb(255 138 181 / 30%);
  --warn-text: #ffc2d8;
  --plus: #6ee7b7;
  --minus: #ff9ec0;
  --money: #b7a8ff;

  --shadow-window: 0 0 0 1px rgb(160 139 255 / 10%), 0 60px 140px -40px rgb(140 90 255 / 45%);
  --shadow-phone: 0 40px 80px -30px rgb(0 0 0 / 70%);
}

:root[data-theme='light'] {
  color-scheme: light;

  --bg: #f4f1fb;
  --aurora-1: rgb(255 150 190 / 55%);
  --aurora-2: rgb(120 150 255 / 50%);
  --aurora-3: rgb(170 120 255 / 26%);
  --aurora-4: rgb(120 220 200 / 32%);
  --aurora-5: rgb(255 180 140 / 38%);

  --text: #14112b;
  --muted: #5a5472;
  --line: #e7e2f2;
  --line-soft: #f0edf7;

  --surface: rgb(255 255 255 / 55%);
  --surface-border: rgb(255 255 255 / 90%);
  --header-bg: rgb(255 255 255 / 60%);
  --window-frame: rgb(255 255 255 / 45%);
  --window: rgb(255 255 255 / 94%);
  --window-active: #f1ecff;
  --window-active-text: #5b3bf0;
  --track: #f1ecff;
  --phone: rgb(255 255 255 / 94%);

  --btn-primary-bg: #6d4aff;
  --btn-primary-text: #ffffff;
  --btn-glow: 0 14px 30px -12px rgb(109 74 255 / 70%);
  --btn-outline: rgb(20 17 43 / 14%);
  --btn-ghost-hover: rgb(20 17 43 / 6%);

  --grad: linear-gradient(90deg, #e2457e, #6d4aff);
  --kicker: #5b3bf0;
  --pill-tag-text: #ffffff;

  --warn-bg: #fff4e0;
  --warn-border: #fde3b5;
  --warn-text: #8a4b00;
  --plus: #1e7a4e;
  --minus: #b42318;
  --money: #5b3bf0;

  --shadow-window: 0 50px 100px -50px rgb(40 20 90 / 55%);
  --shadow-phone: 0 40px 80px -40px rgb(40 20 90 / 50%);
}

:root {
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Geologica', var(--font-body);
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --text-h1: clamp(2.6rem, 1.3rem + 5.2vw, 6.25rem);
  --text-h2: clamp(2rem, 1.2rem + 2.6vw, 3.75rem);
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: clamp(6rem, 4rem + 6vw, 10rem);
  --touch: 48px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(38% 1400px at 18% 0, var(--aurora-1), transparent 70%),
    radial-gradient(36% 1400px at 84% 80px, var(--aurora-2), transparent 70%),
    radial-gradient(40% 900px at 50% 2400px, var(--aurora-3), transparent 70%),
    radial-gradient(40% 900px at 10% 3400px, var(--aurora-4), transparent 70%),
    radial-gradient(40% 900px at 90% 100%, var(--aurora-5), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font: 1rem / 1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color 300ms var(--ease), color 300ms var(--ease);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
  text-wrap: balance;
}

h2 {
  font-size: var(--text-h2);
}

p {
  margin: 0;
}

a {
  color: inherit;
}

kbd,
.mono {
  font-family: var(--font-mono);
}

kbd {
  font-size: 0.75rem;
  color: var(--muted);
}

:focus-visible {
  outline: 2px solid var(--kicker);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.muted {
  color: var(--muted);
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Кнопки */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: var(--touch);
  padding: 0 1.4rem;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 160ms var(--ease),
    background-color 160ms var(--ease),
    box-shadow 160ms var(--ease);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn--sm {
  min-height: 38px;
  padding: 0 0.9rem;
  border-radius: 9px;
  font-size: 0.875rem;
}

.btn--lg {
  min-height: 52px;
  padding: 0 1.6rem;
}

.btn--primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

.btn--primary:hover {
  transform: translateY(-1px);
}

.btn--glow {
  box-shadow: var(--btn-glow);
}

.btn--outline {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--btn-outline);
}

.btn--outline:hover {
  box-shadow: inset 0 0 0 1px var(--muted);
}

.btn--ghost {
  min-height: 38px;
  padding: 0 0.9rem;
  border-radius: 9px;
  font-size: 0.875rem;
  font-weight: 500;
}

.btn--ghost:hover {
  background: var(--btn-ghost-hover);
}

/* Шапка */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff7aa8, #6d4aff);
}

.topnav {
  display: none;
  gap: 1.5rem;
  font-size: 0.875rem;
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms;
}

.topnav a:hover {
  color: var(--text);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.topbar__actions .btn--primary {
  display: none;
}

@media (min-width: 900px) {
  .topnav {
    display: flex;
  }

  .topbar__actions .btn--primary {
    display: inline-flex;
  }
}

/* Переключатель темы: солнце в тёмной теме, луна в светлой */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition:
    background-color 160ms,
    transform 160ms var(--ease);
}

.theme-toggle:hover {
  background: var(--btn-ghost-hover);
}

.theme-toggle:active {
  transform: scale(0.94);
}

.theme-toggle__moon,
:root[data-theme='light'] .theme-toggle__sun {
  display: none;
}

:root[data-theme='light'] .theme-toggle__moon {
  display: block;
}

/* Первый экран */

.hero {
  padding: clamp(3.5rem, 2rem + 5vw, 6.5rem) 0 0;
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 100%;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
}

.pill:hover {
  color: var(--text);
}

.pill__tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--grad);
  color: var(--pill-tag-text);
  font-weight: 700;
}

.hero h1 {
  max-width: 17ch;
  margin: 1.75rem auto 0;
  font-size: var(--text-h1);
  letter-spacing: -0.05em;
  line-height: 1;
}

.lead {
  max-width: 39rem;
  margin: 1.75rem auto 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

/* Экран программы и телефон */

.showcase {
  position: relative;
  max-width: 1100px;
  margin: clamp(3.5rem, 2rem + 4vw, 5rem) auto 0;
  text-align: left;
}

.window {
  padding: 10px;
  border-radius: 22px;
  background: var(--window-frame);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-window);
}

.window__body {
  display: flex;
  border-radius: 14px;
  background: var(--window);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}

.window__side {
  display: none;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 200px;
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.window__side > span {
  padding: 7px 10px;
  border-radius: 6px;
}

.window__side .is-active {
  background: var(--window-active);
  color: var(--window-active-text);
  font-weight: 600;
}

.window__search {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  border: 1px solid var(--line);
}

.window__search kbd {
  font-size: 0.7rem;
}

@media (min-width: 760px) {
  .window__side {
    display: flex;
  }
}

.window__main {
  flex: 1;
  min-width: 0;
  padding: 20px clamp(14px, 2vw, 24px);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.crumbs b {
  color: var(--text);
  font-size: 0.95rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.stats div {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.stats small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.stats b {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1rem + 0.8vw, 1.6rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stats .is-warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-text);
}

.stats .is-warn small {
  color: inherit;
}

.batches {
  margin-top: 18px;
  font-size: 0.82rem;
  overflow-x: auto;
}

.batches__row {
  display: grid;
  grid-template-columns: 70px 60px minmax(120px, 1fr) 60px 72px;
  align-items: center;
  gap: 12px;
  min-width: 440px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line-soft);
}

.batches__row:last-child {
  border-bottom: 0;
}

.batches__row--head {
  padding: 8px 4px;
  color: var(--muted);
  border-bottom-color: var(--line);
}

/* Полоска остатка: дорожка и заливка шириной --w */
.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}

.bar__track {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--track);
}

.bar__fill {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8ab5, #a08bff);
}

.bar__fill--old {
  background: #ff8ab5;
}

.bar__fill--new {
  background: linear-gradient(90deg, #3ccb9b, #7fb8ff);
}

.is-first {
  color: var(--warn-text);
  font-weight: 600;
}

.phone {
  display: none;
  position: absolute;
  right: -28px;
  bottom: -52px;
  width: 230px;
  padding: 8px;
  border-radius: 34px;
  background: var(--window-frame);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow-phone);
}

@media (min-width: 1000px) {
  .phone {
    display: block;
  }

  /* Телефон лежит поверх правого нижнего угла окна — таблица партий уступает ему место */
  .batches {
    margin-right: 190px;
  }
}

.phone__screen {
  padding: 20px 16px;
  border-radius: 27px;
  background: var(--phone);
  border: 1px solid var(--line-soft);
}

.phone__screen small {
  color: var(--muted);
  font-size: 0.75rem;
}

.phone__screen b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.phone__profit {
  color: var(--plus);
  font-size: 0.8rem;
  font-weight: 600;
}

.phone__bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 64px;
  margin-top: 14px;
}

.phone__bars i {
  flex: 1;
  height: var(--h);
  border-radius: 4px;
  background: var(--track);
}

.phone__bars .is-today {
  background: linear-gradient(180deg, #ff8ab5, #8b6bff);
}

@media (prefers-reduced-motion: no-preference) {
  .window {
    animation: rise 900ms var(--ease) both;
  }

  .phone {
    animation: rise 900ms 300ms var(--ease) both;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
}
