/* Premium home — Knowledge Hub + Onboarding */
.home-premium {
  --hp-white: #fff;
  --hp-milk: #f8faf9;
  --hp-gray: #f1f5f3;
  --hp-text: #0f172a;
  --hp-muted: #64748b;
  --hp-g1: #cff7d3;
  --hp-g2: #a7f3b0;
  --hp-g4: #34c759;
  --hp-g5: #12853d;
  --hp-radius: 20px;
  --hp-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
  --hp-glass: rgba(255, 255, 255, 0.78);
}

/* Knowledge Hub */
.home-hub {
  background: linear-gradient(180deg, var(--hp-milk) 0%, #fff 100%);
}

.home-hub__head {
  margin-bottom: 22px;
}

.home-hub__title {
  margin: 0;
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.home-hub__grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .home-hub__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .home-hub__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.home-hub-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 108px;
  padding: 12px 10px;
  border-radius: 16px;
  background: var(--hp-glass);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(52, 199, 89, 0.16);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.home-hub-card:hover {
  transform: translateY(-4px);
  border-color: rgba(52, 199, 89, 0.35);
  box-shadow: 0 14px 32px rgba(52, 199, 89, 0.12);
}

.home-hub-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--hp-g1), #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.home-hub-card__icon--img img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.home-hub-card__label {
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Instagram — CSS logo */
.home-hub-card--instagram .home-hub-card__icon {
  background: linear-gradient(160deg, #fdf2f8, #faf5ff);
}

.hp-insta-logo {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f9ce34, #ee2a7b 45%, #6228d7 78%, #8134af);
  background-size: 200% 200%;
  animation: hp-insta-gradient 4s ease infinite;
  box-shadow: 0 10px 24px rgba(238, 42, 123, 0.28);
}

.hp-insta-logo__lens {
  position: absolute;
  inset: 11px;
  border: 3px solid #fff;
  border-radius: 10px;
  box-sizing: border-box;
}

.hp-insta-logo__lens::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid #fff;
  border-radius: 50%;
}

.hp-insta-logo__flash {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
}

.home-hub-card--instagram:hover .hp-insta-logo {
  animation: hp-insta-gradient 2s ease infinite, hp-insta-pop 0.45s ease;
}

@keyframes hp-insta-gradient {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes hp-insta-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08) rotate(-3deg);
  }
  100% {
    transform: scale(1);
  }
}

/* GLN animated digits on card */
.home-hub-card--gln .home-hub-card__viz {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 48px;
  padding: 4px;
}

.home-hub-card--gln .home-hub-card__digit {
  min-width: 0.95em;
  padding: 3px 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 9px;
  font-weight: 800;
  color: var(--hp-g5);
  font-variant-numeric: tabular-nums;
  transition: transform 0.25s ease, background 0.25s ease;
}

.home-hub-card--gln:hover .home-hub-card__digit {
  animation: hp-digit-pop 0.5s ease backwards;
}

.home-hub-card--gln:hover .home-hub-card__digit:nth-child(odd) {
  background: linear-gradient(135deg, var(--hp-g4), var(--hp-g5));
  color: #fff;
}

/* Acquiring NFC hover */
.home-hub-card--acq .home-hub-card__viz {
  width: 48px;
  height: 40px;
}

.home-hub-card--acq .home-hub-card__viz svg {
  width: 100%;
  height: 100%;
}

.home-hub-card--acq .hp-nfc-ring {
  opacity: 0.35;
  transform-origin: center;
}

.home-hub-card--acq:hover .hp-nfc-ring {
  animation: hp-nfc-pulse 1.2s ease-in-out infinite;
}

