/* ============================================================
   СИЛА ЭКСПЕРТ — Custom CSS
   shadcn-inspired design system
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ─── CSS Variables ──────────────────────────────────────── */
:root {
  --brand: #2563EB;
  --brand-dark: #1D4ED8;
  --brand-light: #3B82F6;
  --accent: #F59E0B;
  --accent-dark: #D97706;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset / Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--gray-900);
  background: #fff;
  line-height: 1.6;
}

/* ─── Utility Classes ────────────────────────────────────── */
.btn-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  border: 2px solid var(--brand);
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.btn-brand:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37,99,235,.35);
}
.btn-brand:active { transform: translateY(0); }

.btn-outline-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-outline-brand:hover {
  background: var(--brand);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline-white {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 2px solid rgba(255,255,255,.4);
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  text-decoration: none;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.btn-outline-white:hover {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.7);
  transform: translateY(-1px);
}

/* Form inputs */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--gray-900);
  background: #fff;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.form-input::placeholder { color: var(--gray-400); }

/* ─── Hero ───────────────────────────────────────────────── */
.hero-bg {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1e40af 100%);
}
.hero-gradient {
  background: radial-gradient(ellipse at 60% 0%, rgba(37,99,235,.25) 0%, transparent 60%),
              radial-gradient(ellipse at 10% 80%, rgba(245,158,11,.1) 0%, transparent 50%);
}

/* ─── Header ─────────────────────────────────────────────── */
#site-header {
  background: transparent;
}
#site-header.scrolled {
  background: rgba(15,23,42,.92);
  box-shadow: 0 1px 20px rgba(0,0,0,.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
#site-header.light-header {
  background: #fff;
  box-shadow: 0 1px 0 var(--gray-100);
}
#site-header.light-header .header-logo-text,
#site-header.light-header .header-nav a {
  color: var(--gray-900);
}
#site-header.light-header .header-nav a { color: var(--gray-700); }

/* Mobile menu */
#mobile-menu a { padding: 0.5rem 0; display: block; }

/* ─── Cards ──────────────────────────────────────────────── */
.pain-card,
.process-card,
.adv-card,
.stat-card {
  transition: transform var(--transition), box-shadow var(--transition);
}
.pain-card:hover,
.process-card:hover,
.adv-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.course-card {
  transition: transform var(--transition), box-shadow var(--transition);
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,.12);
}

.teacher-card {
  transition: transform var(--transition), box-shadow var(--transition);
}
.teacher-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.result-card {
  transition: transform var(--transition), box-shadow var(--transition);
}
.result-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.pricing-card {
  transition: transform var(--transition), box-shadow var(--transition);
}
.pricing-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(0,0,0,.15);
}
.pricing-popular {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  box-shadow: 0 20px 60px rgba(37,99,235,.4);
  transform: scale(1.02);
}
.pricing-popular:hover {
  transform: scale(1.02) translateY(-5px);
}

/* ─── Filter Buttons ─────────────────────────────────────── */
.filter-btn {
  background: #fff;
  color: var(--gray-500);
  border-color: var(--gray-200);
  transition: all var(--transition);
  cursor: pointer;
}
.filter-btn:hover { border-color: var(--brand); color: var(--brand); }
.filter-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ─── Toggle (Hero / Reviews) ────────────────────────────── */
.toggle-btn {
  transition: all var(--transition);
  cursor: pointer;
}
.toggle-btn.active {
  background: rgba(255,255,255,.2);
  color: #fff;
}

.review-toggle {
  background: #fff;
  color: var(--gray-500);
  border-color: var(--gray-200);
  transition: all var(--transition);
  cursor: pointer;
}
.review-toggle:hover { border-color: var(--brand); color: var(--brand); }
.review-toggle.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ─── Reviews Swiper ─────────────────────────────────────── */
.reviews-swiper { overflow: hidden; }
.swiper-wrapper { align-items: stretch; }
.swiper-slide { height: auto; }
.swiper-pagination-bullet {
  background: var(--gray-300);
  opacity: 1;
  width: 8px; height: 8px;
}
.swiper-pagination-bullet-active { background: var(--brand); width: 20px; border-radius: 4px; }

