/* ==================== КОРНЕВЫЕ ПЕРЕМЕННЫЕ ==================== */
:root {
  /* Предполагаемые переменные, адаптируйте под ваш файл variables.css */
  /* --card-bg: ...; */
  /* --radius-lg: ...; */
  /* --radius-md: ...; */
  /* --radius-sm: ...; */
  /* --text-primary: ...; */
  /* --text-secondary: ...; */
  /* --accent: ...; */
  /* --accent-light: ...; */

  /* Переменная для эффекта рассеивания у логотипов клиентов */
  --mask-fade-size: 55%;
}

/* ==================== ОСНОВНОЙ КОНТЕНТ ==================== */
main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

/* ==================== ОСНОВНАЯ СЕТКА КОНТАКТОВ ==================== */
.contact-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  width: 100%;
  margin-bottom: 60px;
  position: relative; /* Для абсолютного позиционирования ссылок */
}

/* ==================== ЛЕВЫЙ БЛОК — КОНТАКТЫ + ФОРМА ==================== */
.contact-info {
  flex: 1 1 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 30px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
}

/* Скрытие заголовка h1 для SEO */
.contact-info h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.contact-info h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.2rem;
  color: var(--text-primary);
  margin-bottom: 16px;
  background: white;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}

.contact-info p.contact-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 30px;
  line-height: 1.6;
  text-align: center;
}

/* ==================== ФОРМА ==================== */
.callback-form {
  background: #050b14;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 25px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

input, select {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.2);
  background: rgba(0, 229, 255, 0.08);
}

input.error, select.error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.error-message {
  color: #ef4444;
  font-size: 0.85rem;
  margin-top: 6px;
  display: block;
}

/* ==================== ПЕРЕКЛЮЧАТЕЛЬ СОГЛАСИЯ ==================== */
.consent-container {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 20px 0;
  padding: 15px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.consent-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  flex-shrink: 0;
}

.consent-checkbox {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.consent-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #4a5568; /* Серый по умолчанию */
  transition: .3s;
  border-radius: 24px;
}

.consent-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.consent-checkbox:checked + .consent-slider {
  background-color: #3b82f6; /* Синий при активации */
}

.consent-checkbox:checked + .consent-slider:before {
  transform: translateX(20px);
}

.consent-checkbox:focus + .consent-slider {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.consent-text {
  margin: 0;
  color: #e2e8f0;
  font-size: 0.95rem;
  line-height: 1.5;
  flex: 1;
}

.consent-text a {
  color: #59DEFA;
  text-decoration: none;
  border-bottom: 1px dotted #59DEFA;
}

.consent-text a:hover {
  border-bottom: 1px solid #59DEFA;
}

/* ==================== КНОПКА ОТПРАВКИ ==================== */
.submit-btn {
  width: 100%;
  padding: 16px; /* Используем значение из предыдущего стиля */
  font-size: 1.1rem; /* Используем значение из предыдущего стиля */
  font-weight: 600;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); /* Используем значение из предыдущего стиля */
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4); /* Используем значение из предыдущего стиля */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* Стили для состояния по умолчанию (когда disabled через JS) */
  opacity: 0.7;
  pointer-events: none;
}

.submit-btn:hover:not(:disabled) {
  box-shadow: 0 6px 15px rgba(0, 229, 255, 0.5);
  transform: translateY(-2px);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(0, 229, 255, 0.3);
}

.submit-btn:enabled {
  opacity: 1;
  pointer-events: all;
}

.submit-btn:disabled {
  background: #cccccc;
  color: #666666;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  opacity: 0.5; /* Переопределяем для состояния disabled */
}

/* Стиль спиннера */
.spinner {
  display: inline-block;
  width: 18px; /* Используем размер из .submit-btn */
  height: 18px; /* Используем размер из .submit-btn */
  border: 2px solid #000; /* Используем цвет из предыдущего .spinner */
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  /* Скрыто по умолчанию */
  display: none;
}

