/* Дизайн-система: функциональный минимализм (нейтральная база, 1px-границы, один акцент) */
:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --text: #111214;
  --text-muted: #5c6370;
  --border: #e2e5e9;
  --accent: #1976d2;
  --accent-hover: #1565c0;
  --accent-soft: #e8f1fc;
  --success: #2e7d32;
  --footer-bg: #1a1c1f;
  --footer-text: #e2e5e9;
  --radius: 6px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max-measure: 70ch;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

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

/* ——— Шапка ——— */
.header-s {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: var(--space-7) var(--space-4);
  margin: 0;
}

.header-s .header-title {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: var(--space-3);
}

.header-s p {
  font-size: 1.05rem;
  max-width: 40rem;
  margin: 0 auto;
  color: var(--text-muted);
}

/* ——— Навигация ——— */
.navbar {
  background-color: var(--surface) !important;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  padding: var(--space-2) 0;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.navbar .navbar-brand {
  font-weight: 700;
  color: var(--text) !important;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.navbar-nav .nav-link {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text) !important;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  position: relative;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus-visible {
  color: var(--accent) !important;
  background-color: var(--accent-soft);
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-link[aria-current="page"] {
  color: var(--accent) !important;
  background-color: transparent;
  border-radius: 0;
}

/* Десктопное подчёркивание пункта меню */
.navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  left: var(--space-3);
  right: var(--space-3);
  bottom: 4px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease;
  border-radius: 1px;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link:focus-visible::after {
  transform: scaleX(1);
}

.navbar-nav .nav-link.active::after,
.navbar-nav .nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

.navbar-toggler {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  color: var(--text);
}

.navbar-toggler:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-soft), 0 0 0 4px var(--accent);
}

/* Иконка-бургер: явный SVG, не зависит от navbar-light */
.navbar-toggler-icon {
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  vertical-align: middle;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23111214' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ——— Хлебные крошки ——— */
.breadcrumbs {
  padding: var(--space-4) 0 0;
}

.breadcrumbs .breadcrumb {
  background: transparent;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
}

.breadcrumbs .breadcrumb-item a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs .breadcrumb-item a:hover,
.breadcrumbs .breadcrumb-item a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.breadcrumbs .breadcrumb-item.active {
  color: var(--text);
}

.breadcrumbs .breadcrumb-item + .breadcrumb-item::before {
  color: var(--text-muted);
}

/* ——— Секции ——— */
section {
  padding: var(--space-7) var(--space-4);
}

section.bg-light,
.bg-light {
  background-color: var(--bg) !important;
}

section h1,
section h2,
main h1,
main h2 {
  color: var(--text);
  margin-bottom: var(--space-5);
  font-weight: 650;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

main h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 700;
  margin-top: var(--space-5);
  margin-bottom: var(--space-3);
}

section h3,
main h3 {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: var(--space-5);
  margin-bottom: var(--space-3);
}

section h4,
main h4 {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

.lead-block {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: var(--max-measure);
  margin-bottom: var(--space-5);
}

.prose p {
  max-width: var(--max-measure);
  margin-bottom: var(--space-4);
}

.highlight {
  color: var(--accent);
  font-weight: 650;
  font-size: 1.1rem;
  max-width: var(--max-measure);
}

.text-muted {
  color: var(--text-muted) !important;
}

/* ——— Карточки и панели ——— */
.panel,
.contact-card,
.case-card,
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.case-card h3,
.faq-item h3,
.faq-item h4 {
  margin-top: 0;
}

.faq-item p:last-child {
  margin-bottom: 0;
}

/* ——— Список преимуществ ——— */
.features {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 52rem;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  margin-bottom: 0;
}

.feature-item .feature-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  color: var(--accent);
}

.feature-item span {
  flex: 1;
  font-size: 0.95rem;
  max-width: var(--max-measure);
}

/* ——— Галерея ——— */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.image-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease;
  cursor: pointer;
  background: var(--surface);
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
}

.image-item:hover,
.image-item:focus-visible {
  border-color: var(--accent);
}

.image-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.image-item img {
  width: 100%;
  height: auto;
  display: block;
}

.image-item .caption {
  padding: var(--space-3);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ——— Комплектация ——— */
.download-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-3);
  border-radius: var(--radius);
  max-width: 40rem;
  font-size: 0.95rem;
}

/* ——— Шаги (reestr / support_bot) ——— */
.soft__steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: flex-start;
  align-items: stretch;
  margin-top: var(--space-5);
}

