/* Юрист РБ — лендинг (/, /citizens, /business).
   Токены и общие классы — в theme.css. Здесь — раскладка страницы и различия двух дизайнов:
   «Современный» (по умолчанию) и «Классика» (:root[data-design="classic"]). HTML у обоих общий. */

/* ===================== Локальные переменные ===================== */

.landing {
  --header-h: 64px;
  --section-y: clamp(64px, 9vw, 112px);
  --mark-bg: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --mark-fg: #ffffff;
  --icon-bg: var(--accent-soft);
  --icon-fg: var(--link);
  --card-radius: var(--radius-lg);
}

:root[data-design="classic"] .landing {
  --header-h: 66px;
  --mark-bg: #1c355e;
  --mark-fg: #e0c486;
  --icon-bg: transparent;
  --icon-fg: var(--accent-3);
}

@media (prefers-color-scheme: dark) {
  :root[data-design="classic"] .landing {
    --mark-bg: #d1ad62;
    --mark-fg: #15110a;
  }
}

html {
  scroll-padding-top: calc(var(--header-h, 64px) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

main {
  display: block;
  overflow-x: hidden;
  overflow-x: clip;
}

main:focus {
  outline: none;
}

/* ===================== Направление: граждане / бизнес ===================== */

:root[data-audience="business"] [data-aud="citizen"],
:root:not([data-audience="business"]) [data-aud="business"] {
  display: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  [data-aud] {
    animation: aud-in 0.35s var(--ease) both;
  }
}

/* На время смены направления — без «якоря прокрутки» браузера: позицию держит landing.js */
.aud-switching,
.aud-switching body {
  overflow-anchor: none;
}

@keyframes aud-in {
  from {
    opacity: 0;
  }
}

/* ===================== Шапка ===================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top);
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}

:root:not([data-design="classic"]) .site-header {
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
}

.site-header.is-scrolled,
.site-header.nav-open {
  border-bottom-color: var(--border);
}

:root:not([data-design="classic"]) .site-header.is-scrolled {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02), 0 8px 24px -16px rgba(0, 0, 0, 0.18);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  min-height: 44px;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--mark-bg);
  color: var(--mark-fg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 4px 10px -4px color-mix(in srgb, var(--accent) 60%, transparent);
}

.brand-mark .icon {
  width: 20px;
  height: 20px;
}

.brand-name {
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-cta .icon {
  width: 16px;
  height: 16px;
}

.cta-short {
  display: none;
}

@media (max-width: 419px) {
  .cta-long {
    display: none;
  }

  .cta-short {
    display: inline;
  }
}

@media (max-width: 559px) {
  .header-login {
    display: none;
  }
}

/* Меню разделов: на телефоне — выпадающая панель, на компьютере — строка ссылок */
.nav-list {
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.nav-link:hover {
  color: var(--text);
  text-decoration: none;
}

@media (max-width: 959px) {
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow: auto;
    padding: 8px max(16px, env(safe-area-inset-left)) 20px max(16px, env(safe-area-inset-right));
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }

  .site-nav.is-open {
    display: block;
    animation: nav-in 0.18s var(--ease);
  }

  .nav-list {
    display: grid;
    gap: 2px;
  }

  .nav-link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 17px;
    font-weight: 500;
  }

  .nav-link:hover {
    background: var(--surface-2);
  }

  .nav-extra {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
  }
}

@media (min-width: 560px) and (max-width: 959px) {
  .nav-extra {
    display: none;
  }
}

@media (min-width: 960px) {
  .site-nav {
    display: flex;
    align-items: center;
    margin-left: 32px;
  }

  .nav-list {
    display: flex;
    gap: 2px;
  }

  .nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 500;
  }

  .nav-link:hover,
  .nav-link.is-active {
    background: var(--surface-2);
  }

  .nav-link.is-active {
    color: var(--text);
  }

  .nav-extra,
  .nav-toggle {
    display: none;
  }
}

@media (min-width: 960px) and (max-width: 1079px) {
  .site-nav {
    margin-left: 16px;
  }

  .nav-link {
    padding-inline: 9px;
  }
}

