/* Общие фоны/анимации/карточки из исходника */
.server-card{
  position: relative;
  border-radius: 0.75rem;
  border: 1px solid rgba(71,85,105,.6);
  background: linear-gradient(180deg,rgba(15,23,42,.75),rgba(15,23,42,.6));
  box-shadow: 0 10px 30px rgba(16,185,129,.08);
  transition:.3s ease;
  overflow: hidden;
}
.server-card:hover{
  background: rgba(15,23,42,.9);
  box-shadow: 0 14px 38px rgba(16,185,129,.18);
  border-color: rgba(16,185,129,.35);
}

.footer-legal {
  background-color: #0f172a; /* тёмно-синий (slate-900) */
  color: #575757;           /* светло-серый текст */
  text-align: center;
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
  letter-spacing: 0.2px;
  line-height: 1.4;
}

.status-dot{
  position: absolute;
  top: 50%;
  right: .75rem;
  transform: translateY(-50%);
  width: .62rem;
  height: .62rem;
  border-radius: 9999px;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16,185,129,.25),0 0 10px 2px rgba(16,185,129,.45);
  opacity:.85;
  animation: var(--anim, blink1) var(--dur,2200ms) infinite;
  animation-delay: var(--delay,0ms);
}
.status-dot::after{
  content:"";
  position:absolute; inset: -6px;
  border-radius:inherit;
  border: 2px solid rgba(16,185,129,.3);
  transform: scale(.6);
  opacity:0;
  animation: var(--ring, ring1) var(--ringdur,2200ms) infinite;
  animation-delay: var(--delay,0ms);
}
@keyframes blink1{0%,100%{opacity:.25}6%{opacity:1}14%{opacity:.35}}
@keyframes blink2{0%,100%{opacity:.2}6%{opacity:1}12%{opacity:.3}18%{opacity:1}26%{opacity:.35}}
@keyframes blink3{0%,100%{opacity:.25}10%{opacity:1}20%{opacity:.28}}
@keyframes ring1{0%{transform:scale(.65);opacity:.0}8%{transform:scale(.9);opacity:.5}18%{transform:scale(1.15);opacity:.0}100%{transform:scale(1.15);opacity:.0}}
@keyframes ring2{0%{transform:scale(.6);opacity:.0}6%{transform:scale(.95);opacity:.55}14%{transform:scale(1.2);opacity:.0}100%{transform:scale(1.2);opacity:.0}}
.grid > .server-card:nth-child(3n+1) .status-dot{--anim:blink2;--ring:ring2;--dur:2600ms;--ringdur:2600ms;--delay:120ms;}
.grid > .server-card:nth-child(3n+2) .status-dot{--anim:blink1;--ring:ring1;--dur:2100ms;--ringdur:2100ms;--delay:0ms;}
.grid > .server-card:nth-child(3n) .status-dot{--anim:blink3;--ring:ring1;--dur:3000ms;--ringdur:3000ms;--delay:220ms;}
:where([class^="ri-"])::before { content: "\f3c2"; }
.gradient-bg {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 25%, #334155 50%, #1e293b 75%, #0f172a 100%);
}
.hero-bg {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}
.pulse-animation { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.line-animation { animation: lineFlow 3s linear infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes lineFlow { 0% { stroke-dashoffset: 100; } 100% { stroke-dashoffset: 0; } }
.card-hover { transition: all 0.3s ease; }
.card-hover:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15); }
.fade-in { opacity: 0; transform: translateY(30px); transition: all 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.server-point { animation: serverPulse 2s ease-in-out infinite; }
@keyframes serverPulse { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.2); opacity: 0.7; } 100% { transform: scale(1); opacity: 1; } }
.connection-line { stroke-dasharray: 5, 5; animation: dash 2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -10; } }
.animated-connection { animation: connectionFlow 3s ease-in-out infinite; }
@keyframes connectionFlow { 0% { stroke-dashoffset: 20; opacity: 0.3; } 50% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: -20; opacity: 0.3; } }
.flowing-line { animation: flowingConnection 6s linear infinite; }
@keyframes flowingConnection { 0% { stroke-dashoffset: 40; opacity: 0.4; } 25% { opacity: 0.8; } 50% { stroke-dashoffset: 0; opacity: 1; } 75% { opacity: 0.8; } 100% { stroke-dashoffset: -40; opacity: 0.4; } }
.server-group:hover .server-point { animation: serverHover 0.8s ease-in-out; transform-origin: center; }
@keyframes serverHover { 0% { transform: scale(1); } 50% { transform: scale(1.5); } 100% { transform: scale(1); } }
.server-group { cursor: pointer; transition: all 0.3s ease; }
.server-group:hover text { fill: #3b82f6; font-size: 1.1em; }
.animated-connections .flowing-line:nth-child(odd) { animation-delay: -2s; }
.animated-connections .flowing-line:nth-child(even) { animation-delay: -4s; }

/* Базовая плавность на случай отключённого JS */
html { scroll-behavior: smooth; }

/* === Footer payment badges === */
.pay-badge { display:inline-flex; align-items:center; justify-content:center; padding:4px 6px; border-radius:10px; background:rgba(30,41,59,.6); border:1px solid rgba(71,85,105,.6); }
.pay-badge img.pay-img { display:block; height:28px; width:auto; image-rendering:-webkit-optimize-contrast; image-rendering:crisp-edges; }
@media (min-width: 640px){ .pay-badge img.pay-img { height:30px; } }
@media (min-width: 1024px){ .pay-badge img.pay-img { height:34px; } }

/* === Cookie banner === */
.cookie-banner { backdrop-filter: blur(6px); }
.cookie-banner.show { animation: cookieFadeIn .25s ease-out both; }
@keyframes cookieFadeIn { from { transform: translateY(12px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }


/* ===== BlinkyVPN modal buttons (glass + modern) ===== */
:root{
  --bv-primary: #3b82f6;
  --bv-primary-2: #6366f1;
  --bv-text: #e5e7eb;
  --bv-muted: #94a3b8;
  --bv-border: rgba(148,163,184,0.25);
  --bv-bg-glass: rgba(15,23,42,0.5);
  --bv-bg-hover: rgba(30,41,59,0.55);
}

.btn{
  display:inline-flex;
  align-items:center;
  gap:.6rem;
  padding:.85rem 1.1rem;
  font-weight:600;
  color:var(--bv-text);
  border:1px solid var(--bv-border);
  border-radius:14px;
  background:var(--bv-bg-glass);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 8px 24px rgba(2,6,23,0.45);
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
  text-decoration:none;
  cursor:pointer;
  user-select:none;
  will-change: transform;
}

.btn:hover{
  background:var(--bv-bg-hover);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 10px 28px rgba(2,6,23,0.55);
}

.btn:active{
  transform: translateY(1px) scale(.99);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.03) inset,
    0 6px 18px rgba(2,6,23,0.45);
}

.btn .btn-icon{
  width:1.35rem;
  height:1.35rem;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  opacity:.9;
}

/* Primary (filled gradient) */
.btn-primary{
  background: linear-gradient(135deg, var(--bv-primary), var(--bv-primary-2));
  border-color: rgba(59,130,246,0.35);
  color:white;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 12px 28px rgba(59,130,246,0.35);
}
.btn-primary:hover{
  filter: brightness(1.05);
}
.btn-primary:active{
  filter: brightness(.98);
}

/* Ghost (outline/transparent) */
.btn-ghost{
  background: linear-gradient(180deg, rgba(148,163,184,0.06), rgba(148,163,184,0.03));
  border-color: rgba(148,163,184,0.25);
  color: var(--bv-text);
}
.btn-ghost:hover{
  border-color: rgba(148,163,184,0.4);
}

/* Neutral (for Close) */
.btn-neutral{
  background: linear-gradient(180deg, rgba(71,85,105,0.35), rgba(15,23,42,0.35));
  border-color: rgba(148,163,184,0.25);
  color: var(--bv-text);
}
.btn-neutral:hover{
  background: linear-gradient(180deg, rgba(100,116,139,0.4), rgba(15,23,42,0.4));
}

/* Compact on small screens */
@media (max-width: 480px){
  .btn{ padding:.8rem 1rem; border-radius:12px; }
}


/* ===== BlinkyVPN form controls ===== */
.input-modern{
  appearance:none;
  width:100%;
  padding:0.9rem 1rem;
  border-radius:14px;
  border:1px solid rgba(148,163,184,0.25);
  background: rgba(15,23,42,0.6);
  color:#e5e7eb;
  outline:none;
  transition:border-color .2s ease, box-shadow .2s ease, background .2s ease;
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 6px 18px rgba(2,6,23,0.4);
}
.input-modern::placeholder{ color:#94a3b8; }
.input-modern:focus{
  border-color: rgba(59,130,246,0.5);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.15), 0 6px 18px rgba(2,6,23,0.5);
  background: rgba(15,23,42,0.7);
}

.checkbox-modern{
  width:18px; height:18px;
  border-radius:6px;
  border:1px solid rgba(148,163,184,0.35);
  background: rgba(15,23,42,0.6);
  appearance:none; outline:none; cursor:pointer;
  position:relative;
  transition: all .2s ease;
}
.checkbox-modern:checked{
  border-color: rgba(59,130,246,0.8);
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
}
.checkbox-modern:checked::after{
  content:''; position:absolute; inset:3px 5px 5px 3px;
  border-right:2px solid white; border-bottom:2px solid white;
  transform: rotate(45deg);
}



/* ===== BlinkyVPN OTP & smooth animations ===== */
.btn{
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .25s cubic-bezier(.2,.8,.2,1), background .25s cubic-bezier(.2,.8,.2,1), border-color .25s cubic-bezier(.2,.8,.2,1), opacity .18s ease;
}
.btn.is-loading{ pointer-events:none; opacity:.85; }
.spinner{ width:18px; height:18px; border-radius:50%; border:2px solid rgba(255,255,255,.35); border-top-color: white; animation: spin .9s linear infinite; margin-left:.35rem; }
@keyframes spin{to{transform:rotate(360deg)}}

.code-grid{ display:grid; grid-template-columns: repeat(6, 1fr); gap:.6rem; }
.code-input{
  text-align:center; font-size:1.25rem; letter-spacing:.1em;
  border-radius:14px; border:1px solid rgba(148,163,184,0.25);
  background: rgba(15,23,42,0.6); color:#e5e7eb; padding:.7rem 0;
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 6px 18px rgba(2,6,23,0.4);
  outline:none; transition:border-color .2s ease, box-shadow .2s ease, background .2s ease, transform .06s ease;
}
.code-input:focus{ border-color: rgba(59,130,246,0.5); box-shadow: 0 0 0 4px rgba(59,130,246,0.15), 0 6px 18px rgba(2,6,23,0.5); background: rgba(15,23,42,0.7); }
.code-input:active{ transform: scale(.98); }
.btn-ghost[disabled]{ opacity:.6; cursor:not-allowed; }


/* ===== OTP sizing & layout refinements ===== */
.code-grid{
  display:flex;
  justify-content:center;
  gap:.55rem;
  flex-wrap:nowrap;
}
.code-input{
  width:2.65rem;
  height:2.95rem;
  padding:0;
  font-size:1.1rem;
  font-variant-numeric: tabular-nums;
  caret-color:#fff;
}
@media (min-width: 380px){
  .code-input{ width:2.9rem; height:3.1rem; font-size:1.2rem; }
}
@media (min-width: 520px){
  .code-input{ width:3.1rem; height:3.25rem; font-size:1.25rem; }
}
/* Remove number input spinners (just in case) */
.code-input::-webkit-outer-spin-button,
.code-input::-webkit-inner-spin-button{ -webkit-appearance: none; margin: 0; }
.code-input[type=number]{ -moz-appearance: textfield; }


/* ===== UI refinements: compact resend + faster animations ===== */

/* Link-style button for subtle actions */
.btn-link{
  background: transparent;
  border: none;
  padding: 0;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--bv-text, #e5e7eb);
  cursor: pointer;
}
.btn-link:hover{ opacity:.9; }
.btn-link:active{ opacity:.8; }

.muted-timer{ font-size:.9em; color: var(--bv-muted, #94a3b8); white-space:nowrap; }

/* Smaller general button option (if needed elsewhere) */
.btn-sm{ padding:.6rem .85rem; border-radius:12px; font-weight:600; font-size:.95rem; }

/* Faster, snappier transitions globally for our custom buttons */
.btn{
  transition: transform .14s cubic-bezier(.22,.9,.22,1),
              box-shadow .18s cubic-bezier(.22,.9,.22,1),
              background .18s cubic-bezier(.22,.9,.22,1),
              border-color .18s cubic-bezier(.22,.9,.22,1),
              opacity .12s ease;
}

/* Faster spinner */
.spinner{ animation: spin .6s linear infinite; }

/* Speed up modal scale/opacity easing for both modals */
#buyModal[role="dialog"], #supportModal[role="dialog"]{
  transition-duration: 120ms !important;
  transition-timing-function: cubic-bezier(.22,.9,.22,1) !important;
}
#buyModal, #supportModal{
  transition-duration: 120ms !important;
  transition-timing-function: cubic-bezier(.22,.9,.22,1) !important;
}

/* Prevent wrapping on small inline actions */
#stepOtp .btn-link{ white-space: nowrap; }

#buyModal[role="dialog"], 
#supportModal[role="dialog"] {
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
  will-change: transform;
}

#buyModal, 
#supportModal {
  transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
  will-change: opacity;
}

