/* ==========================================
   FOOTER
   ========================================== */

footer {
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  padding: 32px 0 40px;
  background: rgba(249, 250, 251, 0.95);
  color: #475569;
  font-size: 14px;
}

footer .container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Основные колонки */

.footer-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: start;
}

.footer-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-brand {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.footer-desc {
  font-size: 14px;
  line-height: 1.5;
  color: #64748b;
}

.footer-legal {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

/* Контакты */

.footer-contacts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  text-align: right;
}

.footer-contact-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
}

.footer-label {
  font-size: 12px;
  color: #94a3b8;
}

.footer-phone {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-phone:hover {
  color: #0ea5e9;
}

.footer-link {
  font-size: 14px;
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #0f172a;
}

/* Нижняя строка */

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 13px;
  color: #94a3b8;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-link-small {
  font-size: 13px;
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s ease;
  cursor: pointer;
}

.footer-link-small:hover {
  color: #0f172a;
  text-decoration: underline;
}

/* ==========================================
   МОДАЛЬНОЕ ОКНО ЮРИДИЧЕСКИХ ДОКУМЕНТОВ
   ========================================== */

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.legal-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.legal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
}

.legal-modal-dialog {
  position: relative;
  z-index: 1;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.legal-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.legal-modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.legal-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.legal-modal-close:hover {
  background: #f8fafc;
}

.legal-modal-close::before,
.legal-modal-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: #64748b;
  transform-origin: center;
}

.legal-modal-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.legal-modal-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.legal-modal-body {
  padding: 32px 40px 40px;
  overflow-y: auto;
  flex: 1;
}

/* Стили контента внутри модалки */

.legal-modal-body h1 {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
  color: #0f172a;
}

.legal-modal-body h2 {
  margin: 24px 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 6px;
}

.legal-modal-body h3 {
  margin: 16px 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

.legal-modal-body p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #475569;
}

.legal-modal-body ul,
.legal-modal-body ol {
  margin: 12px 0;
  padding-left: 20px;
}

.legal-modal-body li {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.5;
  color: #475569;
}

.legal-modal-body strong {
  font-weight: 600;
  color: #0f172a;
}

.legal-modal-body a {
  color: #0ea5e9;
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal-modal-body a:hover {
  color: #0284c7;
  text-decoration: underline;
}

.legal-modal-intro {
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #475569;
  background: #f0f9ff;
  border-left: 4px solid #0ea5e9;
  border-radius: 8px;
  margin-bottom: 24px;
}

.legal-modal-footer-note {
  margin: 32px 0 0;
  padding: 16px;
  font-size: 13px;
  color: #64748b;
  background: #f8fafc;
  border-radius: 8px;
  text-align: center;
}

/* ==========================================
   МОБИЛЬНАЯ ВЕРСИЯ
   ========================================== */

@media (max-width: 900px) {
  footer {
    padding: 24px 0 100px;
  }

  .footer-cols {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .footer-contacts {
    align-items: flex-start;
    text-align: left;
  }

  .footer-contact-item {
    align-items: flex-start;
  }

  .footer-brand {
    font-size: 15px;
  }

  .footer-desc {
    font-size: 13px;
  }

  .footer-legal {
    font-size: 11px;
  }

  .footer-phone {
    font-size: 15px;
  }

  .footer-link {
    font-size: 13px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-top: 16px;
  }

  .footer-copy {
    font-size: 12px;
  }

  .footer-links {
    gap: 12px;
  }

  .footer-link-small {
    font-size: 12px;
  }

  /* Модалка на мобилке */
  .legal-modal {
    padding: 0;
  }

  .legal-modal-dialog {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .legal-modal-header {
    padding: 16px 20px;
  }

  .legal-modal-title {
    font-size: 18px;
  }

  .legal-modal-close {
    width: 28px;
    height: 28px;
  }

  .legal-modal-close::before,
  .legal-modal-close::after {
    width: 14px;
  }

  .legal-modal-body {
    padding: 24px 20px 32px;
  }

  .legal-modal-body h1 {
    font-size: 20px;
  }

  .legal-modal-body h2 {
    font-size: 16px;
    margin: 20px 0 10px;
  }

  .legal-modal-body h3 {
    font-size: 15px;
  }

  .legal-modal-body p,
  .legal-modal-body li {
    font-size: 13px;
  }
}

/* Очень маленькие экраны */
@media (max-width: 400px) {
  footer {
    padding: 20px 0 100px;
  }

  .footer-brand {
    font-size: 14px;
  }

  .footer-desc {
    font-size: 12px;
  }

  .footer-legal {
    font-size: 10px;
  }

  .footer-phone {
    font-size: 14px;
  }

  .footer-copy {
    font-size: 11px;
  }

  .footer-link-small {
    font-size: 11px;
  }

  .legal-modal-body {
    padding: 20px 16px 24px;
  }
}
