/* belnalog.ru — UX enhancement styles */

/* ===== Sticky CTA for mobile ===== */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 0;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  padding: 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}
.sticky-cta.visible {
  transform: translateY(0);
}
/* Пока открыто мобильное меню — панель прячем, иначе она перекрывает
   нижние пункты меню («Записаться», «Войти / Регистрация») */
body.nav-menu-open .sticky-cta,
body.nav-menu-open .back-to-top {
  display: none;
}
.sticky-cta-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.sticky-cta-call {
  background: #0e2a47;
  color: #fff;
}
.sticky-cta-call:hover {
  background: #1a3a5c;
}
.sticky-cta-trial {
  background: linear-gradient(135deg, #d4a843 0%, #e0c078 50%, #d4a843 100%);
  color: #0e2a47;
}
.sticky-cta-trial:hover {
  background: linear-gradient(135deg, #c49a38 0%, #d4b46a 50%, #c49a38 100%);
}

/* Отступ снизу, чтобы панель не закрывала низ страницы */
@media (max-width: 768px) {
  body.has-sticky-cta { padding-bottom: 56px; }
}

/* ===== Back to top ===== */
.back-to-top {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0e2a47;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 999;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.back-to-top.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.back-to-top:hover {
  background: #1a3a5c;
  transform: scale(1.1);
}

/* ===== Smooth page load ===== */
body:not(.loaded) {
  opacity: 0;
}
body.loaded {
  opacity: 1;
  transition: opacity 0.4s ease-out;
}

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-d1 { transition-delay: 0.05s; }
.reveal-d2 { transition-delay: 0.12s; }
.reveal-d3 { transition-delay: 0.19s; }
.reveal-d4 { transition-delay: 0.26s; }
.reveal-d5 { transition-delay: 0.33s; }

/* ===== Hero phone button (mobile only) ===== */
@media (max-width: 768px) {
  .hero-phone-mobile {
    display: flex !important;
  }
}
@media (min-width: 769px) {
  .hero-phone-mobile {
    display: none !important;
  }
}
.hero-phone-mobile {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s;
  margin-top: 0.75rem;
}
.hero-phone-mobile:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ===== Form improvements ===== */
.cm-form .cm-field input:focus,
.cm-form .cm-field input:focus-visible {
  outline: none;
  border-color: #d4a843;
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.2);
}

/* ===== Improved gold contrast ===== */
:root {
  --gold-500: #d4a843;
  --gold-600: #c49a38;
  --gold-400: #e0c078;
}

/* ===== Better mobile spacing ===== */
@media (max-width: 768px) {
  .section-padding {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
  .hero-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .hero-stats {
    flex-direction: column;
    gap: 1rem;
  }
  .hero-stat-divider {
    width: 60px;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
  }
}

/* ===== Loading spinner for form ===== */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.fa-spin {
  animation: spin 1s linear infinite;
}
