:root {
  --bg: #f5f7fa;
  --bg-light: #ffffff;
  --accent: #2563eb;
  --accent-soft: #e0edff;
  --text-main: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--accent);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  z-index: 1000;
}

.skip-link:focus {
  top: 0;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.section {
  padding: 64px 0;
}

.section-light {
  background: var(--bg-light);
}

.section-accent {
  background: var(--accent);
  color: #fff;
}

/* Focus states */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.back-to-top:hover {
  opacity: 1;
}

.back-to-top:active {
  transform: scale(0.95);
}

/* Typography */
h1 {
  font-size: 32px;
  margin: 0 0 16px;
}

h2 {
  font-size: 24px;
  margin: 0 0 16px;
}

h3 {
  font-size: 18px;
  margin: 0 0 8px;
}

.page-intro {
  color: var(--text-muted);
  max-width: 640px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn-light {
  background: #fff;
  color: var(--accent);
}

.submit-spinner {
  display: none;
}

.btn.loading .submit-text {
  visibility: hidden;
}

.btn.loading .submit-spinner {
  display: inline;
}

/* Header */
.site-header {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.logo-img {
  height: 32px;
}

.logo-text {
  font-weight: 700;
}

.main-nav {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-left: auto;
}

.nav-link {
  color: var(--text-muted);
  font-size: 14px;
}

.nav-link:hover {
  color: var(--text-main);
  text-decoration: none;
}

.nav-link-primary {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
}

.nav-link-primary:hover {
  text-decoration: none;
  background: #1d4ed8;
  color: #fff;
}

/* Mobile nav */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  margin-left: auto;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 8px 16px 16px;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
}

.mobile-nav .nav-link {
  padding: 6px 0;
}

/* Hero */
.hero {
  padding: 64px 0 48px;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

.hero-subtitle {
  color: var(--text-muted);
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 8px;
}

.hero-note {
  font-size: 14px;
  color: var(--text-muted);
}

/* Cards, grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.card {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
}

/* CTA */
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Cases */
.case-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: 24px;
  margin-top: 32px;
  background: var(--bg-light);
  border-radius: 16px;
  padding: 20px;
}

.case-content ul {
  padding-left: 20px;
}

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 14px 0;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  padding-right: 16px;
}

.faq-answer p {
  margin: 0 0 16px;
}

/* Blog */
.post-card {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.post-meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 32px;
}

.contact-form {
  background: var(--bg-light);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.form-group {
  margin-bottom: 14px;
}

label {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

input,
select,
textarea {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: inherit;
}

textarea {
  resize: vertical;
}

.form-note {
  font-size: 12px;
  color: var(--text-muted);
}

/* Form enhancements */
.form-feedback {
  font-size: 12px;
  margin-top: 4px;
  min-height: 16px;
}

.form-feedback.error {
  color: #dc3545;
}

.form-feedback.success {
  color: #28a745;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
  border-color: #dc3545;
}

.form-group.success input,
.form-group.success select,
.form-group.success textarea {
  border-color: #28a745;
}

.form-message {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  display: none;
}

.form-message.success {
  background: #d4edda;
  color: #155724;
}

.form-message.error {
  background: #f8d7da;
  color: #721c24;
}

/* Pricing */
.pricing-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.pricing-card {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border);
  text-align: center;
}

.pricing-card h3 {
  margin-top: 0;
  font-size: 20px;
}

.price {
  font-size: 24px;
  font-weight: bold;
  margin: 16px 0;
  color: var(--accent);
}

.pricing-card ul {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.pricing-card li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.pricing-card li:last-child {
  border-bottom: none;
}

.pricing-note {
  margin-top: 32px;
  padding: 16px;
  background: var(--accent-soft);
  border-radius: 8px;
}

/* About */
.about-content h2 {
  margin-top: 32px;
}

.about-content ul {
  padding-left: 20px;
}

.about-content li {
  margin-bottom: 8px;
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #e5e7eb;
  margin-top: 40px;
  padding-top: 0;
  overflow-x: hidden;
}

.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr 1fr max-content;
  gap: 24px;
  padding: 16px 16px 8px;
  align-items: start;
}

.footer-col {
  min-width: 0;
}

.footer-logo {
  margin: 0;
  padding: 0;
}

.footer-logo-img {
  display: block;
  width: 100%;
  max-width: 160px;
  height: auto;
}

.footer-title {
  font-size: 16px;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 10px;
  padding-top: 0;
  color: #fff;
}

.footer-text {
  line-height: 1.5;
  margin: 0;
  color: #9ca3af;
  font-size: 14px;
}

/* Все ссылки и текстовые элементы в колонках футера — одинаковый интервал */
.footer-col a,
.footer-col span {
  display: block;
  margin-bottom: 8px;
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.2s;
  font-size: 14px;
}

.footer-col a:hover {
  color: #fff;
  text-decoration: none;
}

/* Два подстолбца в навигации футера */
.footer-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 80px;
}

.no-wrap {
  white-space: nowrap !important;
}

.footer-bottom {
  border-top: 1px solid #1f2937;
  padding: 12px 0;
  font-size: 12px;
  color: #6b7280;
  text-align: center;
  margin-top: 0;
}

.footer-bottom p {
  margin: 0;
}

/* ================================
   Responsive
   ================================ */

/* Планшеты (до 992px) */
@media (max-width: 992px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px 20px;
  }
}

/* Мобильные (до 768px) */
@media (max-width: 768px) {
  .main-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
    margin-left: auto;
  }

  .header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
  }

  .hero-inner,
  .case-card,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .footer-logo-img {
    max-width: 130px;
  }
}

/* Смартфоны (до 480px) */
@media (max-width: 480px) {
  .site-footer .container {
    padding-left: 0;
    padding-right: 0;
  }

  .footer-col:not(:first-child) {
    padding-left: 16px;
    padding-right: 16px;
  }

  .footer-inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-top: 0;
    padding-bottom: 16px;
  }

  .footer-logo {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .footer-logo-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
  }
}
