/* ------------------ Глобальные стили ------------------ */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

/* -------------- Темная тема + переменные -------------- */
:root {
  --bg-body: #1a2d23;
  --text-color: #e8f3e5;
  --glass-bg: rgba(26, 45, 35, 0.85);
  --glass-border: rgba(124, 169, 130, 0.4);
  --nav-active-bg: #7ca982;
  --nav-active-text: #e8f3e5;
  --field-bg: rgba(26, 45, 35, 0.9);
  --field-text: #e8f3e5;
  --placeholder: rgba(232, 243, 229, 0.6);
}

/* ------------------ Глобальные стили ------------------ */
body {
  background: var(--bg-body);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  min-height: 100vh;
  color: var(--text-color);
  transition: background 0.3s ease, color 0.3s ease;
  overflow-wrap: break-word;
}

/* Фиксированный фон поверх body: одинаковое поведение ПК/мобилки */
.site-bg {
  position: fixed;
  inset: 0;
  background: url("/static/images/Background_2.png") center center / cover no-repeat;
  z-index: -1;
  will-change: transform;
}

/* Мобильный фон */
@media (max-width: 768px) {
  .site-bg {
    background-image: url("/static/images/Background_mobile.png");
    background-position: top center; /* фиксируем композицию сверху */
    background-size: contain; /* избегаем растягивания при скролле */
    background-repeat: no-repeat;
    background-color: var(--bg-body);
  }
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ---------- Стекло ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border) !important;
  border-radius: 12px;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px 0 rgba(36, 62, 54, 0.1);
  padding: 2rem;
  margin: 1rem auto;
  max-width: 900px;
  color: var(--text-color);
  transition: background 0.3s, border-color 0.3s;
}


/* Мобильная адаптация для стеклянных блоков */
@media (max-width: 768px) {
  .glass {
    margin: 0.5rem;
    padding: 1.5rem;
    border-radius: 8px;
  }
}

@media (max-width: 480px) {
  .glass {
    margin: 0.25rem;
    padding: 1rem;
    border-radius: 6px;
  }
}

/* Адаптация фона для мобильных устройств */
/* Удалены принудительные mobile-override для background у body, фон теперь в .site-bg */

/* Адаптация заголовков для мобильных */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem !important;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
  h2 {
    font-size: 2rem !important;
    line-height: 1.3;
  }
  h3 {
    font-size: 1.5rem !important;
    line-height: 1.4;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem !important;
  }
  h2 {
    font-size: 1.75rem !important;
  }
  h3 {
    font-size: 1.25rem !important;
  }
}

/* ---------- Поля форм ---------- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="datetime-local"],
select,
textarea {
  background: var(--field-bg) !important;
  color: var(--field-text) !important;
  caret-color: var(--field-text);
  font-size: 16px; /* Предотвращает зум на iOS */
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder) !important;
}

/* Мобильная адаптация для форм */
@media (max-width: 480px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="datetime-local"],
  select,
  textarea {
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
  }
}





/* ---------- Кнопки ---------- */
.btn, .btn:visited, .btn:active, .btn:focus {
  text-decoration: none !important;
}
a.btn, a.btn:visited, a.btn:active, a.btn:focus {
  text-decoration: none !important;
}

.btn {
  position: relative;
  z-index: 1;
  overflow: hidden;
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
  border-radius: 10px;
  border: none;
  padding: 0.67rem 1.22rem;
  margin: 0.15rem 0;
  font-weight: 700;
  font-size: 1.04rem;
  box-sizing: border-box;
  cursor: pointer;
  transition: background 0.28s, color 0.28s, box-shadow 0.23s, filter 0.14s, transform 0.14s cubic-bezier(.42,1.52,.5,.98);
  box-shadow: 0 2px 10px 0 #7ca98244, 0 1.5px 8px #0002;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  outline: none;
  user-select: none;
  min-height: 44px; /* Минимальная высота для touch-устройств */
}

