/* Aurora — юридические документы (privacy, terms) */

.policy-page {
  --pl-bg: #050810;
  --pl-bg-2: #0a101c;
  --pl-surface: rgba(12, 16, 28, 0.72);
  --pl-card: rgba(14, 18, 30, 0.85);
  --pl-border: rgba(255, 255, 255, 0.08);
  --pl-border-strong: rgba(214, 224, 255, 0.18);
  --pl-text: #f4f6fc;
  --pl-muted: #8b95a8;
  --pl-accent: #6aa9ff;
  --pl-accent-2: #9f7cff;
  --pl-link: #b8c9f0;
  --pl-radius: 20px;
  --pl-radius-sm: 12px;
  --pl-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.55);
  --pl-max: 1080px;
  --pl-header-h: 72px;
  --pl-toc-w: 272px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-padding-top: calc(var(--pl-header-h) + 24px);
  -webkit-tap-highlight-color: transparent;
}

body.policy-page {
  margin: 0;
  min-height: 100%;
  color: var(--pl-text);
  font-family: "Manrope", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.68;
  background-color: var(--pl-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.policy-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 70% at 50% -25%, rgba(88, 110, 180, 0.16), transparent 55%),
    radial-gradient(ellipse 65% 45% at 0% 35%, rgba(70, 90, 160, 0.09), transparent 50%),
    radial-gradient(ellipse 55% 40% at 100% 55%, rgba(100, 80, 160, 0.08), transparent 48%),
    linear-gradient(180deg, var(--pl-bg) 0%, var(--pl-bg-2) 45%, #070b14 100%);
}

body.policy-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

a { color: var(--pl-link); text-decoration: none; transition: color 0.2s; }
a:hover { color: #fff; }

:focus-visible {
  outline: 2px solid rgba(106, 169, 255, 0.65);
  outline-offset: 2px;
}

.policy-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1200;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pl-accent), var(--pl-accent-2));
  box-shadow: 0 0 12px rgba(106, 169, 255, 0.5);
  transition: width 0.08s linear;
}

/* ——— Header ——— */
.policy-header {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  width: calc(100% - 24px);
  max-width: var(--pl-max);
  padding: 10px 14px;
  border-radius: 18px;
  border: 1px solid rgba(201, 216, 255, 0.14);
  background: rgba(8, 12, 22, 0.78);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

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

.policy-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.policy-brand__logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.55), transparent 22%),
    radial-gradient(circle at 68% 78%, rgba(96, 165, 250, 0.65), transparent 46%),
    linear-gradient(135deg, rgba(139, 92, 246, 0.88), rgba(96, 165, 250, 0.8));
  box-shadow: 0 6px 18px rgba(96, 165, 250, 0.25), inset 0 1px 6px rgba(255, 255, 255, 0.25);
}

.policy-brand__logo::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), transparent 58%);
  opacity: 0.45;
}

.policy-brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.policy-brand__kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pl-muted);
}

.policy-brand__name {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff, #cfe0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.policy-doc-badge {
  display: none;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--pl-border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  font-weight: 600;
  color: #cfe0ff;
  white-space: nowrap;
}

.policy-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.policy-nav__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--pl-muted);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.policy-nav__link:hover {
  color: var(--pl-text);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--pl-border);
}

.policy-nav__link.is-active {
  color: #fff;
  background: rgba(106, 169, 255, 0.12);
  border-color: rgba(106, 169, 255, 0.25);
}

/* ——— Main layout ——— */
.policy-main {
  padding: calc(var(--pl-header-h) + 28px) 20px 100px;
  max-width: var(--pl-max);
  margin: 0 auto;
}

.policy-hero {
  padding: 32px 28px;
  border: 1px solid var(--pl-border);
  border-radius: calc(var(--pl-radius) + 4px);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  box-shadow: var(--pl-shadow);
  margin-bottom: 24px;
}

.policy-hero__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(106, 169, 255, 0.22);
  background: rgba(106, 169, 255, 0.08);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a8c8ff;
}

.policy-hero__label svg {
  width: 14px;
  height: 14px;
  opacity: 0.9;
}

.policy-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  background: linear-gradient(95deg, #fff 0%, #cfe0ff 45%, #e7d8ff 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.policy-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
  font-size: 14px;
  color: var(--pl-muted);
}

.policy-hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.policy-hero__meta svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.policy-hero__note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: var(--pl-radius-sm);
  border: 1px solid rgba(106, 169, 255, 0.18);
  background: rgba(106, 169, 255, 0.06);
  font-size: 14px;
  line-height: 1.6;
  color: #d4e4ff;
}

.policy-callout {
  display: flex;
  gap: 14px;
  margin: 18px 0 0;
  padding: 16px 18px;
  border-radius: var(--pl-radius-sm);
  border: 1px solid rgba(52, 211, 153, 0.22);
  background: rgba(52, 211, 153, 0.07);
}

.policy-callout__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.15);
  color: #6ee7b7;
}

.policy-callout__icon svg {
  width: 18px;
  height: 18px;
}

.policy-callout__body {
  min-width: 0;
}

.policy-callout__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: #a7f3d0;
}

.policy-callout__text {
  margin: 0;
  font-size: 14px;
  color: #c8f0de;
  line-height: 1.55;
}

.policy-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .policy-doc-badge { display: inline-block; }
  .policy-grid { grid-template-columns: var(--pl-toc-w) 1fr; align-items: start; }
}

/* ——— Table of contents ——— */
.policy-toc {
  position: sticky;
  top: calc(var(--pl-header-h) + 16px);
  padding: 20px 16px;
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius);
  background: var(--pl-card);
  box-shadow: var(--pl-shadow);
}

.policy-toc__title {
  margin: 0 0 12px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9aa8c4;
}