.soft__steps-item {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 400;
  padding: var(--space-5);
  flex: 1 1 260px;
  min-width: 0;
  max-width: 400px;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-shadow: none;
  transition: border-color 0.15s ease;
}

.soft__steps-item:hover {
  transform: none;
  border-color: var(--accent);
  box-shadow: none;
}

.soft__steps-number {
  display: block;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
  color: var(--accent);
  text-align: left;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.soft__steps-info {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.soft__steps-timing {
  display: block;
  font-size: 0.9rem;
  margin-top: var(--space-2);
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.soft__steps-title {
  font-size: 1.05rem;
  font-weight: 650;
  display: block;
  margin-bottom: var(--space-2);
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.soft__steps-light {
  color: var(--text) !important;
  opacity: 1;
}

.end_step {
  background-color: var(--accent-soft);
  border-color: var(--accent);
}

/* Карточки-вопросы (support_bot): без верхнего регистра, как заголовок */
.soft__steps-item > .soft__steps-number.is-question {
  text-transform: none;
  font-size: 1rem;
  letter-spacing: 0;
  font-weight: 650;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.soft__steps-item > .soft__steps-number.is-question::after {
  width: 32px;
  margin-top: 8px;
}

/* ——— Контакты ——— */
#contacts .contact-card {
  max-width: 40rem;
}

.email-link,
.text-success.fw-bold {
  color: var(--success) !important;
  font-weight: 650;
  font-size: 1.05rem;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
}

/* ——— Кнопки ——— */
.btn {
  border-radius: var(--radius);
  font-weight: 550;
  font-size: 0.925rem;
  padding: 0.5rem 1.15rem;
}

.btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-hover);
  --bs-btn-hover-border-color: var(--accent-hover);
  --bs-btn-active-bg: var(--accent-hover);
  --bs-btn-active-border-color: var(--accent-hover);
  --bs-btn-focus-shadow-rgb: 25, 118, 210;
}

.btn-outline-primary {
  --bs-btn-color: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent);
  --bs-btn-hover-border-color: var(--accent);
  --bs-btn-active-bg: var(--accent);
  --bs-btn-active-border-color: var(--accent);
}

.btn-outline-secondary {
  --bs-btn-color: var(--text);
  --bs-btn-border-color: var(--border);
  --bs-btn-hover-bg: var(--bg);
  --bs-btn-hover-border-color: var(--text-muted);
  --bs-btn-hover-color: var(--text);
  --bs-btn-active-bg: var(--bg);
  --bs-btn-active-border-color: var(--text-muted);
  --bs-btn-active-color: var(--text);
}

/* ——— Модальное окно галереи ——— */
.modal .modal-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-3);
}

.modal .modal-body {
  padding: var(--space-4);
  background: #0f1114;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(70vh, 720px);
}

.modal img {
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

@media (min-width: 992px) {
  .modal-xl,
  #img_modal .modal-dialog {
    max-width: min(96vw, 1600px);
    width: min(96vw, 1600px);
  }
}

@media (max-width: 991.98px) {
  #img_modal.modal-fullscreen-sm-down .modal-dialog {
    max-width: 100vw;
    margin: 0;
    min-height: 100vh;
  }

  #img_modal.modal-fullscreen-sm-down .modal-content {
    min-height: 100vh;
    border-radius: 0;
    border: none;
  }

  #img_modal.modal-fullscreen-sm-down .modal-body {
    min-height: calc(100vh - 56px);
    padding: var(--space-3);
  }

  #img_modal.modal-fullscreen-sm-down img {
    max-height: calc(100vh - 5rem);
  }
}

/* ——— Системные требования ——— */
.req-panel {
  max-width: 40rem;
}

.req-panel h3 {
  margin-top: 0;
  margin-bottom: var(--space-4);
}

.req-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.req-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 0.95rem;
  line-height: 1.5;
}

.req-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent);
}