/* Контурная кнопка */
.btn-outline {
  background: transparent !important;
  color: var(--nav-active-bg) !important;
  border: 2px solid var(--nav-active-bg) !important;
  box-shadow: 0 2px 10px 0 rgba(124, 169, 130, 0.2), 0 1.5px 8px rgba(0, 0, 0, 0.1) !important;
}

.btn-outline:hover {
  background: var(--nav-active-bg) !important;
  color: var(--nav-active-text) !important;
  transform: scale(1.051);
  box-shadow: 0 8px 26px 0 #b4e19744, 0 2px 12px #0002 !important;
}

/* Кнопка Telegram */
.btn-telegram {
  background: #0088cc !important;
  color: white !important;
  border: 2px solid #0088cc !important;
  box-shadow: 0 2px 10px 0 rgba(0, 136, 204, 0.3), 0 1.5px 8px rgba(0, 0, 0, 0.1) !important;
}

.btn-telegram:hover {
  background: #0077b3 !important;
  border-color: #0077b3 !important;
  transform: scale(1.051);
  box-shadow: 0 8px 26px 0 rgba(0, 136, 204, 0.4), 0 2px 12px rgba(0, 0, 0, 0.1) !important;
}

/* Кнопка WhatsApp */
.btn-whatsapp {
  background: #25d366 !important;
  color: white !important;
  border: 2px solid #25d366 !important;
  box-shadow: 0 2px 10px 0 rgba(37, 211, 102, 0.3), 0 1.5px 8px rgba(0, 0, 0, 0.1) !important;
}

.btn-whatsapp:hover {
  background: #20ba5a !important;
  border-color: #20ba5a !important;
  transform: scale(1.051);
  box-shadow: 0 8px 26px 0 rgba(37, 211, 102, 0.4), 0 2px 12px rgba(0, 0, 0, 0.1) !important;
}

.btn::before {
  content: "";
  position: absolute;
  top: -40%;
  left: -30%;
  width: 160%;
  height: 180%;
  background: radial-gradient(circle at 50% 30%, #b4e19766 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.32s;
  z-index: 2;
  pointer-events: none;
}

.btn:hover::before,
.btn:focus::before {
  opacity: 1;
}
.btn:hover, .btn:focus {
  filter: brightness(1.085) saturate(1.11);
  transform: scale(1.051);
  box-shadow: 0 8px 26px 0 #b4e19744, 0 2px 12px #0002;
  color: #fff !important;
  background: var(--nav-active-bg);
}
.btn.active, .btn[aria-current="page"] {
  background: #7ca982 !important;
  color: #f1f7ed !important;
  box-shadow: 0 0 18px 0 #b4e197aa, 0 0 8px #7ca982;
  font-weight: 900;
  border-radius: 12px;
  outline: 2px solid #b4e19755;
  outline-offset: 1.5px;
  z-index: 2;
}

/* Адаптация кнопок для мобильных */
@media (max-width: 900px) {
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    min-height: 40px;
  }
}

@media (max-width: 480px) {
  .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    min-height: 38px;
    border-radius: 8px;
  }
}

