/* =====================================================================
   SAMDTU Klinika — harakatlanuvchi orqa fon (2026)
   base.html dagi <div class="site-bg"> — butun sahifa ortida qotib turadi:
     <b>   — sekin suzuvchi ikki nur dog'i
     <i>   — pastdan yuqoriga suzib chiqadigan tibbiy belgilar
             (xoch, yurak, kapsula, molekula)
     <svg> — yurak urishi (EKG) chizig'i, bo'ylab nur yuguradi
   Faqat transform/opacity/dashoffset animatsiya qilinadi — yengil.
   ===================================================================== */
.site-bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: linear-gradient(180deg, #f1f7fe 0%, #f6fafd 55%, #eef7fb 100%);
}
.site-bg b, .site-bg i, .site-bg svg { position: absolute; display: block; }

/* Bosh sahifadagi och fonli bo'limlar fonni to'sib qo'ymasin */
.nw-section, .hg { background: transparent !important; }
.hq { background: none !important; }

/* ---------- nur dog'lari ---------- */
.site-bg b { border-radius: 50%; will-change: transform; }
.site-bg b:nth-child(1) {
  width: 60vmax; height: 60vmax; left: -22vmax; top: -24vmax;
  background: radial-gradient(closest-side, rgba(86, 160, 255, .34), rgba(86, 160, 255, 0));
  animation: sbgDriftA 26s ease-in-out infinite alternate;
}
.site-bg b:nth-child(2) {
  width: 56vmax; height: 56vmax; right: -20vmax; bottom: -24vmax;
  background: radial-gradient(closest-side, rgba(45, 200, 180, .28), rgba(45, 200, 180, 0));
  animation: sbgDriftB 32s ease-in-out infinite alternate;
}
@keyframes sbgDriftA { to { transform: translate3d(16vw, 18vh, 0) scale(1.15); } }
@keyframes sbgDriftB { to { transform: translate3d(-18vw, -16vh, 0) scale(.9); } }

