.legal-page {
  min-width: 320px;
  scroll-snap-type: none;
  background: #f3efe6;
  color: #18201d;
  font-size: 16px;
  transition: none;
}

.legal-page * {
  scroll-margin-top: 112px;
}

.legal-page .skip-link {
  z-index: 100;
}

.legal-shell {
  width: min(1120px, calc(100% - 96px));
  margin-inline: auto;
}

.legal-header {
  position: sticky;
  z-index: 40;
  top: 0;
  border-bottom: 1px solid rgba(24, 32, 29, 0.12);
  background: rgba(250, 248, 242, 0.92);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.legal-header__inner {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.legal-header__brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.legal-header__brand img {
  width: 154px;
  height: auto;
}

.legal-header__back {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: #38433e;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.legal-header__back svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  transition: transform 0.3s var(--ease-out);
}

.legal-header__back:hover,
.legal-header__back:focus-visible {
  color: #8a6429;
}

.legal-header__back:hover svg,
.legal-header__back:focus-visible svg {
  transform: translateX(-4px);
}

.legal-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(72px, 9vw, 118px) 0 clamp(64px, 8vw, 96px);
  background:
    radial-gradient(circle at 78% 20%, rgba(205, 164, 87, 0.14), transparent 34%),
    linear-gradient(135deg, #06271f 0%, #0a3a2d 70%, #123f33 100%);
  color: #f8f4eb;
}

.legal-hero::after {
  position: absolute;
  z-index: -1;
  top: -190px;
  right: -80px;
  width: 560px;
  height: 560px;
  border: 1px solid rgba(215, 169, 79, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 74px rgba(215, 169, 79, 0.035), 0 0 0 148px rgba(215, 169, 79, 0.025);
  content: "";
}

.legal-hero__eyebrow {
  margin: 0 0 24px;
  color: #d7a94f;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.legal-hero h1 {
  max-width: 920px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.2rem, 7vw, 6.4rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.96;
  text-wrap: balance;
}

.legal-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 34px;
  color: rgba(248, 244, 235, 0.7);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.legal-hero__meta span + span {
  position: relative;
  padding-left: 25px;
}

.legal-hero__meta span + span::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 1px;
  height: 20px;
  background: rgba(248, 244, 235, 0.24);
  content: "";
  transform: translateY(-50%);
}

.legal-main {
  background:
    linear-gradient(rgba(24, 32, 29, 0.025) 1px, transparent 1px),
    #f3efe6;
  background-size: 100% 96px;
}

.legal-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 760px);
  justify-content: space-between;
  gap: clamp(48px, 7vw, 96px);
  padding-block: 64px 128px;
}

.legal-layout--single {
  grid-template-columns: minmax(0, 820px);
  justify-content: center;
}

.legal-toc {
  position: sticky;
  top: 118px;
  align-self: start;
  padding-top: 8px;
}

.legal-toc__label {
  margin: 0 0 20px;
  color: #8a6429;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.legal-toc ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: legal-toc;
}

.legal-toc li {
  counter-increment: legal-toc;
}

.legal-toc a {
  display: grid;
  min-height: 40px;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(24, 32, 29, 0.1);
  color: #4f5954;
  font-size: 0.78rem;
  line-height: 1.35;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.legal-toc a::before {
  color: #9a7435;
  content: counter(legal-toc, decimal-leading-zero);
  font-family: var(--serif);
  font-size: 0.92rem;
}

.legal-toc a:hover,
.legal-toc a:focus-visible {
  padding-left: 4px;
  color: #0a3a2d;
}

.legal-document {
  max-width: 100%;
  padding: clamp(34px, 5vw, 64px);
  border: 1px solid rgba(24, 32, 29, 0.14);
  border-radius: 20px;
  background: #faf8f2;
  box-shadow: 0 28px 90px rgba(28, 31, 25, 0.08);
}

.legal-document__lead {
  margin: 0 0 44px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(24, 32, 29, 0.14);
  color: #33403a;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  line-height: 1.35;
}

.legal-document__section + .legal-document__section {
  margin-top: 54px;
}

.legal-document h2 {
  margin: 0 0 20px;
  color: #102b23;
  font-family: var(--serif);
  font-size: clamp(1.85rem, 3.2vw, 2.45rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.08;
  text-wrap: balance;
}

.legal-document h3 {
  margin: 30px 0 12px;
  color: #26332d;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.45;
  text-transform: uppercase;
}

.legal-document p,
.legal-document li,
.legal-document dd,
.legal-document dt {
  max-width: 72ch;
  font-size: 1rem;
  line-height: 1.78;
}

.legal-document p {
  margin: 0;
}

.legal-document p + p {
  margin-top: 16px;
}

.legal-document ul,
.legal-document ol {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding-left: 1.35em;
}

.legal-document li::marker {
  color: #8a6429;
}

.legal-document a {
  color: #123f33;
  font-weight: 550;
  text-decoration: underline;
  text-decoration-color: #8a6429;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.legal-document a:hover,
.legal-document a:focus-visible {
  color: #8a6429;
}

.legal-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 26px 0 0;
  overflow: hidden;
  border: 1px solid rgba(24, 32, 29, 0.14);
  border-radius: 14px;
  background: rgba(24, 32, 29, 0.14);
}

.legal-facts > div {
  min-width: 0;
  padding: 20px;
  background: #f6f2e9;
}

.legal-facts dt {
  color: #727a75;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.legal-facts dd {
  margin: 7px 0 0;
  color: #1f2b26;
  font-size: 0.92rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.legal-callout {
  margin-top: 26px;
  padding: 24px 26px;
  border-left: 3px solid #b58a43;
  border-radius: 0 12px 12px 0;
  background: #f1eadc;
}

.legal-callout p {
  color: #33403a;
  font-size: 0.92rem;
}

.legal-callout strong {
  color: #0a3a2d;
}

.legal-steps {
  margin-top: 24px;
  border-top: 1px solid rgba(24, 32, 29, 0.14);
}

.legal-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 16px;
  padding: 21px 0;
  border-bottom: 1px solid rgba(24, 32, 29, 0.14);
}

.legal-step > span {
  color: #8a6429;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.45;
}

.legal-step p {
  font-size: 0.94rem;
}

.legal-signature {
  display: grid;
  gap: 10px;
  margin-top: 44px;
  padding: 28px;
  border: 1px solid rgba(24, 32, 29, 0.15);
  border-radius: 14px;
  background: #f6f2e9;
}

.legal-signature p {
  font-size: 0.88rem;
}

.legal-document__contacts {
  margin-top: 24px;
  padding: 26px;
  border-radius: 14px;
  background: #0a3a2d;
  color: rgba(248, 244, 235, 0.78);
  font-style: normal;
}

.legal-document__contacts strong {
  display: block;
  margin-bottom: 10px;
  color: #f8f4eb;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
}

.legal-document__contacts p {
  font-size: 0.9rem;
  line-height: 1.7;
}

.legal-document__contacts a {
  color: #f8f4eb;
  text-decoration-color: #d7a94f;
}

.legal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: #06271f;
  color: rgba(248, 244, 235, 0.68);
}

.legal-footer__inner {
  display: grid;
  min-height: 148px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 36px;
}

.legal-footer__brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.legal-footer__brand img {
  display: block;
  box-sizing: border-box;
  width: 42px !important;
  height: 42px !important;
  flex: 0 0 42px;
  max-width: none;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.72;
}

.legal-footer__brand p {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  line-height: 1.55;
  text-transform: uppercase;
}

.legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 24px;
}

