body { position: relative; }

/* ===== ФОН: два слоя =====
   Слой 1 — картинка с фильтром нормализации.
   Фильтр выравнивает разные фото по яркости и насыщенности,
   чтобы под белой вуалью все страницы выглядели одинаково.
   Слой 2 — белая вуаль постоянной плотности. */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: var(--bg-image);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: grayscale(45%) brightness(1.12) contrast(0.85);
  z-index: -2;
}
body::after {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.62);
  z-index: -1;
}

/* Плашки под текстом — одинаковые на всех страницах */
main, section, header, footer {
  background-color: rgba(255, 255, 255, 0.72);
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: 0.5rem;
}

html { scroll-behavior: smooth; }
a { transition: color 0.2s ease, background-color 0.2s ease; }

/* Выпадающее меню */
.dropdown { position: relative; display: inline-block; }
.dropdown-content {
  display: none; position: absolute; right: 0;
  background-color: #ffffff; min-width: 240px;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
  z-index: 999; border-radius: 0.5rem; overflow: hidden;
}
.dropdown:hover .dropdown-content { display: block; }
.dropdown-content a {
  color: #1e3a8a; padding: 10px 16px; text-decoration: none;
  display: block; font-weight: 500;
}
.dropdown-content a:hover { background-color: #f1f5f9; }

/* Шапка сжимается */
header { transition: box-shadow 0.3s ease; }
header.shrink { box-shadow: 0 4px 20px rgba(0,0,0,0.25); }
header img { transition: height 0.3s ease; }
header.shrink img { height: 2.25rem; }
header h1 { transition: font-size 0.3s ease; }
header.shrink h1 { font-size: 0.95rem; }

header a.hover\:text-blue-300 { position: relative; }
header a.hover\:text-blue-300::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 0; height: 2px; background-color: #93c5fd;
  transition: width 0.28s ease;
}
header a.hover\:text-blue-300:hover::after { width: 100%; }


/* Иконка телефона в шапке */
.phone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 9999px;
  background-color: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  transition: background-color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.phone-icon:hover {
  background-color: #fff;
  color: #1e3a8a;
  border-color: #fff;
  transform: scale(1.08);
}

/* Карточки практик */
#practices a {
  border: 2px solid transparent;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}
#practices a:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: #1e3a8a;
  box-shadow: 0 14px 30px rgba(30,58,138,0.22);
}

/* Карточки новостей */
.news-card {
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}
.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(30,58,138,0.20);
  border-color: #1d4ed8;
}