.home-hub-card--acq .hp-pay-ok {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.home-hub-card--acq:hover .hp-pay-ok {
  opacity: 1;
}

/* Onboarding — horizontal scroll */
.home-guide {
  background: linear-gradient(180deg, #fff 0%, var(--hp-milk) 40%, #fff 100%);
  overflow: visible;
}

.home-guide__head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 20px;
  padding-top: 8px;
}

.home-guide__title {
  margin: 0 0 10px;
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.home-guide__lead {
  margin: 0;
  color: var(--hp-muted);
  font-size: 17px;
  line-height: 1.55;
}

.hp-onboard-root {
  width: 100%;
}

.hp-onboard__controls {
  max-width: 1100px;
  margin: 0 auto 16px;
  padding: 0 20px;
}

.hp-onboard__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}

.hp-onboard__tab {
  padding: 12px 22px;
  border-radius: 14px;
  border: 1px solid rgba(52, 199, 89, 0.2);
  background: var(--hp-glass);
  backdrop-filter: blur(10px);
  font-weight: 700;
  font-size: 14px;
  color: var(--hp-muted);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.hp-onboard__tab.is-active {
  background: linear-gradient(135deg, var(--hp-g4), var(--hp-g5));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 28px rgba(52, 199, 89, 0.28);
}

.hp-onboard__progress-wrap {
  display: grid;
  gap: 8px;
}

.hp-onboard__progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--hp-muted);
}

.hp-onboard__progress-meta strong {
  color: var(--hp-g5);
  font-variant-numeric: tabular-nums;
}

.hp-onboard__progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(52, 199, 89, 0.12);
  overflow: hidden;
}

.hp-onboard__progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--hp-g2), var(--hp-g4), var(--hp-g5));
  box-shadow: 0 0 12px rgba(52, 199, 89, 0.45);
  transition: width 0.15s ease-out;
}

.hp-onboard__stage {
  display: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.hp-onboard__stage.is-active {
  display: block;
  opacity: 1;
}

.hp-carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 12px 8px;
}

.hp-carousel__nav {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(52, 199, 89, 0.25);
  background: var(--hp-glass);
  backdrop-filter: blur(10px);
  color: var(--hp-g5);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.hp-carousel__nav:hover:not(:disabled) {
  background: rgba(207, 247, 211, 0.6);
  border-color: var(--hp-g4);
}

.hp-carousel__nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.hp-carousel__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(52, 199, 89, 0.35) transparent;
  padding: 4px 0 12px;
}

.hp-carousel__viewport:focus-visible {
  outline: 2px solid var(--hp-g4);
  outline-offset: 4px;
  border-radius: 12px;
}

.hp-carousel__track {
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  padding: 8px 0;
}

.hp-carousel__pad {
  flex: 0 0 max(12px, calc(50% - min(140px, 39vw)));
  pointer-events: none;
}

.hp-slide {
  flex: 0 0 min(280px, 78vw);
  scroll-snap-align: center;
}

.hp-slide__inner {
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--hp-glass);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(52, 199, 89, 0.08);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hp-slide.is-active .hp-slide__inner {
  border-color: rgba(52, 199, 89, 0.32);
  box-shadow: 0 16px 40px rgba(52, 199, 89, 0.12), 0 0 0 1px rgba(52, 199, 89, 0.15);
}

.hp-slide--success .hp-slide__inner {
  background: linear-gradient(160deg, rgba(207, 247, 211, 0.55), #fff);
  border-color: rgba(52, 199, 89, 0.35);
}

.hp-slide__idx {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hp-g4);
  margin-bottom: 12px;
}

.hp-slide__title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.hp-slide__text {
  margin: 0;
  font-size: 13px;
  color: var(--hp-muted);
  line-height: 1.5;
}

