/* --- Global Settings & Variables --- */
:root {
  --color-primary: #2d3142; /* Deep Indigo */
  --color-accent: #ef8354; /* Vibrant Coral */
  --color-bg: #f9fafc; /* Off-White */
  --color-text: #4f5d75; /* Grey Blue */
  --color-white: #ffffff;

  --font-main: 'Inter', sans-serif;
  --font-heading: 'Montserrat', sans-serif;

  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1);

  --transition: all 0.3s ease;
  --container-width: 1200px;
  --header-height: 80px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 16px;
  padding-top: var(--header-height); /* Компенсация фикс. хедера */
}

ul {
  list-style: none;
}

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

img {
  max-width: 100%;
  display: block;
}

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

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  background-color: var(--color-accent);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  border: 2px solid var(--color-accent);
  transition: var(--transition);
}

.btn:hover {
  background-color: transparent;
  color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.header__container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--color-primary);
}

.header__logo-img {
  height: 40px;
  width: 40px;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 40px;
}

.header__menu {
  display: flex;
  gap: 30px;
}

.header__link {
  font-weight: 500;
  color: var(--color-primary);
  position: relative;
}

.header__link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-accent);
  transition: var(--transition);
}

.header__link:hover::after {
  width: 100%;
}

.header__burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-primary);
}

/* --- Mobile Menu Logic --- */
@media (max-width: 992px) {
  .header__burger {
    display: block;
  }

  .header__nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background-color: var(--color-white);
    flex-direction: column;
    padding: 40px 20px;
    box-shadow: var(--shadow-md);
    transform: translateY(-150%);
    transition: var(--transition);
    z-index: 999;
  }

  .header__nav.active {
    transform: translateY(0);
  }

  .header__menu {
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
  }
}

/* --- Footer --- */
.footer {
  background-color: var(--color-primary);
  color: #bfc0c5;
  padding: 60px 0 20px;
  margin-top: 60px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-white);
  margin-bottom: 20px;
}

.footer__desc {
  font-size: 0.9rem;
  max-width: 300px;
}

.footer__title {
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: 600;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.footer__list li {
  margin-bottom: 12px;
}

.footer__link:hover {
  color: var(--color-accent);
  padding-left: 5px;
}

.footer__contacts li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 15px;
  font-size: 0.95rem;
}

.footer__contacts i {
  color: var(--color-accent);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
}

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

/* --- Hero Section --- */
.hero {
  position: relative;
  padding: 60px 0 100px;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 70% 30%, rgba(239, 131, 84, 0.1) 0%, transparent 60%);
}

.hero__container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 2;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: rgba(45, 49, 66, 0.05);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 24px;
  border: 1px solid rgba(45, 49, 66, 0.1);
}

.hero__title {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  line-height: 1.1;
  color: var(--color-primary);
  margin-bottom: 24px;
}

.text-accent {
  color: var(--color-accent);
}

.hero__desc {
  font-size: 1.15rem;
  color: var(--color-text);
  margin-bottom: 40px;
  max-width: 500px;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 30px;
}

.hero__stat {
  display: flex;
  flex-direction: column;
}

.hero__stat-num {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--color-primary);
}

.hero__stat-text {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Three.js Container */
.hero__visual {
  width: 100%;
  height: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Scroll Indicator */
.hero__scroll {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--color-primary);
  opacity: 0.6;
  animation: bounce 2s infinite;
  z-index: 2;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* Responsive */
@media (max-width: 992px) {
  .hero__container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__visual {
    height: 400px;
    order: -1; /* Візуал зверху на мобільному */
  }

  .hero__content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero__desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__title {
    font-size: 2.5rem;
  }
}

@media (max-width: 576px) {
  .hero__title {
    font-size: 2rem;
  }

  .hero__actions {
    flex-direction: column;
    gap: 20px;
  }
}

/* --- Common Section Styles --- */
.section {
  padding: 100px 0;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--color-primary);
  margin-bottom: 20px;
  line-height: 1.2;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--color-text);
  opacity: 0.8;
  max-width: 600px;
}

/* --- About Section (Asymmetric) --- */
.about__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: flex-start;
}

.about__lead {
  font-size: 1.25rem;
  line-height: 1.6;
  margin-bottom: 40px;
}