/* Упростите бэкдроп */
.absolute.inset-0.bg-slate-900 {
  backdrop-filter: blur(2px); /* вместо 8px */
}

/* Отключайте анимации для пользователей, которые их предпочитают избегать */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === Toast notifications === */
.toast-shell {
  pointer-events: auto;
  display: flex;
  gap: .75rem;
  align-items: start;
  max-width: 38rem;
  width: calc(100% - 2rem);
  background: rgba(2,6,23,.92); /* slate-950/92 */
  backdrop-filter: blur(6px);
  border: 1px solid rgba(100,116,139,.35); /* slate-500/35 */
  border-radius: 14px;
  padding: .9rem 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  color: #e5e7eb; /* slate-200 */
  overflow: hidden;
  will-change: transform, opacity;
  transform-origin: top center;
  animation: toastIn .25s ease-out both;
}
.toast-shell.hide {
  animation: toastOut .22s ease-in both;
}
.toast-title {
  font-weight: 700;
  color: #fff;
  margin-bottom: .15rem;
  line-height: 1.2;
}
.toast-message {
  font-size: .95rem;
  color: #cbd5e1; /* slate-300 */
  line-height: 1.35;
}
.toast-accent-info { background: rgba(30,64,175,.22); }        /* blue-800/22 */
.toast-accent-success { background: rgba(5,122,85,.22); }      /* emerald-700/22 */
.toast-accent-warning { background: rgba(180,83,9,.22); }      /* amber-700/22 */
.toast-accent-error { background: rgba(153,27,27,.22); }       /* red-800/22 */

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-16px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-10px) scale(.98); }
}