.hp-slide__link {
  font-weight: 700;
  color: var(--hp-g5);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hp-slide__link:hover {
  color: var(--hp-g4);
}

.hp-slide__link--btn {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
}

@media (max-width: 640px) {
  .hp-carousel {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hp-carousel__nav {
    display: none;
  }

}

@media (prefers-reduced-motion: reduce) {
  .hp-insta-logo {
    animation: none;
  }

  .home-hub-card--instagram:hover .hp-insta-logo {
    animation: none;
  }

  .hp-carousel__viewport {
    scroll-behavior: auto;
  }

  .hp-slide__inner {
    transition: none;
  }
}

.hp-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.hp-reveal.is-in {
  opacity: 1;
  transform: none;
}

@keyframes hp-digit-pop {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hp-nfc-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hp-reveal {
    opacity: 1;
    transform: none;
  }

  .home-hub-card--gln:hover .home-hub-card__digit,
  .home-hub-card--acq:hover .hp-nfc-ring {
    animation: none;
  }
}


/* =========================================================
   Home redesign — cleaner Knowledge Hub + onboarding
   ========================================================= */
.home-hub {
  padding-top: 42px;
  padding-bottom: 54px;
  background:
    radial-gradient(circle at 8% 10%, rgba(207,247,211,.42), transparent 28%),
    linear-gradient(180deg, #f8faf9 0%, #ffffff 100%);
}

.home-hub__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.home-hub__title {
  font-size: clamp(30px, 3.2vw, 42px);
  letter-spacing: -.035em;
}

.home-hub__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.home-hub-card {
  position: relative;
  min-height: 164px;
  padding: 20px 18px 18px;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 15px;
  border-radius: 22px;
  border: 1px solid rgba(15,23,42,.07);
  background: rgba(255,255,255,.9);
  box-shadow: 0 12px 32px rgba(15,23,42,.055);
  overflow: hidden;
  transition: transform .28s cubic-bezier(.22,1,.36,1), box-shadow .28s ease, border-color .28s ease;
}

.home-hub-card::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -42px;
  bottom: -42px;
  border-radius: 50%;
  background: rgba(52,199,89,.08);
  transition: transform .3s ease;
}

.home-hub-card:hover {
  transform: translateY(-5px);
  border-color: rgba(52,199,89,.24);
  box-shadow: 0 20px 42px rgba(15,23,42,.09);
}

.home-hub-card:hover::after { transform: scale(1.45); }

.home-hub-card__icon {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 18px;
  background: linear-gradient(145deg, #dff9e2, #f7fbf8);
  box-shadow: inset 0 0 0 1px rgba(52,199,89,.08);
}

.home-hub-card__icon--img img {
  width: 42px;
  height: 42px;
}

.home-hub-card__copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding-right: 10px;
}

.home-hub-card__label {
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -.02em;
  text-align: left;
}

.home-hub-card__desc {
  color: var(--hp-muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.home-hub-card__arrow {
  position: absolute;
  right: 16px;
  bottom: 14px;
  z-index: 2;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f0faf2;
  color: var(--hp-g5);
  font-size: 15px;
  font-weight: 800;
  transition: transform .25s ease, background .25s ease;
}

.home-hub-card:hover .home-hub-card__arrow {
  transform: translate(2px,-2px);
  background: #dff7e3;
}

/* Onboarding redesign */
.home-guide {
  position: relative;
  padding-top: 66px;
  padding-bottom: 72px;
  background: linear-gradient(180deg, #fff 0%, #f8fbf9 45%, #fff 100%);
}

.home-guide__head {
  max-width: 820px;
  margin-bottom: 28px;
  padding-top: 0;
}

.home-guide__title {
  font-size: clamp(31px, 4vw, 48px);
  letter-spacing: -.045em;
}

.home-guide__lead {
  max-width: 690px;
  margin: 0 auto;
  font-size: 17px;
}

.hp-onboard-root {
  position: relative;
}

.hp-onboard__controls {
  max-width: 1160px;
  margin-bottom: 22px;
  padding: 0 24px;
}

.hp-onboard__tabs {
  width: fit-content;
  margin: 0 auto 22px;
  padding: 4px;
  gap: 4px;
  border: 1px solid #e5eee8;
  border-radius: 17px;
  background: #f6f9f7;
  box-shadow: inset 0 1px 2px rgba(15,23,42,.03);
}

.hp-onboard__tab {
  min-width: 150px;
  padding: 11px 20px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
  box-shadow: none;
}

.hp-onboard__tab.is-active {
  background: #fff;
  color: var(--hp-g5);
  box-shadow: 0 5px 16px rgba(15,23,42,.08);
}

.hp-onboard__progress-wrap {
  gap: 9px;
}

.hp-onboard__progress-meta {
  font-size: 13px;
  font-weight: 700;
}

.hp-onboard__progress-meta::after {
  content: "Прокрутите или используйте стрелки";
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}

.hp-onboard__progress {
  height: 5px;
  background: #e8f2eb;
}

.hp-carousel {
  max-width: 1220px;
  grid-template-columns: 46px minmax(0,1fr) 46px;
  gap: 12px;
  padding: 0 18px 12px;
}

.hp-carousel__nav {
  width: 46px;
  height: 46px;
  border: 1px solid #dcebe0;
  background: #fff;
  color: var(--hp-g5);
  font-size: 25px;
  box-shadow: 0 8px 20px rgba(15,23,42,.06);
}

.hp-carousel__nav:hover:not(:disabled) {
  background: #f2fbf4;
  border-color: rgba(52,199,89,.35);
}

.hp-carousel__viewport {
  padding: 6px 0 16px;
  scrollbar-width: none;
}

.hp-carousel__viewport::-webkit-scrollbar { display: none; }

.hp-carousel__track {
  gap: 16px;
  padding: 10px 0 8px;
}

.hp-carousel__pad {
  flex-basis: max(18px, calc(50% - 174px));
}

.hp-slide {
  flex-basis: min(350px, 78vw);
}

.hp-slide__inner {
  min-height: 205px;
  padding: 22px 22px 20px;
  border-radius: 22px;
  border: 1px solid #e5eee8;
  background: #fff;
  box-shadow: 0 12px 34px rgba(15,23,42,.065);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease, opacity .3s ease;
}

.hp-slide:not(.is-active) .hp-slide__inner {
  opacity: .68;
  transform: scale(.97);
}

.hp-slide.is-active .hp-slide__inner {
  opacity: 1;
  transform: translateY(-2px);
  border-color: rgba(52,199,89,.28);
  box-shadow: 0 20px 48px rgba(52,199,89,.11), 0 0 0 1px rgba(52,199,89,.07);
}

.hp-slide__idx {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef9f0;
  color: var(--hp-g5);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
}

.hp-slide__title {
  margin: 16px 0 10px;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.15;
  letter-spacing: -.025em;
}

.hp-slide__text {
  margin: 0;
  color: #66758b;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 600;
}

.hp-slide--success .hp-slide__inner {
  background: linear-gradient(145deg, #effbf1 0%, #fff 72%);
}

@media (max-width: 1100px) {
  .home-hub__grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .home-hub { padding-top: 30px; padding-bottom: 42px; }
  .home-hub__grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .home-hub-card { min-height: 150px; padding: 17px 15px; }
  .home-guide { padding-top: 48px; padding-bottom: 52px; }
  .hp-onboard__controls { padding: 0 16px; }
  .hp-onboard__progress-meta::after { display: none; }
  .hp-carousel { grid-template-columns: 38px minmax(0,1fr) 38px; gap: 6px; padding-left: 8px; padding-right: 8px; }
  .hp-carousel__nav { width: 38px; height: 38px; font-size: 22px; }
  .hp-slide { flex-basis: min(320px, 82vw); }
  .hp-slide__inner { min-height: 190px; padding: 19px; }
}

@media (max-width: 520px) {
  .home-hub__grid { grid-template-columns: 1fr; }
  .home-hub-card { min-height: 126px; flex-direction: row; align-items: center; }
  .home-hub-card__copy { padding-right: 24px; }
  .hp-onboard__tabs { width: 100%; }
  .hp-onboard__tab { min-width: 0; flex: 1 1 50%; padding-left: 12px; padding-right: 12px; }
}