@keyframes nav-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* ===================== Первый экран ===================== */

.hero {
  position: relative;
  isolation: isolate;
  padding: clamp(32px, 6vw, 88px) 0 clamp(56px, 8vw, 104px);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* «Современный»: мягкое свечение и сетка, растворяющаяся книзу */
.hero-bg::before,
.hero-bg::after {
  content: "";
  position: absolute;
}

.hero-bg::before {
  inset: -30% -20% 10% -20%;
  background:
    radial-gradient(38% 46% at 72% 34%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%),
    radial-gradient(30% 40% at 90% 70%, color-mix(in srgb, var(--accent-3) 18%, transparent), transparent 70%),
    radial-gradient(34% 42% at 18% 12%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 70%);
  filter: blur(8px);
}

.hero-bg::after {
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center top;
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 0%, transparent 75%);
}

.hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
    gap: 56px;
  }
}

@media (min-width: 1200px) {
  .hero-grid {
    gap: 72px;
  }
}

.hero-copy {
  min-width: 0;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.hero-eyebrow .icon {
  width: 18px;
  height: 18px;
  color: var(--link);
}

.hero-title {
  margin-top: 14px;
  font-size: clamp(34px, 5.4vw, 60px);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  :root:not([data-design="classic"]) .hero-title em {
    background: linear-gradient(95deg, var(--accent) 0%, var(--accent-2) 55%, var(--accent-3) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }
}

.hero-lead {
  max-width: 34em;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

@media (max-width: 479px) {
  .hero-actions .btn {
    flex: 1 1 100%;
  }
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 24px;
  list-style: none;
  color: var(--text-muted);
  font-size: 14.5px;
}

.hero-points li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-points .icon {
  width: 18px;
  height: 18px;
  color: var(--success);
}

/* --- Переключатель «Гражданам | Бизнесу и ИП» --- */

.segmented {
  position: relative;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
}

.seg-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.seg-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.seg-option:hover {
  color: var(--text);
}

.seg-option .icon {
  width: 18px;
  height: 18px;
}

.seg-input:checked + .seg-option {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.seg-input:focus-visible + .seg-option {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.segmented-sm .seg-option {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 14px;
}

@media (pointer: coarse) {
  .seg-option,
  .segmented-sm .seg-option {
    min-height: 44px;
  }
}

@media (max-width: 479px) {
  .hero-switch {
    display: flex;
    width: 100%;
  }

  .hero-switch .seg-option {
    flex: 1 1 0;
    padding-inline: 10px;
  }
}

/* --- Пример ответа --- */

.demo {
  position: relative;
  isolation: isolate;
  min-width: 0;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

:root:not([data-design="classic"]) .demo::before {
  content: "";
  position: absolute;
  inset: 10% -8% 0 8%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 34%, transparent), transparent);
  filter: blur(36px);
  pointer-events: none;
}

.demo-window {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius-lg) + 4px);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.demo-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}

.demo-dots {
  display: inline-flex;
  gap: 6px;
}

.demo-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
}

.demo-title {
  font-size: 14px;
  font-weight: 600;
}

.demo-tag {
  margin-left: auto;
}

.demo-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 20px 8px;
  font-size: 14.5px;
  line-height: 1.55;
}

.demo-user {
  align-self: flex-end;
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 18px 18px 6px 18px;
  background: var(--bubble-user-bg);
  color: var(--bubble-user-text);
}

.demo-steps {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 8px;
  border-radius: var(--radius-pill);
  background: var(--success-soft);
  color: var(--success);
  font-size: 13px;
  font-weight: 600;
}

.demo-steps .icon {
  width: 16px;
  height: 16px;
}

.demo-bot {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
}

.demo-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--mark-bg);
  color: var(--mark-fg);
}

.demo-avatar .icon {
  width: 17px;
  height: 17px;
}

.demo-answer p + p {
  margin-top: 8px;
}

.demo-h {
  font-weight: 650;
}

.demo-answer ol {
  margin-top: 4px;
  padding-left: 1.25em;
}

.demo-answer li + li {
  margin-top: 4px;
}

