/* ====== qa-best-template — улучшенная версия ====== */
/* Контейнер блока — растянуть на всю ширину строки в hold__row */
.hold__row .qa-best-answer--full,
.qa-best-answer--full {
  box-sizing: border-box;
  width: 100%;
  flex: 0 0 100%;
  max-width: 100%;
  margin-top: 28px;
  margin-bottom: 20px;
}

/* Карточка ответа — фон, бордер, тень, отступы */
.qa-best-answer--full .qa-card {
  position: relative;
  background: linear-gradient(180deg, #f8fbff 0%, #eef6fb 100%);
  border: 1px solid rgba(27, 64, 124, 0.06); /* мягкая рамка */
  border-left: 6px solid #2e7d32; /* акцент слева */
  border-radius: 14px;
  padding: 28px 34px;
  box-shadow: 0 10px 30px rgba(30, 50, 90, 0.06);
  transition: transform .18s ease, box-shadow .18s ease;
  overflow: hidden;
}

/* Немного подтянуть типографику внутри карточки */
.qa-best-answer--full .qa-card h3,
.qa-best-answer--full .qa-card .title-4 {
  margin: 0 0 10px 0;
  font-size: 20px;
  line-height: 1.2;
  color: #2b2b45;
}

/* Текст ответа */
.qa-best-answer--full .qa-card [itemprop="text"],
.qa-best-answer--full .qa-card p {
  margin: 0;
  color: #48505a;
  font-size: 15px;
  line-height: 1.65;
}

/* Пилюльный бейдж (Meilleure réponse / Лучший ответ) */
.qa-badge {
  display: inline-block;
  background: #2e7d32;
  color: #fff;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
  font-size: 13px;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 14px rgba(46,125,50,0.12);
}

/* Шапка блока — бейдж + подпись эксперта (опционально) */
.qa-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.qa-expert {
  font-size: 13px;
  color: #5b6472;
  font-weight: 600;
  background: rgba(88,94,122,0.04);
  padding: 6px 10px;
  border-radius: 8px;
}

/* Hover эффект — мягкое "высветление" */
.qa-best-answer--full .qa-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(30,50,90,0.12);
}

/* Внутренние отступы для компактного вида на маленьких экранах */
@media (max-width: 992px) {
  .qa-best-answer--full .qa-card {
    padding: 20px;
  }

  .qa-best-answer--full .qa-card h3,
  .qa-best-answer--full .qa-card .title-4 {
    font-size: 18px;
  }

  .qa-badge {
    padding: 5px 10px;
    font-size: 12px;
  }

  .qa-best-answer--full .qa-card::before {
    width: 34px;
    height: 34px;
    top: 14px;
    right: 14px;
    font-size: 14px;
  }
}

/* Мобильная оптимизация */
@media (max-width: 480px) {
  .qa-best-answer--full .qa-card {
    padding: 16px;
    border-radius: 12px;
  }
  .qa-best-answer--full .qa-card [itemprop="text"],
  .qa-best-answer--full .qa-card p {
    font-size: 14px;
    line-height: 1.55;
  }
}

/* Вариация: более контрастный featured (опционально) */
.qa-best-answer--full.qa-featured .qa-card {
  background: #ffffff;
  border-left-color: #1f5fb0;
  box-shadow: 0 18px 42px rgba(20,40,90,0.10);
}

/* Небольшая утилита для соответствия сетке, если нужно вынести блок ниже .hold__row */
.qa-full-standalone {
  margin-left: auto;
  margin-right: auto;
  max-width: 1100px; /* регулируй по дизайну */
}

.qa-best-answer--full [itemprop="name"] {
  text-align: center;
  display: block;
  width: 100%;
  margin-bottom: 14px;
}

/* ===== CTA above footer — larger button + english text ===== */
.cta-inline {
  padding: 48px 0 28px;
}

