/* ==========================================================================
   Займы без отказа — чистая вёрстка (без Тильды)
   Семантичная разметка, один файл стилей, понятные классы
   ========================================================================== */

/* --- Базовые сбросы и переменные --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1b1b1b;
  background-color: #f6f6f6;
}

a {
  color: #4c37d1;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Скрытый заголовок для доступности */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- Контейнер (ширина контента) --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 640px) {
  .container {
    padding: 0 24px;
  }
}

/* --- Шапка страницы --- */
.page-header {
  background: linear-gradient(165deg, #f8f7fc 0%, #f0eef8 50%, #f6f6f6 100%);
  padding: 24px 0 12px;
  border-bottom: 1px solid rgba(76, 55, 209, 0.08);
}

.page-header__hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #4c37d1;
}

.page-header__hint-dot {
  width: 8px;
  height: 8px;
  background: #63b84c;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(99, 184, 76, 0.3);
  animation: headerDotPulse 2s ease-in-out infinite;
}

@keyframes headerDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.1); }
}

.page-title {
  margin: 0 0 14px;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.25;
  color: #1b1b1b;
  letter-spacing: -0.02em;
  max-width: 20em;
}

.page-lead {
  margin: 0 0 22px;
  font-size: 1rem;
  line-height: 1.5;
  color: #565656;
  max-width: 36em;
}

.page-header__pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
  max-width: 100%;
}

.page-header__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #4c37d1;
  background: #fff;
  border: 2px solid rgba(76, 55, 209, 0.25);
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
  min-width: 0;
}

/* Третья пилюля на всю ширину второй строки — на мобиле строка не уезжает */
.page-header__pill:nth-child(3) {
  grid-column: 1 / -1;
}

.page-header__pill:hover {
  background: rgba(76, 55, 209, 0.08);
  border-color: #4c37d1;
  color: #1b1b1b;
  text-decoration: none;
  transform: translateY(-1px);
}

.page-header__pill--active {
  background: #4c37d1;
  border-color: #4c37d1;
  color: #fff;
}

.page-header__pill--active:hover {
  background: #6b57e9;
  border-color: #6b57e9;
  color: #fff;
}

@media (min-width: 640px) {
  .page-header {
    padding: 28px 0 14px;
  }
  .page-title {
    font-size: 2.25rem;
    max-width: none;
  }
  .page-lead {
    font-size: 1.0625rem;
  }
  .page-header__pills {
    margin-bottom: 24px;
    grid-template-columns: repeat(3, auto);
  }
  .page-header__pill:nth-child(3) {
    grid-column: auto;
  }
  .page-header__pill {
    padding: 12px 22px;
    font-size: 1rem;
  }
}

@media (min-width: 900px) {
  .page-title {
    font-size: 2.5rem;
  }
}

/* --- Сетка карточек --- */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 8px 0 40px;
}

@media (min-width: 480px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1024px) {
  .cards {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }
}

/* --- Карточка МФО (вся карточка — ссылка) --- */
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  border-radius: 15px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.2s ease;
  cursor: pointer;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: inherit;
}


/* Логотип и название в одну строку */
.card__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card__head .card__name {
  flex: 1;
  min-width: 0;
}

.card__badge {
  display: inline-block;
  align-self: flex-start;
  padding: 8px 14px;
  font-size: 0.9375rem;
  border-radius: 8px;
  background-color: #f1f1f1;
  color: #717171;
}

.card__badge_recommend {
  position: relative;
  overflow: hidden;
  /* Градиент замкнут в кольцо (начало = конец) — сдвиг на 100% даёт тот же вид, без скачка */
  background: linear-gradient(90deg, #4322ff 0%, #2771cb 33%, #5b4ae0 66%, #4322ff 100%);
  background-size: 100% 100%;
  color: #fff;
  animation: badgeShimmer 5s linear infinite;
}

.card__badge_recommend::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 50%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: badgeShine 2.5s linear infinite;
}