/* Тело статьи — читаемая типографика */
.post-body h2 { font-size: 1.6rem; font-weight: 700; color: #1e3a8a; margin: 2rem 0 1rem; }
.post-body h3 { font-size: 1.25rem; font-weight: 700; color: #1e3a8a; margin: 1.5rem 0 0.75rem; }
.post-body p  { margin-bottom: 1rem; text-align: justify; }
.post-body ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.post-body ol { list-style: decimal; padding-left: 1.5rem; margin-bottom: 1rem; }
.post-body li { margin-bottom: 0.4rem; }
.post-body a  { color: #1d4ed8; text-decoration: underline; }
.post-body blockquote {
  border-left: 4px solid #1e3a8a;
  padding-left: 1rem; margin: 1.25rem 0;
  color: #374151; font-style: italic;
}
.post-body strong { font-weight: 700; color: #1e3a8a; }

/* Контент страниц практик */
main h2 { font-size: 1.875rem; font-weight: 700; color: #1e3a8a; margin-bottom: 1.5rem; }
main h3 { font-size: 1.25rem; font-weight: 700; color: #1e3a8a; margin: 1.5rem 0 0.75rem; }
main p  { margin-bottom: 1rem; text-align: justify; text-indent: 2rem; }
main ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
main ul li { margin-bottom: 0.4rem; transition: transform 0.2s ease, color 0.2s ease; }
main ul li:hover { transform: translateX(4px); color: #1e3a8a; }


/* Разделители внутри статьи */
.post-body hr {
  border: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, #1e3a8a55, transparent);
  margin: 2.5rem 0;
}

/* Дисклеймер / примечание курсивом в конце */
.post-body em {
  color: #4b5563;
}
.post-body p em:only-child {
  display: block;
  font-size: 0.9rem;
  color: #6b7280;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
  margin-top: 2rem;
  text-align: left;
  text-indent: 0;
}

/* Нумерованные подзаголовки — чуть заметнее */
.post-body h2 {
  border-bottom: 2px solid #dbeafe;
  padding-bottom: 0.4rem;
}

/* Кнопка наверх */
#toTop {
  position: fixed; bottom: 1.25rem; left: 1.25rem;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background-color: #1e3a8a; color: #fff;
  border-radius: 9999px; box-shadow: 0 6px 18px rgba(0,0,0,0.28);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  z-index: 60; cursor: pointer; border: none;
}
#toTop.show { opacity: 1; visibility: visible; transform: translateY(0); }
#toTop:hover { background-color: #1d4ed8; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ КАЛЬКУЛЯТОРЫ ============ */
.calc-box {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 8px 28px rgba(30,58,138,0.12);
  padding: 1.75rem;
  border-top: 4px solid #1e3a8a;
}
.calc-field { margin-bottom: 1.25rem; }
.calc-label {
  display: block;
  font-weight: 600;
  color: #1e3a8a;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.calc-sublabel {
  display: block;
  font-size: 0.78rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
  font-weight: 600;
}
.calc-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 1rem;
  color: #111827;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}
.calc-input:focus {
  outline: none;
  border-color: #1e3a8a;
  box-shadow: 0 0 0 3px rgba(30,58,138,0.12);
}
select.calc-input { cursor: pointer; }
.calc-hint {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.4rem;
  line-height: 1.4;
}

/* Табы-переключатели */
.calc-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.calc-tab {
  flex: 1;
  min-width: 140px;
  padding: 0.6rem 0.9rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fff;
  color: #4b5563;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.calc-tab:hover { border-color: #93c5fd; }
.calc-tab.active {
  background: #1e3a8a;
  border-color: #1e3a8a;
  color: #fff;
}

/* Результат */
.calc-result {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
  border-radius: 0.65rem;
  color: #fff;
  text-align: center;
}
.calc-result-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
  font-weight: 600;
}
.calc-result-value {
  font-size: 2rem;
  font-weight: 800;
  margin: 0.35rem 0;
  line-height: 1.15;
}
.calc-result-note {
  font-size: 0.85rem;
  opacity: 0.9;
  line-height: 1.45;
}

/* Таблица детализации */
.calc-detail { margin-top: 1.25rem; }
.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.calc-table th {
  background: #f1f5f9;
  color: #1e3a8a;
  font-weight: 700;
  padding: 0.5rem 0.6rem;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
}
.calc-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
}
.calc-table tr:last-child td { border-bottom: none; }

/* Периоды в калькуляторе неустойки */
.ne-row { margin-bottom: 0.65rem; }
.ne-row-inner {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 0.6rem;
  align-items: end;
}
.ne-rate-col { width: 100px; }
.ne-del {
  width: 38px; height: 42px;
  border: 2px solid #fecaca;
  background: #fff;
  color: #dc2626;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}
.ne-del:hover { background: #fef2f2; border-color: #dc2626; }

.calc-btn-add {
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  background: #eff6ff;
  border: 2px dashed #93c5fd;
  color: #1d4ed8;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.calc-btn-add:hover { background: #dbeafe; border-color: #1d4ed8; }

/* Две колонки */
.calc-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Чекбокс */
.calc-checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.92rem;
  color: #374151;
}
.calc-checkbox input { width: 18px; height: 18px; cursor: pointer; }

/* Дисклеймер */
.calc-disclaimer {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  border-radius: 0.5rem;
  font-size: 0.88rem;
  color: #78350f;
  line-height: 1.6;
}
.calc-disclaimer strong { color: #92400e; }

/* Мобильные */
@media (max-width: 640px) {
  .calc-box { padding: 1.15rem; }
  .calc-result-value { font-size: 1.6rem; }
  .ne-row-inner { grid-template-columns: 1fr 1fr; }
  .ne-rate-col { width: auto; }
  .ne-del { grid-column: span 2; width: 100%; }
  .calc-row-2 { grid-template-columns: 1fr; }
  .calc-tab { min-width: 0; font-size: 0.82rem; padding: 0.55rem 0.5rem; }
}

/* ============ ДВИЖЕНИЕ ДОЛГА ============ */
.mv-row { margin-bottom: 0.6rem; }
.mv-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 0.6rem;
  align-items: end;
}
.mv-del {
  width: 40px; height: 44px;
  border: 2px solid #fecaca;
  background: #fff;
  color: #dc2626;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}
.mv-del:hover { background: #fef2f2; border-color: #dc2626; }

/* ============ КНОПКИ ЭКСПОРТА ============ */
.calc-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}
.calc-btn-copy, .calc-btn-word {
  flex: 1;
  min-width: 180px;
  padding: 0.75rem 1.2rem;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.22s ease;
  font-family: inherit;
  border: 2px solid;
}
.calc-btn-copy {
  background: #fff;
  border-color: #1e3a8a;
  color: #1e3a8a;
}
.calc-btn-copy:hover {
  background: #1e3a8a;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30,58,138,0.25);
}
.calc-btn-word {
  background: #1e3a8a;
  border-color: #1e3a8a;
  color: #fff;
}
.calc-btn-word:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30,58,138,0.3);
}

/* ============ ТАБЛИЦА РАСЧЁТА ============ */
.calc-table td.c { text-align: center; }
.calc-table td.r { text-align: right; white-space: nowrap; }
.calc-table td.b { font-weight: 700; color: #1e3a8a; }
.calc-table td.sm { font-size: 0.78rem; color: #6b7280; white-space: nowrap; }
.calc-table tr.tot td {
  background: #eff6ff;
  font-weight: 800;
  color: #1e3a8a;
  border-top: 2px solid #1e3a8a;
  font-size: 0.95rem;
}
.calc-detail { overflow-x: auto; }

/* Инфо-блок (синий, в отличие от жёлтого дисклеймера) */
.calc-info {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: #eff6ff;
  border-left: 4px solid #1e3a8a;
  border-radius: 0.5rem;
  font-size: 0.88rem;
  color: #1e3a8a;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .mv-inner { grid-template-columns: 1fr 1fr; }
  .mv-del { grid-column: span 2; width: 100%; }
  .calc-btn-copy, .calc-btn-word { min-width: 0; flex-basis: 100%; }
  .calc-table { font-size: 0.75rem; }
  .calc-table td.sm { font-size: 0.68rem; }
}

/* ============ КАЛЕНДАРЬ ============ */
.dp-wrap { position: relative; }

input.dp { padding-right: 2.6rem; }

.dp-open {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  color: #1e3a8a;
  cursor: pointer;
  border-radius: 0.35rem;
  transition: background-color 0.2s ease;
}
.dp-open:hover { background: #eff6ff; }

.dp-panel {
  position: absolute;
  z-index: 200;
  top: calc(100% + 6px);
  left: 0;
  width: 300px;
  max-width: calc(100vw - 2rem);
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 0.65rem;
  box-shadow: 0 12px 32px rgba(30,58,138,0.22);
  padding: 0.75rem;
  animation: dpIn 0.16s ease-out;
}
.dp-panel.dp-up { top: auto; bottom: calc(100% + 6px); }

@keyframes dpIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dp-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}
.dp-nav {
  width: 28px; height: 32px;
  flex-shrink: 0;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #1e3a8a;
  border-radius: 0.35rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: all 0.18s ease;
}
.dp-nav:hover { background: #1e3a8a; color: #fff; border-color: #1e3a8a; }

.dp-sel {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.4rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.35rem;
  background: #fff;
  color: #1e3a8a;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}
.dp-sel:focus { outline: none; border-color: #1e3a8a; }
.dp-year { max-width: 78px; flex: 0 0 78px; }

.dp-wd {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 3px;
}
.dp-wd span {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  padding: 2px 0;
}

.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dp-empty { height: 34px; }

.dp-day {
  height: 34px;
  border: none;
  background: none;
  border-radius: 0.35rem;
  color: #374151;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
  font-family: inherit;
}
.dp-day:hover { background: #dbeafe; color: #1e3a8a; }
.dp-day.dp-we { color: #dc2626; }
.dp-day.dp-today {
  box-shadow: inset 0 0 0 2px #93c5fd;
}
.dp-day.dp-sel-day {
  background: #1e3a8a !important;
  color: #fff !important;
}

.dp-foot {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid #f1f5f9;
}
.dp-today-btn, .dp-clear {
  flex: 1;
  padding: 0.4rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}
.dp-today-btn { color: #1e3a8a; }
.dp-today-btn:hover { background: #1e3a8a; color: #fff; border-color: #1e3a8a; }
.dp-clear { color: #6b7280; }
.dp-clear:hover { background: #f3f4f6; }

/* ============ МАКЕТ С БОКОВЫМ МЕНЮ ============ */
.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 1.75rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1rem 0;
  align-items: start;
}

.content-area { min-width: 0; }

/* Сайдбар */
.sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
}

.side-nav {
  background: rgba(255, 255, 255, 0.88);
  border-radius: 0.75rem;
  box-shadow: 0 6px 24px rgba(30, 58, 138, 0.12);
  padding: 1rem 0.75rem;
  border-top: 4px solid #1e3a8a;
}

.side-group { margin-bottom: 1rem; }
.side-group:last-of-type { margin-bottom: 0.75rem; }

.side-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #94a3b8;
  padding: 0 0.6rem;
  margin-bottom: 0.45rem;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem;
  border-radius: 0.45rem;
  color: #1e3a8a;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  position: relative;
  transition: background-color 0.22s ease, color 0.22s ease, padding-left 0.22s ease;

  /* Каскадное появление при загрузке */
  opacity: 0;
  transform: translateX(-10px);
  animation: sideIn 0.42s cubic-bezier(.2,.8,.2,1) forwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes sideIn {
  to { opacity: 1; transform: translateX(0); }
}

.side-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
  transition: background-color 0.22s ease, transform 0.22s ease;
}

.side-link:hover {
  background: #eff6ff;
  padding-left: 0.95rem;
  color: #1d4ed8;
}
.side-link:hover .side-dot {
  background: #1d4ed8;
  transform: scale(1.5);
}

/* Активный пункт */
.side-link.active {
  background: #1e3a8a;
  color: #fff;
}
.side-link.active .side-dot {
  background: #93c5fd;
  transform: scale(1.4);
}
.side-link.active:hover {
  background: #1d4ed8;
  color: #fff;
  padding-left: 0.6rem;
}

/* Телефон в сайдбаре */
.side-phone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
  padding: 0.65rem;
  background: #1e3a8a;
  color: #fff;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 0.86rem;
  text-decoration: none;
  transition: background-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}
.side-phone:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30, 58, 138, 0.3);
}

/* На узких экранах сайдбар прячется — работает бургер */
@media (max-width: 1023px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 0;
  }
  .sidebar { display: none; }
}

/* Убираем двойные отступы у секций внутри контента */
.content-area > section:first-child,
.content-area > main:first-child { margin-top: 0; }

/* ============ ТИПОГРАФИКА: увеличенный текст ============ */
/* Базовый текст контента — 17px вместо 16px (заголовки не трогаем) */
.content-area p,
.content-area li,
main p,
main ul li,
main ol li,
.post-body p,
.post-body li {
  font-size: 1.0625rem;   /* 17px */
  line-height: 1.72;
}

/* Мелкие подписи и служебные элементы остаются как были */
.content-area .calc-hint,
.content-area .calc-sublabel,
.content-area .calc-disclaimer,
.content-area .calc-info,
.content-area .calc-table td,
.content-area .calc-table th,
.content-area nav p,
.calc-result-note,
.news-card p,
footer p {
  font-size: inherit;
  line-height: inherit;
}
.calc-hint     { font-size: 0.8rem !important;  line-height: 1.45 !important; }
.calc-sublabel { font-size: 0.78rem !important; }
.calc-disclaimer, .calc-info { font-size: 0.9rem !important; line-height: 1.6 !important; }
.calc-table td, .calc-table th { font-size: 0.85rem !important; line-height: 1.4 !important; }
.calc-table td.sm { font-size: 0.78rem !important; }
.calc-result-note { font-size: 0.85rem !important; }
.news-card p { font-size: 0.92rem !important; line-height: 1.55 !important; }
footer p { font-size: 0.9rem !important; }

/* ============ САЙДБАР: правки ============ */
/* Пункты меню чуть крупнее */
.side-link { font-size: 0.95rem; }

/* Разделительная линия вместо заголовка "Разделы" */
.side-divided {
  border-top: 1px solid #e2e8f0;
  padding-top: 0.85rem;
  margin-top: 0.85rem;
}