.cta-inline__box {
  background: linear-gradient(90deg, #5f3af8 0%, #bf2bf0 100%);
  border-radius: 18px;
  padding: 40px 36px;
  color: #ffffff;
  box-shadow: 0 20px 54px rgba(95, 58, 248, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Контент (заголовок + подзаголовок) */
.cta-inline__content {
  max-width: 920px; /* увеличено для "растянуть текста" */
  margin-bottom: 26px;
  padding: 0 12px;
}

.cta-inline__title {
  font-size: 26px;      /* увеличен заголовок */
  font-weight: 900;
  line-height: 1.06;
  margin: 0 0 10px;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.cta-inline__text {
  font-size: 16px;      /* увеличен подзаголовок */
  line-height: 1.5;
  margin: 0;
  opacity: 0.97;
  color: rgba(255,255,255,0.96);
}

/* Очень большая кнопка */
.cta-inline__btn {
  background: #ffffff;
  color: #5a2bd6;
  border: 0;
  border-radius: 16px;
  padding: 18px 36px;
  font-weight: 900;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(0,0,0,0.16);
  transition: transform 180ms ease, box-shadow 180ms ease;
  width: 640px;          /* расширенная ширина кнопки на десктопе */
  max-width: 100%;
  text-align: center;
}

/* Hover / focus */
.cta-inline__btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 48px rgba(0,0,0,0.22);
}
.cta-inline__btn:active { transform: translateY(0); }
.cta-inline__btn:focus {
  outline: none;
  box-shadow: 0 0 0 6px rgba(95,58,248,0.14), 0 22px 48px rgba(0,0,0,0.22);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .cta-inline__btn { width: 520px; }
  .cta-inline__content { max-width: 760px; }
  .cta-inline__title { font-size: 24px; }
  .cta-inline__text { font-size: 15px; }
}

@media (max-width: 992px) {
  .cta-inline__btn { width: 420px; }
  .cta-inline__content { max-width: 680px; }
}

@media (max-width: 768px) {
  .cta-inline {
    padding: 28px 0 16px;
  }
  .cta-inline__box {
    padding: 22px 16px;
    border-radius: 12px;
  }
  .cta-inline__content {
    max-width: 100%;
    margin-bottom: 14px;
  }
  .cta-inline__title { font-size: 20px; }
  .cta-inline__text { font-size: 14px; }
  .cta-inline__btn {
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
    border-radius: 12px;
  }
}

/* Accessibility: reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cta-inline__btn,
  .cta-inline__box {
    transition: none;
  }
}

/* ============================
   Блок отзывы
   ============================ */

.testimonials {
  padding: 60px 0;
  background: linear-gradient(180deg, #fbfbff 0%, #f7f8ff 100%);
}
.testimonials .title-2 {
  text-align: center;
  margin-bottom: 32px;
}

/* Grid */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  align-items: stretch;
}

.testimonial-card {
  display: flex;
  flex-direction: column;   /* ВАЖНО */
  gap: 16px;

  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(250,250,255,0.85));
  padding: 18px;
  border-radius: 14px;
  border: 1px solid rgba(95,58,248,0.06);
  box-shadow: 0 8px 18px rgba(17,24,39,0.06), 0 2px 6px rgba(17,24,39,0.03);

  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 700ms cubic-bezier(.2,.9,.3,1) var(--delay, 0ms),
    transform 360ms cubic-bezier(.2,.9,.3,1),
    box-shadow 240ms ease;
}

/* in-view / revealed state */
.testimonial-card.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
  /* Reset delay variable so subsequent interactions aren't affected */
  --delay: 0ms;
}

/* Hover and focus (no JS conflict) */
.testimonial-card:hover,
.testimonial-card:focus {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 18px 36px rgba(95,58,248,0.12);
  outline: none;
}

/* Keyboard focus visible */
.testimonial-card:focus-visible {
  box-shadow: 0 20px 40px rgba(95,58,248,0.14), 0 0 0 4px rgba(95,58,248,0.06);
  border-color: rgba(95,58,248,0.18);
}

/* Avatar */
.avatar {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(95,58,248,0.10);
  box-shadow: 0 6px 18px rgba(16,24,40,0.06);
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Body content */
.testimonial-body {
  flex: 1;
  min-width: 0;
}
.quote {
  color: rgba(95,58,248,0.9);
  margin-bottom: 10px;
  opacity: 0.95;
}
.quote-text {
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 10px 0;
  color: #0f1724;
}

/* name/role */
.testimonial-body .name {
  display: inline-block;
  font-weight: 700;
  color: #111827;
}
.testimonial-body .role {
  color: #6b7280;
  font-size: 13px;
  margin-left: 6px;
}

/* responsiveness */
@media (max-width: 767px) {
  .testimonials { padding: 36px 12px; }
  .avatar { width: 56px; height: 56px; }
}

/* small utility to vertically center multiple-line avatars if used */
.avatar img[alt=""] {
  object-position: center;
}

/* Chat Widget Container */
.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

/* Speech Bubble */
.chat-bubble {
    background: #ffffff;
    border-radius: 20px;
    padding: 12px 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 200px;
    animation: slideInRight 0.4s ease-out;
    position: relative;
}

/* Speech bubble tail pointing to the button */
.chat-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 25px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #ffffff;
}

.chat-bubble-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.chat-bubble-text {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 500;
}

/* Chat Button */
.chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
    animation: slideInRight 0.5s ease-out 0.2s both;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.chat-button:active {
    transform: scale(0.95);
}

.chat-icon {
    width: 28px;
    height: 28px;
    color: white;
}

/* Animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Pulse animation for attention */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.chat-button.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Content */
.modal-content {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: #f3f4f6;  /* Светло-серый фон */
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #1f2937;
    z-index: 1000;
    padding: 0;
}

.modal-close:hover {
    background: #e5e7eb;
    transform: rotate(90deg);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-close svg path {
    stroke: #1f2937;  /* Чёрный крестик */
    stroke-width: 2;
}

/* Modal Header */
.modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.modal-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

/* Modal Body */
.modal-body {
    text-align: center;
    margin-bottom: 32px;
}

.modal-text {
    font-size: 16px;
    color: #1a1a1a;
    line-height: 1.6;
    margin: 0 0 12px 0;
    font-weight: 600;
}

.modal-subtext {
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
    margin: 0;
    font-weight: 500;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: center;
}

.modal-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.modal-button:active {
    transform: translateY(0);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .chat-widget {
        bottom: 20px;
        right: 20px;
    }

    .chat-button {
        width: 56px;
        height: 56px;
    }

    .chat-icon {
        width: 24px;
        height: 24px;
    }

    .chat-bubble {
        max-width: 160px;
        padding: 10px 14px;
    }

    .chat-bubble-text {
        font-size: 13px;
    }

    .modal-content {
        padding: 32px 24px;
        max-width: 95%;
    }

    .modal-title {
        font-size: 24px;
    }

    .modal-icon {
        width: 70px;
        height: 70px;
    }

    .modal-text {
        font-size: 15px;
    }

    .modal-button {
        width: 100%;
        justify-content: center;
        padding: 12px 24px;
    }
}

.modal-text,
.modal-subtext,
.modal-title {
    color: #111827 !important;
}
