/* ============================================================
   1XQ.RU — Main Stylesheet (Light theme)
   ============================================================ */

:root {
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-glow: rgba(37, 99, 235, 0.22);
  --accent-light: rgba(37, 99, 235, 0.08);
  --accent-gradient: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);

  --bg-body: #f7f9fc;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f4fa;
  --bg-nav: rgba(255, 255, 255, 0.97);
  --bg-footer: #0B1B3A;
  --bg-dark-section: #eef2f9;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --border-color: #e2e8f0;
  --glass-border: rgba(37, 99, 235, 0.14);
  --glass-bg: rgba(255, 255, 255, 0.9);

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-card: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-glow: 0 8px 30px rgba(37, 99, 235, 0.16);
  --shadow-nav: 0 1px 3px rgba(0,0,0,0.06);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   Base
   ============================================================ */
* { box-sizing: border-box; }

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-primary);
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); }

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; }

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.25; color: var(--text-primary); }

.text-accent { color: var(--accent) !important; }
.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
  background: var(--bg-nav) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
  transition: var(--transition);
  box-shadow: var(--shadow-nav);
}

.navbar-brand {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary) !important;
}

.brand-tagline {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.navbar-nav .nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 8px 16px !important;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--accent) !important;
  background: var(--accent-light);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-accent {
  background: var(--accent-gradient);
  border: none;
  color: #fff !important;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  color: #fff !important;
}

.btn-outline-accent {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent) !important;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: var(--transition);
}

.btn-outline-accent:hover {
  background: var(--accent);
  color: #fff !important;
  transform: translateY(-2px);
}

.btn-glow {
  animation: glowPulse 2s infinite;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25); }
  50% { box-shadow: 0 4px 28px rgba(37, 99, 235, 0.45); }
}

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding: 90px 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-header h2 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

.section-divider {
  width: 48px;
  height: 4px;
  background: var(--accent-gradient);
  border-radius: 2px;
  margin: 12px auto 20px;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #0B1B3A 0%, #132A56 55%, #1D3A72 100%);
  padding-top: 80px;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(37, 99, 235, 0.14) 0%, transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(37, 99, 235, 0.10) 0%, transparent 50%);
  animation: heroBg 20s ease-in-out infinite;
  pointer-events: none;
}

@keyframes heroBg {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(2%, -2%) rotate(1deg); }
  66% { transform: translate(-1%, 1%) rotate(-1deg); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  color: #c7d6f0;
  font-weight: 600;
  margin-bottom: 24px;
  animation: fadeInDown 0.6s ease-out;
}

.hero-badge i { color: #7CB3FF; }

.hero h1 {
  font-size: 3.3rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  color: #ffffff;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, #60A5FA 0%, #93C5FD 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: #b6c2d9;
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 60px;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.hero-stat-item { text-align: center; }
.hero-stat-item .stat-number { font-size: 2rem; font-weight: 800; color: #7CB3FF; }
.hero-stat-item .stat-label { font-size: 0.85rem; color: #8fa3c7; margin-top: 4px; }

/* Hero grid */
.hero-grid {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* Outline button on dark hero */
.hero .btn-outline-accent {
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff !important;
}

.hero .btn-outline-accent:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #0B1B3A !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Service Cards
   ============================================================ */
.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 28px 24px;
  height: 100%;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 3px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.service-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow);
  border-color: var(--accent);
}

.service-card:hover::before { transform: scaleX(1); }

.service-icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 1.4rem;
  color: var(--accent);
  transition: var(--transition);
}

.service-card:hover .service-icon {
  background: var(--accent);
  color: #fff;
  transform: scale(1.08);
}

.service-card h5 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.service-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 0;
}

/* ============================================================
   Stats
   ============================================================ */
.stats-section {
  background: linear-gradient(135deg, #0B1B3A 0%, #132A56 50%, #0B1B3A 100%);
  position: relative;
}

.stats-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, #60A5FA, transparent);
}

.stat-card { text-align: center; padding: 32px 16px; }
.stat-card .stat-icon { font-size: 2rem; color: #7CB3FF; margin-bottom: 16px; }
.stat-card .counter {
  font-size: 2.8rem; font-weight: 800;
  background: linear-gradient(135deg, #60A5FA 0%, #93C5FD 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1; margin-bottom: 8px;
}
.stat-card .stat-title { color: #8fa3c7; font-size: 0.95rem; font-weight: 500; }

/* ============================================================
   Portfolio
   ============================================================ */
.portfolio-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  height: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.portfolio-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow);
  border-color: var(--accent);
}

.portfolio-card img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.portfolio-card:hover img { transform: scale(1.05); }

.portfolio-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0; padding: 20px;
  background: linear-gradient(transparent, rgba(26,29,41,0.85));
  transform: translateY(30%);
  transition: var(--transition);
}

.portfolio-card:hover .portfolio-overlay { transform: translateY(0); }
.portfolio-overlay h5 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; color: #fff; }
.portfolio-overlay span { color: var(--accent); font-size: 0.82rem; font-weight: 500; }

.portfolio-card .placeholder-img {
  display: flex; align-items: center; justify-content: center;
  height: 100%; font-size: 3rem; color: var(--accent);
  background: var(--bg-card);
}

/* ============================================================
   Testimonials
   ============================================================ */
.bg-dark-section { background: var(--bg-dark-section); }

.testimonial-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 28px;
  height: 100%;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 12px; right: 20px;
  font-size: 4rem; line-height: 1;
  color: var(--accent); opacity: 0.12;
  font-family: Georgia, serif;
}