.about__stats-row {
  display: flex;
  gap: 60px;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid rgba(45, 49, 66, 0.1);
}

.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-accent);
}

.stat-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-primary);
}

.about__details {
  padding-top: 20px;
}

.feature-row {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
}

.feature-row:last-child {
  margin-bottom: 0;
}

.feature-icon {
  min-width: 32px; /* Фікс ширини, щоб не сплющувалась */
  width: 32px;
  height: 32px;
  color: var(--color-accent);
}

.feature-row h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--color-primary);
}

/* --- Methodology Section (Flow) --- */
.section-header {
  margin-bottom: 80px;
  text-align: left; /* Вирівнювання по лівому краю виглядає сучасніше */
}

.steps-wrapper {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.steps-line {
  position: absolute;
  top: 0;
  left: 28px; /* Центр номера (приблизно) */
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, var(--color-accent) 0%, rgba(239, 131, 84, 0.1) 100%);
  z-index: 0;
}

.step {
  position: relative;
  display: flex;
  gap: 50px;
  margin-bottom: 80px;
  z-index: 1;
}

.step:last-child {
  margin-bottom: 0;
}

.step__number {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  background-color: var(--color-bg); /* Щоб перекрити лінію */
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-primary);
}

.step__content {
  padding-top: 10px;
}

.step__content h3 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: var(--color-primary);
}

.step__content p {
  font-size: 1.1rem;
  color: var(--color-text);
  margin-bottom: 20px;
  max-width: 600px;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--color-accent);
  border-bottom: 1px solid transparent;
}

.link-arrow:hover {
  border-bottom-color: var(--color-accent);
  gap: 12px;
}

/* --- Responsive --- */
@media (max-width: 992px) {
  .about__layout {
    grid-template-columns: 1fr;
    gap: 50px;
  }

  .about__stats-row {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .section-title {
    font-size: 2rem;
  }

  .steps-line {
    left: 20px;
  }

  .step {
    gap: 20px;
  }

  .step__number {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

/* --- Reviews Section --- */
.reviews {
  background-color: var(--color-primary); /* Темний фон для контрасту */
  color: var(--color-white);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.reviews__wrapper {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  padding: 40px 0;
}

.reviews__icon {
  margin-bottom: 30px;
  color: var(--color-accent);
}

.reviews__icon svg {
  width: 48px;
  height: 48px;
  fill: var(--color-accent); /* Заливка іконки */
}

.reviews__slider {
  position: relative;
  min-height: 250px; /* Резервуємо місце під текст */
}

.review-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.review-slide.active {
  position: relative;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.review-text {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  line-height: 1.4;
  margin-bottom: 40px;
  font-weight: 500;
}

.review-author {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.author-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-accent);
}

.author-role {
  font-size: 0.9rem;
  opacity: 0.7;
}

.reviews__controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 50px;
}

.review-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--color-white);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.review-btn:hover {
  border-color: var(--color-accent);
  background-color: var(--color-accent);
}

/* --- FAQ Section --- */
.faq__container {
  max-width: 800px; /* Вужчий контейнер для зручності читання */
}

.faq__list {
  margin-top: 40px;
  border-top: 1px solid rgba(45, 49, 66, 0.1);
}

.faq__item {
  border-bottom: 1px solid rgba(45, 49, 66, 0.1);
}

.faq__question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-primary);
  transition: color 0.3s ease;
}

.faq__question:hover {
  color: var(--color-accent);
}

.faq__icon {
  transition: transform 0.3s ease;
  color: var(--color-accent);
}

.faq__item.active .faq__icon {
  transform: rotate(45deg); /* Плюс стає хрестиком */
}

.faq__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
}

.faq__content {
  padding-bottom: 24px;
  color: var(--color-text);
  line-height: 1.6;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .review-text {
    font-size: 1.3rem;
  }
}

/* --- Contact Section --- */
.contact__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.contact__desc {
  font-size: 1.15rem;
  margin-bottom: 40px;
  color: var(--color-text);
}

