/* =====================================
   ШРИФТЫ И БАЗОВЫЙ СБРОС
   ===================================== */
@font-face { font-family: "TildaSans"; src: url("../fonts/TildaSans-Light.woff2") format("woff2"); font-weight: 300; font-style: normal; }
@font-face { font-family: "TildaSans"; src: url("../fonts/TildaSans-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; }
@font-face { font-family: "TildaSans"; src: url("../fonts/TildaSans-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; }
@font-face { font-family: "TildaSans"; src: url("../fonts/TildaSans-Semibold.woff2") format("woff2"); font-weight: 600; font-style: normal; }
@font-face { font-family: "TildaSans"; src: url("../fonts/TildaSans-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; }
@font-face { font-family: "TildaSans"; src: url("../fonts/TildaSans-ExtraBold.woff2") format("woff2"); font-weight: 800; font-style: normal; }
@font-face { font-family: "TildaSans"; src: url("../fonts/TildaSans-Black.woff2") format("woff2"); font-weight: 900; font-style: normal; }

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

body {
  font-family: "TildaSans", sans-serif;
  color: #333;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
}

/* Стандартный узкий контейнер для комфортного чтения */
.container {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =====================================
   ШАПКА
   ===================================== */
.header {
  padding: 12px 0;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(243, 244, 246, 0.9);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.logo img {
  height: 20px;
  width: auto;
  display: block;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.desktop-only-text {
  font-size: 15px;
  font-weight: 500;
  color: #333;
}
.header-actions a {
  transition: opacity 0.2s;
}
.header-actions a:hover {
  opacity: 0.8;
}
.header-actions img {
  width: 28px;
  height: 28px;
  display: block;
}

/* =====================================
   ОСНОВНОЙ КОНТЕНТ (ТЕКСТ ДОКУМЕНТОВ)
   ===================================== */
.legal-section {
  padding: 120px 0 80px;
  background-color: #fff;
  flex: 1 0 auto; /* Растягивает блок, прижимая подвал вниз */
}
.legal-content {
  max-width: 800px; /* Ограничиваем ширину текста для читабельности */
  margin: 0 auto;
}
.legal-content h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 40px;
  color: #333;
  line-height: 1.2;
}
.legal-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 40px 0 20px;
  color: #288ceb;
}
.legal-content p, 
.legal-content li {
  font-size: 16px;
  line-height: 1.6;
  color: #555;
  margin-bottom: 15px;
}
.legal-content ul {
  margin-left: 20px;
  margin-bottom: 20px;
}
.legal-content li {
  margin-bottom: 8px;
}
.legal-content strong {
  color: #333;
  font-weight: 600;
}
.legal-content a {
  color: #288ceb;
  text-decoration: none;
}
.legal-content a:hover {
  text-decoration: underline;
}

/* =====================================
   ПОДВАЛ
   ===================================== */
.lab-footer {
  flex-shrink: 0;
  background: #ffffff;
  border-top: 1px solid #eaeaea;
  position: relative;
  z-index: 10;
  padding: 40px 0;
  /* Тень для заливки низа при bounce-скролле в Safari */
  box-shadow: 0 50px 0 0 #ffffff, 0 100px 0 0 #ffffff, 0 150px 0 0 #ffffff, 0 200px 0 0 #ffffff, 0 300px 0 0 #ffffff;
}
.custom-footer-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand links right" "legal links right";
  align-items: center;
  gap: 8px 30px;
  width: 100%;
}
.cf-brand { grid-area: brand; display: flex; align-items: center; gap: 10px; }
.cf-legal { grid-area: legal; color: #888; font-size: 13px; }
.cf-links { grid-area: links; display: flex; justify-content: center; gap: 24px; }
.cf-links a { color: #333; text-decoration: none; font-size: 14px; transition: color 0.2s; font-weight: 500;}
.cf-links a:hover { color: #288ceb; }
.cf-right { grid-area: right; display: flex; justify-content: flex-end; }

.footer-logo-icon { height: 24px; opacity: 0.5; }
.footer-copy { color: #999; font-size: 15px; font-weight: 500; }
.footer-design-logo { height: 20px; opacity: 0.3; transition: opacity 0.3s; }
.footer-design-logo:hover { opacity: 0.8; }

/* =====================================
   COOKIE БАННЕР (Стили кнопок)
   ===================================== */
.btn {
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
}
.btn-primary {
  background: linear-gradient(180deg, #4da3f0 0%, #288ceb 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(40, 140, 235, 0.3), inset 0 2px 1px rgba(255, 255, 255, 0.4), inset 0 -3px 2px rgba(0, 0, 0, 0.15);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.btn-primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #5eb0f9 0%, #3695f2 100%);
  box-shadow: 0 10px 25px rgba(40, 140, 235, 0.4), inset 0 2px 1px rgba(255, 255, 255, 0.5), inset 0 -3px 2px rgba(0, 0, 0, 0.15);
}
.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(40, 140, 235, 0.3), inset 0 3px 4px rgba(0, 0, 0, 0.2);
}
.btn-small {
  padding: 10px 20px;
  font-size: 14px;
  white-space: nowrap;
  border-radius: 40px;
}

.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  max-width: 450px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  z-index: 9999;
  transform: translateY(150%);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner p { font-size: 13px; color: #555; line-height: 1.4; margin: 0; }
.cookie-banner a { color: #288ceb; text-decoration: underline; }

/* =====================================
   АДАПТАЦИЯ (Мобильные устройства)
   ===================================== */
@media (max-width: 900px) {
  .header { padding-top: 25px; padding-bottom: 25px; }
  .desktop-only-text { display: none; }
  
  .lab-footer { padding: 30px 0; }
  .custom-footer-grid {
    grid-template-columns: 1fr auto;
    grid-template-areas: "links links" "legal legal" "brand right";
    gap: 12px 0;
  }
  .cf-links { justify-content: flex-start; flex-wrap: wrap; gap: 16px; }
  .cf-legal { text-align: left; }
}

@media (max-width: 480px) {
  .legal-section { padding-top: 100px; }
  .legal-content h1 { font-size: 28px; }
  .legal-content h2 { font-size: 20px; }
  .legal-content p, .legal-content li { font-size: 15px; }
  
  .cookie-banner {
    bottom: 10px; left: 10px; right: 10px;
    flex-direction: column;
    padding: 15px; text-align: center;
  }
  .cookie-banner .btn-small { width: 100%; }
}