.testimonial-stars { color: #f5a623; margin-bottom: 14px; font-size: 0.85rem; }
.testimonial-text { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.7; margin-bottom: 18px; font-style: italic; }

.testimonial-author { display: flex; align-items: center; gap: 12px; }
.testimonial-author .avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-weight: 700; font-size: 1.1rem; flex-shrink: 0;
}
.testimonial-author .name { font-weight: 600; font-size: 0.92rem; }
.testimonial-author .company { color: var(--text-muted); font-size: 0.8rem; }

/* ============================================================
   Pricing
   ============================================================ */
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 36px 28px;
  height: 100%;
  position: relative;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.pricing-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow);
}

.pricing-card.featured {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(30,136,229,0.04), var(--bg-card));
}

.pricing-card.featured::before {
  content: 'Популярный';
  position: absolute;
  top: 14px; right: 14px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 50px;
}

.pricing-card .pricing-name { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.pricing-card .pricing-desc { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 24px; }
.pricing-card .pricing-amount { font-size: 2.2rem; font-weight: 800; margin-bottom: 4px; }
.pricing-card .pricing-period { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 24px; }

.pricing-card .pricing-features {
  list-style: none; padding: 0; margin: 0 0 28px;
}

.pricing-card .pricing-features li {
  padding: 7px 0; color: var(--text-secondary);
  font-size: 0.88rem; display: flex; align-items: center; gap: 10px;
}

.pricing-card .pricing-features li i { color: var(--accent); font-size: 0.8rem; }

/* ============================================================
   Brief Form
   ============================================================ */
.brief-section {
  background: linear-gradient(135deg, #eef2f9 0%, #e3ebf7 50%, #eef2f9 100%);
  position: relative;
}

.brief-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.brief-form-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 44px;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
}

.form-control, .form-select {
  background-color: var(--bg-body);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-family: var(--font-family);
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  background-color: #fff;
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-control::placeholder { color: var(--text-muted); }

.form-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-check-input {
  background-color: var(--bg-body);
  border-color: var(--border-color);
}

.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  border-color: var(--accent);
}

/* ============================================================
   Blog Cards
   ============================================================ */
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  height: 100%;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow);
  border-color: var(--accent);
}

.blog-card .blog-img { height: 200px; overflow: hidden; }

.blog-card .blog-img .placeholder-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--accent);
  background: var(--bg-card);
}

.blog-card .blog-img img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.blog-card:hover .blog-img img { transform: scale(1.05); }
.blog-card .blog-body { padding: 22px; }

.blog-card .blog-category {
  font-size: 0.78rem; color: var(--accent); font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px;
}

