/* ============================================
   Система Сервис — Custom Styles
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --color-bg-dark: #0F172A;
  --color-bg-dark-2: #020617;
  --color-bg-light: #F8FAFC;
  --color-accent: #EF4444;
  --color-accent-hover: #DC2626;
  --color-accent-light: #FEF2F2;
  --color-primary-blue: #2563EB;
  --color-text-primary: #0F172A;
  --color-text-secondary: #64748B;
  --color-border: #E2E8F0;
}

/* --- Base --- */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Scroll-triggered animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.slide-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

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

/* Staggered children animation */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 80ms; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 160ms; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 240ms; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 320ms; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 400ms; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 480ms; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 560ms; }
.stagger-children.visible > *:nth-child(9) { transition-delay: 640ms; }
.stagger-children.visible > *:nth-child(10) { transition-delay: 720ms; }
.stagger-children.visible > *:nth-child(11) { transition-delay: 800ms; }
.stagger-children.visible > *:nth-child(12) { transition-delay: 880ms; }

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* --- FAQ Accordion --- */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

.faq-item .faq-chevron {
  transition: transform 0.3s ease;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

/* --- Mobile menu --- */
.mobile-menu {
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* --- Form focus states --- */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-accent);
  border-color: var(--color-accent);
}

/* --- Phone link (no underline on mobile) --- */
a[href^="tel:"] {
  text-decoration: none;
}

/* --- Reduce motion for accessibility --- */
@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .slide-up,
  .stagger-children > * {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .faq-answer {
    transition: none;
  }

  .mobile-menu,
  .mobile-menu-overlay {
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}
