/* Светлая тема itcompania.ru. Включается переключателем (кнопка солнце/луна), выбор хранится в браузере.
   По умолчанию — фирменная тёмная тема. Контраст проверен по WCAG: акцент-текст #527a00 на белом — 5.1:1,
   основной текст — 17:1, приглушённый — 6.3:1. Кнопки остаются фирменного салатового с чёрным текстом. */

html[data-theme="light"] {
  --bg: #ffffff;
  --bg2: #f5f6f2;
  --bg3: #ebede6;
  --border: #dcdfd5;
  --accent: #527a00;
  --text: #1b1d18;
  --muted: #5d6158;
  --muted2: #8a8d85;
  --white: #111311;
  color-scheme: light;
}
html[data-theme="light"] body { background: var(--bg); color: var(--text); }

/* Фирменные салатовые кнопки и метки — без изменений */
html[data-theme="light"] :is(.btn-primary, .btn-accent, .btn-dark, .nav-cta, .service-btn, .icon-btn.tg, .pricing-badge) {
  background: #b5e05a; color: #000;
}
html[data-theme="light"] :is(a[aria-label="Написать в Telegram"], a[style*="background:var(--accent)"], a[style*="background: var(--accent)"]) { background: #b5e05a !important; color: #000 !important; }
html[data-theme="light"] :is(.hero-badge, .process-step)::before { background: #b5e05a; }

/* Тексты, у которых цвет был задан жёстко под тёмный фон */
html[data-theme="light"] :is(.article p, .article ul, .article ol, .article td, .faq-static dd,
  .prose p, .prose li, .prose td, .admin td, .admin-help, .flow figcaption) { color: #2c2f28; }

/* Блоки призыва внизу страниц */
html[data-theme="light"] :is(.cta, .cta-section) { background: var(--bg2); }
html[data-theme="light"] :is(.cta h2, .cta-section h2) { color: var(--white); }
html[data-theme="light"] :is(.cta p, .cta-section p, .terms-link) { color: var(--muted); }

/* «Занятый клиент»: полупрозрачная тёмная шапка */
html[data-theme="light"] header { background: rgba(255, 255, 255, .95); }


/* Доводка контраста (проверено автоматически по WCAG) */
html[data-theme="light"] :is(.step-num, .step-big-num) { color: #b3b8aa; }
html[data-theme="light"] :is(.blog-link.active, .blog-link:hover) { color: #456700; border-color: #456700; }
html[data-theme="light"] .split-label.red { color: #c62828; }

/* Переключатель темы */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 40px; height: 40px; padding: 0; border-radius: 50%; cursor: pointer;
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  transition: border-color .2s, color .2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { display: block; }
.theme-toggle .i-moon { display: none; }
html[data-theme="light"] .theme-toggle .i-sun { display: none; }
html[data-theme="light"] .theme-toggle .i-moon { display: block; }
footer .theme-toggle { width: 36px; height: 36px; }
/* На узких экранах в шапке нет места — переключатель остаётся в подвале */
@media (max-width: 480px) { header .theme-toggle { display: none; } }

/* Навигация: кнопка «Работы» в шапке и ссылки в подвале */
.nav-pill { display: flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 20px; background: var(--bg3);
  border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600;
  transition: border-color .2s, color .2s; flex-shrink: 0; }
.nav-pill:hover, .nav-pill.active { border-color: var(--accent); color: var(--accent); }
html[data-theme="light"] :is(.nav-pill.active, .nav-pill:hover) { color: #456700; border-color: #456700; }
footer { flex-wrap: wrap; gap: 12px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
@media (max-width: 560px) {
  header .nav-pill { display: none; }
  .footer-nav { order: 3; width: 100%; justify-content: center; padding-top: 4px; }
}

/* Закреплённый подвал: меню и контакты всегда внизу экрана */
body > footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 16px;
  padding: 10px 24px calc(10px + env(safe-area-inset-bottom));
  background: rgba(24, 24, 24, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}
html[data-theme="light"] body > footer { background: rgba(255, 255, 255, .94); }
body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
body > footer .footer-nav { flex: 1; justify-content: center; }
@media (max-width: 560px) {
  body > footer { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); gap: 10px; }
  body > footer :is(.footer-logo, .footer-brand) { display: none; }
  body > footer .footer-nav { order: 0; width: auto; padding-top: 0; justify-content: flex-start; gap: 4px 16px; font-size: 14px; }
  body > footer .footer-nav a[href="/usloviya-raboty/"] { display: none; }
  body > footer .footer-nav a { color: var(--text); font-weight: 600; }
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
}

/* Уведомление о cookie — над закреплённым подвалом */
.cookie-bar {
  position: fixed; z-index: 95; left: 50%; transform: translateX(-50%);
  bottom: calc(76px + env(safe-area-inset-bottom)); width: min(720px, calc(100% - 32px));
  display: flex; align-items: center; gap: 16px; padding: 14px 16px 14px 20px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35); color: var(--text);
}
.cookie-bar p { margin: 0; flex: 1; font-size: 14px; line-height: 1.45; }
.cookie-bar__btns { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-bar button {
  height: 40px; padding: 0 18px; border-radius: 20px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--text); transition: border-color .2s, opacity .2s;
}
.cookie-bar button:hover { border-color: var(--text); }
.cookie-bar .cookie-bar__yes { background: #b5e05a; border-color: #b5e05a; color: #000; }
.cookie-bar .cookie-bar__yes:hover { opacity: .88; border-color: #b5e05a; }
.cookie-bar button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html[data-theme="light"] .cookie-bar { background: #fff; box-shadow: 0 12px 40px rgba(0, 0, 0, .14); }
@media (max-width: 560px) {
  .cookie-bar { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px; bottom: calc(68px + env(safe-area-inset-bottom)); }
  .cookie-bar__btns button { flex: 1; }
}
