:root {
  --bg: #0b0b0c;
  --card: #111214;
  --text: #e5e7eb;
  --muted: #9aa3af;
  --brand: #7c3aed;
  --brand-600: #6d28d9;
  --accent: #22d3ee;
  --border: #1f2125;
  --radius: 12px;
  --container: 1200px;

  --keyboard-offset: 0px;
  --chat-height: 100dvh;
}

body.page-locked {
  /* position: fixed;
  width: 100%;
  overflow: hidden; */
}

* {
  box-sizing: border-box;
}
html,
body {
  /* overscroll-behavior: contain; блокує bounce/scroll на мобільних */
  /* touch-action: pan-y; дозволяє тільки вертикальний скрол всередині scrollable блоків */
}
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-top: 64px; /* offset for fixed header */
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(11, 11, 12, 0.7);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f1012;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease,
    transform 0.12s ease;
}
.icon-button:hover {
  background: #151618;
  border-color: #2a2e35;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}
.call-button {
  margin-left: 12px;
}
.brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease,
    transform 0.12s ease;
  border-radius: 10px;
}
.nav-toggle:hover {
  background: #151618;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
}
.nav-menu {
  display: flex;
  list-style: none;
  gap: 24px;
  margin: 0;
  padding: 0;
}
.nav-menu a {
  color: var(--text);
  text-decoration: none;
}
.nav-menu a:hover {
  color: #fff;
}

