/* ═══════════════════════════════════════════
   KAIF VPN — Общие стили (Remnawave style)
   ═══════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0d1117;
  --bg-card:     #161b22;
  --bg-card2:    #1c2330;
  --border:      rgba(255, 255, 255, 0.07);
  --border-h:    rgba(255, 255, 255, 0.14);
  --accent:      #00d4e0;
  --accent-dim:  rgba(0, 212, 224, 0.15);
  --accent-glow: rgba(0, 212, 224, 0.35);
  --green:       #22c55e;
  --green-dim:   rgba(34, 197, 94, 0.15);
  --red:         #ef4444;
  --red-dim:     rgba(239, 68, 68, 0.15);
  --text:        #e6edf3;
  --text-muted:  #7d8590;
  --text-sub:    #94a3b8;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Скроллбар ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 3px; }

/* ── Типографика ── */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; }

/* ── Logo ── */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo-icon {
  width: 36px; height: 36px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  font-size: 1.1rem;
}

/* ── Карточка ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card:hover { border-color: var(--border-h); }

/* ── Кнопки ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover:not(:disabled) {
  background: #00e8f5;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-h);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.btn-ghost {
  background: var(--bg-card2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--border-h); }

.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-sm); }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-full { width: 100%; }

/* ── Badge-статус ── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-green { background: var(--green-dim); color: var(--green); }
.badge-red   { background: var(--red-dim); color: var(--red); }
.badge-cyan  { background: var(--accent-dim); color: var(--accent); }

.badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Input ── */
.input-wrap { position: relative; }

.input-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

input[type="text"], input[type="number"] {
  width: 100%;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px 11px 40px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.18s;
}

input[type="text"]:focus, input[type="number"]:focus {
  border-color: var(--accent);
}

input[type="text"]::placeholder, input[type="number"]::placeholder {
  color: var(--text-muted);
}

/* ── Разделитель ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ── Текст ── */
.text-muted  { color: var(--text-muted); }
.text-sub    { color: var(--text-sub); }
.text-accent { color: var(--accent); }
.text-green  { color: var(--green); }
.text-sm     { font-size: 0.85rem; }
.text-xs     { font-size: 0.78rem; }
.text-center { text-align: center; }

/* ── Flex helpers ── */
.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* ── Спиннер ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 0.88rem;
  min-width: 240px;
  box-shadow: var(--shadow);
  animation: slide-in 0.25s ease;
}
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error   { border-color: var(--red);   color: var(--red);   }

@keyframes slide-in {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ═══════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════ */

/* ── Header nav на мобильных ── */
@media (max-width: 700px) {
  .header-nav .nav-links { display: none !important; }
  .header-nav { gap: 8px; }
}

/* ── Общие мобильные поправки ── */
@media (max-width: 600px) {
  html { font-size: 15px; }

  input[type="text"], input[type="number"] {
    font-size: 16px; /* предотвращает зум на iOS */
  }

  .btn { padding: 12px 18px; }
  .btn-lg { padding: 13px 20px; font-size: .95rem; }

  .card { padding: 16px; }
}

/* ── index.html / buy page ── */
@media (max-width: 580px) {
  .days-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .method-cards { flex-direction: column !important; }
  .method-card { width: 100% !important; }
  .summary-section { padding: 18px !important; }
  .tg-tabs { font-size: .8rem; }
  .tg-tab { padding: 9px 6px; font-size: .8rem; }
}

/* ── landing.html ── */
@media (max-width: 700px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .features-grid { grid-template-columns: 1fr !important; }
  .geo-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .prices-grid { grid-template-columns: 1fr !important; }
  .referral-grid { grid-template-columns: 1fr !important; }
  .top-list { gap: 10px !important; }
  .top-item { padding: 14px !important; }
  .cta-section h2 { font-size: 1.5rem !important; }
  .cta-buttons { flex-direction: column !important; align-items: stretch !important; }
  .cta-buttons a { text-align: center; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.8rem !important; }
  .section-header h2 { font-size: 1.4rem !important; }
  .price-card { padding: 20px !important; }
  .price-amount { font-size: 2rem !important; }
}

/* ═══════════════════════════════════════════
   SAFARI iOS — КРИТИЧЕСКИЙ ФИХ
   position:sticky + backdrop-filter на одном элементе = белый экран на iOS Safari
   Убираем blur на мобильных, заменяем непрозрачным фоном.
   !important нужен чтобы перебить inline <style> блоки на каждой странице.
   ═══════════════════════════════════════════ */

/* z-index хедера должен быть выше nav-overlay (z-index:150) на всех страницах.
   На главной уже z-index:220, на других страницах было z-index:100 — overlay
   перекрывал дравер и поглощал клики по ссылкам. */
header {
  z-index: 200 !important;
}

@media (max-width: 900px) {
  header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(13, 17, 23, 0.98) !important;
  }
  /* на landing.html blur стоит на ::before — тоже убираем */
  header::before {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* ── Touch-оптимизации ── */
body { -webkit-tap-highlight-color: transparent; }
.btn, button, a { touch-action: manipulation; }