@keyframes badgeShimmer {
  from { background-position: 0 0; }
  to { background-position: 100% 0; }
}

@keyframes badgeShine {
  from { transform: translateX(-100%); }
  to { transform: translateX(300%); }
}

.card__name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1b1b1b;
}

.card__meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9375rem;
}

.card__row dt {
  margin: 0;
  font-weight: 400;
  color: #565656;
}

.card__row dd {
  margin: 0;
  font-weight: 600;
  color: #1b1b1b;
}

.card__cta {
  display: block;
  margin-top: 4px;
  padding: 12px 16px;
  text-align: center;
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  background-color: #4c37d1;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.card__cta:hover {
  background-color: #6b57e9;
  text-decoration: none;
}

/* Отзывы и рейтинг — одна строка внизу карточки */
.card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.card__reviews {
  margin: 0;
  font-size: 0.75rem;
  color: #909090;
}

.card__rating {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #63b84c;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card__rating-icon {
  flex-shrink: 0;
  color: #e6b422;
}

/* --- Блок «Почему выбирают» (в стиле витрины) --- */
.why-section {
  padding: 32px 0 40px;
  background-color: #f6f6f6;
}

.why-section__title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1b1b1b;
  text-align: center;
}

.why-section__subtitle {
  margin: 0 0 24px;
  font-size: 1rem;
  color: #565656;
  text-align: center;
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
}

.why-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .why-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

.why-card {
  background: #fff;
  border-radius: 15px;
  padding: 24px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.why-card__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  background: #4c37d1;
  color: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.why-card__icon svg {
  display: block;
}

.why-card__title {
  margin: 0 0 8px;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1b1b1b;
}

.why-card__text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #565656;
}

/* --- Футер (юридический блок) --- */
.footer-legal {
  padding: 24px 0 40px;
  font-size: 0.9375rem;
  color: #333;
  background-color: #f3f3f3;
}

.footer-legal .container {
  padding-left: 20px;
  padding-right: 20px;
}

.footer-legal__intro {
  margin: 0 0 16px;
  font-weight: 600;
}

.footer-legal__text {
  margin: 0 0 16px;
}

.footer-legal__desc {
  margin: 0 0 24px;
}

.footer-legal__heading {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
}

.mfo-list {
  margin: 0 0 20px;
  padding-left: 20px;
}

.mfo-list li {
  margin-bottom: 12px;
}

.footer-legal__contacts {
  margin: 0 0 16px;
}

.footer-legal__disclaimers {
  margin: 0 0 24px;
  font-size: 0.875rem;
  color: #666;
}

/* --- FAQ (вопросы и ответы) --- */
.faq-section {
  padding: 32px 0 48px;
  background-color: #f6f6f6;
}