/* ——— Лёгкая игривость: акценты и микроанимации ——— */
.header-s .header-title {
  background: linear-gradient(90deg, var(--text) 0%, var(--accent) 55%, #0d47a1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

@supports not (background-clip: text) {
  .header-s .header-title {
    color: var(--text);
    -webkit-text-fill-color: currentColor;
    background: none;
  }
}

.feature-item {
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.feature-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.feature-item .feature-icon {
  transition: transform 0.2s ease, color 0.2s ease;
}

.feature-item:hover .feature-icon {
  transform: scale(1.15);
  color: var(--accent-hover);
}

.download-item {
  transition: border-left-color 0.2s ease, background-color 0.2s ease;
}

.download-item:hover {
  background: var(--accent-soft);
  border-left-color: var(--accent-hover);
}

.btn {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.soft__steps-item {
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.soft__steps-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.soft__steps-number {
  position: relative;
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.soft__steps-number::after {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  margin-top: 6px;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.2s ease;
}

.soft__steps-item:hover .soft__steps-number::after {
  width: 48px;
}

.end_step .soft__steps-number::after {
  background: var(--accent-hover);
}

.image-item {
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.image-item:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.case-card {
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.case-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .feature-item,
  .feature-item .feature-icon,
  .download-item,
  .btn,
  .soft__steps-item,
  .soft__steps-number::after,
  .image-item,
  .case-card,
  .navbar-nav .nav-link::after {
    transition: none !important;
    transform: none !important;
  }
}

/* ——— Футер ——— */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  padding: var(--space-6) var(--space-4);
  margin-top: var(--space-7);
  border-top: 1px solid #2a2d32;
}

footer p {
  margin: var(--space-2) 0;
  opacity: 0.85;
  font-size: 0.9rem;
}

footer a {
  color: #90caf9;
}

/* ——— Cookie-баннер ——— */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1080;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--space-4) var(--space-5);
  display: none;
  box-shadow: 0 -4px 16px rgba(17, 18, 20, 0.08);
}

.cookie-banner.is-visible {
  display: block;
}

.cookie-banner .cookie-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  justify-content: space-between;
}

.cookie-banner p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
  flex: 1;
  min-width: 240px;
  max-width: 48rem;
}

.cookie-banner .cookie-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-shrink: 0;
}

/* ——— Служебное ——— */
main {
  display: block;
}

.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background: var(--accent);
  color: #fff;
  padding: var(--space-2) var(--space-4);
}

.skip-link:focus {
  left: var(--space-4);
  top: var(--space-2);
}

/* Числа и даты */
.num,
.tabular {
  font-variant-numeric: tabular-nums;
}

/* ——— Адаптив ——— */
@media (max-width: 991.98px) {
  /* Раскрытое мобильное меню: чистый список без «рамок» и подчёркиваний */
  .navbar-collapse {
    border-top: 1px solid var(--border);
    margin-top: var(--space-3);
    padding-top: var(--space-2);
  }

  .navbar-nav {
    gap: 2px;
    padding-top: var(--space-1);
    padding-bottom: var(--space-2);
  }

  .navbar-nav .nav-link {
    padding: 10px var(--space-3);
    border-radius: var(--radius);
    border-bottom: none;
    box-shadow: none !important;
  }

  .navbar-nav .nav-link::after {
    display: none;
  }

  .navbar-nav .nav-link:hover,
  .navbar-nav .nav-link:focus-visible {
    background-color: var(--accent-soft);
  }

  .navbar-nav .nav-link.active,
  .navbar-nav .nav-link[aria-current="page"] {
    background-color: var(--accent-soft);
    color: var(--accent) !important;
    border-radius: var(--radius);
    box-shadow: none !important;
    font-weight: 600;
  }

  .navbar-nav .nav-link.active::after,
  .navbar-nav .nav-link[aria-current="page"]::after {
    display: none;
  }
}

@media (max-width: 768px) {
  .header-s {
    padding: var(--space-6) var(--space-4);
  }

  .header-s .header-title {
    font-size: 1.5rem;
  }

  .header-s p {
    font-size: 0.95rem;
  }

  section {
    padding: var(--space-6) var(--space-4);
  }

  .feature-item {
    flex-direction: column;
    gap: var(--space-2);
  }

  .soft__steps-item {
    max-width: none;
    min-width: 0;
    flex: 1 1 100%;
    width: 100%;
    padding: var(--space-4);
  }

  .soft__steps {
    gap: var(--space-3);
  }

  .soft__steps-number,
  .soft__steps-item > .soft__steps-number.is-question {
    font-size: 0.95rem;
    letter-spacing: 0;
  }

  .soft__steps-title {
    font-size: 1rem;
  }

  .soft__steps-info,
  .soft__steps-timing {
    font-size: 0.925rem;
  }

  .soft__steps-item .soft__steps-title_mobile-big {
    font-size: 1.05rem;
  }

  .cookie-banner .cookie-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-banner .cookie-actions {
    justify-content: stretch;
  }

  .cookie-banner .cookie-actions .btn {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
