:root{
  --bg0:#06070a;
  --bg1:#0b0f16;

  --card: rgba(255,255,255,.045);
  --card2: rgba(255,255,255,.03);

  --stroke: rgba(255,255,255,.10);
  --stroke2: rgba(255,255,255,.07);

  --txt: rgba(235,242,255,.92);
  --muted: rgba(235,242,255,.65);
  --muted2: rgba(235,242,255,.52);

  --gold1: rgba(255, 214, 120, .55);
  --gold2: rgba(255, 214, 120, .20);

  --shadow: 0 24px 90px rgba(0,0,0,.55);

  --r12: 12px;
  --r16: 16px;
  --r20: 20px;
  --r24: 24px;
}

/* ==========================================================
   ✅ FULLSCREEN + SCROLL FIX (важное)
   Чтобы ref-страница всегда скроллилась,
   даже если в глобальном style.css overflow:hidden
   ========================================================== */
html, body{
  height: 100%;
}
body.ref{
  margin:0;
  min-height: 100vh;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;

  background:
    radial-gradient(1200px 700px at 20% 0%, rgba(255,214,120,.10), transparent 55%),
    radial-gradient(900px 600px at 90% 15%, rgba(120,255,180,.08), transparent 60%),
    radial-gradient(900px 700px at 50% 120%, rgba(90,140,255,.07), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
  color: var(--txt);
}

/* ==========================================================
   ✅ WRAP: теперь на весь экран по ширине,
   но с “премиум” полями по бокам
   ========================================================== */
.wrap{
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 18px clamp(14px, 3vw, 28px) 64px;
}

/* Чтобы карточки не прилипали к topbar на мобилке */
@media (max-width: 520px){
  .wrap{ padding-top: 14px; }
}

.card{
  border-radius: var(--r24);
  border: 1px solid var(--stroke2);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  box-shadow: var(--shadow);
}

.pad{ padding: 16px; }

/* TOPBAR tweaks (не ломаем твой стиль.css, только чуть улучшаем) */
.topbar-ref{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10,14,20,.52);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.topbar-ref .navlinks{ display:flex; align-items:center; gap: 12px; }
.topbar-ref .navlinks .spacer{ flex:1; }
.topbar-ref a{ text-decoration:none; }
.topbar-ref a.active{
  color: var(--txt);
  border-bottom: 2px solid rgba(255,214,120,.45);
  padding-bottom: 6px;
}
.topbar-ref .pill{
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--txt);
  font-weight: 800;
  font-size: 13px;
}
.topbar-ref .pill.gold{
  border-color: rgba(255,214,120,.34);
  background: linear-gradient(180deg, rgba(255,214,120,.22), rgba(255,214,120,.10));
}
.topbar-ref .icon{
  width: 34px; height: 34px;
  display:inline-flex; align-items:center; justify-content:center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--txt);
}

/* HERO */
.hero{ padding: 18px; }
.heroGrid{
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 980px){
  .heroGrid{ grid-template-columns: 1fr; }
}
.badge{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.86);
  font-size: 12px;
  font-weight: 800;
  width: fit-content;
}
.h1{
  margin: 14px 0 10px;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.05;
  letter-spacing: -.5px;
  font-weight: 950;
}
.sub{
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 62ch;
}

.heroStats{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
@media (max-width: 620px){
  .heroStats{ grid-template-columns: 1fr; }
}
.stat{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  padding: 12px;
}
.stat .k{ font-size: 12px; color: var(--muted2); }
.stat .v{ margin-top: 6px; font-size: 16px; font-weight: 950; }

.heroCta{
  display:flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.btn{
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--txt);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  gap: 8px;
}
.btn:hover{ background: rgba(255,255,255,.07); }
.btnGold{
  border-color: rgba(255,214,120,.34);
  background: linear-gradient(180deg, rgba(255,214,120,.22), rgba(255,214,120,.10));
  box-shadow: 0 14px 40px rgba(255,214,120,.12);
}
.btnGold:hover{ filter: brightness(1.05); }
.w100{ width:100%; }

.trust{
  display:flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.trustItem{
  font-size: 12px;
  color: rgba(235,242,255,.72);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
}

.heroRight{ display:flex; flex-direction:column; gap: 12px; }
.preview{
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
  overflow:hidden;
  min-height: 240px;
}
.preview img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
  opacity: .92;
}
.previewOverlay{
  position:absolute; inset:0;
  background:
    radial-gradient(500px 300px at 30% 10%, rgba(255,214,120,.14), transparent 55%),
    linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.42));
  pointer-events:none;
}
.previewHint{
  position:absolute;
  left: 14px; bottom: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.28);
  padding: 10px 12px;
  backdrop-filter: blur(10px);
}
.hintTitle{ font-weight: 950; font-size: 13px; }
.hintSub{ margin-top: 2px; font-size: 12px; color: rgba(235,242,255,.65); }

