/* ============ Правовой редут — общие стили ============ */
:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-tint: #eaf1fe;
  --navy: #0f1f3f;
  --text: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --alt: #f4f7fb;
  --white: #ffffff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 31, 63, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Manrope", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
  font-size: 16px;
}

img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4 { color: var(--navy); line-height: 1.2; font-weight: 800; }
h2 { font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -0.01em; }

.lead { font-size: 18px; color: var(--muted); }

.eyebrow {
  display: inline-block;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.section { padding: 76px 0; }
.section.alt { background: var(--alt); }
.section-head { max-width: 680px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { margin-top: 14px; }

/* ============ Кнопки ============ */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3); }
.btn-ghost { border-color: var(--blue); color: var(--blue); background: transparent; }
.btn-ghost:hover { background: var(--blue-tint); transform: translateY(-2px); }
.btn-lg { padding: 16px 34px; font-size: 17px; }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ============ Шапка ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }

.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--blue), #1e40af);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 17px; letter-spacing: 0.02em;
  flex-shrink: 0;
}
.logo-text { line-height: 1.15; }
.logo-text b { display: block; color: var(--navy); font-size: 17px; font-weight: 800; }
.logo-text span { display: block; color: var(--muted); font-size: 12px; }

.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  padding: 9px 13px;
  border-radius: 10px;
  transition: all 0.15s ease;
  position: relative;
}
.main-nav a:hover { background: var(--blue-tint); color: var(--blue-dark); }
.main-nav a.active { color: var(--blue); background: var(--blue-tint); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 44px; height: 44px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--navy); border-radius: 2px; transition: all 0.2s; }

/* ============ Hero (главная) ============ */
.hero {
  padding: 88px 0 72px;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(37, 99, 235, 0.14), transparent 60%),
    radial-gradient(800px 400px at 100% 0%, rgba(37, 99, 235, 0.10), transparent 55%),
    var(--white);
}
.hero .eyebrow { margin-bottom: 18px; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); max-width: 780px; }
.hero p.lead { margin-top: 22px; max-width: 640px; font-size: 19px; }
.hero .btn-row { margin-top: 34px; }
.hero-note { margin-top: 16px; font-size: 14px; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 56px; }
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 30px; color: var(--blue); font-weight: 800; line-height: 1.1; }
.stat span { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); }

/* ============ Внутренний hero ============ */
.page-hero {
  padding: 64px 0 56px;
  background:
    radial-gradient(700px 320px at 10% -20%, rgba(37, 99, 235, 0.12), transparent 60%),
    var(--white);
}
.page-hero h1 { font-size: clamp(30px, 4.4vw, 44px); max-width: 760px; }
.page-hero p.lead { margin-top: 18px; max-width: 660px; }