.blog-card .blog-title {
  font-size: 1.05rem; font-weight: 700; margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.blog-card .blog-excerpt {
  color: var(--text-secondary); font-size: 0.88rem; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.blog-card .blog-meta {
  display: flex; gap: 16px; padding: 14px 22px;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem; color: var(--text-muted);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--bg-footer);
  color: #ccc;
  padding: 56px 0 28px;
}

.footer-brand { font-size: 1.4rem; font-weight: 800; color: #fff !important; }

.footer-socials { display: flex; gap: 10px; margin-top: 18px; }

.social-link {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #ccc !important;
  font-size: 1rem;
  transition: var(--transition);
}

.social-link:hover {
  background: var(--accent);
  color: #fff !important;
  transform: translateY(-3px);
}

.max-icon {
  width: 14px;
  height: 14px;
  display: block;
  opacity: 0.8;
  transition: var(--transition);
}

.social-link:hover .max-icon {
  opacity: 1;
  transform: scale(1.1);
}

.site-footer h6 {
  font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 18px; color: #fff;
}

.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 10px; }

.footer-links a {
  color: #888ea0;
  font-size: 0.88rem;
  transition: var(--transition);
}

.footer-links a:hover { color: var(--accent); padding-left: 4px; }

.footer-divider {
  border-color: rgba(255,255,255,0.08);
  margin: 28px 0;
}

.site-footer .text-muted { color: #666e88 !important; }

/* ============================================================
   Калькулятор стоимости
   ============================================================ */
.calc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.calc-step-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.calc-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.calc-type {
  width: 100%;
  background: var(--bg-body);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-family);
}

.calc-type:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
}