.demo-norms {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  font-size: 13.5px;
}

.demo-norms-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
}

.demo-norms-title .icon {
  width: 16px;
  height: 16px;
  color: var(--link);
}

.demo-norms ul {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  list-style: none;
}

.demo-norms li {
  position: relative;
  padding-left: 14px;
  color: var(--link);
}

.demo-norms li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.demo-note {
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 12.5px;
  font-style: italic;
}

.demo-composer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 16px 16px;
  padding: 7px 7px 7px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-faint);
  font-size: 14px;
}

.demo-composer > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-send {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
}

.demo-send .icon {
  width: 16px;
  height: 16px;
}

.demo-caption {
  margin-top: 14px;
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 479px) {
  .demo-body {
    padding: 16px 14px 6px;
    font-size: 14px;
  }

  .demo-bot {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .demo-composer {
    margin-inline: 12px;
  }
}

/* ===================== Секции ===================== */

.section {
  padding-block: var(--section-y);
}

.section-alt {
  background: var(--bg-elev);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.section-head-split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
  max-width: none;
}

.section-head-split > div {
  max-width: 680px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--link);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eyebrow-mark {
  display: none;
}

.section-title {
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.12;
}

.section-lead {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: clamp(16.5px, 1.4vw, 18px);
}

.section-head.center .section-lead {
  margin-inline: auto;
  max-width: 36em;
}

/* --- Преимущества --- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
  list-style: none;
}

@media (min-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.feature {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.feature-icon,
.trust-icon,
.topic-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--icon-bg);
  color: var(--icon-fg);
}

.feature-icon .icon,
.trust-icon .icon,
.topic-icon .icon {
  width: 22px;
  height: 22px;
}

.feature-icon {
  margin-bottom: 18px;
}

.feature-title {
  font-size: 18px;
}

.feature p {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 15.5px;
}

/* --- Как это работает --- */

.steps {
  display: grid;
  gap: 16px;
  list-style: none;
}

@media (min-width: 880px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
}

.step {
  display: flex;
  flex-direction: column;
  padding: 26px 24px 24px;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.step-num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--mark-bg);
  color: var(--mark-fg);
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 80%, transparent);
}

.num-roman {
  display: none;
}

.step-title {
  font-size: 19px;
}

.step p {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 15.5px;
}

.step .step-visual {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
}

.step-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.step-chip .icon {
  width: 15px;
  height: 15px;
}

.step-chip-input {
  width: 100%;
  border-radius: var(--radius-md);
  color: var(--text-faint);
  font-weight: 500;
}

.step-chip-input > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-chip-norm {
  color: var(--link);
}

.step-chip-ok {
  border-color: transparent;
  background: var(--success-soft);
  color: var(--success);
}

/* --- Темы --- */

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  list-style: none;
}

.topic-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.topic-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.topic-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topic-icon {
  width: 42px;
  height: 42px;
}

.topic-title {
  font-size: 17.5px;
}

.topic-examples {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  list-style: none;
}

.topic-examples li {
  padding: 9px 13px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.45;
}

.topic-examples li::before {
  content: "«";
}

.topic-examples li::after {
  content: "»";
}

.topics-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: 24px;
  padding: 20px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--card-radius);
  color: var(--text-muted);
}

.topics-more > span {
  flex: 1 1 320px;
}

@media (max-width: 479px) {
  .topics-more {
    padding: 18px;
  }

  .topics-more .btn {
    flex: 1 1 100%;
  }
}

/* --- Надёжность --- */

.trust-grid {
  display: grid;
  gap: 40px;
}

@media (min-width: 1024px) {
  .trust-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 64px;
    align-items: start;
  }
}

.trust-list {
  display: grid;
  gap: 26px;
  margin-top: 36px;
  list-style: none;
}

.trust-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 18px;
}

.trust-title {
  font-size: 18px;
}

.trust-item p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 15.5px;
}

.lawbase {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

@media (min-width: 1024px) {
  .lawbase {
    position: sticky;
    top: calc(var(--header-h) + 24px);
  }
}

.lawbase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lawbase-title {
  font-size: 20px;
}

.lawbase-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  list-style: none;
}

