/* ==========================================================================
   NEBODANCE · theme-2026-pages.css
   Вторичные страницы: юридические документы, вход/восстановление, статьи.
   Язык главной: бумага + чернила + бирюзовый акцент, Unbounded в заголовках.
   Подключается ПОСЛЕ inline-стилей страницы, поэтому перекрывает их.
   Цвета берутся из токенов html[data-theme] — работает и светлая, и тёмная.
   ========================================================================== */

/* ---------- 0. ТОКЕНЫ ----------
   На этих страницах не грузится theme-2026.css, где объявлены --t-*.
   Объявляем их здесь, чтобы работали и светлая, и тёмная тема. */

:root,
html[data-theme="light"]{
  --t-bg: #f6f5f1;
  --t-surface: #ffffff;
  --t-surface-2: #eeede6;
  --t-line: rgba(17,17,19,.11);
  --t-line-strong: rgba(17,17,19,.3);
  --t-text: #111113;
  --t-muted: #5c5c64;
  --t-accent: #0f9dc4;
  --t-accent-ink: #04222a;
  --t-accent-text: #0a7f9c;
  --t-accent-display: #0f9dc4;
  --t-ghost-bg: rgba(17,17,19,.045);
  --t-ghost-border: rgba(17,17,19,.28);
}
html[data-theme="dark"]{
  --t-bg: #08080a;
  --t-surface: #101013;
  --t-surface-2: #17171c;
  --t-line: rgba(255,255,255,.09);
  --t-line-strong: rgba(255,255,255,.26);
  --t-text: #f4f4f5;
  --t-muted: #9a9aa3;
  --t-accent: #ffb63c;
  --t-accent-ink: #1a1200;
  --t-accent-text: #ffb63c;
  --t-accent-display: #ffb63c;
  --t-ghost-bg: rgba(255,255,255,.08);
  --t-ghost-border: rgba(255,255,255,.3);
}


/* ---------- 1. ЮРИДИЧЕСКИЕ ДОКУМЕНТЫ ---------- */

