/*
 * design_v2.css — Бизнес Конструктор UI v2
 * Mood Mix: Vercel/Bento (Mood 2) + 3D Glass (Mood 3) + Playful Motion (Mood 4)
 *
 * ─── ШРИФТ ───────────────────────────────────────────────────────────────────
 * Активный шрифт: Inter (по требованию пользователя 18.04.2026)
 * ─────────────────────────────────────────────────────────────────────────────
 */

/* ===== FONT OVERRIDE ===== */
body {
  font-family: 'Inter', sans-serif;
}

/* ===== GRADIENT TEXT (Mood 2) ===== */
/*
 * Применяй класс .gradient-text к h1, h2 или любому тексту.
 * На тёмном фоне (hero/dark sections) — работает нативно.
 * На светлом фоне — текст будет #2563EB → #38BDF8 диагональный.
 */
.gradient-text {
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    #93C5FD 35%,
    #38BDF8 60%,
    #ffffff 100%
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 8s ease infinite;
  /* Fallback для браузеров без поддержки */
  color: #ffffff;
}

/* На светлом фоне — синий вариант */
.gradient-text-light {
  background: linear-gradient(
    135deg,
    #1D4ED8 0%,
    #2563EB 40%,
    #38BDF8 70%,
    #1D4ED8 100%
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 8s ease infinite;
  color: #2563EB;
}

@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== CURSOR SPOTLIGHT (Mood 3) ===== */
/*
 * Добавь класс .spotlight-card к карточке-контейнеру.
 * JS в design_v2.js отслеживает mousemove и устанавливает --mouse-x/--mouse-y.
 * Эффект: мягкий синий ореол следует за курсором.
 */
.spotlight-card {
  position: relative;
  overflow: hidden;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.spotlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    500px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(56, 189, 248, 0.10),
    rgba(37, 99, 235, 0.04) 40%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}

.spotlight-card > * {
  position: relative;
  z-index: 1;
}

.spotlight-card:hover::before {
  opacity: 1;
}

.spotlight-card:hover {
  border-color: rgba(56, 189, 248, 0.35) !important;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.12), 0 8px 32px rgba(37, 99, 235, 0.10);
}

/* ===== LIVE ICON ANIMATIONS (Mood 4) ===== */
/*
 * .icon-wiggle    → покачивание (весы, документы)
 * .icon-pulse     → дыхание (документ «живёт»)
 * .icon-spin-slow → медленное вращение (шестерёнка)
 * .icon-bounce-soft → мягкий подпрыжок (финансы)
 *
 * На hover карточки с классом .module-card — иконка .module-icon
 * делает однократный bounce для интерактивного отклика.
 */

.icon-wiggle {
  animation: icon-wiggle 3s ease-in-out infinite;
  transform-origin: bottom center;
  display: inline-block;
}
@keyframes icon-wiggle {
  0%, 100% { transform: rotate(0deg); }
  20%       { transform: rotate(-6deg); }
  40%       { transform: rotate(4deg); }
  60%       { transform: rotate(-3deg); }
  80%       { transform: rotate(2deg); }
}

.icon-pulse {
  animation: icon-pulse 2.8s ease-in-out infinite;
  display: inline-block;
}
@keyframes icon-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.10); opacity: 0.85; }
}

.icon-spin-slow {
  animation: icon-spin 10s linear infinite;
  display: inline-block;
}
@keyframes icon-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.icon-bounce-soft {
  animation: icon-bounce 3.5s ease-in-out infinite;
  display: inline-block;
}
@keyframes icon-bounce {
  0%, 100% { transform: translateY(0px); }
  40%       { transform: translateY(-7px); }
  60%       { transform: translateY(-4px); }
}

/* Hover-triggered bounce на карточке модуля */
.module-card:hover .module-icon,
.why-card:hover .why-icon,
.product-card:hover .p-icon {
  animation: icon-hover-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes icon-hover-pop {
  0%   { transform: scale(1) rotate(0deg); }
  40%  { transform: scale(1.18) rotate(-5deg); }
  70%  { transform: scale(0.95) rotate(3deg); }
  100% { transform: scale(1.05) rotate(0deg); }
}

/* ===== MAGNETIC BUTTONS (Mood 2) ===== */
/*
 * Добавь класс .btn-magnetic к CTA-кнопке.
 * JS плавно сдвигает кнопку за курсором (эффект магнита).
 * ::before добавляет анимированную рамку при hover.
 */
.btn-magnetic {
  position: relative;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s ease;
  will-change: transform;
}

.btn-magnetic::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, #38BDF8, #2563EB, #38BDF8);
  background-size: 200% 200%;
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  animation: gradient-shift 3s ease infinite;
  transition: opacity 0.3s ease;
}

.btn-magnetic:hover::after {
  opacity: 0.6;
}

.btn-magnetic:hover {
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.30);
}

/* ===== LIVE TICKER COUNTERS (Mood 2) ===== */
/*
 * Счётчик не требует CSS-класса — управляется через data-атрибуты в HTML.
 * Обёртка .stat-num — опциональный стиль для красивого отображения.
 */