.previewFallback{
  display:flex;
  align-items:center;
  justify-content:center;
}
.previewFallback::before{
  content:"Добавь /static/img/referral/hero.png";
  color: rgba(235,242,255,.65);
  font-weight: 800;
}

.miniCard{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  padding: 14px;
}
.miniTitle{ font-weight: 950; }
.miniSub{ margin-top: 6px; color: var(--muted); font-size: 13px; line-height:1.45; }

/* Section headers */
.secHead{
  margin: 24px 0 12px;
}
.secHead h2{
  margin:0;
  font-size: 22px;
  font-weight: 950;
}
.secHead p{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.secHead.inCard{ padding: 16px 16px 0; margin: 0; }

/* WHY */
.grid3{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 980px){
  .grid3{ grid-template-columns: 1fr; }
}
.ico{ font-size: 22px; opacity: .95; }
.grid3 h3{ margin: 10px 0 6px; font-size: 15px; font-weight: 950; }
.grid3 p{ margin:0; color: var(--muted); font-size: 13px; line-height:1.45; }

/* PLANS */
.planGrid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1100px){
  .planGrid{ grid-template-columns: 1fr; }
}
.plan{
  padding: 16px;
  position: relative;
  overflow:hidden;
}
.planTop{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.planName{
  font-weight: 950;
  letter-spacing: .6px;
}
.planPrice{
  font-weight: 950;
  font-size: 22px;
}
.planPrice span{
  font-size: 12px;
  color: rgba(235,242,255,.65);
  font-weight: 800;
}
.planTag{
  margin-top: 8px;
  font-size: 12px;
  color: rgba(235,242,255,.72);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  border-radius: 999px;
  padding: 6px 10px;
  width: fit-content;
}
.list{
  margin: 12px 0 12px;
  padding-left: 18px;
  color: rgba(235,242,255,.78);
  font-size: 13px;
  line-height: 1.55;
}
.list li{ margin: 6px 0; }

.planBox{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  padding: 12px;
}
.planBoxTitle{
  font-weight: 950;
  font-size: 13px;
}
.planBoxText{
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.planMedia{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 12px;
}
@media (max-width: 1100px){
  .planMedia{ grid-template-columns: 1fr; }
}
.planMedia img{
  width:100%;
  height: 160px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.25);
}

.fine{
  margin-top: 8px;
  color: rgba(235,242,255,.60);
  font-size: 12px;
}

/* accent cards */
.plan.accent{
  border-color: rgba(255,214,120,.24);
  box-shadow: 0 0 0 1px rgba(255,214,120,.08) inset, var(--shadow);
}
.ribbon{
  position:absolute;
  top: 14px;
  right: -44px;
  transform: rotate(35deg);
  padding: 6px 56px;
  font-size: 11px;
  font-weight: 950;
  color: rgba(0,0,0,.78);
  background: rgba(255,214,120,.85);
  border: 1px solid rgba(0,0,0,.18);
}

/* PRO glow */
.plan.pro{
  border-color: rgba(255,214,120,.22);
  background:
    radial-gradient(600px 260px at 20% 0%, rgba(255,214,120,.10), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
}

/* GALLERY */
.gallery{ margin-top: 16px; overflow:hidden; }
.tabs{
  display:flex;
  gap: 10px;
  padding: 12px 16px 0;
  flex-wrap: wrap;
}
.tab{
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: rgba(235,242,255,.78);
  cursor:pointer;
  font-weight: 900;
  font-size: 13px;
}
.tab.active{
  border-color: rgba(255,214,120,.30);
  background: rgba(255,214,120,.12);
  color: var(--txt);
}
.tabBody{ display:none; padding: 14px 16px 16px; }
.tabBody.active{ display:block; }

.shotGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 980px){
  .shotGrid{ grid-template-columns: 1fr; }
}
.shot{
  margin:0;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
  overflow:hidden;
}
.shot img{
  width:100%;
  height: 260px;
  object-fit: cover;
  display:block;
  background: rgba(0,0,0,.25);
}
.shot figcaption{
  padding: 10px 12px;
  font-size: 12px;
  color: rgba(235,242,255,.68);
}

/* COMPARE TABLE */
.table{
  overflow:hidden;
  margin-top: 8px;
}
.row{
  display:grid;
  grid-template-columns: 1.8fr .7fr .7fr .7fr;
  gap: 0;
  border-top: 1px solid rgba(255,255,255,.07);
}
.row.head{
  border-top: 0;
  background: rgba(255,255,255,.03);
  font-weight: 950;
}
.c0, .c{
  padding: 12px 14px;
  font-size: 13px;
}
.c0{ color: rgba(235,242,255,.86); }
.c{ text-align:center; color: rgba(235,242,255,.76); }
.yes{ color: rgba(120,255,180,.80); font-weight: 950; }
.no{ color: rgba(235,242,255,.45); }

.centerCta{
  display:flex;
  justify-content:center;
  margin-top: 12px;
}

/* FAQ */
.faqList{
  padding: 6px;
  overflow:hidden;
}
.faqQ{
  width:100%;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color: var(--txt);
  padding: 12px 12px;
  border-radius: 16px;
  cursor:pointer;
  margin: 10px 8px;
  font-weight: 950;
}
.faqQ i{
  width: 28px; height: 28px;
  border-radius: 10px;
  display:inline-flex; align-items:center; justify-content:center;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.15);
  font-style: normal;
  color: rgba(235,242,255,.82);
}
.faqA{
  display:none;
  margin: -4px 16px 10px;
  padding: 10px 12px;
  color: var(--muted);
  border-left: 2px solid rgba(255,214,120,.35);
  background: rgba(255,255,255,.02);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}
