:root {
  --bg: #ffffff;
  --bg-alt: #f4f8f5;          
  --text: #16201a;            
  --muted: #5a6b60;           
  --line: #dde8e0;            
  --accent: #059669;          
  --accent-dark: #047857;     
  --radius: 14px;
  --shadow: 0 4px 20px rgba(16, 40, 24, .07);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 760px; }
.center { text-align: center; }
img { max-width: 100%; display: block; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--text); }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.lang-switch {
  background: none; border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; font-size: .85rem; cursor: pointer; color: var(--muted);
}
.lang-switch:hover { color: var(--text); border-color: #c4d6cb; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font-size: .95rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .1s, border-color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: #c4d6cb; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-block { width: 100%; }

/* hero */
.hero { padding: clamp(56px, 9vw, 110px) 0 clamp(40px, 6vw, 70px); }
.hero-inner { max-width: 820px; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 720px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 20px; }
.hero-actions.center { justify-content: center; }
.hero-badges { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-badges li {
  font-size: .85rem; color: var(--muted);
  background: var(--bg-alt); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px;
}

/* sections */
.section { padding: clamp(48px, 7vw, 90px) 0; }
.section-alt { background: var(--bg-alt); }
.section-sub { color: var(--muted); max-width: 640px; margin: 0 0 32px; }

/* grid & cards */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .nav { display: none; }
}

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card-icon { font-size: 1.6rem; margin-bottom: 10px; }
.service h3 { margin-top: 0; }

/* cases (на главной) */
.case { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.case-img { aspect-ratio: 16/10; object-fit: cover; width: 100%; background: var(--bg-alt); }
.case-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: .78rem; color: var(--muted); background: var(--bg-alt);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}
.case-link { margin-top: auto; font-weight: 600; color: var(--accent); text-decoration: none; }
.case-link:hover { text-decoration: underline; }

/* process */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.steps li { display: flex; gap: 16px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.step-num {
  flex: 0 0 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.steps h3 { margin: 0 0 4px; }
.steps p { margin: 0; color: var(--muted); }

/* pricing */
.price { position: relative; display: flex; flex-direction: column; }
.price.featured { border-color: var(--accent); box-shadow: 0 8px 30px rgba(5, 150, 105, .14); }
.badge {
  position: absolute; top: -12px; left: 20px;
  background: var(--accent); color: #fff; font-size: .75rem; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
}
.price-desc { color: var(--muted); flex: 1; }
.price-amount { font-size: 1.5rem; font-weight: 800; margin: 10px 0 18px; }

/* faq */
.faq { display: grid; gap: 10px; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.faq-item summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; float: right; color: var(--muted); }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin: 12px 0 0; color: var(--muted); }

/* final cta */
.cta-final { background: linear-gradient(180deg, #ffffff, #eef7f1); }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: .9rem; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal[aria-hidden="false"] { display: block; }
.modal-overlay { position: absolute; inset: 0; background: rgba(16, 32, 24, .45); }
.modal-box {
  position: relative; max-width: 480px; margin: 8vh auto 0; background: #fff;
  border-radius: 16px; padding: 28px; box-shadow: 0 20px 60px rgba(16, 40, 24, .25);
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute; top: 14px; right: 16px; background: none; border: none;
  font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer;
}
.modal-sub { color: var(--muted); margin-top: -6px; }

form label { display: block; margin-bottom: 14px; font-size: .9rem; font-weight: 600; }
form input, form textarea {
  width: 100%; margin-top: 6px; padding: 11px 13px; font: inherit;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text);
}
form input:focus, form textarea:focus { outline: 2px solid rgba(5, 150, 105, .35); border-color: var(--accent); }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; }
.form-note { font-size: .78rem; color: var(--muted); margin: 10px 0 0; text-align: center; }
.form-status { min-height: 1.2em; font-size: .9rem; margin: 10px 0 0; text-align: center; }
.form-status.success { color: #047857; }
.form-status.error { color: #b91c1c; }

/* Success Screen */
.modal-success { text-align: center; padding: 10px 0; animation: pop .2s ease-out; }
.success-icon { font-size: 3rem; margin-bottom: 10px; line-height: 1; }
.modal-success h3 { margin-bottom: 10px; color: var(--accent); }
.modal-success p { color: var(--muted); margin-bottom: 24px; }

/* Валидация полей */
input.invalid, textarea.invalid {
  border-color: #b91c1c !important;
  background-color: #fef2f2 !important;
}
input.invalid:focus, textarea.invalid:focus {
  outline: 2px solid rgba(185, 28, 28, .35) !important;
  border-color: #b91c1c !important;
}

/* ---------- Страница кейса ---------- */
.case-hero { padding-bottom: 30px; }
.back-link {
  display: inline-block; margin-bottom: 18px; color: var(--muted);
  text-decoration: none; font-size: .9rem;
}
.back-link:hover { color: var(--text); }

.case-tags { margin-top: 16px; }

.case-screenshot { padding-top: 0; }

/* ---------- Галерея скриншотов на странице кейса ---------- */
.main-img-wrapper {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  background: var(--bg-alt);
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.case-main-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: block;
  cursor: zoom-in; /* Курсор-лупа */
}

.case-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.thumb-wrapper {
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.thumb-wrapper:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(16, 40, 24, 0.15);
}

.case-thumb {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  cursor: zoom-in; /* Курсор-лупа */
  border-radius: 6px;
}

@media (max-width: 640px) {
  .case-gallery { grid-template-columns: 1fr; }
}

/* Растягиваем последнюю картинку на всю ширину, если их нечётное количество (для страницы грузоперевозок) */
.case-gallery .thumb-wrapper:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  aspect-ratio: 21 / 9;
}

.case-features h3 { margin-top: 0; }

.case-results { padding-left: 20px; margin: 0; }
.case-results li { margin-bottom: 10px; color: var(--muted); }
.case-results li::marker { color: var(--accent); }

.case-tech { display: grid; gap: 10px; }
.case-tech div {
  padding: 12px 16px; background: var(--bg-alt);
  border: 1px solid var(--line); border-radius: 10px;
}

/* ---------- Лайтбокс для скриншотов ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox[aria-hidden="false"] {
  display: flex;
}
.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(16, 32, 24, 0.9);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
}
.lightbox-img {
  position: relative;
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 1;
  animation: lightbox-pop 0.2s ease-out;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
@keyframes lightbox-pop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}