/* ============ Карточки ============ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d3ddf0; }
.card h3 { font-size: 19px; margin: 16px 0 10px; }
.card p { font-size: 15px; }

.icon-circle {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--blue-tint);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  font-weight: 800;
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue-dark);
  background: var(--blue-tint);
  border-radius: 999px;
  padding: 5px 12px;
}

/* ============ Таймлайн истории ============ */
.timeline { position: relative; max-width: 820px; margin: 0 auto; padding-left: 30px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 8px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(var(--blue) 0%, #c7d7f7 100%);
}
.t-item { position: relative; padding: 0 0 42px 26px; }
.t-item:last-child { padding-bottom: 0; }
.t-item::before {
  content: "";
  position: absolute;
  left: -30px; top: 8px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--blue);
  box-shadow: 0 0 0 4px var(--blue-tint);
}
.t-year {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.t-item h3 { font-size: 20px; margin-bottom: 8px; }
.t-item p { color: var(--text); }
.t-fact {
  margin-top: 12px;
  background: var(--blue-tint);
  border-left: 3px solid var(--blue);
  border-radius: 0 10px 10px 0;
  padding: 10px 16px;
  font-size: 14.5px;
  color: var(--blue-dark);
  font-weight: 600;
}

/* ============ Команда ============ */
.team-card { text-align: center; }
.avatar {
  width: 88px; height: 88px;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #1e40af);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800;
  letter-spacing: 0.02em;
}
.team-card h3 { margin-top: 18px; font-size: 19px; }
.team-role { color: var(--blue); font-weight: 700; font-size: 14.5px; margin-top: 4px; }
.team-meta { margin-top: 10px; font-size: 14px; color: var(--muted); }
.team-card .chips { justify-content: center; }

/* ============ Кейсы ============ */
.case-card { display: flex; flex-direction: column; gap: 12px; }
.case-tag { font-size: 13px; color: var(--muted); font-weight: 600; }
.case-result {
  margin-top: auto;
  background: var(--blue-tint);
  border-radius: 12px;
  padding: 14px 18px;
  font-weight: 800;
  color: var(--blue-dark);
  font-size: 16px;
}

/* ============ Отзывы ============ */
.review-card { display: flex; flex-direction: column; gap: 14px; }
.stars { color: #e9a800; font-size: 16px; letter-spacing: 2px; }
.review-text { font-size: 15.5px; color: var(--text); flex: 1; }
.review-author { border-top: 1px solid var(--line); padding-top: 14px; }
.review-author b { display: block; color: var(--navy); font-size: 15px; }
.review-author span { color: var(--muted); font-size: 13.5px; }

/* ============ FAQ ============ */
.faq-list { max-width: 800px; margin: 0 auto; display: grid; gap: 14px; }
.faq-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 56px 20px 24px;
  font-weight: 700;
  color: var(--navy);
  font-size: 16.5px;
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 22px; top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  background: var(--blue-tint);
  color: var(--blue);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  transition: all 0.2s;
}
.faq-item[open] summary::after { content: "−"; background: var(--blue); color: #fff; }
.faq-item .faq-body { padding: 0 24px 20px; color: var(--text); font-size: 15.5px; }

/* ============ Контакты ============ */
.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 26px; align-items: start; }
.info-card { display: flex; gap: 16px; padding: 20px 22px; }
.info-card .icon-circle { width: 46px; height: 46px; font-size: 20px; flex-shrink: 0; }
.info-card b { display: block; color: var(--navy); font-size: 15.5px; }
.info-card p { font-size: 15px; margin-top: 3px; }

.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.form-card h3 { font-size: 22px; margin-bottom: 6px; }
.form-note { font-size: 13.5px; color: var(--muted); margin-bottom: 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 12px 16px;
  font-size: 15.5px;
  font-family: inherit;
  color: var(--navy);
  background: var(--alt);
  transition: border 0.15s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); background: #fff; }
.field textarea { min-height: 120px; resize: vertical; }
.form-success {
  display: none;
  margin-top: 16px;
  background: #e7f7ee;
  color: #14734a;
  border: 1px solid #bfe8d2;
  border-radius: 11px;
  padding: 14px 18px;
  font-size: 14.5px;
  font-weight: 600;
}
.small-print { font-size: 12.5px; color: var(--muted); margin-top: 14px; }

/* ============ CTA-полоса ============ */
.cta-band {
  background: linear-gradient(120deg, var(--navy) 0%, #16306b 60%, var(--blue-dark) 100%);
  border-radius: 22px;
  padding: 52px 48px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}
.cta-band h2 { color: #fff; font-size: clamp(22px, 3vw, 30px); max-width: 560px; }
.cta-band p { color: #c7d2ea; margin-top: 10px; max-width: 520px; }
.cta-band .btn-primary { background: #fff; color: var(--blue-dark); }
.cta-band .btn-primary:hover { background: #eaf1fe; box-shadow: 0 8px 20px rgba(0,0,0,0.25); }

/* ============ Список-шаги ============ */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.step { counter-increment: step; position: relative; padding-top: 10px; }
.step::before {
  content: counter(step);
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.step h3 { font-size: 17px; margin-bottom: 8px; }
.step p { font-size: 14.5px; }

/* ============ Мини-вехи на главной ============ */
.mini-hist { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.mini-hist .card .t-year { margin-bottom: 10px; }

/* ============ Подвал ============ */
.site-footer { background: var(--navy); color: #b9c4dd; margin-top: 90px; padding: 56px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 44px; }
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 16px; letter-spacing: 0.04em; }
.site-footer a { color: #b9c4dd; font-size: 14.5px; display: block; padding: 4px 0; }
.site-footer a:hover { color: #fff; }
.footer-about p { font-size: 14.5px; line-height: 1.7; margin-top: 16px; max-width: 320px; }
.footer-contacts p { font-size: 14.5px; line-height: 1.7; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); padding: 20px 0; font-size: 13px; color: #8fa0c4; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ============ Анимация появления (без JS, всегда видимы в итоге) ============ */
.reveal { animation: rise-soft 0.7s ease-out both; }
@keyframes rise-soft {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ Адаптив ============ */
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-4, .steps { grid-template-columns: repeat(2, 1fr); }
  .mini-hist { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 72px; left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 14px 24px 20px;
    gap: 2px;
    box-shadow: 0 20px 30px rgba(15, 31, 63, 0.08);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 14px; font-size: 16px; }
  .grid-2, .grid-3, .grid-4, .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .cta-band { padding: 36px 28px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .section { padding: 56px 0; }
}

/* ============ Фото в hero и на страницах ============ */
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.hero-photo {
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  background: var(--blue-tint);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; display: block; }

.photo-band {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  margin: 0 0 44px;
}
.photo-band img { width: 100%; height: auto; display: block; }
.photo-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(15, 31, 63, 0.82));
  color: #fff;
  padding: 46px 26px 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.avatar-img {
  width: 116px; height: 116px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto;
  display: block;
  box-shadow: 0 0 0 4px var(--blue-tint), 0 10px 24px rgba(15, 31, 63, 0.14);
}

/* ============ Онлайн-приёмная (чат) ============ */
.chat-fab {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 1000;
  display: flex; align-items: center; gap: 10px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.4);
  transition: all 0.2s ease;
}
.chat-fab:hover { background: var(--blue-dark); transform: translateY(-2px); }
.chat-fab svg { width: 20px; height: 20px; }

.chat-panel {
  position: fixed;
  right: 22px; bottom: 88px;
  z-index: 1000;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 31, 63, 0.28);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}
.chat-panel.open { opacity: 1; visibility: visible; transform: translateY(0); }

.chat-head {
  background: linear-gradient(120deg, var(--navy) 0%, #16306b 60%, var(--blue-dark) 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}
.chat-head img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255, 255, 255, 0.55); }
.chat-head-name b { display: block; font-size: 15px; }
.chat-head-name span { font-size: 12px; color: #c7d2ea; }
.chat-close {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: none;
  width: 34px; height: 34px;
  border-radius: 9px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-close:hover { background: rgba(255, 255, 255, 0.3); }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--alt);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg.bot { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; color: var(--text); }
.msg.user { background: var(--blue); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.msg.typing { color: var(--muted); font-style: italic; }
.msg a { color: var(--blue-dark); font-weight: 700; text-decoration: underline; }
.msg.user a { color: #fff; }

.chat-form-bubble { display: flex; flex-direction: column; gap: 8px; }
.chat-form-bubble b { color: var(--navy); font-size: 14.5px; }
.chat-form-bubble input {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--alt);
  color: var(--navy);
}
.chat-form-bubble input:focus { outline: none; border-color: var(--blue); background: #fff; }
.chat-submit {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.chat-submit:hover { background: var(--blue-dark); }

.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 16px 12px;
  background: var(--alt);
  flex-shrink: 0;
}
.chat-chip {
  background: #fff;
  border: 1.5px solid var(--blue);
  color: var(--blue-dark);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.chat-chip:hover { background: var(--blue-tint); transform: translateY(-1px); }

.chat-form { border-top: 1px solid var(--line); background: #fff; padding: 12px 14px; flex-shrink: 0; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input {
  flex: 1;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--alt);
  color: var(--navy);
  min-width: 0;
}
.chat-input:focus { outline: none; border-color: var(--blue); background: #fff; }
.chat-send {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.chat-send:hover { background: var(--blue-dark); }
.chat-note { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 8px; }
.chat-note a { color: var(--blue-dark); font-weight: 700; }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
}

@media (max-width: 760px) {
  .chat-fab { right: 14px; bottom: 14px; padding: 13px 18px; }
  .chat-panel {
    right: 12px; left: 12px;
    width: auto;
    bottom: 78px;
    height: min(560px, calc(100vh - 108px));
  }
}