.review-card {
  transition: transform var(--transition), box-shadow var(--transition);
  height: 100%;
}
.review-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* ─── FAQ ────────────────────────────────────────────────── */
.faq-item { transition: box-shadow var(--transition); }
.faq-item:has(.faq-answer:not(.hidden)) {
  box-shadow: var(--shadow-md);
}
.faq-question { background: #fff; }
.faq-icon { transition: transform 250ms ease; }
.faq-item.open .faq-icon { transform: rotate(180deg); }
.faq-answer { transition: all 250ms ease; }

/* ─── Scroll indicator ───────────────────────────────────── */
.scroll-dot {
  animation: scrollBounce 2s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* ─── Hero blob ──────────────────────────────────────────── */
.hero-blob {
  animation: blobFloat 8s ease-in-out infinite;
}
.hero-blob:nth-child(2) { animation-delay: -4s; }
@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(15px, -10px) scale(1.05); }
  66% { transform: translate(-10px, 15px) scale(0.95); }
}

/* ─── Promo Timer ────────────────────────────────────────── */
#promo-timer > div:not(:last-child) { min-width: 4rem; }

/* ─── Section animations ─────────────────────────────────── */
.section-header,
.stagger-item {
  opacity: 0;
  transform: translateY(24px);
}
.animate-in {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition: opacity 600ms ease, transform 600ms ease;
}

/* ─── Success Modal ──────────────────────────────────────── */
#success-modal.visible { display: flex; }
#success-modal > div:last-child {
  animation: modalIn 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Pricing popular card: no scale on mobile */
  .pricing-popular { transform: none; }
  .pricing-popular:hover { transform: translateY(-5px); }

  /* Prevent horizontal scroll */
  body { overflow-x: hidden; }

  /* Section vertical padding: py-20 (80px) → 3rem (48px) on mobile */
  #pains, #stats-section, #courses, #process, #pricing,
  #teachers, #results, #reviews, #leadmagnet, #advantages,
  #promo, #faq, #cta {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  /* Section header bottom margin: mb-14 (3.5rem) → 1.75rem */
  #pains .section-header,
  #stats-section .section-header,
  #process .section-header,
  #teachers .section-header,
  #results .section-header,
  #advantages .section-header,
  #promo .section-header,
  #faq .section-header { margin-bottom: 1.75rem; }

  /* Stats section: tighter cards + smaller numbers */
  #stats-section .stat-card { padding: 0.75rem 0.625rem; }
  #stats-section .stat-number { font-size: 1.375rem !important; line-height: 1.75rem; }

  /* iOS input zoom prevention (font < 16px triggers zoom) */
  .form-input { font-size: 1rem; }

  /* Larger touch target for hamburger */
  #mobile-menu-btn {
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  /* Hide decorative blobs on mobile (performance) */
  .hero-blob { display: none; }

  /* Footer top padding */
  #site-footer { padding-top: 2.5rem; }

  /* Prevent long CJK/Latin words from breaking layout */
  h1, h2, h3 { overflow-wrap: break-word; word-break: break-word; }
}

/* ─── Touch devices: disable card hover transforms ───────── */
@media (hover: none) {
  .pain-card:hover,
  .process-card:hover,
  .adv-card:hover,
  .course-card:hover,
  .teacher-card:hover,
  .result-card:hover,
  .pricing-card:hover,
  .review-card:hover,
  .stat-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  .btn-brand:hover,
  .btn-outline-brand:hover,
  .btn-outline-white:hover { transform: none; }
}

/* ─── Hamburger → X animation ────────────────────────────── */
#mobile-menu-btn span {
  transition: transform 300ms ease, opacity 300ms ease;
  transform-origin: center;
}
#mobile-menu-btn.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
#mobile-menu-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
#mobile-menu-btn.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ─── iOS safe-area (bottom notch) ───────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  body { padding-bottom: env(safe-area-inset-bottom); }
}

/* ─── Respects prefers-reduced-motion ────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero-blob, .scroll-dot { animation: none; }
  .section-header, .stagger-item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ─── Skeleton loader ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, #e5e7eb 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ─── Print ──────────────────────────────────────────────── */
@media print {
  #site-header, #mobile-menu, #success-modal { display: none !important; }
  section { break-inside: avoid; }
}