.policy-toc__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: calc(100vh - var(--pl-header-h) - 80px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.policy-toc__nav::-webkit-scrollbar { width: 4px; }
.policy-toc__nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.policy-toc__link {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: #c5cfe8;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.policy-toc__num {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--pl-muted);
  min-width: 18px;
}

.policy-toc__link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--pl-border);
}

.policy-toc__link.is-active {
  color: #fff;
  background: rgba(106, 169, 255, 0.1);
  border-color: rgba(106, 169, 255, 0.22);
  box-shadow: inset 3px 0 0 var(--pl-accent);
}

/* ——— Content sections ——— */
.policy-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.policy-section {
  scroll-margin-top: calc(var(--pl-header-h) + 20px);
  padding: 22px 24px;
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.008));
  transition: border-color 0.25s;
}

.policy-section:target,
.policy-section.is-visible {
  border-color: rgba(106, 169, 255, 0.2);
}

.policy-section h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #eef2ff;
}

.policy-section h2::before {
  content: attr(data-num);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  color: #a8c8ff;
  background: rgba(106, 169, 255, 0.12);
  border: 1px solid rgba(106, 169, 255, 0.2);
}

.policy-section p { margin: 10px 0; }
.policy-section p:first-of-type { margin-top: 0; }
.policy-section p:last-child { margin-bottom: 0; }

.policy-section ul,
.policy-section ol {
  margin: 10px 0;
  padding-left: 0;
  list-style: none;
}

.policy-section li {
  position: relative;
  margin: 8px 0;
  padding-left: 22px;
  color: #dce3f5;
}

.policy-section li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pl-accent), var(--pl-accent-2));
  box-shadow: 0 0 8px rgba(106, 169, 255, 0.4);
}

.policy-muted {
  color: var(--pl-muted);
  font-size: 14px;
}

.policy-hl { color: #e7f0ff; font-weight: 600; }

/* ——— Related doc card ——— */
.policy-related {
  margin-top: 8px;
  padding: 20px 22px;
  border: 1px solid var(--pl-border-strong);
  border-radius: var(--pl-radius);
  background: linear-gradient(135deg, rgba(106, 169, 255, 0.08), rgba(159, 124, 255, 0.06));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.policy-related__text {
  margin: 0;
  font-size: 14px;
  color: var(--pl-muted);
}

.policy-related__text strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
  color: var(--pl-text);
}

.policy-related__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.policy-related__btn:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
}

.policy-related__btn svg {
  width: 16px;
  height: 16px;
}

/* ——— Footer ——— */
.policy-footer {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--pl-border);
  text-align: center;
}

.policy-footer__copy {
  margin: 0;
  font-size: 13px;
  color: var(--pl-muted);
}

.policy-footer__nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 14px;
}

.policy-footer__nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--pl-muted);
}

.policy-footer__nav a:hover { color: var(--pl-text); }

.policy-footer__chat {
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--pl-muted);
  padding: 0;
}

.policy-footer__chat:hover { color: var(--pl-text); }

/* ——— Mobile TOC ——— */
.policy-toc-fab,
.policy-top {
  position: fixed;
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--pl-border-strong);
  background: rgba(10, 14, 24, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s, opacity 0.2s, visibility 0.2s;
}

.policy-toc-fab {
  right: 20px;
  bottom: 88px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.policy-top {
  right: 20px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.policy-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.policy-toc-fab svg,
.policy-top svg {
  width: 20px;
  height: 20px;
}

.policy-drawer {
  position: fixed;
  inset: 0;
  z-index: 1150;
  display: none;
  pointer-events: none;
}

.policy-drawer.is-open {
  display: block;
  pointer-events: auto;
}

.policy-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 12, 0.72);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.28s;
}

.policy-drawer.is-open .policy-drawer__backdrop { opacity: 1; }

.policy-drawer__panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(320px, 88vw);
  padding: 20px 16px 28px;
  border-left: 1px solid var(--pl-border);
  background: rgba(10, 14, 24, 0.97);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
}

.policy-drawer.is-open .policy-drawer__panel { transform: translateX(0); }

.policy-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
}

.policy-drawer__head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.policy-drawer__close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--pl-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

/* ——— Reveal animation ——— */
.policy-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.policy-reveal.is-in {
  opacity: 1;
  transform: none;
}

.policy-toc,
.policy-toc.policy-reveal {
  opacity: 1;
  transform: none;
}

/* ——— Responsive ——— */
@media (max-width: 959px) {
  .policy-toc--desktop { display: none; }
  .policy-toc-fab,
  .policy-top { display: flex; }
}

@media (max-width: 640px) {
  .policy-main { padding-left: 16px; padding-right: 16px; }
  .policy-hero { padding: 24px 20px; }
  .policy-section { padding: 18px 16px; }
  .policy-section h2 { font-size: 17px; flex-wrap: wrap; }
  .policy-brand__kicker { display: none; }
  .policy-nav__link { padding: 8px 10px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .policy-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .policy-drawer__panel,
  .policy-drawer__backdrop { transition: none !important; }
}

/* ——— Print ——— */
@media print {
  body.policy-page::before,
  body.policy-page::after,
  .policy-progress,
  .policy-header,
  .policy-toc,
  .policy-toc-fab,
  .policy-top,
  .policy-drawer,
  .policy-related { display: none !important; }

  body.policy-page {
    background: #fff;
    color: #111;
    font-size: 11pt;
  }

  .policy-main {
    padding: 0;
    max-width: none;
  }

  .policy-hero,
  .policy-section {
    border: 1px solid #ccc;
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .policy-hero h1,
  .policy-section h2 {
    color: #111;
    background: none;
    -webkit-background-clip: unset;
  }

  a { color: #111; text-decoration: underline; }
}