/* === Mobile modal overflow fix (prevents background border from stretching past viewport) === */
@supports (height: 1svh) {
  @media (max-width: 640px){
    #buyModal [role="dialog"],
    #supportModal [role="dialog"]{
      height: auto !important;
      max-height: 90svh !important;
    }
    #buyModal [role="dialog"] > div,
    #supportModal [role="dialog"] > div{
      height: auto !important;
      max-height: 90svh !important;
      overflow-y: auto !important;
      -webkit-overflow-scrolling: touch;
    }
  }
}
@media (max-width: 640px){
  #buyModal [role="dialog"],
  #supportModal [role="dialog"]{
    height: auto !important;
    max-height: 90vh !important;
  }
  #buyModal [role="dialog"] > div,
  #supportModal [role="dialog"] > div{
    height: auto !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}


/* =========================
   Download page: star-border install cards
   ========================= */
.install-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.install-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.9);
}

.dl-star-card {
  display: block;
  --dl-star-color: #3b82f6;
  --dl-star-speed: 6s;
}

.dl-border-gradient-bottom,
.dl-border-gradient-top {
  position: absolute;
  width: 300%;
  height: 50%;
  opacity: 0.7;
  border-radius: 50%;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-direction: alternate;
  z-index: 0;
}

.dl-border-gradient-bottom {
  bottom: -18px;
  right: -250%;
  animation-name: dl-star-movement-bottom;
}