.hero {
  padding: 72px 0;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(
      1200px 600px at 80% -20%,
      rgba(124, 58, 237, 0.22),
      rgba(124, 58, 237, 0) 60%
    ),
    radial-gradient(
      900px 500px at 10% 0%,
      rgba(34, 211, 238, 0.16),
      rgba(34, 211, 238, 0) 60%
    );
}
.hero-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 32px;
  align-items: center;
}
.hero h1 {
  font-size: 40px;
  line-height: 1.15;
  margin: 0 0 16px;
}
.hero p {
  margin: 0 0 24px;
  color: var(--muted);
}
.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  background: #1a1b1e;
  color: #fff;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease,
    transform 0.12s ease;
}
.button:hover {
  background: #232529;
  border-color: #2a2e35;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}
.button.primary {
  background: var(--brand);
  border-color: var(--brand-600);
}
.button.primary:hover {
  background: var(--brand-600);
  box-shadow: 0 8px 18px rgba(124, 58, 237, 0.35);
  transform: translateY(-1px);
}
.button.full {
  width: 100%;
}
.button .icon {
  margin-right: 8px;
}

.placeholder {
  background: linear-gradient(180deg, #151618, #0e0f11);
  border: 1px dashed #2a2e35;
  border-radius: var(--radius);
  color: var(--muted);
  display: grid;
  place-items: center;
  min-height: 220px;
}
.media-card {
  min-height: 320px;
}
.media-illustration {
  width: 100%;
  height: auto;
  max-height: 380px;
  object-fit: contain;
}
.hero-steps {
  margin-top: 16px;
}
.hero-steps .steps li {
  padding: 14px;
}

/* Timeline Steps (HTML replacement for image) */
.timeline-steps {
  position: relative;
  padding-left: 64px;
  padding-right: 12px;
  width: 100%;
}
.timeline-spine {
  position: absolute;
  left: 32px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
  opacity: 0.9;
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease,
    transform 0.12s ease;
}
.timeline-item:hover {
  background: #151618;
  border-color: #2a2e35;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--brand), var(--accent));
  box-shadow: 0 0 0 2px #0b0b0c;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 30px;
  width: 56px;
  height: 28px;
  border-radius: 999px;
  background: #0f1012;
  border: 1px solid #2a2e35;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.step-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.step-title {
  font-weight: 600;
  font-size: 18px;
  line-height: 1.2;
}
.step-desc {
  color: var(--muted);
  font-size: 15px;
}
.timeline-item .arrow {
  color: var(--brand);
  font-size: 16px;
  transition: transform 0.2s ease;
}
.timeline-item:hover .arrow {
  transform: translateX(2px);
}

@media (max-width: 900px) {
  .timeline-steps {
    padding-left: 52px;
  }
  .timeline-spine {
    left: 26px;
  }
  .timeline-item {
    grid-template-columns: 56px 1fr;
  }
  .step-title {
    font-size: 17px;
  }
}

.section-title {
  font-size: 28px;
  margin: 10px 0 16px;
  color: white;
}
.lead {
  color: var(--muted);
  margin: 0 0 24px;
}

.grid {
  display: grid;
  gap: 20px;
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.feature,
.card,
.solution-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.feature-icon {
  font-size: 24px;
}
.card.highlighted {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand) inset;
  position: relative;
}
.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

/* Integrations Section */
.integrations-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.integrations-title {
  font-size: 20px;
  margin: 0 0 16px;
  color: var(--text);
}
.integrations-logos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.integration-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #0f1012;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: background 0.2s ease;
}
.integration-item:hover {
  background: #151618;
}
/* Icon box and sizes */
.integration-logo {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}
.integration-logo img,
.integration-logo svg {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
}
/* Make local black icons appear white, keep external already-white icons untouched */
.integration-logo img[src^="public/icons/"] {
  filter: brightness(0) invert(1);
}
.integration-item span {
  font-size: 13px;
  color: var(--text);
}
.integrations-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.steps li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.steps h3 {
  margin: 0 0 6px;
}

.stats {
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat .num {
  font-size: 26px;
  font-weight: 700;
}
.stat .label {
  color: var(--muted);
}
.ceo-quote {
  margin-top: 20px;
  color: var(--muted);
  font-style: italic;
}

.center {
  text-align: center;
  margin-top: 12px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.contact-form {
  display: grid;
  gap: 12px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  background: #0f1012;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  padding: 10px 12px;
  outline: none;
  font-size: 16px;
}
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.25);
}
.form-status {
  margin-top: 8px;
  min-height: 20px;
  color: var(--accent);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal[aria-hidden="false"] {
  display: flex;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(1px);
}
.modal-dialog {
  position: relative;
  width: min(560px, calc(100% - 32px));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.modal-close {
  position: absolute;
  top: 6px;
  right: 6px;
  height: 28px;
  width: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1012;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease,
    transform 0.12s ease;
}
.modal-close:hover {
  background: #151618;
  border-color: #2a2e35;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .nav-toggle {
    display: block;
  }
  .nav-menu {
    display: none;
  }
  .media-card {
    min-height: 460px;
  }
  .media-illustration {
    max-height: none;
  }
  .timeline-spine {
    height: 100%;
    top: 0;
    bottom: auto;
  }
}

/* Mobile nav dialog overrides */
.mobile-nav-dialog {
  width: min(420px, calc(100% - 48px));
}
.mobile-nav-links {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
  display: grid;
  gap: 10px;
}
.mobile-nav-links a {
  display: block;
  background: #0f1012;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease,
    transform 0.12s ease;
}
.mobile-nav-links a:hover {
  background: #151618;
  border-color: #2a2e35;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.why {
  margin-bottom: 20px;
}

/* Pricing Table */
.pricing-table {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 24px;
}
.pricing-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: #0f1012;
  border-bottom: 1px solid var(--border);
}
.pricing-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-bottom: 1px solid var(--border);
}
.pricing-row:last-child {
  border-bottom: none;
}
.pricing-criteria {
  padding: 16px;
  font-weight: 500;
}
.pricing-option {
  padding: 16px;
  text-align: center;
  font-weight: 600;
}
.pricing-option.highlighted {
  background: rgba(124, 58, 237, 0.1);
  color: var(--brand);
}
.pricing-value {
  padding: 16px;
  text-align: center;
  color: var(--muted);
}
.pricing-row .pricing-value:last-child {
  color: var(--accent);
  font-weight: 500;
}