.legal-footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: rgba(248, 244, 235, 0.82);
  font-size: 0.76rem;
  text-decoration: underline;
  text-decoration-color: rgba(248, 244, 235, 0.3);
  text-underline-offset: 4px;
}

.legal-footer a:hover,
.legal-footer a:focus-visible {
  color: #d7a94f;
  text-decoration-color: currentColor;
}

@media (max-width: 899px) {
  .legal-shell {
    width: min(740px, calc(100% - 56px));
  }

  .legal-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
    padding-block: 48px 96px;
  }

  .legal-toc {
    position: static;
    padding: 22px 24px;
    border: 1px solid rgba(24, 32, 29, 0.14);
    border-radius: 14px;
    background: rgba(250, 248, 242, 0.78);
  }

  .legal-toc ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
  }
}

@media (max-width: 767px) {
  .legal-page {
    font-size: 16px;
  }

  .legal-page * {
    scroll-margin-top: 88px;
  }

  .legal-shell {
    width: calc(100% - 36px);
  }

  .legal-header__inner {
    min-height: 68px;
  }

  .legal-header__brand img {
    width: 124px;
  }

  .legal-header__back {
    font-size: 0;
    gap: 0;
  }

  .legal-header__back::after {
    font-size: 0.75rem;
    content: "На сайт";
  }

  .legal-header__back svg {
    margin-right: 8px;
  }

  .legal-hero {
    padding: 58px 0 52px;
  }

  .legal-hero h1 {
    font-size: clamp(2.75rem, 14vw, 4.1rem);
    line-height: 0.98;
  }

  .legal-hero__meta {
    display: grid;
    gap: 7px;
    margin-top: 26px;
  }

  .legal-hero__meta span + span {
    padding-left: 0;
  }

  .legal-hero__meta span + span::before {
    display: none;
  }

  .legal-layout {
    gap: 24px;
    padding-block: 30px 72px;
  }

  .legal-toc {
    padding: 20px;
  }

  .legal-toc ol {
    grid-template-columns: minmax(0, 1fr);
  }

  .legal-document {
    padding: 28px 20px;
    border-radius: 16px;
    box-shadow: 0 20px 64px rgba(28, 31, 25, 0.07);
  }

  .legal-document__lead {
    margin-bottom: 34px;
    padding-bottom: 30px;
    font-size: 1.4rem;
  }

  .legal-document__section + .legal-document__section {
    margin-top: 44px;
  }

  .legal-document p,
  .legal-document li,
  .legal-document dd,
  .legal-document dt {
    font-size: 0.96rem;
    line-height: 1.74;
  }

  .legal-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .legal-facts > div,
  .legal-callout,
  .legal-document__contacts,
  .legal-signature {
    padding: 20px;
  }

  .legal-step {
    grid-template-columns: 27px 1fr;
    gap: 10px;
  }

  .legal-footer__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding-block: 30px calc(30px + env(safe-area-inset-bottom));
  }

  .legal-footer nav {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legal-page *,
  .legal-page *::before,
  .legal-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .legal-page {
    background: #fff;
    color: #000;
  }

  .legal-header,
  .legal-toc,
  .legal-footer {
    display: none;
  }

  .legal-hero {
    padding: 24px 0;
    background: #fff;
    color: #000;
  }

  .legal-hero__eyebrow,
  .legal-hero__meta {
    color: #333;
  }

  .legal-hero h1 {
    font-size: 42pt;
  }

  .legal-layout {
    display: block;
    padding: 24px 0;
  }

  .legal-document {
    padding: 0;
    border: 0;
    box-shadow: none;
  }
}
