/* ╔══════════════════════════════════════════════════════════════╗
   ║  OKO · ТАРИФЫ — окно с живыми карточками                        ║
   ║  Свайп-карусель, у каждого тарифа своя движущаяся графика в     ║
   ║  шапке, свечение активной карточки, точки-пагинация, сравнение. ║
   ║  Движется только transform/opacity, всё гаснет при              ║
   ║  prefers-reduced-motion. Обе темы.                              ║
   ╚══════════════════════════════════════════════════════════════╝ */

#okoTarPop{
  position:fixed; inset:0; z-index:82;
  display:flex; align-items:flex-end; justify-content:center;
  visibility:hidden; pointer-events:none;
}
#okoTarPop.on{ visibility:visible; pointer-events:auto }

.tp-back{
  position:absolute; inset:0;
  background:rgba(0,0,0,.66);
  backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px);
  opacity:0; transition:opacity .28s ease;
}
#okoTarPop.on .tp-back{ opacity:1 }

.tp-win{
  position:relative; width:100%; max-width:620px;
  max-height:94vh; max-height:94dvh;
  display:flex; flex-direction:column;
  background:var(--bg,#050505);
  border:1px solid var(--border); border-bottom:0;
  border-radius:26px 26px 0 0;
  box-shadow:0 -20px 70px rgba(0,0,0,.6);
  transform:translateY(24px) scale(.97); opacity:0;
  transition:transform .34s cubic-bezier(.22,1,.32,1), opacity .26s ease;
  padding-bottom:var(--oko-safe-bottom,0px);
  overflow:hidden;
}
#okoTarPop.on .tp-win{ transform:none; opacity:1 }
@media (min-width:700px){
  #okoTarPop{ align-items:center }
  .tp-win{ border:1px solid var(--border); border-radius:24px; max-height:88vh }
}

/* ── шапка окна ── */
.tp-bar{
  flex:0 0 auto; display:flex; align-items:center; gap:10px;
  padding:16px 14px 13px 20px; border-bottom:1px solid var(--border);
  position:relative;
}
.tp-bar::after{                      /* тонкая лаймовая нить под шапкой */
  content:''; position:absolute; left:0; right:0; bottom:-1px; height:1px;
  background:linear-gradient(90deg,transparent,var(--lime,#9AFF00),transparent);
  opacity:.5;
}
.tp-bar-t{ flex:1; min-width:0 }
.tp-bar-t b{
  display:block; font-family:'Bebas Neue',Montserrat,sans-serif;
  font-size:27px; letter-spacing:.03em; line-height:1;
}
.tp-bar-t small{ display:block; color:var(--dim); font-size:12px; margin-top:3px }
.tp-x{
  flex:0 0 auto; width:44px; height:44px; border-radius:13px;
  display:flex; align-items:center; justify-content:center;
  background:var(--surface); border:1px solid var(--border);
  color:var(--text); cursor:pointer;
  transition:border-color .16s, transform .12s;
}
.tp-x:hover{ border-color:var(--lime,#9AFF00) }
.tp-x:active{ transform:scale(.93) }
.tp-x svg.i{ width:17px; height:17px }

.tp-body{ flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch; padding:14px 0 20px }
.tp-empty{ padding:32px 20px; text-align:center; color:var(--dim); font-size:13.5px }
.tp-hint{ text-align:center; color:var(--dim); font-size:12px; margin:0 0 12px }

/* ── срок оплаты ── */
.tp-per{
  display:flex; gap:7px; padding:0 16px 14px;
  overflow-x:auto; scrollbar-width:none;
}
.tp-per::-webkit-scrollbar{ display:none }
.tp-per-b{
  flex:0 0 auto; min-height:44px; padding:0 15px;
  border-radius:99px; border:1px solid var(--border); background:var(--surface);
  color:var(--dim); cursor:pointer; font:inherit;
  display:inline-flex; align-items:center; gap:7px;
  transition:background .2s, color .2s, border-color .2s, transform .12s;
}
.tp-per-b b{ font-size:13px; font-weight:700; letter-spacing:.02em; text-transform:uppercase }
.tp-per-b i{ font-style:normal; font-size:12px; font-weight:700; color:var(--lime,#9AFF00) }
.tp-per-b:active{ transform:scale(.96) }
.tp-per-b.on{
  background:transparent; color:var(--text);
  border-color:var(--lime,#9AFF00);
  box-shadow:0 0 0 1px var(--lime,#9AFF00) inset, 0 0 18px -6px var(--lime,#9AFF00);
}
.tp-per-b.on i{ color:var(--lime,#9AFF00) }

/* ── карусель ── */
.tp-rail{
  display:flex; gap:14px;
  overflow-x:auto; scroll-snap-type:x mandatory;
  padding:6px 16px 14px; scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}
.tp-rail::-webkit-scrollbar{ display:none }

.tp-card{
  flex:0 0 auto; width:min(300px, 82vw);
  scroll-snap-align:center;
  border-radius:20px; border:1px solid var(--border);
  background:var(--surface); overflow:hidden; cursor:pointer;
  transform:scale(.955); opacity:.72;
  transition:transform .3s cubic-bezier(.22,1,.32,1), opacity .3s, border-color .25s, box-shadow .3s;
  animation:tpIn .42s cubic-bezier(.22,1,.32,1) backwards;
  animation-delay:calc(var(--i,0) * 60ms);
}
@keyframes tpIn{ from{ opacity:0; transform:translateY(18px) scale(.93) } }
.tp-card.on{
  transform:none; opacity:1;
  border-color:var(--lime,#9AFF00);
  box-shadow:0 0 0 1px var(--lime,#9AFF00) inset, 0 12px 44px -14px var(--lime,#9AFF00);
}
.tp-card:focus-visible{ outline:2px solid var(--lime,#9AFF00); outline-offset:3px }
@media (min-width:700px){ .tp-card{ width:290px } }

/* шапка карточки с живой графикой */
.tp-head{
  position:relative; height:104px; overflow:hidden;
  background:linear-gradient(160deg,
    color-mix(in srgb, var(--lime,#9AFF00) 13%, transparent),
    transparent 72%);
  border-bottom:1px solid var(--border);
}
.tp-art{ position:absolute; inset:0; width:100%; height:100%; opacity:.5 }
.tp-card.on .tp-art{ opacity:.92 }
.tp-head-b{ position:absolute; left:16px; bottom:11px; right:16px }
.tp-head-b b{
  display:block; font-family:'Bebas Neue',Montserrat,sans-serif;
  font-size:34px; line-height:.94; letter-spacing:.02em;
}
.tp-head-b span{
  display:block; color:var(--dim); font-size:11.5px; margin-top:3px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.tp-flags{ position:absolute; top:11px; left:12px; right:12px; display:flex; gap:6px; justify-content:space-between }
.tp-flag{
  font-size:10px; font-weight:800; letter-spacing:.07em; text-transform:uppercase;
  padding:5px 10px; border-radius:99px; white-space:nowrap;
}
.tp-flag.now{ background:var(--text); color:var(--bg) }
.tp-flag.hit{ background:var(--lime,#9AFF00); color:#08120a; margin-left:auto }

/* графика: общие цвета */
.tp-art circle, .tp-art rect, .tp-art ellipse, .tp-art path{
  fill:none; stroke:var(--lime,#9AFF00); stroke-width:2;
}
.tp-art .a-hole{ fill:var(--surface); stroke:none }
.tp-art .a-dot, .tp-art .a-node, .tp-art .a-core, .tp-art .a-run, .tp-art .a-sat{
  fill:var(--lime,#9AFF00); stroke:none;
}
.tp-art .a-bar{ fill:color-mix(in srgb,var(--lime,#9AFF00) 26%,transparent); stroke:none }
.tp-art .a-net, .tp-art .a-orb{ stroke-opacity:.45 }

/* шестерни крутятся, соседние в разные стороны */
.a-gear{ animation:tpSpin 9s linear infinite }
.a-gear.g2{ animation-duration:6s; animation-direction:reverse }
.a-gear.g3{ animation-duration:4.5s }
@keyframes tpSpin{ to{ transform:rotate(360deg) } }

/* столбики дышат */
.a-bar{ transform-origin:50% 100%; animation:tpBar 2.6s ease-in-out infinite }
.a-bar.b2{ animation-delay:.2s } .a-bar.b3{ animation-delay:.4s } .a-bar.b4{ animation-delay:.6s }
@keyframes tpBar{ 0%,100%{ transform:scaleY(.55) } 50%{ transform:scaleY(1) } }
.a-line{ stroke-dasharray:4 4; animation:tpDash 6s linear infinite }
@keyframes tpDash{ to{ stroke-dashoffset:-80 } }

/* круги пульсируют */
.a-pulse{ transform-origin:52px 45px; animation:tpPulse 3.2s ease-in-out infinite; stroke-opacity:.5 }
.a-pulse.d1{ animation-delay:.35s } .a-pulse.d2{ animation-delay:.7s }
@keyframes tpPulse{ 0%,100%{ transform:scale(.86); stroke-opacity:.22 } 50%{ transform:scale(1.06); stroke-opacity:.6 } }
.a-dot{ animation:tpBlink 2.4s ease-in-out infinite }
.a-dot.f2{ animation-delay:.5s } .a-dot.f3{ animation-delay:1s }
@keyframes tpBlink{ 0%,100%{ opacity:.25 } 50%{ opacity:1 } }

/* узлы сети загораются по очереди */
.a-node{ animation:tpNode 3.4s ease-in-out infinite }
.a-node.n2{ animation-delay:.3s } .a-node.n3{ animation-delay:.6s }
.a-node.n4{ animation-delay:.9s } .a-node.n5{ animation-delay:1.2s } .a-node.n6{ animation-delay:1.5s }
@keyframes tpNode{ 0%,100%{ opacity:.35 } 50%{ opacity:1 } }

/* орбиты MAX */
.a-orb{ transform-origin:120px 45px }
.a-orb.o1{ animation:tpSpin 16s linear infinite }
.a-orb.o2{ animation:tpSpin 11s linear infinite reverse }
.a-core{ animation:tpCore 3s ease-in-out infinite }
@keyframes tpCore{ 0%,100%{ opacity:.6 } 50%{ opacity:1 } }

/* тело карточки */
.tp-body-c{ padding:14px 16px 16px }
.tp-price-row{ display:flex; align-items:baseline; gap:10px; margin-bottom:12px }
.tp-price{ flex:1; font-size:26px; font-weight:800; letter-spacing:-.01em; line-height:1 }
.tp-price small{ font-size:12px; font-weight:600; color:var(--dim); margin-left:3px }
.tp-day{
  font-size:12px; font-weight:700; color:var(--lime,#9AFF00);
  background:color-mix(in srgb,var(--lime,#9AFF00) 13%,transparent);
  border-radius:99px; padding:4px 9px; white-space:nowrap;
}
.tp-feats{ list-style:none; margin:0 0 12px; padding:0; display:flex; flex-direction:column; gap:8px }
.tp-feats li{
  display:flex; gap:8px; align-items:flex-start; font-size:12.5px; line-height:1.4;
  opacity:0; transform:translateX(-6px);
  animation:tpFeat .34s ease forwards; animation-delay:calc(var(--k,0) * 60ms + 120ms);
}
@keyframes tpFeat{ to{ opacity:1; transform:none } }
.tp-feats svg.i{ width:14px; height:14px; flex:0 0 auto; margin-top:1px; color:var(--lime,#9AFF00) }

.tp-total{
  display:flex; align-items:baseline; gap:7px; flex-wrap:wrap;
  padding-top:11px; border-top:1px dashed var(--border);
  font-size:12px; color:var(--dim); margin-bottom:12px;
}
.tp-total b{ color:var(--text); font-size:15px }
.tp-total s{ opacity:.45 }

.tp-cta{
  width:100%; min-height:46px; border-radius:13px; font:inherit;
  display:flex; align-items:center; justify-content:center; gap:7px;
  font-size:14px; font-weight:700; cursor:pointer; border:1px solid transparent;
  transition:transform .12s, filter .2s;
}
.tp-cta svg.i{ width:16px; height:16px }
.tp-cta.go{ background:var(--lime,#9AFF00); color:#08120a }
.tp-cta.go:active{ transform:scale(.97) }
.tp-cta.go:hover{ filter:brightness(1.06) }
.tp-cta.mine{ background:transparent; border-color:var(--border); color:var(--dim); cursor:default }

/* точки */
.tp-dots{ display:flex; gap:6px; justify-content:center; padding:2px 0 14px }
.tp-dot{
  width:7px; height:7px; border-radius:99px; background:var(--border);
  transition:width .26s cubic-bezier(.22,1,.32,1), background .26s;
}
.tp-dot.on{ width:22px; background:var(--lime,#9AFF00) }

/* сравнить */
.tp-cmp{
  display:flex; align-items:center; justify-content:center; gap:8px;
  width:calc(100% - 32px); margin:0 16px; min-height:48px;
  border-radius:14px; border:1px dashed color-mix(in srgb,var(--lime,#9AFF00) 40%,transparent);
  background:color-mix(in srgb,var(--lime,#9AFF00) 6%,transparent);
  color:var(--lime,#9AFF00); font:inherit; font-size:14px; font-weight:700; cursor:pointer;
  transition:background .2s, transform .12s;
}
.tp-cmp:active{ transform:scale(.98) }
.tp-cmp svg.i{ width:16px; height:16px }
.tp-cmp svg.i:last-child{ width:14px; height:14px; opacity:.7 }

/* таблица сравнения */
.tp-cmp-wrap{ overflow-x:auto; padding:0 16px 14px; -webkit-overflow-scrolling:touch }
.tp-tab{ width:100%; border-collapse:collapse; font-size:12px; min-width:460px }
.tp-tab th{
  position:sticky; top:0; background:var(--bg); z-index:1;
  font-family:'Bebas Neue',Montserrat,sans-serif; font-size:17px; letter-spacing:.02em;
  padding:9px 6px; text-align:center; border-bottom:1px solid var(--border);
}
.tp-tab th:first-child{ text-align:left; min-width:170px }
.tp-tab td{ padding:9px 6px; text-align:center; border-bottom:1px solid var(--border); color:var(--dim) }
.tp-tab td:first-child{ text-align:left; color:var(--text) }
.tp-yes svg.i{ width:14px; height:14px; color:var(--lime,#9AFF00) }
.tp-no{ opacity:.3; font-style:normal }
.tp-cmp-wrap + .btn{ width:calc(100% - 32px); margin:0 16px }

@media (prefers-reduced-motion:reduce){
  .tp-back,.tp-win,.tp-card,.tp-dot{ transition:none }
  .tp-card,.tp-feats li{ animation:none; opacity:1; transform:none }
  .tp-card{ transform:none; opacity:1 }
  .a-gear,.a-bar,.a-line,.a-pulse,.a-dot,.a-node,.a-orb,.a-core{ animation:none }
  .tp-art animateMotion{ display:none }
}
