/* ============================================================
   AI.Practice — кастомні стилі та анімації
   Доповнення до Tailwind CDN
   ============================================================ */

/* --- Тіні з фірмовим відтінком --- */
.custom-shadow {
  box-shadow: 0 10px 30px -10px rgba(45, 90, 63, 0.15);
}
.ai-glow {
  box-shadow: 0 0 25px rgba(45, 90, 63, 0.25);
}

/* --- Плавна поява блоків при скролі --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1.is-visible { transition-delay: 0.12s; }
.reveal-delay-2.is-visible { transition-delay: 0.24s; }
.reveal-delay-3.is-visible { transition-delay: 0.36s; }

/* Якщо JS не завантажився — контент все одно видно */
html.no-observer .reveal {
  opacity: 1;
  transform: none;
}

/* --- Мікровзаємодія кнопок --- */
.btn-lift {
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}
.btn-lift:hover {
  transform: translateY(-2px);
}
.btn-lift:active {
  transform: translateY(0) scale(0.98);
}

/* --- Картки: підйом і тінь при наведенні --- */
.card-hover {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px -18px rgba(45, 90, 63, 0.28);
}

/* --- Іконки в картках болю: легкий нахил при наведенні картки --- */
.icon-tilt {
  transition: transform 0.35s ease;
}
.card-hover:hover .icon-tilt {
  transform: rotate(-6deg) scale(1.08);
}

/* --- Тарифні картки --- */
.tariff-card {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}
.tariff-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 50px -20px rgba(18, 36, 25, 0.25);
}
.tariff-featured:hover {
  box-shadow: 0 28px 55px -20px rgba(45, 90, 63, 0.4);
}
@media (min-width: 1024px) {
  .tariff-featured:hover {
    transform: translateY(-14px); /* компенсує lg:-translate-y-2 */
  }
}

/* --- М'яке "плавання" вікна симулятора в hero --- */
@media (min-width: 1024px) {
  .float-soft {
    animation: floatSoft 7s ease-in-out infinite;
  }
}
@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* --- Пульс логотипа --- */
.logo-pulse {
  position: relative;
}
.logo-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  box-shadow: 0 0 0 0 rgba(45, 90, 63, 0.45);
  animation: logoPulse 3.2s ease-out infinite;
  pointer-events: none;
}
@keyframes logoPulse {
  0%   { box-shadow: 0 0 0 0 rgba(45, 90, 63, 0.35); }
  70%  { box-shadow: 0 0 0 12px rgba(45, 90, 63, 0); }
  100% { box-shadow: 0 0 0 0 rgba(45, 90, 63, 0); }
}

/* --- Вертикальна лінія таймлайну "Шлях клієнта" --- */
.timeline::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(to bottom, rgba(45, 90, 63, 0.9), rgba(45, 90, 63, 0.15));
}

/* --- Активний пункт навігації (scroll-spy) --- */
.nav-link.active {
  color: #2d5a3f;
  font-weight: 600;
}

/* --- Тінь шапки після прокрутки --- */
#site-header.scrolled {
  box-shadow: 0 6px 24px -12px rgba(18, 36, 25, 0.18);
}

/* --- Мобільне меню --- */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.mobile-menu.open {
  max-height: 480px;
}
.mobile-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 0.75rem;
  border-radius: 0.75rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.mobile-link:active,
.mobile-link:hover {
  background-color: #e5ebe6;
  color: #122419;
}

/* --- Instagram автора --- */
.insta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #234732;
  background: #fff;
  border: 1px solid #e8e5d8;
  border-radius: 9999px;
  padding: 0.45rem 1rem 0.45rem 0.45rem;
  box-shadow: 0 4px 14px -6px rgba(18, 36, 25, 0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.insta-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -8px rgba(131, 58, 180, 0.35);
}
.insta-icon {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

/* --- Анімація "чпок" для іконки успіху --- */
.success-pop {
  animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes successPop {
  0%   { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* --- Спінер на кнопці відправки --- */
.spinner {
  width: 1em;
  height: 1em;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Виділення тексту у фірмовому кольорі --- */
::selection {
  background: #ccd9cf;
  color: #122419;
}

/* --- Кастомний скролбар (WebKit) --- */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #f5f4ef;
}
::-webkit-scrollbar-thumb {
  background: #ccd9cf;
  border-radius: 8px;
  border: 2px solid #f5f4ef;
}
::-webkit-scrollbar-thumb:hover {
  background: #2d5a3f;
}

/* --- Доступність: видимий фокус із клавіатури --- */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid #2d5a3f;
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Поля форми: підсвітка помилки --- */
input.input-error {
  border-color: #dc2626 !important;
  background-color: #fef2f2 !important;
}

/* --- Менше руху для тих, хто це просить у системі --- */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .btn-lift,
  .card-hover,
  .tariff-card,
  .icon-tilt {
    transition: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .float-soft,
  .logo-pulse::after,
  .success-pop {
    animation: none !important;
  }
}

/* --- Cookie банер: плавна поява знизу --- */
#cookie-banner {
  animation: cookieUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
#cookie-banner.hidden {
  animation: none;
}
@keyframes cookieUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Дрібні мобільні правки --- */
@media (max-width: 380px) {
  h1 {
    font-size: 2rem !important;
    line-height: 1.2 !important;
  }
  .grid.grid-cols-3 {
    gap: 0.5rem;
  }
}
