:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1f2937;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gradient: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
  --shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
  --radius: 16px;
  --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-icon { font-size: 1.5rem; }
.highlight { color: var(--accent); }

.nav {
  display: none;
  gap: 24px;
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.nav a:hover { color: var(--accent); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-toggle {
  display: block;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.6);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover { color: var(--accent); }

.btn-large {
  padding: 16px 32px;
  font-size: 1.1rem;
}

/* Hero */
.hero {
  padding: 80px 0;
  background: radial-gradient(ellipse at top, rgba(59,130,246,0.15), transparent 70%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  padding: 8px 16px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 580px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius);
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.hero-cta { margin-bottom: 24px; }

.small-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.trust-badges span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Terminal Mockup */
.mockup-terminal {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.1);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.terminal-title {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.terminal-body {
  padding: 24px;
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  line-height: 1.8;
}

.terminal-body code { color: var(--text-secondary); }
.terminal-body .success { color: var(--success); }
.terminal-body .num { color: var(--accent); font-weight: 600; }
.terminal-body .highlight { color: var(--warning); font-weight: 700; }
.terminal-body .recommendation { color: var(--success); font-weight: 600; }

/* Sections */
section { padding: 80px 0; }

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 56px;
}

.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 16px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Story Section */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.story-card {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.05);
}

.story-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.story-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.story-card p { color: var(--text-secondary); }

.process-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  background: var(--bg-card);
  border-radius: 12px;
  min-width: 140px;
}

.flow-step.highlight {
  border: 2px solid var(--accent);
  background: rgba(59, 130, 246, 0.1);
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.flow-arrow {
  font-size: 1.5rem;
  color: var(--text-secondary);
}

/* Features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.05);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.feature-card p { color: var(--text-secondary); }

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: start;
}

.pricing-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  border: 2px solid transparent;
  transition: var(--transition);
}

.pricing-card.featured {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(59,130,246,0.1), var(--bg-card));
  position: relative;
}

.pricing-card.featured::before {
  content: "Популярный";
  position: absolute;
  top: -12px;
  right: 24px;
  background: var(--accent);
  color: white;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
}

.pricing-header { margin-bottom: 24px; }

.pricing-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(255,255,255,0.1);
  margin-bottom: 12px;
}

.pricing-badge.popular {
  background: var(--accent);
  color: white;
}

.pricing-price {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.pricing-period {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.pricing-desc {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.pricing-features {
  list-style: none;
  margin-bottom: 24px;
}

.pricing-features li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.pricing-features li:last-child { border-bottom: none; }
.pricing-features li.disabled { color: var(--text-secondary); opacity: 0.6; }

.pricing-footer {
  text-align: center;
  margin-top: 32px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Reviews */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.review-card {
  background: var(--bg-card);
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.05);
}

.review-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.review-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.review-rating { color: var(--warning); }
.review-card p { color: var(--text-secondary); }

/* =========================================
   📰 NEWS SECTION (С КАРТИНКАМИ И FALLBACK)
   ========================================= */
#news-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.news-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 12px 30px -5px rgba(59, 130, 246, 0.25);
}

/* Контейнер картинки */
.news-image {
  height: 190px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Фоллбэк-иконка (показывается если картинки нет или она не загрузилась) */
.news-image::after {
  content: "📰";
  font-size: 3.5rem;
  opacity: 0.4;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Сама картинка */
.news-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  transition: transform 0.4s ease;
}

.news-image img:hover {
  transform: scale(1.05);
}

/* Скрываем фоллбэк, если картинка загрузилась успешно */
.news-image.has-image::after { display: none; }

/* Контент карточки */
.news-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.news-card h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-primary);
}

.news-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 16px;
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s ease;
}

.news-link:hover {
  color: var(--accent-hover);
  gap: 10px;
}

/* Состояния загрузки и ошибки */
.news-loading,
.news-fallback {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius);
  color: var(--text-secondary);
}

.news-loading .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(59,130,246,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.news-fallback a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 20px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 10px;
  transition: background 0.2s;
}

.news-fallback a:hover {
  background: rgba(59, 130, 246, 0.2);
}

/* CTA Section */
.cta-section {
  background: radial-gradient(ellipse at bottom, rgba(59,130,246,0.2), transparent 70%);
}

.cta-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
  border: 1px solid rgba(255,255,255,0.1);
}

.cta-card h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  margin-bottom: 16px;
}

.cta-card p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 32px;
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 24px;
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  padding: 64px 0 24px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand p {
  color: var(--text-secondary);
  margin: 16px 0 24px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links h4 {
  font-size: 1rem;
  margin-bottom: 16px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover { color: var(--accent); }

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.05);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  animation: slideIn 0.3s ease;
}

.toast.hidden { display: none; }

@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: var(--shadow);
  max-width: 400px;
}

.toast-icon { font-size: 1.5rem; }
.toast-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  margin-left: auto;
}

/* Responsive */
@media (min-width: 768px) {
  .nav { display: flex; }
  .mobile-toggle { display: none; }
  .hero-grid { grid-template-columns: 1.2fr 1fr; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

@media (max-width: 767px) {
  .header-inner { flex-wrap: wrap; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .pricing-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-buttons { flex-direction: column; }
  #news-container { grid-template-columns: 1fr; }
  .news-image { height: 160px; }
}

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
/* Блок для картинок новостей */
.news-image {
    height: 190px;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
}

.news-image img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    z-index: 2;
}

.news-image:hover img { transform: scale(1.05); }

/* Фоллбэк-эмодзи (показывается если картинки нет или она не загрузилась) */
.news-image::after {
    content: "📰";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.5rem;
    opacity: 0.4;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Скрываем фоллбэк когда картинка загрузилась успешно */
.news-image.has-image::after { display: none; }

/* Состояние загрузки и ошибки */
.news-loading, .news-fallback {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px;
    background: var(--bg-card);
    border: 2px dashed rgba(255,255,255,0.1);
    border-radius: var(--radius);
    color: var(--text-secondary);
}
.news-loading .spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(59,130,246,0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.news-fallback a { color: var(--accent); text-decoration: none; font-weight: 600; }
.news-fallback a:hover { text-decoration: underline; }