:root {
  /* --- ТЕМНАЯ ТЕМА (Основная) --- */
  --bg: #070b14;
  --bg2: #0b1224;
  --card: rgba(255, 255, 255, .05);
  --line: rgba(255, 255, 255, .12);
  --text: #eef2ff;
  --muted: #c7d0ea;
  --muted2: #aeb9da;
  --accent: #35e3a1; /* Зеленый акцент */
  --accent2: #7aa7ff; /* Синий акцент */
  --shadow: 0 18px 55px rgba(0, 0, 0, .45);
  --radius: 18px;
  --max: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 18% 0%, rgba(122, 167, 255, .20), transparent 55%),
    radial-gradient(900px 650px at 82% 10%, rgba(53, 227, 161, .16), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  min-height: 100vh;
}

/* Ссылки и кнопки */
a { color: inherit; text-decoration: none; transition: 0.2s; }
a:hover { color: #fff; }
button { font-family: inherit; }

/* --- КОНТЕЙНЕР (Исправлены отступы) --- */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px; /* Базовый отступ для ПК */
  width: 100%;
}

/* Карточки (общий стиль) */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* --- HEADER (ШАПКА) --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(140%) blur(12px);
  background: rgba(7, 11, 20, .85);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 20px;
}

/* Логотип */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.brand__logo { width: 55px; height: auto; display: block; }
.brand__text { display: flex; flex-direction: column; gap: 2px; }
.brand__text b { font-size: 18px; line-height: 1.1; letter-spacing: -0.01em; }
.brand__text span { font-size: 12px; line-height: 1.1; color: var(--muted2); }

/* Меню в центре */
.nav__menuChips {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.chiplink {
  display: inline-flex;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  transition: 0.2s;
}
.chiplink:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.nav__cta {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  text-decoration: none;
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  cursor: pointer;
  transition: .2s ease-in-out;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  user-select: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .1); border-color: #fff; }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: linear-gradient(135deg, rgba(53, 227, 161, .95), rgba(122, 167, 255, .80));
  border: 0;
  color: #07101f;
  font-weight: 800;
  box-shadow: 0 4px 15px rgba(53, 227, 161, .25);
}
.btn--primary:hover {
  box-shadow: 0 6px 20px rgba(53, 227, 161, .4);
  color: #000;
}

.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: rgba(255, 255, 255, .08); border-color: var(--line); }
.btn--big { padding: 16px 24px; font-size: 18px; border-radius: 16px; }

/* --- HERO SECTION --- */
.hero { padding: 30px 0 40px; }
.hero__grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1.3fr 0.9fr;
  align-items: start;
}
.hero__copy { padding: 32px; }
.hero__side { padding: 20px; }

h1 { margin: 0 0 16px; font-size: 38px; line-height: 1.15; letter-spacing: -0.02em; }
.lead { color: var(--muted); margin: 0 0 24px; font-size: 18px; }
.muted { color: var(--muted); }

.offer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0;
}
.offer__item {
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, .03);
}
.offer__item b { display: block; margin-bottom: 4px; color: #fff; }
.offer__item span { color: var(--muted); font-size: 13px; line-height: 1.3; display: block; }

.cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.trustline {
  display: flex; align-items: center; gap: 10px;
  margin-top: 20px; color: var(--muted); font-size: 14px;
}
.trustline__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(53, 227, 161, .15);
}