/* ---------- Анимация ---------- */
@keyframes colorCycle {
  0% { color: #243e36; }
  50% { color: #7ca982; }
  100% { color: #243e36; }
}
h1, h2 {
  animation: colorCycle 6s infinite;
}

/* ---------- Hero-section ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 80vh;
  padding: 2rem;
  color: #f1f7ed;
  z-index: 1;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(36, 62, 54, 0.5);
  backdrop-filter: blur(4px);
  z-index: 0;
  border-radius: 12px;
}
.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: slideIn 1s ease-out forwards;
  opacity: 0;
  transform: translateY(-20px);
}
.hero p {
  font-size: 1.25rem;
  max-width: 700px;
  animation: fadeIn 1.5s ease-out forwards;
  opacity: 0;
}

/* Мобильная адаптация для hero-section */
@media (max-width: 768px) {
  .hero {
    min-height: 60vh;
    padding: 1.5rem;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .hero p {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: 50vh;
    padding: 1rem;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* ---------- Contacts page styles ---------- */
.contact-page {
  background-color: #1B3A1B;
  min-height: 100vh;
  padding: 3rem 1rem;
  color: #f1f7ed;
}

.contact-form {
  background: rgba(241, 247, 237, 0.85);
  border: 1px solid rgba(124, 169, 130, 0.5);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  max-width: 600px;
  margin: 0 auto;
  color: #243e36;
}

/* Мобильная адаптация для contact-page */
@media (max-width: 768px) {
  .contact-page {
    padding: 2rem 0.5rem;
  }
  .contact-form {
    padding: 1.5rem;
    margin: 0 0.5rem;
  }
}

@media (max-width: 480px) {
  .contact-page {
    padding: 1.5rem 0.25rem;
  }
  .contact-form {
    padding: 1rem;
    margin: 0 0.25rem;
  }
}

/* ---------- Иконки на странице контактов ---------- */
.contact-static-icons {
  position: fixed;
  top: 50%;
  right: 2.5vw;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  z-index: 1050;
  background: rgba(36, 62, 54, 0.92);
  border-radius: 18px;
  padding: 1.2rem 1rem;
  box-shadow: 0 6px 32px 0 rgba(36,62,54,0.18);
  border: 1.5px solid #7ca982;
}
.contact-static-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s, box-shadow 0.18s;
  min-height: 48px; /* Минимальная высота для touch */
  min-width: 48px; /* Минимальная ширина для touch */
}
.contact-static-icons a:hover {
  transform: none;
  box-shadow: none;
}
.contact-static-icons img {
  width: 48px;
  height: 48px;
  filter: none;
}

/* Мобильная адаптация для контактных иконок - красивые как на ПК */
@media (max-width: 700px) {
  .contact-static-icons {
    position: fixed;
    bottom: 90px; /* Позиционируем выше Jivo виджета */
    right: 25px; /* Капельку левее от Jivo чата */
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 15px 8px 15px 8px;
    gap: 15px;
    z-index: 1040;
    width: auto;
    height: fit-content;
    max-height: fit-content;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transform: none;
  }
  
  .contact-static-icons img {
    width: 48px;
    height: 48px;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
  }
  
  .contact-static-icons a {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 0;
    margin: 0;
  }
  
  .contact-static-icons a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.3);
  }
  
  .contact-static-icons a:active {
    transform: scale(0.95) translateY(-1px);
  }
}

@media (max-width: 480px) {
  .contact-static-icons {
    bottom: 80px;
    right: 20px; /* Капельку левее от Jivo чата на маленьких экранах */
    gap: 12px;
    padding: 12px 6px 12px 6px;
  }
  
  .contact-static-icons img {
    width: 44px;
    height: 44px;
  }
  
  .contact-static-icons a {
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }
}

/* Анимация появления контактной панели на мобильных */
@media (max-width: 700px) {
  .contact-static-icons {
    animation: slideInFromRight 0.4s ease-out;
  }
  
  /* Убираем пульсацию - она не нужна */
}

@keyframes slideInFromBottom {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Адаптация для планшетов в ландшафтном режиме */
@media (max-width: 1024px) and (min-width: 701px) and (orientation: landscape) {
  .contact-static-icons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    flex-direction: row;
    justify-content: center;
    background: rgba(36, 62, 54, 0.95);
    padding: 8px 20px;
    gap: 25px;
    border-top: 1px solid #7ca982;
    backdrop-filter: blur(12px);
  }
  .contact-static-icons img {
    width: 36px;
    height: 36px;
  }
  .contact-static-icons a {
    min-height: 48px;
    min-width: 48px;
    border-radius: 12px;
    background: rgba(124, 169, 130, 0.2);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

/* Самая основа */
#back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3rem;
  height: 3rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(6px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
  min-height: 48px; /* Минимальная высота для touch */
  min-width: 48px; /* Минимальная ширина для touch */
}

/* Мобильная адаптация для кнопки "вверх" */
@media (max-width: 480px) {
  #back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
    min-height: 40px;
    min-width: 40px;
  }
}

/* Когда нужно показать */
#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Эффект при наведении */
#back-to-top:hover {
  transform: scale(1.1);
}

@keyframes spin{to{transform:rotate(360deg);}}
.htmx-indicator{display:none;}
.htmx-indicator.htmx-request{display:flex;}   /* HTMX сам добавляет .htmx-request */
.toast{
  position:fixed; top:50%; left:50%; transform:translate(-50%,-50%) scale(.9);
  padding:1.2rem 2rem; background:var(--glass-bg); border:1px solid var(--glass-border);
  border-radius:16px; font-size:1.15rem; color:var(--text-color); z-index:1100;
  box-shadow:0 8px 24px rgba(0,0,0,.18); opacity:0; transition:all .35s ease;
}
.toast.show{opacity:1; transform:translate(-50%,-50%) scale(1);}

/* Мобильная адаптация для toast */
@media (max-width: 480px) {
  .toast {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    margin: 0 1rem;
    max-width: calc(100vw - 2rem);
  }
}

/* Дополнительные мобильные улучшения */
@media (max-width: 768px) {
  main {
    padding: 1rem !important;
  }
  
  /* Улучшение читаемости текста на мобильных */
  p {
    line-height: 1.6;
    margin-bottom: 1rem;
  }
  
  /* Оптимизация отступов */
  section {
    margin-bottom: 2rem;
  }
  
  /* Улучшение сеток для мобильных */
  .grid-container {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
}

@media (max-width: 480px) {
  main {
    padding: 0.5rem !important;
  }
  
  section {
    margin-bottom: 1.5rem;
  }
  
  /* Уменьшение отступов для очень маленьких экранов */
  .glass {
    margin: 0.25rem;
    padding: 0.75rem;
  }
}

/* Дополнительные улучшения для мобильных форм */
@media screen and (max-width: 480px) {
  /* Улучшаем доступность форм на мобильных */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="datetime-local"],
  select,
  textarea {
    font-size: 16px !important; /* Предотвращает зум на iOS */
    padding: 14px !important;
    border-radius: 8px !important;
    border: 2px solid var(--glass-border) !important;
  }
  
  /* Улучшаем фокус для форм */
  input[type="text"]:focus,
  input[type="email"]:focus,
  input[type="tel"]:focus,
  input[type="datetime-local"]:focus,
  select:focus,
  textarea:focus {
    outline: none !important;
    border-color: var(--nav-active-bg) !important;
    box-shadow: 0 0 0 3px rgba(124, 169, 130, 0.3) !important;
  }
  
  /* Улучшаем кнопки отправки форм */
  input[type="submit"],
  button[type="submit"] {
    min-height: 48px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
  }
}

         /* Улучшения для страницы "О нас" */
         @media (max-width: 768px) {
           /* Улучшаем отображение информации о компании */
           .glass h2,
           .glass h3 {
             text-align: center;
             margin-bottom: 1rem;
           }

           .glass p,
           .glass ul {
             text-align: left;
             line-height: 1.6;
           }

           .glass li {
             margin-bottom: 0.5rem;
           }

           /* Улучшаем отображение форм сотрудничества */
           #cooperation .glass > div {
             flex-direction: column;
             gap: 1rem;
           }

           #cooperation .glass > div > div {
             flex: 1 1 100% !important;
             min-width: 100% !important;
           }

           /* Улучшаем отображение карты */
           #map {
             height: 350px !important;
           }
         }



@media (max-width: 480px) {
  /* Дополнительные улучшения для очень маленьких экранов */
  .glass h2 {
    font-size: 1.25rem !important;
  }
  
  .glass h3 {
    font-size: 1.1rem !important;
  }
  
  .glass p,
  .glass li {
    font-size: 0.9rem !important;
  }
  
  #map {
    height: 300px !important;
  }
}