.faqQ.open + .faqA{ display:block; }

/* REFERRAL */
.refBlock{ margin-top: 16px; padding-bottom: 12px; }
.refGrid{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 12px;
  padding: 12px 16px 16px;
}
@media (max-width: 980px){
  .refGrid{ grid-template-columns: 1fr; }
}
.refSteps{
  display:grid;
  gap: 10px;
}
.step{
  display:grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.step .n{
  width: 34px; height: 34px;
  border-radius: 14px;
  display:flex; align-items:center; justify-content:center;
  font-weight: 950;
  border: 1px solid rgba(255,214,120,.28);
  background: rgba(255,214,120,.10);
}
.step .t{ font-weight: 950; }
.step .d{ grid-column: 2 / 3; color: var(--muted); font-size: 13px; line-height:1.45; }

.refNote{
  margin-top: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
  color: rgba(235,242,255,.70);
  font-size: 13px;
  line-height: 1.45;
}

.refBox{
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.refLabel{
  font-weight: 950;
  margin-bottom: 10px;
}
.refRow{
  display:flex;
  gap: 10px;
}
.refInput{
  flex:1;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  color: rgba(235,242,255,.88);
  padding: 0 12px;
  outline: none;
}
.refOk{
  margin-top: 10px;
  color: rgba(120,255,180,.85);
  font-weight: 900;
  font-size: 12px;
}
.refTiny{
  margin-top: 10px;
  color: rgba(235,242,255,.60);
  font-size: 12px;
  line-height: 1.45;
}
.refCta{
  display:flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* FOOT */
.foot{
  margin-top: 22px;
  text-align:center;
}
.footLine{
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 18px 0 12px;
}
.footText{
  color: rgba(235,242,255,.55);
  font-size: 12px;
}