.faq-section__title {
  margin: 0 0 24px;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1b1b1b;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.faq-item__q {
  width: 100%;
  padding: 16px 44px 16px 20px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #1b1b1b;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s ease;
}

.faq-item__q:hover {
  background-color: #f9f9f9;
}

.faq-item__q::after {
  content: '';
  position: absolute;
  right: 20px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-right: 2px solid #4c37d1;
  border-bottom: 2px solid #4c37d1;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.faq-item.is-open .faq-item__q::after {
  margin-top: -3px;
  transform: rotate(-135deg);
}

.faq-item__a {
  display: none;
  padding: 0 20px 16px;
}

.faq-item.is-open .faq-item__a {
  display: block;
}

.faq-item__a p {
  margin: 0;
  padding: 0 24px 0 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #565656;
}

.faq-section__back-wrap {
  margin: 24px 0 0;
}

.btn-back-to-vitrina {
  display: block;
  width: 100%;
  padding: 14px 28px;
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  background-color: #4c37d1;
  border-radius: 10px;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.2s ease;
}

.btn-back-to-vitrina:hover {
  background-color: #6b57e9;
  text-decoration: none;
  color: #fff;
}

/* --- Кнопка «Назад»: на мобильном — полоса внизу как в браузере, на десктопе — плавающая --- */
.btn-back-fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background-color: #4c37d1;
  text-decoration: none;
  border: none;
  border-radius: 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
  transition: background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-back-fixed:hover {
  background-color: #6b57e9;
  color: #fff;
  text-decoration: none;
}

.btn-back-fixed:active {
  background-color: #5a46c4;
}

@media (min-width: 768px) {
  .btn-back-fixed {
    bottom: 24px;
    left: 24px;
    right: auto;
    width: auto;
    padding: 12px 20px;
    padding-bottom: 12px;
    font-size: 0.9375rem;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(76, 55, 209, 0.4);
  }
}

/* --- Попап-карточка (пуш, 50/50 первый или второй оффер) --- */
.popup-card {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.popup-card.is-open {
  opacity: 1;
  visibility: visible;
}

.popup-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.popup-card__box {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.popup-card__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f1f1;
  color: #1b1b1b;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.popup-card__inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.popup-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.popup-card__logo {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-card__logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.popup-card__name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1b1b1b;
}

.popup-card__badge {
  display: inline-block;
  align-self: flex-start;
  padding: 8px 14px;
  font-size: 0.9375rem;
  border-radius: 8px;
  background-color: #f1f1f1;
  color: #717171;
}

.popup-card__badge.popup-card__badge_recommend {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #4322ff 0%, #2771cb 33%, #5b4ae0 66%, #4322ff 100%);
  background-size: 100% 100%;
  color: #fff;
  animation: badgeShimmer 5s linear infinite;
}

.popup-card__badge.popup-card__badge_recommend::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 50%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: badgeShine 2.5s linear infinite;
}

.popup-card__meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.popup-card__row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9375rem;
}

.popup-card__row dt {
  margin: 0;
  color: #565656;
}

.popup-card__row dd {
  margin: 0;
  font-weight: 600;
  color: #1b1b1b;
}

.popup-card__cta {
  display: block;
  margin-top: 4px;
  padding: 12px 16px;
  text-align: center;
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  background-color: #4c37d1;
  border-radius: 10px;
  text-decoration: none;
}

.popup-card__cta:hover {
  background-color: #6b57e9;
  color: #fff;
  text-decoration: none;
}

/* --- Виджет «Выдачи сейчас» --- */
.live-section {
  padding: 24px 0;
}

.live-feed--strip {
  background: #fff;
  border-radius: 12px;
  padding: 16px 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.live-feed__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 12px 20px;
  color: #1b1b1b;
}

.live-feed__strip-wrap {
  overflow: hidden;
}

.live-feed__track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: liveStripScroll 45s linear infinite;
  padding: 0 20px;
}

.live-feed__strip-wrap:hover .live-feed__track {
  animation-play-state: paused;
}

@keyframes liveStripScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.feed-item-h {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #f6f6f6;
  border-radius: 999px;
  font-size: 0.8125rem;
  color: #1b1b1b;
}

.feed-item-h__avatar {
  width: 28px;
  height: 28px;
  background: #4c37d1;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
}

.feed-item-h__amount {
  font-weight: 600;
  color: #4c37d1;
}

.feed-item-h__status {
  font-size: 0.75rem;
  color: #717171;
}

/* --- Логотип МФО в карточке --- */
.card__head .card__logo {
  flex-shrink: 0;
}

.card__logo {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card__logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* --- Дисклеймер под витриной --- */
.vitrina-disclaimer {
  margin: 0 auto 24px;
  padding: 18px 24px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #4a4a4a;
  background: linear-gradient(180deg, #fafafa 0%, #f2f2f2 100%);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 560px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.vitrina-disclaimer__item {
  display: block;
  letter-spacing: 0.01em;
}

@media (min-width: 640px) {
  .vitrina-disclaimer {
    padding: 20px 32px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 28px;
    max-width: 640px;
  }
}