.stat-block {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.stat-item {
  text-align: left;
}

.stat-num {
  font-size: 2em;
  font-weight: 800;
  color: var(--blue-light, #38BDF8);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  /* Фиксированная ширина предотвращает дёргание layout при изменении цифр */
  min-width: 5ch;
  display: inline-block;
  /* Плавная замена числа без визуальных скачков */
  transition: none;
}

.stat-label {
  font-size: 0.78em;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ===== SECTION ENTRY ANIMATIONS ===== */
/*
 * Применяй .fade-up к секциям — они появляются при скролле.
 * JS в design_v2.js добавляет .visible через IntersectionObserver.
 */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger для дочерних элементов */
.fade-up-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-up-stagger.visible > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.05s; }
.fade-up-stagger.visible > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.12s; }
.fade-up-stagger.visible > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.19s; }
.fade-up-stagger.visible > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 0.26s; }
.fade-up-stagger.visible > *:nth-child(5) { opacity: 1; transform: none; transition-delay: 0.33s; }
.fade-up-stagger.visible > *:nth-child(6) { opacity: 1; transform: none; transition-delay: 0.40s; }

/* ===== ACCOUNTING PAGE: step cards get spotlight automatically ===== */
/*
 * На странице /accounting шаги wizard получают spotlight без добавления класса вручную.
 * JS в design_v2.js обнаружит их через .step.visible или инициализирует при загрузке.
 */
.step {
  position: relative;
  overflow: hidden;
}

.step::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    500px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(56, 189, 248, 0.06),
    rgba(37, 99, 235, 0.02) 40%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}

.step > * {
  position: relative;
  z-index: 1;
}

.step:hover::before {
  opacity: 1;
}

/* upload-zone icon animation */
.upload-icon {
  display: inline-block;
  font-size: 2em;
  margin-bottom: 12px;
  animation: icon-bounce 4s ease-in-out infinite;
}

/* ===== HERO BADGE ===== */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 999px;
  color: #38BDF8;
  font-size: 0.88em;
  font-weight: 600;
  margin-bottom: 24px;
  font-family: 'Inter', sans-serif;
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  background: #38BDF8;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ===== HERO CTA LAYOUT ===== */
.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.hero-cta .btn {
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 0.97em;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  border: none;
}

.hero-cta .btn-primary {
  background: #2563EB;
  color: white;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.hero-cta .btn-primary:hover {
  background: #1D4ED8;
  transform: translateY(-2px);
}

.hero-cta .btn-ghost {
  background: transparent;
  color: #38BDF8;
  border: 2px solid rgba(56, 189, 248, 0.35);
}

.hero-cta .btn-ghost:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: #38BDF8;
}

/* ===== HERO STATS (new layout) ===== */
.hero-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.hero-stats .stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-stats .stat-num {
  font-size: 2em;
  font-weight: 800;
  color: #38BDF8;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  min-width: 5ch;
  display: inline-block;
  font-family: 'Inter', sans-serif;
}

.hero-stats .stat-label {
  font-size: 0.78em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  letter-spacing: 0.01em;
  font-family: 'Inter', sans-serif;
}

/* ===== DEMO MODAL ===== */
.demo-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.demo-modal-card {
  background: linear-gradient(135deg, #0F172A, #1E293B);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 20px;
  padding: 32px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  font-family: 'Inter', sans-serif;
}

.demo-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.demo-modal-head h3 {
  font-size: 1.5em;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
}

.demo-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.8em;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  line-height: 1;
  padding: 0 4px;
}

.demo-close:hover { opacity: 1; }

.demo-modal-sub {
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 24px;
  font-size: 0.95em;
  font-family: 'Inter', sans-serif;
}

.demo-list {
  display: grid;
  gap: 10px;
}

.demo-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  text-decoration: none;
  color: white;
  transition: all 0.25s;
  font-family: 'Inter', sans-serif;
}

.demo-item:hover {
  background: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateX(4px);
}

.demo-icon {
  font-size: 1.8em;
  min-width: 40px;
  text-align: center;
}

.demo-text { flex: 1; }

.demo-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.demo-desc {
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.55);
}

.demo-arrow {
  color: #38BDF8;
  font-size: 1.4em;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===== DEMO TOAST ===== */
.demo-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #1E293B, #0F172A);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: white;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.9em;
  font-weight: 600;
  z-index: 9998;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.3s ease;
  font-family: 'Inter', sans-serif;
}

/* ===== ACCESSIBILITY: prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
  .gradient-text,
  .gradient-text-light {
    animation: none;
    background-position: 0% 50%;
  }

  .icon-wiggle,
  .icon-pulse,
  .icon-spin-slow,
  .icon-bounce-soft {
    animation: none;
  }

  .btn-magnetic::after {
    animation: none;
  }

  .fade-up,
  .fade-up-stagger > * {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .fade-up-stagger.visible > * {
    transition-delay: 0s;
  }
}