.contact__details {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact__item {
  display: flex;
  align-items: center;
  gap: 15px;
  font-weight: 500;
  color: var(--color-primary);
}

/* --- Form Styling (Minimalist) --- */
.contact__form-wrapper {
  position: relative;
}

.form-group {
  position: relative;
  margin-bottom: 30px;
}

.form-input {
  width: 100%;
  padding: 12px 0;
  font-size: 1rem;
  color: var(--color-primary);
  border: none;
  border-bottom: 1px solid rgba(45, 49, 66, 0.2);
  background: transparent;
  outline: none;
  transition: border-color 0.3s ease;
  border-radius: 0; /* Прибирає дефолтні стилі iOS */
}

.form-input:focus {
  border-bottom-color: var(--color-accent);
}

/* Floating Label Logic */
.form-label {
  position: absolute;
  top: 12px;
  left: 0;
  font-size: 1rem;
  color: #999;
  pointer-events: none;
  transition: 0.3s ease all;
}

.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label {
  top: -12px;
  font-size: 0.8rem;
  color: var(--color-accent);
}

/* Error styles */
.error-msg {
  display: block;
  font-size: 0.75rem;
  color: #e74c3c;
  margin-top: 5px;
  opacity: 0;
  transform: translateY(-5px);
  transition: 0.3s;
}

.form-group.error .form-input {
  border-bottom-color: #e74c3c;
}

.form-group.error .error-msg {
  opacity: 1;
  transform: translateY(0);
}

/* Captcha */
.captcha-group {
  display: flex;
  align-items: baseline;
  gap: 20px;
  flex-wrap: wrap;
}

.captcha-label {
  font-weight: 600;
  color: var(--color-primary);
}

.captcha-input {
  width: 60px;
  text-align: center;
}

/* Checkbox */
.form-checkbox {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 30px;
  font-size: 0.85rem;
  color: var(--color-text);
}

.form-checkbox input {
  margin-top: 3px;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.form-checkbox a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Button Loader */
.contact__btn {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.loader {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-bottom-color: transparent;
  border-radius: 50%;
  animation: rotation 1s linear infinite;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.contact__btn.loading .btn-text {
  display: none;
}

.contact__btn.loading .loader {
  display: block;
}

/* Success Message */
.success-message {
  display: none;
  text-align: center;
  padding: 40px;
  background-color: #f0fff4;
  border-radius: 8px;
  animation: fadeIn 0.5s ease;
}

.success-icon {
  width: 60px;
  height: 60px;
  background-color: #27ae60;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 992px) {
  .contact__layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}


/* --- Cookie Banner --- */
.cookie-banner {
    position: fixed;
    bottom: -100px; /* Скрыт изначально */
    left: 20px;
    right: 20px;
    max-width: 500px; /* Не на всю ширину на десктопе */
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    transition: bottom 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.cookie-banner.show {
    bottom: 20px;
}

.cookie-content p {
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.cookie-content a {
    color: var(--color-accent);
    text-decoration: underline;
}

.cookie-btn {
    background-color: var(--color-white);
    color: var(--color-primary);
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    white-space: nowrap;
}

.cookie-btn:hover {
    background-color: var(--color-accent);
    color: var(--color-white);
}

/* --- Legal Pages Styles (Текстовые страницы) --- */
/* Используется для privacy.html, terms.html и т.д. */

.pages {
    padding: 120px 0 80px; /* Отступ сверху больше из-за хедера */
    min-height: 80vh;
}

.pages .container {
    max-width: 800px; /* Узкая колонка для удобного чтения */
}

.pages h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--color-accent); /* Акцентная линия */
}

.pages h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-top: 40px;
    margin-bottom: 15px;
}

.pages p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--color-text);
    margin-bottom: 20px;
}

.pages ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.pages li {
    position: relative;
    padding-left: 15px;
    margin-bottom: 10px;
    color: var(--color-text);
}

.pages li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: bold;
}

.pages a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.pages a:hover {
    color: var(--color-primary);
}

.pages strong {
    color: var(--color-primary);
    font-weight: 600;
}

/* Адаптив для Cookie и страниц */
@media (max-width: 576px) {
    .cookie-banner {
        flex-direction: column;
        align-items: flex-start;
        left: 10px;
        right: 10px;
        bottom: -200px;
    }
    
    .cookie-banner.show {
        bottom: 10px;
    }
    
    .cookie-btn {
        width: 100%;
    }

    .pages h1 {
        font-size: 2rem;
    }
}