.submit-btn:disabled .spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==================== ПРАВЫЙ БЛОК — ФОТО И КОНТАКТЫ ==================== */
.contact-image-wrapper {
  flex: 2 1 400px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.contact-image {
  flex-grow: 1;
  min-height: 400px;
  background: url('/assets/Contacts/20250903_0614_Futuristic BIZON Reception_simple_compose_01k46j72ksejnvd6p4jce7g1ww.png') no-repeat center center;
  background-size: cover;
  position: relative;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.contact-image::before {
  content: "";
  position: absolute;
  inset: 0;
  /* Градиент снизу вверх, затемняющий только нижнюю часть */
  background: linear-gradient(0deg, rgba(15, 22, 41, 0.4) 0%, rgba(15, 22, 41, 0.2) 30%, transparent 60%);
  z-index: 1;
  border-radius: inherit; /* Наследует скругление от родителя */
}

/* ==================== ССЫЛКИ НА МЕССЕНДЖЕРЫ НА ФОТО ==================== */
/* Абсолютное позиционирование внутри .contact-image-wrapper */
.contact-links-below-image {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  z-index: 2;
  padding: 0 10px;
  width: 100%;
  justify-content: center;
}

/* Стили для ссылок на фото */
.contact-link--below {
  width: auto;
  padding: 10px 20px;
  background: rgba(15, 22, 41, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.contact-link--below:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--accent);
  box-shadow: 0 6px 15px rgba(0, 229, 255, 0.4);
  transform: translateY(-2px);
}

/* Стили для иконок в ссылках на фото */
.contact-link--below svg {
  width: 24px;
  height: 24px;
  min-width: 24px;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
  transition: filter 0.3s ease;
}

.contact-link--below:hover svg {
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.8));
}

/* ==================== СЕКЦИЯ КЛИЕНТОВ ==================== */
.clients {
  width: 100%;
  text-align: center;
  margin-bottom: 60px;
  padding: 0 20px;
  box-sizing: border-box;
}

.clients h2 {
  font-size: 1.8rem;
  margin-bottom: 30px;
  color: var(--text-primary);
}

.clients-track {
  overflow: hidden;
  /* Используем переменную для гибкой настройки */
  mask-image: linear-gradient(
    to right,
    transparent,
    black var(--mask-fade-size),
    black calc(100% - var(--mask-fade-size)),
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black var(--mask-fade-size),
    black calc(100% - var(--mask-fade-size)),
    transparent
  );
}

.clients-track-inner {
  display: flex;
  width: max-content;
  animation: scroll 30s linear infinite;
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.client-logo {
  height: 60px;
  margin: 0 30px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  filter: grayscale(100%);
}

.client-logo:hover {
  opacity: 1;
  filter: grayscale(0%);
}

/* ==================== АДАПТИВ ==================== */
@media (max-width: 992px) {
  .contact-layout {
    flex-direction: column;
    align-items: center;
  }

  .contact-info,
  .contact-image-wrapper {
    flex: 1 1 auto;
    width: 100%;
    max-width: 600px;
  }

  .contact-image {
    display: none;
  }

  .contact-image-wrapper {
    position: relative;
  }

  .contact-links-below-image {
    position: absolute;
  }

  .clients h2 {
    font-size: 1.5rem;
  }

  .client-logo {
    height: 50px;
    margin: 0 20px;
  }
}

@media (max-width: 768px) {
  .contact-links-below-image {
    bottom: 15px;
    gap: 12px;
  }

  .contact-link--below {
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  .contact-link--below svg {
    width: 20px;
    height: 20px;
  }

  /* Адаптация переключателя согласия */
  .consent-container {
    flex-direction: row; /* Убедимся, что элементы в ряд */
    gap: 12px;
    padding: 12px;
  }

  .consent-text {
    font-size: 0.9rem;
  }

  /* Адаптация изображения */
  .contact-image {
    min-height: 200px;
    /* display: none;  Убрано, так как противоречит основной логике блока */
  }
}

@media (max-width: 576px) {
  main {
    padding: 15px;
  }

  .contact-info {
    padding: 25px 15px;
  }

  .contact-info h2 {
    font-size: 1.8rem;
  }

  .contact-info p.contact-subtitle {
    font-size: 1rem;
    margin-bottom: 25px;
  }

  .callback-form {
    padding: 20px;
  }

  input,
  select {
    padding: 12px 14px;
  }

  .submit-btn {
    padding: 14px;
    font-size: 1rem;
  }

  .contact-links-below-image {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    bottom: 10px;
  }

  .contact-link--below {
    width: 80%;
    max-width: 250px;
    justify-content: center;
  }

  .clients {
    margin-bottom: 40px;
    padding: 0 10px;
  }

  .clients h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
  }

  .client-logo {
    height: 40px;
    margin: 0 15px;
  }
}