/* ---------- suzuvchi tibbiy belgilar ---------- */
.site-bg i {
  --s: 44px; --o: .2; --dx: 40px; --r: 40deg;
  bottom: -90px; width: var(--s); height: var(--s); opacity: 0;
  background: center / contain no-repeat; will-change: transform, opacity;
  animation: sbgRise 26s linear infinite;
}
@keyframes sbgRise {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: var(--o); }
  85%  { opacity: var(--o); }
  100% { transform: translate3d(var(--dx), calc(-100vh - 200px), 0) rotate(var(--r)); opacity: 0; }
}
/* belgi turlari: 4n+1 xoch · 4n+2 yurak · 4n+3 kapsula · 4n molekula (b,b dan keyin i lar 3-bola'dan boshlanadi) */
.site-bg i:nth-of-type(4n+1) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3h6v6h6v6h-6v6H9v-6H3V9h6z' fill='%231764d8' fill-opacity='.12' stroke='%231764d8' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.site-bg i:nth-of-type(4n+2) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230ea5e9' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20.5S3.5 15.4 3.5 9.3A4.6 4.6 0 0 1 12 6.9a4.6 4.6 0 0 1 8.5 2.4c0 6.1-8.5 11.2-8.5 11.2z' fill='%230ea5e9' fill-opacity='.1'/%3E%3Cpath d='M6.5 11.8h3l1.2-2.4 2 4.6 1.3-2.2h3.5'/%3E%3C/svg%3E"); }
.site-bg i:nth-of-type(4n+3) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314a89a' stroke-width='1.5' stroke-linecap='round'%3E%3Cg transform='rotate(45 12 12)'%3E%3Crect x='7.5' y='2.5' width='9' height='19' rx='4.5' fill='%2314a89a' fill-opacity='.1'/%3E%3Cpath d='M7.5 12h9'/%3E%3C/g%3E%3C/svg%3E"); }
.site-bg i:nth-of-type(4n)   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236d7cf0' fill-opacity='.12' stroke='%236d7cf0' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M8.3 7.4l6.8.4M7.1 9.3l2.7 6.1M16.4 10.7l-3.7 5.1' fill='none'/%3E%3Ccircle cx='6' cy='7' r='2.5'/%3E%3Ccircle cx='18' cy='8' r='3'/%3E%3Ccircle cx='11' cy='18' r='2.8'/%3E%3C/svg%3E"); }
/* joylashuv, o'lcham, tezlik — manfiy kechikish sahifa ochilishi bilan ekran to'la bo'lishi uchun */
.site-bg i:nth-of-type(1)  { left: 4%;  --s: 46px; --dx: 50px;  --r: 60deg;  animation-duration: 24s; animation-delay: -3s; }
.site-bg i:nth-of-type(2)  { left: 12%; --s: 34px; --dx: -30px; --r: -40deg; animation-duration: 31s; animation-delay: -17s; }
.site-bg i:nth-of-type(3)  { left: 20%; --s: 56px; --dx: 40px;  --r: 90deg;  animation-duration: 28s; animation-delay: -9s; --o: .16; }
.site-bg i:nth-of-type(4)  { left: 28%; --s: 40px; --dx: -50px; --r: 50deg;  animation-duration: 35s; animation-delay: -26s; }
.site-bg i:nth-of-type(5)  { left: 36%; --s: 30px; --dx: 30px;  --r: -70deg; animation-duration: 22s; animation-delay: -12s; }
.site-bg i:nth-of-type(6)  { left: 44%; --s: 52px; --dx: -40px; --r: 30deg;  animation-duration: 33s; animation-delay: -5s; --o: .16; }
.site-bg i:nth-of-type(7)  { left: 52%; --s: 38px; --dx: 60px;  --r: 110deg; animation-duration: 27s; animation-delay: -20s; }
.site-bg i:nth-of-type(8)  { left: 60%; --s: 44px; --dx: -30px; --r: -60deg; animation-duration: 30s; animation-delay: -14s; }
.site-bg i:nth-of-type(9)  { left: 68%; --s: 32px; --dx: 40px;  --r: 45deg;  animation-duration: 23s; animation-delay: -7s; }
.site-bg i:nth-of-type(10) { left: 75%; --s: 58px; --dx: -50px; --r: -90deg; animation-duration: 36s; animation-delay: -29s; --o: .15; }
.site-bg i:nth-of-type(11) { left: 82%; --s: 36px; --dx: 30px;  --r: 70deg;  animation-duration: 25s; animation-delay: -16s; }
.site-bg i:nth-of-type(12) { left: 89%; --s: 48px; --dx: -40px; --r: -30deg; animation-duration: 32s; animation-delay: -2s; }
.site-bg i:nth-of-type(13) { left: 95%; --s: 30px; --dx: -60px; --r: 80deg;  animation-duration: 29s; animation-delay: -22s; }
.site-bg i:nth-of-type(14) { left: 48%; --s: 28px; --dx: 20px;  --r: -100deg; animation-duration: 38s; animation-delay: -33s; }

/* ---------- EKG chizig'i ---------- */
.site-bg svg { left: 0; bottom: 12vh; width: 100%; height: 150px; }
.site-bg svg path { fill: none; stroke: #1764d8; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.site-bg svg path:nth-child(1) { stroke-opacity: .1; }
.site-bg svg path:nth-child(2) { stroke: #0ea5e9; stroke-opacity: .6; stroke-width: 2.8; stroke-dasharray: 110 890; animation: sbgBeat 6s linear infinite; }
@keyframes sbgBeat { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }

@media (max-width: 767.98px) {
  .site-bg b:nth-child(1), .site-bg b:nth-child(2) { width: 95vmax; height: 95vmax; }
  .site-bg i:nth-of-type(even) { display: none; } /* telefonda belgilar ikki baravar kam */
  .site-bg i { --o: .16; }
  .site-bg svg { height: 100px; bottom: 9vh; }
}
@media (prefers-reduced-motion: reduce) {
  .site-bg b, .site-bg i, .site-bg svg path { animation: none !important; }
  .site-bg i, .site-bg svg path:nth-child(2) { display: none; }
}
