/* ── Шрифт ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --c-bg:       #f6f7fb;
  --c-surface:  #ffffff;
  --c-border:   #e8eaf0;
  --c-text:     #1a1d27;
  --c-muted:    #7b8099;
  --c-primary:  #6c63ff;
  --c-primary2: #a78bfa;
  --c-green:    #22c55e;
  --c-red:      #ef4444;
  --c-yellow:   #f59e0b;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 16px rgba(108,99,255,.10), 0 1px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 12px 40px rgba(108,99,255,.15), 0 2px 8px rgba(0,0,0,.08);
  --radius:     16px;
  --radius-sm:  10px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Фон с градиентными пятнами ── */
body::before {
  content: '';
  position: fixed;
  top: -30%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(108,99,255,.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -20%;
  left: -15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(167,139,250,.10) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Навигация ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--c-border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideDown .4s ease;
}
.navbar-logo {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.5px;
  text-decoration: none;
}
.navbar-links { display: flex; gap: 4px; }
.navbar-links a {
  text-decoration: none;
  color: var(--c-muted);
  font-size: .875rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  transition: all .2s ease;
}
.navbar-links a:hover, .navbar-links a.active {
  color: var(--c-primary);
  background: rgba(108,99,255,.08);
}
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-text);
  border-radius: 2px;
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none;
  position: fixed;
  inset: 64px 0 0 0;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(20px);
  z-index: 99;
  flex-direction: column;
  padding: 24px;
  gap: 8px;
  animation: slideDown .3s ease;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  text-decoration: none;
  color: var(--c-text);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  transition: all .2s;
  border: 1px solid transparent;
}
.mobile-menu a:hover {
  background: rgba(108,99,255,.08);
  color: var(--c-primary);
  border-color: rgba(108,99,255,.15);
}

/* ── Контент ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  position: relative;
  z-index: 1;
}

/* ── Карточки ── */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ── Кнопки ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.18);
  opacity: 0;
  transition: opacity .15s;
}
.btn:active::after { opacity: 1; }
.btn:active { transform: scale(.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--c-primary), #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 14px rgba(108,99,255,.35);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(108,99,255,.45); transform: translateY(-1px); }

.btn-green  { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; box-shadow: 0 4px 14px rgba(34,197,94,.3); }
.btn-green:hover  { box-shadow: 0 6px 20px rgba(34,197,94,.4); transform: translateY(-1px); }

.btn-red    { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.btn-ghost  { background: transparent; color: var(--c-muted); border: 1px solid var(--c-border); }
.btn-ghost:hover { background: var(--c-bg); color: var(--c-text); }
.btn-sm { font-size: .8rem; padding: 6px 14px; }
.btn-block { width: 100%; }

/* ── Инпуты ── */
.input, .select, .textarea {
  width: 100%;
  font-family: inherit;
  font-size: .875rem;
  color: var(--c-text);
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: all .2s ease;
  outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--c-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(108,99,255,.12);
}
.textarea { resize: vertical; min-height: 100px; }
label.field-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}

/* ── Бейджи ── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
}
.badge-green  { background: rgba(34,197,94,.12);  color: #16a34a; }
.badge-red    { background: rgba(239,68,68,.10);   color: #dc2626; }
.badge-purple { background: rgba(108,99,255,.12);  color: var(--c-primary); }
.badge-yellow { background: rgba(245,158,11,.12);  color: #b45309; }
.badge-blue   { background: rgba(59,130,246,.12);  color: #2563eb; }

/* ── Таблица ── */
.table-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--c-border); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead { background: var(--c-bg); }
thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
tbody tr {
  border-top: 1px solid var(--c-border);
  transition: background .15s;
}
tbody tr:hover { background: rgba(108,99,255,.03); }
tbody td { padding: 14px 16px; vertical-align: middle; }

/* ── Stat-карточки ── */
.stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s, box-shadow .25s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card .accent {
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 0 var(--radius) 0 80px;
  opacity: .08;
}
.stat-card .icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 14px;
}
.stat-card .value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
}
.stat-card .label { font-size: .8rem; color: var(--c-muted); margin-top: 6px; font-weight: 500; }

/* ── Сетки ── */
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }

/* ── Анимации появления ── */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(108,99,255,.4); }
  70%  { box-shadow: 0 0 0 10px rgba(108,99,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(108,99,255,0); }
}
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.anim-up   { animation: fadeUp .5s ease both; }
.anim-up-1 { animation: fadeUp .5s .1s ease both; }
.anim-up-2 { animation: fadeUp .5s .2s ease both; }
.anim-up-3 { animation: fadeUp .5s .3s ease both; }
.anim-up-4 { animation: fadeUp .5s .4s ease both; }

/* ── Заголовок страницы ── */
.page-header { margin-bottom: 32px; animation: fadeUp .45s ease both; }
.page-header h1 { font-size: 1.875rem; font-weight: 800; letter-spacing: -.04em; }
.page-header p  { color: var(--c-muted); margin-top: 6px; font-size: .9rem; }

/* ── Уведомление ── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  animation: fadeUp .3s ease;
  border: 1px solid transparent;
}
.alert-green  { background: rgba(34,197,94,.08);  color: #15803d; border-color: rgba(34,197,94,.2); }
.alert-red    { background: rgba(239,68,68,.08);   color: #b91c1c; border-color: rgba(239,68,68,.2); }
.alert-yellow { background: rgba(245,158,11,.08);  color: #92400e; border-color: rgba(245,158,11,.2); }

/* ── Разделитель ── */
.divider { height: 1px; background: var(--c-border); margin: 20px 0; }

/* ── Пустое состояние ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--c-muted);
}
.empty-state .emoji { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state p { font-size: .9rem; }

/* ── QR preview ── */
#qrResult img {
  max-width: 240px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  animation: fadeUp .3s ease;
}

/* ── Footer ── */
footer {
  text-align: center;
  color: var(--c-muted);
  font-size: .8rem;
  padding: 24px;
  border-top: 1px solid var(--c-border);
  position: relative;
  z-index: 1;
}

/* ── Scroll-анимации ── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Мобильный ── */
@media (max-width: 768px) {
  .container { padding: 24px 16px 60px; }
  .navbar-links { display: none; }
  .burger { display: flex; }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 1.5rem; }
  .stat-card .value { font-size: 1.4rem; }
  table { font-size: .8rem; }
  thead th, tbody td { padding: 10px 12px; }
  .hide-mobile { display: none !important; }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card { padding: 18px; }
}