.calc-type.active {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.calc-type i {
  font-size: 1.5rem;
  color: var(--accent);
  display: block;
  margin-bottom: 10px;
}

.calc-type-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.calc-type-price {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.calc-option {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: var(--transition);
  background: var(--bg-body);
}

.calc-option:hover {
  border-color: var(--accent);
}

.calc-option .form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

.calc-option .form-check-label {
  cursor: pointer;
  font-size: 0.9rem;
  width: 100%;
}

.calc-summary {
  position: sticky;
  top: 110px;
  background: linear-gradient(135deg, #0B1B3A 0%, #132A56 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 20px 60px rgba(11, 27, 58, 0.35);
}

.calc-summary h5 { color: #fff; }

.calc-summary h5 i { color: #7CB3FF !important; }

.calc-breakdown {
  font-size: 0.88rem;
  color: #b6c2d9;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.calc-row-total {
  font-weight: 700;
  color: #fff;
  border-bottom: none;
  padding-top: 12px;
  font-size: 1.05rem;
}

.calc-total {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #60A5FA 0%, #93C5FD 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (max-width: 991px) {
  .calc-summary { position: static; margin-bottom: 30px; }
}

/* ============================================================
   Scroll to Top
   ============================================================ */
.scroll-top-btn {
  position: fixed; bottom: 104px; right: 28px;
  width: 44px; height: 44px; border: none; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 1.1rem;
  cursor: pointer; opacity: 0; visibility: hidden;
  transition: var(--transition); z-index: 999;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.scroll-top-btn.show { opacity: 1; visibility: visible; }

.scroll-top-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

/* ============================================================
   AI-консультант (чат-виджет)
   ============================================================ */
.ai-chat {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 1040;
}

.ai-chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
  transition: var(--transition);
  position: relative;
}

.ai-chat-toggle:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.5);
}

.ai-chat-toggle-close { display: none; }

.ai-chat.open .ai-chat-toggle-icon { display: none; }
.ai-chat.open .ai-chat-toggle-close { display: block; }
.ai-chat.open .ai-chat-toggle {
  background: var(--text-primary);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.ai-chat-window {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(11, 27, 58, 0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.ai-chat.open .ai-chat-window { display: flex; }

.ai-chat-header {
  background: linear-gradient(135deg, #0B1B3A 0%, #132A56 100%);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #7CB3FF;
  flex-shrink: 0;
}

.ai-chat-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-chat-title strong { font-size: 0.95rem; }

.ai-chat-status {
  font-size: 0.72rem;
  color: #8fa3c7;
}

.ai-chat-status i {
  color: #34D399;
  font-size: 0.5rem;
  vertical-align: middle;
  margin-right: 4px;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg-body);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.55;
  word-wrap: break-word;
  animation: fadeInUp 0.3s ease-out;
}

.ai-msg-bot {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-top-left-radius: 2px;
  align-self: flex-start;
}

.ai-msg-user {
  background: var(--accent);
  color: #fff;
  border-top-right-radius: 2px;
  align-self: flex-end;
}

.ai-msg-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

.ai-msg-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: aiTyping 1.2s infinite;
}

.ai-msg-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-msg-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.ai-chat-quick {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  flex-wrap: wrap;
  background: var(--bg-body);
  border-top: 1px solid var(--border-color);
}

.ai-chat-chip {
  background: var(--accent-light);
  border: 1px solid var(--glass-border);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
}

.ai-chat-chip:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.ai-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}

.ai-chat-input {
  flex: 1;
  border: 1.5px solid var(--border-color);
  border-radius: 50px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-family: var(--font-family);
  outline: none;
  transition: var(--transition);
}

.ai-chat-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.ai-chat-send {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.ai-chat-send:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

@media (max-width: 480px) {
  .ai-chat-window {
    right: -16px;
    width: calc(100vw - 30px);
  }
}

/* ============================================================
   Glass Modal
   ============================================================ */
.glass-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

/* ============================================================
   Accordion
   ============================================================ */
.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  margin-bottom: 6px;
  border-radius: var(--radius-sm) !important;
}

.accordion-button {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: none !important;
}

.accordion-button:not(.collapsed) {
  color: var(--accent);
  background: var(--accent-light);
}

.accordion-button::after {
  background-color: var(--accent);
  mask-size: cover;
}

.accordion-body {
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* ============================================================
   Pagination
   ============================================================ */
.page-link {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-secondary);
  padding: 8px 14px;
}

.page-link:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

.page-item.active .page-link {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ============================================================
   Tables (admin)
   ============================================================ */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-primary);
  --bs-table-border-color: var(--border-color);
}

.table thead th {
  border-bottom: 2px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.table td, .table th {
  border-color: var(--border-color);
  vertical-align: middle;
}

.table > :not(caption) > * > * {
  border-bottom-color: var(--border-color);
}

/* ============================================================
   Alerts
   ============================================================ */
.alert { border-radius: var(--radius-sm); font-size: 0.88rem; }

/* ============================================================
   Blog content (post body)
   ============================================================ */
.blog-content p { margin-bottom: 1.2rem; }

.blog-content h2, .blog-content h3 {
  margin-top: 2rem; margin-bottom: 1rem;
  color: var(--text-primary);
}

.blog-content ul, .blog-content ol {
  margin-bottom: 1.2rem; padding-left: 1.5rem;
  color: var(--text-secondary);
}

.blog-content code {
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
}

.blog-content pre {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow-x: auto;
}

.blog-content img {
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
  max-width: 100%;
}

/* ============================================================
   Badge
   ============================================================ */
.badge { font-weight: 500; padding: 4px 12px; border-radius: 50px; }

/* ============================================================
   Spinner
   ============================================================ */
.spinner-border { vertical-align: middle; }

/* ============================================================
   Buttons outline variants (admin)
   ============================================================ */
.btn-outline-success {
  border: 1.5px solid #28a745;
  color: #28a745;
  background: transparent;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: var(--transition);
}
.btn-outline-success:hover { background: #28a745; color: #fff; }

.btn-outline-danger {
  border: 1.5px solid #dc3545;
  color: #dc3545;
  background: transparent;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: var(--transition);
}
.btn-outline-danger:hover { background: #dc3545; color: #fff; }

.btn-sm { padding: 6px 14px !important; font-size: 0.85rem !important; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 991.98px) {
  .hero h1 { font-size: 2.4rem; }
  .hero-stats { gap: 24px; flex-wrap: wrap; }
  .section-header h2 { font-size: 1.8rem; }
  .brief-form-wrapper { padding: 24px; }
}

@media (max-width: 767.98px) {
  .hero h1 { font-size: 1.9rem; }
  .hero p { font-size: 1rem; }
  .section { padding: 56px 0; }
  .hero-stat-item .stat-number { font-size: 1.5rem; }
  .pricing-card.featured { transform: none; margin-top: 0; }
  .stat-card .counter { font-size: 2rem; }
  .portfolio-card { height: 220px; }
}

@media (max-width: 575.98px) {
  .hero h1 { font-size: 1.6rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .hero-buttons .btn { width: 100%; max-width: 260px; }
  .hero-stats { gap: 12px; }
  .brief-form-wrapper { padding: 16px; }
}