.lawbase-list li {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.4;
}

.lawbase-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 13.5px;
}

.lawbase-note .icon {
  width: 16px;
  height: 16px;
}

/* --- Тарифы --- */

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
  align-items: stretch;
}

@media (min-width: 1100px) {
  .plan-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 26px 24px 24px;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.plan-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 22px 44px -24px color-mix(in srgb, var(--accent) 65%, transparent);
}

.plan-label {
  align-self: flex-start;
  margin-bottom: 14px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.plan-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 21px;
}

.plan-tagline {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.5;
}

.plan-price {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-tracking);
  line-height: 1.15;
}

.plan-price-soon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.plan-price-soon .icon {
  width: 16px;
  height: 16px;
}

.plan-features {
  display: grid;
  gap: 10px;
  margin: 20px 0 24px;
  list-style: none;
  font-size: 15px;
}

.plan-features li {
  display: flex;
  gap: 10px;
  line-height: 1.45;
}

.plan-features .icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--success);
}

.plan-cta {
  margin-top: auto;
}

.plan-soon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: auto;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-faint);
  font-size: 15px;
  font-weight: 600;
}

.plan-skeleton {
  min-height: 380px;
  background:
    linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--surface-2) 80%, transparent) 50%, transparent 80%) var(--surface);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}

.plans-error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  color: var(--danger);
}

.pricing-note {
  display: flex;
  gap: 12px;
  max-width: 820px;
  margin: 28px auto 0;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 14.5px;
}

.pricing-note .icon {
  margin-top: 2px;
  color: var(--link);
}

.pricing-note strong {
  color: var(--text);
}

/* --- Вопросы и ответы --- */

.faq-grid {
  display: grid;
  gap: 8px;
}