.legal-page{
  background: var(--t-bg, #f6f5f1) !important;
  padding: clamp(104px, 12vw, 148px) 0 clamp(56px, 8vw, 96px) !important;
  min-height: 70vh;
  color: var(--t-text, #111113);
}
.legal-container{ max-width: 880px !important; }

.legal-header{
  text-align: left !important;
  margin-bottom: clamp(30px, 4.5vw, 48px) !important;
  display: grid;
  gap: 10px;
  justify-items: start;
}
.legal-title{
  font-family: 'Unbounded', 'Onest', sans-serif !important;
  font-size: clamp(1.95rem, 5.2vw, 3.2rem) !important;
  font-weight: 600 !important;
  line-height: 1.08 !important;
  letter-spacing: -.03em !important;
  color: var(--t-text, #111113) !important;
  margin: 0 !important;
  text-align: left !important;
}
.legal-date{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .7rem !important;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--t-muted, #5c5c64) !important;
  margin: 0 !important;
}
.legal-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.legal-actions a,
.legal-actions button{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--t-line, rgba(17,17,19,.11));
  background: var(--t-surface, #fff);
  color: var(--t-text, #111113);
  font-family: 'Onest', sans-serif;
  font-size: .86rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: border-color .2s, transform .2s;
}
.legal-actions a:hover,
.legal-actions button:hover{
  border-color: var(--t-line-strong, rgba(17,17,19,.3));
  transform: translateY(-1px);
}

.legal-card{
  background: var(--t-surface, #fff) !important;
  border: 1px solid var(--t-line, rgba(17,17,19,.11)) !important;
  border-radius: 24px !important;
  padding: clamp(22px, 4vw, 44px) !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.legal-section{ margin-bottom: clamp(26px, 4vw, 38px) !important; }
.legal-section:last-child{ margin-bottom: 0 !important; }
.legal-section h2{
  font-family: 'Unbounded', 'Onest', sans-serif !important;
  font-size: clamp(1.12rem, 2.3vw, 1.42rem) !important;
  font-weight: 600 !important;
  letter-spacing: -.02em !important;
  line-height: 1.25 !important;
  color: var(--t-text, #111113) !important;
  margin: 0 0 12px !important;
}
.legal-section h3{
  font-family: 'Unbounded', 'Onest', sans-serif !important;
  font-size: clamp(1rem, 2vw, 1.1rem) !important;
  font-weight: 600 !important;
  letter-spacing: -.015em !important;
  color: var(--t-text, #111113) !important;
  margin: 18px 0 8px !important;
}
.legal-section p,
.legal-section li{
  font-size: 1rem !important;
  line-height: 1.72 !important;
  color: var(--t-text, #111113) !important;
}
.legal-section p{ margin: 0 0 12px !important; }
.legal-section ul,
.legal-section ol{
  margin: 0 0 14px !important;
  padding-left: 1.2em !important;
  display: grid;
  gap: 7px;
}
.legal-section a{
  color: var(--t-accent-text, #0a7f9c) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.legal-section strong{ font-weight: 650; }

.legal-note{
  background: var(--t-surface-2, #eeede6) !important;
  border: 0 !important;
  border-left: 3px solid var(--t-accent-text, #0a7f9c) !important;
  border-radius: 14px !important;
  padding: 16px 18px !important;
  margin: 20px 0 !important;
  font-size: .95rem !important;
  line-height: 1.65 !important;
}

.legal-table,
.cookie-table{
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0;
  border: 1px solid var(--t-line, rgba(17,17,19,.11));
  border-radius: 16px;
  overflow: hidden;
  background: var(--t-surface, #fff) !important;
  margin: 18px 0 !important;
}
.legal-table th,
.cookie-table th{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: .68rem !important;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--t-muted, #5c5c64) !important;
  text-align: left !important;
  padding: 12px 14px !important;
  background: var(--t-surface-2, #eeede6) !important;
  border: 0 !important;
  font-weight: 600 !important;
}
.legal-table td,
.cookie-table td{
  padding: 12px 14px !important;
  border: 0 !important;
  border-top: 1px solid var(--t-line, rgba(17,17,19,.11)) !important;
  font-size: .93rem !important;
  line-height: 1.55 !important;
  vertical-align: top;
  color: var(--t-text, #111113) !important;
}

.consent-box{
  border: 1px solid var(--t-line, rgba(17,17,19,.11)) !important;
  border-radius: 16px !important;
  background: var(--t-surface-2, #eeede6) !important;
  padding: 20px !important;
}

/* ---------- 2. ВХОД / ВОССТАНОВЛЕНИЕ / БИОМЕТРИЯ ---------- */

.auth-container{ max-width: 460px !important; width: 100% !important; }

.auth-card{
  background: var(--t-surface, #ffffff) !important;
  border: 1px solid var(--t-line, rgba(17,17,19,.11)) !important;
  border-radius: 26px !important;
  padding: clamp(26px, 5vw, 42px) !important;
  box-shadow: 0 28px 70px -36px rgba(17,17,19,.35) !important;
}
.auth-header{
  text-align: left !important;
  margin-bottom: 26px !important;
}
.auth-header h1,
.auth-header h2,
.auth-title{
  font-family: 'Unbounded', 'Onest', sans-serif !important;
  font-size: clamp(1.5rem, 4.2vw, 2.05rem) !important;
  font-weight: 600 !important;
  line-height: 1.12 !important;
  letter-spacing: -.03em !important;
  color: var(--t-text, #111113) !important;
  margin: 0 0 8px !important;
}
.auth-header p{
  color: var(--t-muted, #5c5c64) !important;
  font-size: .93rem !important;
  line-height: 1.55 !important;
  margin: 0 !important;
}

.form-group{ margin-bottom: 18px !important; }
.form-group label{
  display: block;
  font-family: 'Onest', sans-serif;
  font-size: .7rem !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--t-muted, #5c5c64) !important;
  margin-bottom: 7px !important;
}
.form-group input,
.form-group select,
.form-group textarea,
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="tel"]{
  width: 100% !important;
  height: 48px !important;
  padding: 0 14px !important;
  border: 1px solid var(--t-line, rgba(17,17,19,.11)) !important;
  border-radius: 14px !important;
  background: var(--t-surface, #fff) !important;
  color: var(--t-text, #111113) !important;
  font-family: 'Onest', sans-serif !important;
  font-size: 1rem !important;
  box-shadow: none !important;
  transition: border-color .18s, box-shadow .18s;
}
.form-group input:focus,
.auth-card input:focus{
  outline: none !important;
  border-color: var(--t-accent-text, #0a7f9c) !important;
  box-shadow: 0 0 0 3px rgba(10,127,156,.16) !important;
}
.form-group input::placeholder{ color: var(--t-muted, #9a9aa3); }

.btn,
.btn-primary,
.auth-card button[type="submit"],
.auth-form button[type="submit"]{
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  width: 100% !important;
  min-height: 48px !important;
  padding: 0 22px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--t-accent-display, #0f9dc4) !important;
  color: var(--t-accent-ink, #04222a) !important;
  font-family: 'Onest', sans-serif !important;
  font-size: .98rem !important;
  font-weight: 650 !important;
  letter-spacing: -.01em;
  cursor: pointer;
  box-shadow: none !important;
  transition: transform .18s, filter .18s;
}
.btn:hover,
.btn-primary:hover,
.auth-card button[type="submit"]:hover{
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: none !important;
}
.btn:active,
.auth-card button[type="submit"]:active{ transform: translateY(0); }

.auth-card a,
.auth-form a{
  color: var(--t-accent-text, #0a7f9c) !important;
  font-weight: 600;
  text-decoration: none !important;
  border-bottom: 1px solid transparent;
  transition: border-color .18s;
}
.auth-card a:hover,
.auth-form a:hover{ border-bottom-color: currentColor; }

.auth-footer,
.auth-links{
  color: var(--t-muted, #5c5c64) !important;
  font-size: .88rem !important;
  text-align: center;
  margin-top: 18px;
}

/* ---------- 3. СТАТЬИ ---------- */

.articles-container{
  background: var(--t-bg, #f6f5f1) !important;
  color: var(--t-text, #111113) !important;
  padding-top: clamp(96px, 11vw, 132px) !important;
}

.articles-container .section-title{
  font-family: 'Unbounded', 'Onest', sans-serif !important;
  font-size: clamp(1.5rem, 3.4vw, 2.25rem) !important;
  font-weight: 600 !important;
  letter-spacing: -.025em !important;
  line-height: 1.14 !important;
  color: var(--t-text, #111113) !important;
}

.articles-container .article-card{
  background: var(--t-surface, #fff) !important;
  border: 1px solid var(--t-line, rgba(17,17,19,.11)) !important;
  border-radius: 20px !important;
  overflow: hidden;
  box-shadow: none !important;
  transition: transform .28s cubic-bezier(.22,1,.36,1), border-color .28s;
}
.articles-container .article-card:hover{
  transform: translateY(-3px);
  border-color: var(--t-line-strong, rgba(17,17,19,.3)) !important;
}
.articles-container .article-body{ padding: 20px 22px 22px !important; }
.articles-container .article-card h3,
.articles-container .article-card h5,
.articles-container .article-card .card-title{
  font-family: 'Unbounded', 'Onest', sans-serif !important;
  font-size: 1.02rem !important;
  font-weight: 600 !important;
  letter-spacing: -.015em !important;
  line-height: 1.3 !important;
  color: var(--t-text, #111113) !important;
}
.articles-container .article-card p,
.articles-container .article-card .text-muted{
  color: var(--t-muted, #5c5c64) !important;
  font-size: .92rem !important;
  line-height: 1.6 !important;
}
.articles-container .article-badge{
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--t-ghost-bg, rgba(17,17,19,.045)) !important;
  color: var(--t-accent-text, #0a7f9c) !important;
  font-family: 'Onest', sans-serif;
  font-size: .68rem !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.articles-container .read-more{
  color: var(--t-accent-text, #0a7f9c) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

.articles-container .sticky-sidebar .card,
.articles-container .card{
  background: var(--t-surface, #fff) !important;
  border: 1px solid var(--t-line, rgba(17,17,19,.11)) !important;
  border-radius: 20px !important;
  box-shadow: none !important;
  color: var(--t-text, #111113) !important;
}
.articles-container .card-header,
.articles-container .card-footer{
  background: transparent !important;
  border-color: var(--t-line, rgba(17,17,19,.11)) !important;
}
.articles-container .card-body h5,
.articles-container .card-body h6{
  font-family: 'Unbounded', 'Onest', sans-serif !important;
  font-size: .98rem !important;
  font-weight: 600 !important;
  letter-spacing: -.01em;
}

.articles-container .tag-cloud a{
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  margin: 0 6px 6px 0;
  border-radius: 999px;
  border: 1px solid var(--t-line, rgba(17,17,19,.11));
  background: var(--t-surface, #fff) !important;
  color: var(--t-text, #111113) !important;
  font-size: .8rem !important;
  font-weight: 500;
  text-decoration: none !important;
  transition: border-color .2s, color .2s;
}
.articles-container .tag-cloud a:hover{
  border-color: var(--t-accent-text, #0a7f9c);
  color: var(--t-accent-text, #0a7f9c) !important;
}

.articles-container .form-control,
.articles-container .form-select{
  height: 46px;
  border-radius: 13px !important;
  border: 1px solid var(--t-line, rgba(17,17,19,.11)) !important;
  background: var(--t-surface, #fff) !important;
  color: var(--t-text, #111113) !important;
  font-family: 'Onest', sans-serif !important;
  font-size: .95rem !important;
  box-shadow: none !important;
}
.articles-container .form-control:focus,
.articles-container .form-select:focus{
  border-color: var(--t-accent-text, #0a7f9c) !important;
  box-shadow: 0 0 0 3px rgba(10,127,156,.16) !important;
}
.articles-container .input-group-text{
  border-radius: 13px 0 0 13px !important;
  border: 1px solid var(--t-line, rgba(17,17,19,.11)) !important;
  background: var(--t-surface-2, #eeede6) !important;
  color: var(--t-muted, #5c5c64) !important;
}

.articles-container .newsletter-form button,
.articles-container .newsletter-form .btn{
  border-radius: 999px !important;
  min-height: 46px;
  background: var(--t-accent-display, #0f9dc4) !important;
  color: var(--t-accent-ink, #04222a) !important;
  font-weight: 650 !important;
}

.articles-container .alert-info{
  background: var(--t-surface-2, #eeede6) !important;
  border: 1px solid var(--t-line, rgba(17,17,19,.11)) !important;
  border-radius: 14px !important;
  color: var(--t-text, #111113) !important;
}

/* ---------- 4. ТЁМНАЯ ТЕМА: мелкие доводки ---------- */

html[data-theme="dark"] .legal-card,
html[data-theme="dark"] .auth-card{
  box-shadow: 0 28px 70px -40px rgba(0,0,0,.9) !important;
}
html[data-theme="dark"] .legal-actions a,
html[data-theme="dark"] .legal-actions button,
html[data-theme="dark"] .articles-container .tag-cloud a{
  background: var(--t-surface, #101013) !important;
}

/* ---------- 5. МОБИЛЬНЫЕ ДОВОДКИ ---------- */

@media (max-width: 640px){
  .legal-page{ padding: 92px 0 48px !important; }
  .legal-card{ border-radius: 18px !important; }
  .legal-table,
  .cookie-table{ font-size: .88rem !important; }
  .legal-table th,
  .legal-table td,
  .cookie-table th,
  .cookie-table td{ padding: 10px 11px !important; }
  .auth-card{ border-radius: 22px !important; }
  .articles-container{ padding-top: 84px !important; }
}

/* ---------- 6. ФУТЕР: сброс box-sizing ----------
   Эти страницы не грузят landing-core.css, где лежит общий сброс.
   Из-за этого footer.php (width:100% + padding) вылезает за экран на ~64px. */

.site-footer,
.site-footer *,
.site-footer *::before,
.site-footer *::after{ box-sizing: border-box; }

/* ---------- 7. ДЛИННЫЕ СТРОКИ ----------
   В бланке согласия есть неразрывные линии из подчёркиваний («От: ____»),
   из-за них страница вылезала за экран на 168px. Разрешаем перенос. */

.legal-card p,
.legal-card li,
.legal-card td,
.legal-card th,
.consent-box p,
.legal-note{
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------- 8. ПАЛИТРА ШАПКИ ----------
   site-header.css по умолчанию задаёт фиолетовый --primary (#7c3aed).
   На главной theme-2026.css переопределяет его на бирюзовый/янтарный.
   Повторяем это здесь, иначе шапка («Войти») выбивается из контента. */

html[data-theme="light"]{
  --primary: #12b3d6;
  --primary-light: #5fd6ea;
  --primary-dark: #0a8ba6;
  --primary-soft: rgba(18,179,214,.14);
  --text-primary: #111113;
  --text-secondary: #5c5c64;
  --bg-deep: #f6f5f1;
  --bg-deep-secondary: #eeede6;
  --bg-glass: rgba(17,17,19,.035);
  --border-glass: rgba(17,17,19,.11);
}
html[data-theme="dark"]{
  --primary: #ffb63c;
  --primary-light: #ffcf85;
  --primary-dark: #d99524;
  --primary-soft: rgba(255,182,60,.14);
  --text-primary: #f4f4f5;
  --text-secondary: #9a9aa3;
  --bg-deep: #08080a;
  --bg-deep-secondary: #0c0c10;
  --bg-glass: rgba(255,255,255,.045);
  --border-glass: rgba(255,255,255,.09);
}

/* ---------- 9. ФОН СТРАНИЦЫ И ШАПКИ ----------
   site-header.css красит body и шапку в лавандовый (#faf9ff).
   На главной фон бумажный, шапка полупрозрачная от него же. */

html[data-theme="light"] body{ background: #f6f5f1 !important; }
html[data-theme="light"] .site-header{ background: rgba(246, 245, 241, .9) !important; }
html[data-theme="dark"] body{ background: #08080a !important; }
html[data-theme="dark"] .site-header{ background: rgba(8, 8, 10, .92) !important; }

/* страницы входа не участвуют в теме (нет data-theme) — красим явно */
body.auth-page{ background: #f6f5f1 !important; }
body.auth-page .auth-card{ max-width: 100%; }
