/* ================================================
   TERMS PAGE STYLES (Пользовательское соглашение)
   ================================================ */

/* Background colors - match index.html */
body {
  background: var(--bg-purple-light);
  color: var(--text-black);
}

[data-theme="dark"] body {
  background: #131416;
  color: var(--text-white);
}

[data-theme="light"] body {
  background: #f5f5f5;
  color: var(--text-black);
}

/* Переносим стили header/фона как на donate-странице для всех юр-страниц */
body:has(.terms-container) .header {
  position: relative;
  z-index: 1000;
  padding: 20px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] body:has(.terms-container) .header {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* SENIORCODE всегда белый (как на donate / тёмный хедер) */
body:has(.terms-container) .header-logo,
body:has(.terms-container) .header-logo:hover,
body:has(.terms-container) .header-logo:focus,
body:has(.terms-container) .header-logo:active {
  color: #ffffff;
}

body:has(.terms-container) .header-logo-text {
  color: #ffffff;
}

body:has(.terms-container) {
  background-attachment: fixed;
}

[data-theme="light"] body:has(.terms-container) {
  background: #f5f5f5;
}

[data-theme="dark"] body:has(.terms-container) {
  background: var(--bg-dark);
}

/* Бургер на юр-страницах - чёрные линии в светлой теме */
[data-theme="light"] body:has(.terms-container) .header-menu-btn .menu-icon {
  background: #000000;
}

[data-theme="light"] body:has(.terms-container) .header-menu-btn:hover .menu-icon {
  background: #000000;
}

/* Контейнер для всего контента */
.terms-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 20px 40px 20px;
  color: var(--text-primary);
  line-height: 1.8;
}

[data-theme="light"] .terms-container {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  padding: 32px 32px 40px 32px;
  margin-bottom: 60px;
}

/* Заголовок страницы */
.terms-title {
  font-size: 2.5rem;
  margin-bottom: 30px;
  text-align: center;
  color: var(--text-primary);
  font-weight: 700;
}

[data-theme="light"] .terms-title {
  color: #111111;
}

/* Вводный блок (intro) */
.terms-intro {
  background: rgba(255, 255, 255, 0.05);
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .terms-intro {
  background: #f5f7fa;
  border-color: rgba(0, 0, 0, 0.1);
  backdrop-filter: none;
}

.terms-intro p {
  margin-bottom: 0;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Заголовки разделов */
.terms-section-title {
  font-size: 1.8rem;
  margin-top: 40px;
  margin-bottom: 20px;
  color: var(--text-primary);
  font-weight: 600;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

[data-theme="light"] .terms-section-title {
  border-bottom-color: rgba(0, 0, 0, 0.12);
  color: #111111;
}

/* Параграфы */
.terms-container p {
  margin-bottom: 15px;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

[data-theme="light"] .terms-container p {
  color: #333333;
}

.terms-container p strong {
  color: var(--text-primary);
  font-weight: 600;
}

[data-theme="light"] .terms-container p strong {
  color: #000000;
}

.terms-container ul,
.offer-layout .terms-container ul {
  margin: 0 0 15px;
  padding-left: 1.5em;
  list-style-type: disc;
  list-style-position: outside;
}

.terms-container ul li {
  margin-bottom: 10px;
  padding-left: 0.25em;
  color: var(--text-secondary);
  line-height: 1.7;
}

[data-theme="light"] .terms-container ul li {
  color: #333333;
}

.terms-container ul li strong {
  color: var(--text-primary);
}

[data-theme="light"] .terms-container ul li strong {
  color: #000000;
}

/* Footer с датой */
.terms-footer {
  text-align: center;
  margin-top: 50px;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .terms-footer {
  border-top-color: rgba(0, 0, 0, 0.1);
  color: #777777;
}

/* Адаптивность для планшетов */
@media (max-width: 768px) {
  body:has(.offer-layout) .main .container,
  body:has(.terms-container) .main .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .offer-layout {
    padding-left: 0;
    padding-right: 0;
  }

  .terms-container {
    padding: 24px 14px 32px;
  }

  .terms-title {
    font-size: 2rem;
  }

  .terms-section-title {
    font-size: 1.5rem;
    margin-top: 30px;
  }

  .terms-intro {
    padding: 20px;
  }
}

/* Адаптивность для мобильных */
@media (max-width: 480px) {
  body:has(.offer-layout) .main .container,
  body:has(.terms-container) .main .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .terms-container {
    padding: 18px 12px 28px;
  }

  .terms-title {
    font-size: 1.75rem;
  }

  .terms-section-title {
    font-size: 1.3rem;
  }

  .terms-container ul {
    margin-left: 0;
    padding-left: 1.35em;
  }
}

@media (max-width: 360px) {
  .terms-container {
    padding: 15px 8px;
  }

  .terms-title {
    font-size: 1.5rem;
  }

  .terms-section-title {
    font-size: 1.2rem;
    margin-top: 25px;
  }

  .terms-intro {
    padding: 15px;
  }

  .terms-intro p {
    font-size: 0.95rem;
  }

  .terms-container p {
    font-size: 0.9rem;
  }

  .terms-container ul {
    margin-left: 0;
    padding-left: 1.35em;
  }
}

@media (max-width: 440px) {
  .container {
    padding: 0 12px;
  }

  .header {
    padding: 12px 0;
  }

  .header-logo-text {
    font-size: 12px;
  }

  .header-logo-img {
    width: 32px;
    height: 32px;
  }

  .terms-container {
    padding: 16px;
  }

  .terms-title {
    font-size: 1.5rem;
  }

  .terms-section-title {
    font-size: 1.2rem;
  }

  .terms-intro {
    padding: 16px;
    font-size: 14px;
  }

  .terms-container p {
    font-size: 14px;
  }

  .terms-container ul {
    font-size: 14px;
    margin-left: 0;
  }
}

@media (max-width: 320px) {
  .terms-container {
    padding: 12px 6px;
  }

  .terms-title {
    font-size: 1.3rem;
  }

  .terms-section-title {
    font-size: 1.1rem;
  }

  .terms-intro {
    padding: 12px;
  }

  .terms-container p {
    font-size: 0.85rem;
  }

  .terms-container ul {
    margin-left: 0;
  }
}

.terms-telegram-link {
  color: #0088cc;
  background-color: rgba(0, 136, 204, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.terms-telegram-link:hover {
  background-color: rgba(0, 136, 204, 0.2);
  text-decoration: underline;
}

[data-theme="light"] .terms-telegram-link {
  color: #0088cc;
  background-color: rgba(0, 136, 204, 0.15);
}

[data-theme="light"] .terms-telegram-link:hover {
  background-color: rgba(0, 136, 204, 0.25);
}

@media (max-width: 380px) {
  body:has(.terms-container) .container,
  body:has(.offer-layout) .main .container {
    padding-left: 8px;
    padding-right: 8px;
  }

  body:has(.terms-container) .container {
    padding: 0 8px;
  }

  [data-theme="light"] .terms-container,
  [data-theme="dark"] .offer-layout .terms-container,
  .terms-container {
    border-radius: 12px;
    padding: 14px 12px 24px;
  }

  .terms-container,
  .terms-container p,
  .terms-container li,
  .terms-telegram-link {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .terms-title {
    line-height: 1.15;
  }
}