@media (min-width: 1024px) {
  .faq-grid {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 64px;
    align-items: start;
  }

  .faq-head {
    position: sticky;
    top: calc(var(--header-h) + 32px);
    margin-bottom: 0;
  }
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: var(--surface);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.faq-item[open] {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 16px 20px;
  border-radius: var(--card-radius);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary:focus-visible {
  outline-offset: -2px;
}

.faq-item summary .icon {
  color: var(--text-faint);
  transition: transform 0.2s var(--ease);
}

.faq-item[open] summary .icon {
  transform: rotate(180deg);
}

.faq-body {
  padding: 0 20px 20px;
  color: var(--text-muted);
}

.faq-body p + p {
  margin-top: 10px;
}

.tg-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
}

.tg-link:hover {
  text-decoration: underline;
}

.tg-link .icon {
  width: 18px;
  height: 18px;
}

/* --- Финальный призыв --- */

.cta-final {
  padding-top: calc(var(--section-y) * 0.8);
}

.cta-box {
  --cta-bg: linear-gradient(135deg, #4338ca 0%, #6d28d9 55%, #0e7490 130%);
  --cta-fg: #ffffff;
  --cta-muted: rgba(255, 255, 255, 0.82);
  --cta-btn-bg: #ffffff;
  --cta-btn-fg: #1e1b4b;
  --cta-btn2-border: rgba(255, 255, 255, 0.45);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(40px, 6vw, 72px) clamp(20px, 5vw, 64px);
  border-radius: calc(var(--radius-lg) + 8px);
  background: var(--cta-bg);
  color: var(--cta-fg);
  text-align: center;
}

.cta-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(40% 70% at 12% 0%, rgba(255, 255, 255, 0.22), transparent 70%),
    radial-gradient(36% 60% at 92% 100%, rgba(34, 211, 238, 0.28), transparent 70%);
  pointer-events: none;
}

.cta-title {
  max-width: 18em;
  margin-inline: auto;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  color: inherit;
}

.cta-lead {
  max-width: 34em;
  margin: 14px auto 0;
  color: var(--cta-muted);
  font-size: 17px;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

/* Кнопки на цветной плашке; селекторы сильнее правил дизайнов из theme.css */
.cta-box .cta-actions .btn-primary,
.cta-box .cta-actions .btn-primary:hover {
  border-color: var(--cta-btn-bg);
  background: var(--cta-btn-bg);
  color: var(--cta-btn-fg);
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.5);
}

.cta-box .cta-actions .btn-primary:hover {
  filter: brightness(0.96);
}

.cta-box .cta-actions .btn-secondary,
.cta-box .cta-actions .btn-secondary:hover {
  border-color: var(--cta-btn2-border);
  background: transparent;
  color: var(--cta-fg);
  box-shadow: none;
}

.cta-box .cta-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.cta-box :focus-visible {
  outline-color: var(--cta-fg);
}

@media (max-width: 479px) {
  .cta-actions .btn {
    flex: 1 1 100%;
  }
}

/* ===================== Подвал ===================== */

.site-footer {
  padding: 56px 0 calc(72px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 15px;
}

.footer-grid {
  display: grid;
  gap: 32px;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
    gap: 40px;
  }
}

.footer-about,
.footer-text {
  margin-top: 12px;
  max-width: 30em;
  color: var(--text-muted);
}

.footer-text {
  margin-top: 0;
  margin-bottom: 4px;
}

.footer-h {
  margin-bottom: 12px;
  color: var(--text-faint);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-links {
  display: grid;
  gap: 2px;
  list-style: none;
}

.footer-links a,
.footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.footer-links a:hover,
.footer-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-disclaimer {
  display: flex;
  gap: 12px;
  margin-top: 40px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}

.footer-disclaimer .icon {
  margin-top: 1px;
  color: var(--warning);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 24px;
  color: var(--text-faint);
  font-size: 13.5px;
}

/* Юридические тексты в окне */
.legal-body {
  font-size: 15px;
  line-height: 1.6;
}

.legal-body:focus-visible {
  outline-offset: -2px;
}

.legal-error {
  color: var(--danger);
}

.legal-error + .btn {
  margin-top: 12px;
}

/* ===================== Появление при прокрутке ===================== */

.js-reveal .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* =====================================================================
   «Классика»: юридический документ — серифные заголовки, тонкие линейки,
   золото на тёмно-синем, сдержанные радиусы и никаких свечений.
   ===================================================================== */

:root[data-design="classic"] .site-header {
  border-top: 3px solid var(--accent);
  border-bottom-color: var(--border);
}

:root[data-design="classic"] .brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
}

:root[data-design="classic"] .brand-mark {
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px rgba(209, 173, 98, 0.55);
}

:root[data-design="classic"] .nav-link {
  border-radius: 0;
}

@media (min-width: 960px) {
  :root[data-design="classic"] .nav-link:hover,
  :root[data-design="classic"] .nav-link.is-active {
    background: none;
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--accent-2);
    text-decoration-thickness: 2px;
    text-underline-offset: 8px;
  }
}

/* Первый экран: бумага, крупный знак параграфа на фоне вместо свечения */
:root[data-design="classic"] .hero {
  border-bottom: 1px solid var(--border);
}

:root[data-design="classic"] .hero-bg::before {
  inset: auto -2% -18% auto;
  content: "§";
  background: none;
  filter: none;
  color: var(--accent-2);
  font-family: var(--font-display);
  font-size: clamp(320px, 42vw, 620px);
  line-height: 1;
  opacity: 0.07;
}

:root[data-design="classic"] .hero-bg::after {
  content: none;
}