/* --- ЮРИСТ (Исправлено фото) --- */
.lawyer {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .03);
}
.lawyer__photo {
  width: 140px; height: 140px;
  flex-shrink: 0;
  border-radius: 50%; /* Круглое фото */
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .15);
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.lawyer__meta { display: flex; flex-direction: column; justify-content: center; }
.lawyer__meta b { font-size: 18px; margin-bottom: 6px; line-height: 1.2; color: #fff; }
.lawyer__meta span { display: block; color: var(--muted); font-size: 13px; }

.hero__quick { margin-top: 16px; }
.quick { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.quick:last-child { border-bottom: 0; }
.quick__k { color: var(--muted2); font-size: 12px; margin-bottom: 2px; }
.quick__v { font-size: 16px; font-weight: 500; }

/* --- SECTIONS --- */
.section { padding: 60px 0; }
.section--alt {
  background: rgba(255, 255, 255, .02);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.h2 { font-size: 32px; margin: 0 0 16px; }

.grid3 { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.grid4 { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }

.tile { padding: 20px; transition: .2s; }
.tile:hover { background: rgba(255, 255, 255, .06); }
.tile b { display: block; margin-bottom: 8px; font-size: 18px; }
.tile span { color: var(--muted); font-size: 15px; }

.step { padding: 20px; }
.step__n {
  font-weight: 900; color: var(--accent);
  font-size: 14px; margin-bottom: 8px; letter-spacing: 0.05em;
}

/* --- CASES --- */
.cases { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.case {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0; overflow: hidden;
  background: rgba(255, 255, 255, .03);
  cursor: pointer; text-align: left;
  transition: .2s;
}
.case:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.case img { display: block; width: 100%; height: 240px; object-fit: cover; }
.case__meta { padding: 16px; }
.case__meta b { display: block; font-size: 17px; margin-bottom: 4px; color: #fff; }
.case__meta span { color: var(--muted); font-size: 14px; }

/* --- CASES PAGE --- */
.h1 { font-size: 36px; margin: 0 0 12px; }
.caseList { display: grid; gap: 20px; margin-top: 24px; }
.caseHuman {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  padding: 24px;
}
.caseHuman__img {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  padding: 0; cursor: pointer;
  background: #000;
}
.caseHuman__img img {
  display: block; width: 100%; height: 100%;
  max-height: 350px; object-fit: cover;
  transition: .3s;
}
.caseHuman__img:hover img { opacity: 0.8; }
.caseHuman__body { display: flex; flex-direction: column; justify-content: center; }
.caseHuman__title { margin: 0 0 16px; font-size: 22px; line-height: 1.3; }
.caseHuman__grid {
  display: grid; gap: 12px;
  font-size: 16px; color: var(--muted);
}
.caseHuman__grid b { color: var(--text); margin-right: 6px; }

/* --- FOOTER & MAP --- */
.map { margin-top: 20px; padding: 10px; }
.map__body {
  min-height: 400px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

.footer { border-top: 1px solid var(--line); padding: 40px 0 100px; color: var(--muted); font-size: 14px; }
.footer__inner { display: grid; gap: 12px; }
.center { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* --- MOBILE BAR --- */
.mbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: none;
  padding: 12px;
  background: rgba(7, 11, 20, .9);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  gap: 10px;
}
.mbar .btn { flex: 1; padding: 12px; font-size: 14px; border-radius: 12px; }

/* --- SUBNAV --- */
.subnav { display: none; padding: 10px 0; border-bottom: 1px solid var(--line); background: rgba(7,11,20,.5); }
.subnav__inner { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
.subnav__btn {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .1);
  font-size: 14px; font-weight: 600;
}

/* --- MODAL (ИСПРАВЛЕННАЯ ВЕРСИЯ) --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(5px);
  
  /* Скролл для длинных форм */
  overflow-y: auto; 
  -webkit-overflow-scrolling: touch;
  
  /* Центровка для ПК */
  align-items: center; 
  justify-content: center;
  padding: 20px;
}

.modal.is-open { display: flex; }

.modal__panel {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: #121829;
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0,0,0,.8);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  margin: auto; /* Центровка при flex */
}

.modal__head {
  /* ЛИПКАЯ ШАПКА */
  position: sticky;
  top: 0;
  z-index: 10;
  
  padding: 16px 20px;
  background: rgba(18, 24, 41, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal__body {
  padding: 20px;
  background: #121829;
  border-radius: 0 0 16px 16px;
}

/* --- АДАПТИВ (MOBILE) --- */
@media (max-width: 920px) {
  .nav__menuChips { display: none; }
  .subnav { display: block; }
  .mbar { display: flex; }

  .hero__grid { grid-template-columns: 1fr; }
  .offer { grid-template-columns: 1fr; }
  .grid3, .grid4, .cases { grid-template-columns: 1fr; }
  
  .caseHuman { grid-template-columns: 1fr; }
  .caseHuman__img { height: 250px; }
  
  h1 { font-size: 28px; }
  .brand__logo { width: 45px; }
  .brand__text b { font-size: 16px; }
  .nav__cta .btn { padding: 8px 12px; font-size: 14px; }
  
  /* Юрист на мобильном */
  .lawyer {
    flex-direction: row;
    align-items: center;
    padding: 16px;
    gap: 16px;
  }
  .lawyer__photo {
    width: 100px; 
    height: 100px;
  }
  .lawyer__meta b { font-size: 16px; }
}

/* --- АДАПТИВ ДЛЯ ТЕЛЕФОНОВ (МЕЛКИЕ ЭКРАНЫ) --- */
@media (max-width: 600px) {
  /* Отступы контейнера, чтобы лого не прилипало */
  .container { padding: 0 16px; }
  .nav__inner { padding: 12px 4px; }

  /* Модалка на весь экран */
  .modal {
    padding: 0;
    align-items: flex-start; /* Прижимаем к верху */
    background: #121829;
  }
  .modal.is-open { display: block; } /* Block для скролла */

  .modal__panel {
    max-width: 100%;
    min-height: 100%;
    border-radius: 0;
    border: none;
    box-shadow: none;
    margin: 0;
  }
  .modal__head { border-radius: 0; padding: 12px 16px; }
  .modal__body { padding: 16px; border-radius: 0; }
}

/* --- СВЕТЛАЯ ТЕМА (LIGHT MODE) --- */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f7fc;
    --bg2: #ffffff;
    --card: #ffffff;
    --line: #e2e8f0;
    --text: #1a202c;
    --muted: #4a5568;
    --muted2: #718096;
    --shadow: 0 10px 30px rgba(0, 0, 0, .06);
  }

  body {
    background:
      radial-gradient(1000px 600px at 20% 0%, rgba(59, 130, 246, .08), transparent 50%),
      radial-gradient(800px 600px at 80% 10%, rgba(16, 185, 129, .08), transparent 50%),
      linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  }

  .nav { background: rgba(255, 255, 255, .9); border-bottom-color: var(--line); }
  .brand__text b { color: #000; }
  
  .card { background: #fff; border-color: var(--line); }
  .offer__item, .lawyer, .case { background: #f8fafc; border-color: var(--line); }
  .offer__item b, .case__meta b { color: #1a202c; }
  
  .btn { background: #f1f5f9; color: #1a202c; border-color: var(--line); }
  .btn:hover { background: #e2e8f0; }
  .btn--primary { background: linear-gradient(135deg, #10b981, #3b82f6); color: #fff; }
  
  .chiplink:hover { background: rgba(0,0,0,.05); color: #000; }
  
  /* Модалка светлая */
  .modal__panel, .modal__body { background: #fff; }
  .modal__head { background: rgba(255,255,255,.95); }
  @media (max-width: 600px) { .modal { background: #fff; } }
  
  .subnav { background: #fff; }
  .subnav__btn { background: #f1f5f9; color: #000; border: 1px solid var(--line); }
  
  .mbar { background: rgba(255, 255, 255, .95); border-top-color: var(--line); }
}