.dl-border-gradient-top {
  top: -18px;
  left: -250%;
  animation-name: dl-star-movement-top;
}

.dl-border-gradient-bottom,
.dl-border-gradient-top {
  background: radial-gradient(circle, var(--dl-star-color), transparent 10%);
  animation-duration: var(--dl-star-speed);
}

.dl-inner {
  position: relative;
  z-index: 1;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background:
    radial-gradient(900px 600px at 0% -30%, rgba(59, 130, 246, 0.18), transparent 55%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

@keyframes dl-star-movement-bottom {
  0% {
    transform: translate(0%, 0%);
    opacity: 1;
  }
  100% {
    transform: translate(-100%, 0%);
    opacity: 0;
  }
}

@keyframes dl-star-movement-top {
  0% {
    transform: translate(0%, 0%);
    opacity: 1;
  }
  100% {
    transform: translate(100%, 0%);
    opacity: 0;
  }
}

/* Color variations */
.dl-star-card--cyan {
  --dl-star-color: #22d3ee;
  --dl-star-speed: 5s;
}

.dl-star-card--white {
  --dl-star-color: #e5e7eb;
  --dl-star-speed: 7s;
}

.dl-star-card--blue {
  --dl-star-color: #3b82f6;
  --dl-star-speed: 6s;
}

.dl-star-card--violet {
  --dl-star-color: #a855f7;
  --dl-star-speed: 8s;
}

/* Compact download buttons */
.btn-download {
  font-size: 0.9rem;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  white-space: nowrap;
}


/* Download page layout tweaks */
.download-grid {
  row-gap: 1.75rem;
  column-gap: 1.75rem;
}

.dl-inner {
  padding: 24px 22px 20px;
}

/* Right-aligned button area inside cards */
.install-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
}

@media (max-width: 767px) {
  .install-actions {
    justify-content: flex-start;
  }
}