:root[data-design="classic"] .hero-eyebrow {
  color: var(--accent-3);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

:root[data-design="classic"] .hero-eyebrow .icon {
  display: none;
}

:root[data-design="classic"] .hero-eyebrow::before {
  content: "";
  width: 36px;
  height: 1px;
  background: var(--accent-2);
}

:root[data-design="classic"] .hero-title {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

:root[data-design="classic"] .hero-title em {
  font-style: italic;
  color: var(--accent-3);
}

:root[data-design="classic"] .hero-points .icon {
  color: var(--accent-3);
}

:root[data-design="classic"] .segmented {
  border-color: var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

:root[data-design="classic"] .seg-option {
  border-radius: 2px;
  letter-spacing: 0.01em;
}

:root[data-design="classic"] .seg-input:checked + .seg-option {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: none;
}

/* Пример ответа — как справка на бумаге */
:root[data-design="classic"] .demo-window {
  border-color: var(--border-strong);
  border-top: 3px solid var(--accent-2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 10px 10px 0 -1px var(--surface-2), 10px 10px 0 0 var(--border);
}

:root[data-design="classic"] .demo-bar {
  background: var(--surface);
}

:root[data-design="classic"] .demo-dots {
  display: none;
}

:root[data-design="classic"] .demo-title {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:root[data-design="classic"] .demo-user {
  border-radius: var(--radius-md) var(--radius-md) 2px var(--radius-md);
}

:root[data-design="classic"] .demo-steps {
  border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
  border-radius: var(--radius-sm);
}

:root[data-design="classic"] .demo-avatar {
  border-radius: var(--radius-sm);
}

:root[data-design="classic"] .demo-norms {
  border-left: 3px solid var(--accent-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-elev);
}

:root[data-design="classic"] .demo-norms-title {
  font-family: var(--font-display);
  font-size: 14px;
}

:root[data-design="classic"] .demo-norms-title .icon {
  color: var(--accent-3);
}

:root[data-design="classic"] .demo-composer {
  border-radius: var(--radius-md);
}

:root[data-design="classic"] .demo-send {
  border-radius: var(--radius-sm);
}

/* Заголовки секций: «§ 2 — Как это работает» */
:root[data-design="classic"] .eyebrow {
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--accent-3);
  font-size: 12.5px;
  letter-spacing: 0.16em;
}

:root[data-design="classic"] .eyebrow-mark {
  display: inline;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

:root[data-design="classic"] .eyebrow::after {
  content: "";
  width: 40px;
  height: 1px;
  background: var(--accent-2);
}

:root[data-design="classic"] .section-head.center .eyebrow::before {
  content: "";
  width: 40px;
  height: 1px;
  background: var(--accent-2);
}

:root[data-design="classic"] .section-title {
  font-size: clamp(28px, 3.4vw, 42px);
  letter-spacing: -0.005em;
}

:root[data-design="classic"] .section-alt {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

@media (prefers-color-scheme: dark) {
  :root[data-design="classic"] .section-alt {
    background: var(--bg-elev);
    border-color: var(--border);
  }
}

/* Преимущества — колонки с линейкой сверху, без карточек */
:root[data-design="classic"] .feature-grid {
  gap: 32px 28px;
}

:root[data-design="classic"] .feature {
  padding: 22px 0 0;
  border: 0;
  border-top: 2px solid var(--accent);
  border-radius: 0;
  background: none;
  box-shadow: none;
}

:root[data-design="classic"] .feature-icon,
:root[data-design="classic"] .trust-icon,
:root[data-design="classic"] .topic-icon {
  border: 1px solid var(--accent-2);
  border-radius: 50%;
}

:root[data-design="classic"] .feature-title,
:root[data-design="classic"] .step-title,
:root[data-design="classic"] .topic-title,
:root[data-design="classic"] .trust-title {
  font-size: 20px;
}

/* Шаги — римские цифры */
:root[data-design="classic"] .step {
  padding: 24px 0 0;
  border: 0;
  border-top: 1px solid var(--border-strong);
  border-radius: 0;
  background: none;
  box-shadow: none;
}

:root[data-design="classic"] .step-num {
  place-items: start;
  width: auto;
  height: auto;
  margin-bottom: 10px;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--accent-3);
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 400;
  line-height: 1;
}

:root[data-design="classic"] .num-roman {
  display: inline;
}

:root[data-design="classic"] .num-arabic {
  display: none;
}

:root[data-design="classic"] .step-chip {
  border-color: var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

:root[data-design="classic"] .step-chip-ok {
  border-color: transparent;
  background: var(--success-soft);
}

/* Темы — карточки-выписки, примеры курсивом */
:root[data-design="classic"] .topic-card {
  border-color: var(--border-strong);
  box-shadow: none;
}

:root[data-design="classic"] .topic-card:hover {
  border-color: var(--accent-2);
  box-shadow: none;
}

:root[data-design="classic"] .topic-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

:root[data-design="classic"] .topic-examples li {
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--accent-2);
  border-radius: 0;
  background: none;
  font-family: var(--font-display);
  font-size: 15.5px;
  font-style: italic;
}

:root[data-design="classic"] .topics-more {
  border-style: solid;
  border-color: var(--border-strong);
  background: var(--surface);
}

/* Надёжность — реестр актов */
:root[data-design="classic"] .lawbase {
  border-color: var(--border-strong);
  border-top: 3px solid var(--accent-2);
  box-shadow: var(--shadow-md);
}

:root[data-design="classic"] .lawbase-title {
  font-size: 22px;
}

:root[data-design="classic"] .lawbase-list {
  display: block;
  columns: 2 200px;
  column-gap: 28px;
  counter-reset: law;
}

:root[data-design="classic"] .lawbase-list li {
  display: flex;
  gap: 8px;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px dotted var(--border-strong);
  border-radius: 0;
  background: none;
  break-inside: avoid;
  counter-increment: law;
}

:root[data-design="classic"] .lawbase-list li::before {
  content: counter(law) ".";
  flex: none;
  min-width: 1.6em;
  color: var(--accent-3);
  font-family: var(--font-display);
}

/* Тарифы */
:root[data-design="classic"] .plan {
  border-color: var(--border-strong);
  box-shadow: none;
}

:root[data-design="classic"] .plan-featured {
  border-color: var(--border-strong);
  border-top: 3px solid var(--accent-2);
  box-shadow: var(--shadow-md);
}

:root[data-design="classic"] .plan-label {
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--accent-3);
  letter-spacing: 0.14em;
}

:root[data-design="classic"] .plan-name {
  font-size: 23px;
}

:root[data-design="classic"] .plan-price-soon {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

:root[data-design="classic"] .plan-features .icon {
  color: var(--accent-3);
}

:root[data-design="classic"] .pricing-note {
  border-color: var(--border-strong);
  border-left: 3px solid var(--accent-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface);
}

:root[data-design="classic"] .pricing-note .icon {
  color: var(--accent-3);
}

/* Вопросы — список с линейками */
:root[data-design="classic"] .faq-list {
  gap: 0;
  border-top: 1px solid var(--border-strong);
}

:root[data-design="classic"] .faq-item,
:root[data-design="classic"] .faq-item[open] {
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
  background: none;
  box-shadow: none;
}

:root[data-design="classic"] .faq-item summary {
  padding-inline: 4px;
  border-radius: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
}

:root[data-design="classic"] .faq-item summary .icon {
  color: var(--accent-3);
}

:root[data-design="classic"] .faq-body {
  padding: 0 4px 22px;
}

/* Финальный призыв — тёмно-синяя плашка с золотом */
:root[data-design="classic"] .cta-box {
  --cta-bg: #172b4d;
  --cta-fg: #f6f2e9;
  --cta-muted: rgba(246, 242, 233, 0.8);
  --cta-btn-bg: #d1ad62;
  --cta-btn-fg: #15110a;
  --cta-btn2-border: rgba(209, 173, 98, 0.7);
  border: 1px solid #b38b3d;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 6px #172b4d, inset 0 0 0 7px rgba(209, 173, 98, 0.45);
}

:root[data-design="classic"] .cta-glow {
  display: none;
}

:root[data-design="classic"] .cta-title {
  font-weight: 600;
}

@media (prefers-color-scheme: dark) {
  :root[data-design="classic"] .cta-box {
    --cta-bg: #162133;
    --cta-fg: #ece5d6;
    --cta-muted: #b6af9f;
    box-shadow: inset 0 0 0 6px #162133, inset 0 0 0 7px rgba(209, 173, 98, 0.35);
  }
}

/* Подвал */
:root[data-design="classic"] .site-footer {
  border-top: 3px double var(--border-strong);
}

:root[data-design="classic"] .footer-disclaimer {
  border-color: var(--border-strong);
  border-left: 3px solid var(--accent-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

:root[data-design="classic"] .footer-disclaimer .icon {
  color: var(--accent-3);
}
