/* ============================================================
   PUBLIC LIGHT PAGES — единая светлая обвязка для:
   - landing/privacy.html, terms.html, offer.html, pricing.html, contacts.html, cases.html, demo.html
   - landing/product.html, features*.html, for_owners.html, for_contractors.html
   - landing/help/*.html
   - landing/blog/*.html

   Все они наследуют base.html (без класса landing-page),
   поэтому без этого файла body остаётся тёмным от style.css → текст #0f172a
   сливается с фоном.

   Активация через :has() — браузер применяет светлый фон body, если
   внутри есть .ap-wrap, .legal-content, .help-content, .features-content и т.п.
   ============================================================ */

body:has(.ap-wrap),
body:has(.legal-content),
body:has(.help-content),
body:has(.help-wrap),
body:has(.features-content),
body:has(.cases-wrap),
body:has(.demo-wrap),
body:has(.contact-wrap),
body:has(.public-light-page) {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 50%, #ffffff 100%) !important;
    background-image:
        radial-gradient(circle at 18% 0%, rgba(102,126,234,0.08), transparent 34%),
        radial-gradient(circle at 86% 8%, rgba(16,185,129,0.06), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 50%, #ffffff 100%) !important;
    color: #0f172a !important;
}

/* Тексты на этих страницах — нормальный читаемый цвет */
body:has(.ap-wrap) p,
body:has(.legal-content) p,
body:has(.legal-content) li,
body:has(.legal-content) ul {
    color: #475569;
}

body:has(.legal-content) h1,
body:has(.legal-content) h2,
body:has(.legal-content) h3,
body:has(.legal-content) h4,
body:has(.legal-content) strong {
    color: #0f172a;
}

/* Linki */
body:has(.legal-content) a {
    color: #4338ca;
}
body:has(.legal-content) a:hover {
    color: #312e81;
}

/* Шрифт ссылок и кнопок в footer на light-странице */
body:has(.ap-wrap) .landing-footer-v2,
body:has(.legal-content) .landing-footer-v2 {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%) !important;
    border-top-color: #e2e8f0 !important;
    color: #64748b !important;
}
body:has(.ap-wrap) .landing-footer-v2 a,
body:has(.legal-content) .landing-footer-v2 a {
    color: #64748b !important;
}
body:has(.ap-wrap) .landing-footer-v2 a:hover,
body:has(.legal-content) .landing-footer-v2 a:hover {
    color: #4338ca !important;
}
body:has(.ap-wrap) .landing-footer-v2 .footer-v2-col-title,
body:has(.ap-wrap) .landing-footer-v2 .footer-v2-logo,
body:has(.legal-content) .landing-footer-v2 .footer-v2-col-title,
body:has(.legal-content) .landing-footer-v2 .footer-v2-logo {
    color: #0f172a !important;
}
body:has(.ap-wrap) .landing-footer-v2 .footer-v2-trust-card,
body:has(.legal-content) .landing-footer-v2 .footer-v2-trust-card {
    background: rgba(255,255,255,0.92) !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}
body:has(.ap-wrap) .landing-footer-v2 .footer-v2-trust-card strong,
body:has(.legal-content) .landing-footer-v2 .footer-v2-trust-card strong {
    color: #0f172a !important;
}
body:has(.ap-wrap) .landing-footer-v2 .footer-v2-trust-icon,
body:has(.ap-wrap) .landing-footer-v2 .footer-v2-social-link,
body:has(.legal-content) .landing-footer-v2 .footer-v2-trust-icon,
body:has(.legal-content) .landing-footer-v2 .footer-v2-social-link {
    background: #eef2ff !important;
    border: 1px solid #dbe4ff !important;
    color: #667eea !important;
}
body:has(.ap-wrap) .landing-footer-v2 .footer-v2-primary-link-alt,
body:has(.legal-content) .landing-footer-v2 .footer-v2-primary-link-alt {
    background: #ffffff !important;
    border-color: #dbe4f0 !important;
    color: #4338ca !important;
}

/* Fallback для браузеров без :has() — на этих страницах добавлен класс body
   `.public-light` через JS на старте. Всё должно сработать так же. */
body.public-light {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 50%, #ffffff 100%) !important;
    color: #0f172a !important;
}