@media (max-width: 900px) {
  .pricing-header,
  .pricing-row {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .pricing-criteria,
  .pricing-option,
  .pricing-value {
    padding: 10px 6px;
    font-size: 12px;
  }
}

/* Pricing Tiers */
.pricing-tiers {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.pricing-tiers-title {
  font-size: 20px;
  margin: 0 0 20px;
  color: var(--text);
}
.tiers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.tier-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tier-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.tier-card.highlighted {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand) inset;
}
.tier-header {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: nowrap;
  margin-bottom: 0;
}
.tier-name {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.tier-price {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 0px;
  color: var(--brand);
}
.tier-price {
  font-size: 16px;
  font-weight: 600;
  color: var(--brand);
}
.tier-features {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tier-features li {
  padding: 6px 0;
  color: var(--muted);
  font-size: 14px;
  position: relative;
  padding-left: 16px;
}
.tier-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 900px) {
  .tiers-grid {
    grid-template-columns: 1fr;
  }
}

/* FAQ Section */
.faq {
  padding: 72px 0;
  background: var(--bg);
}
.faq-list {
  width: 100%;
}
.faq-item {
  margin-bottom: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.faq-question {
  width: 100%;
  padding: 20px;
  background: none;
  border: none;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s ease;
}
.faq-question:hover {
  background: rgba(255, 255, 255, 0.02);
}
.faq-question[aria-expanded="true"] {
  background: rgba(124, 58, 237, 0.05);
}
.faq-icon {
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 16px;
}
.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(180deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-answer.open {
  max-height: 500px;
}
.faq-answer p {
  padding: 20px 20px 20px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

/* Chat Styles (New Addition) */
.chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 99;
  border: none;
}

.chat-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.35);
}

/* Базове положення модалки чату (десктоп) */
#chat-modal {
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  pointer-events: auto;
}

/* Бекдроп прозоро з’являється */
#chat-modal .modal-backdrop {
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#chat-modal[aria-hidden="false"] .modal-backdrop {
  opacity: 1;
}

/* Панель чату справа (десктоп) */
#chat-modal .modal-dialog {
  margin: 0;
  width: 35%;
  min-width: 320px;
  max-width: 500px;
  height: 100vh;
  border-radius: 0;
  transform: translateX(100%);
  transition: transform 0.3s ease-out;
  display: flex;
  flex-direction: column;
  padding: 12px;
}

#chat-modal.open .modal-dialog {
  transform: translateX(0);
}

.chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: #0f1012;
  border: 1px solid var(--border);
  border-radius: 10px;
  -webkit-overflow-scrolling: touch;
}

.message {
  margin-bottom: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  word-wrap: break-word;
  max-width: 80%;
  width: fit-content;
}

.user-message {
  background: var(--brand);
  color: #fff;
  margin-left: auto;
}

.bot-message {
  background: #151618;
  color: var(--text);
}

/* Форма вводу + адаптивний відступ під клавіатуру (iOS/Android) */
.chat-form {
  transform: translateY(calc(var(--keyboard-offset, 0px) * -1));
  display: flex;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: calc(var(--keyboard-offset, 0px));
}

.chat-form input {
  flex: 1;
  background: #0f1012;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  padding: 8px 10px;
  outline: none;
}

.chat-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.25);
}

.chat-form button {
  padding: 0 12px;
}

/* Індикатор "друкує..." */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  max-width: 80%;
  margin-right: auto;
}

.dot {
  width: 8px;
  height: 8px;
  background: var(--muted);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}

.dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-6px);
  }
}

#chat-modal .chat-messages {
  /* overflow-y: auto; */
  /* -webkit-overflow-scrolling: touch; */
  /* overscroll-behavior: contain; */
  /* touch-action: pan-y; */
}

#chat-modal {
  touch-action: auto;
}

/* === MOBILE CHAT FULLSCREEN VARIANT B === */
@media (max-width: 768px) {
  #chat-modal {
    justify-content: flex-end;
    align-items: flex-end;
    height: 100dvh;
  }

  #chat-modal .modal-dialog {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 100dvh !important; /* <-- ГОЛОВНЕ ВИПРАВЛЕННЯ */
    max-height: none !important;
    border-radius: 0 !important;
    padding: 8px 8px 0 8px;

    display: flex;
    flex-direction: column;

    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.4, 1);
  }

  #chat-modal.open .modal-dialog {
    transform: translateY(0);
  }

  .chat-messages {
    flex: 1 1 auto;
    padding: 12px 12px 8px 12px;
    margin: 0;
    border-radius: 8px 8px 0 0;
    background: #0f1012;
  }

  .chat-form {
    padding: 10px 8px 14px 8px;
    background: var(--card);
    border-top: 1px solid var(--border);
    margin: 0;
    flex-shrink: 0;
    transform: translateY(calc(var(--keyboard-offset, 0px) * -1));
    margin-bottom: calc(var(--keyboard-offset, 0px));
  }
  @supports (padding: env(safe-area-inset-bottom)) {
    #chat-modal .modal-dialog {
      padding-bottom: env(safe-area-inset-bottom);
    }

    .chat-form {
      padding-bottom: calc(env(safe-area-inset-bottom) + 8px) !important;
    }
  }
}

.no-scroll {
  position: fixed;
  overflow: hidden;
  height: 100vh;
}