/* Страницы документов (/terms, /privacy, /consent, /subscription, /paid) в стиле лендинга. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #141414;
  --text: #2c2c2e;
  --soft: #6e6e73;
  --muted: #a1a1a6;
  --line: rgba(0, 0, 0, .07);
  --wash: #f5f5f7;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --puffy:
    inset 0 1px 4px rgba(255, 255, 255, .67),
    inset 0 -4px 4px rgba(255, 255, 255, .85),
    inset 0 0 14px rgba(229, 229, 229, .55),
    0 11px 28px rgba(0, 0, 0, .05),
    0 23px 31px rgba(0, 0, 0, .035);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 400 17px/1.7 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-optical-sizing: auto;
  font-feature-settings: "cv11", "ss03";
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(0, 0, 0, .22); text-underline-offset: 3px; transition: text-decoration-color .2s; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
::selection { background: #e6e1ff; }

/* ---------- Шапка, как на лендинге ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: 68px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 32px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav a { text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 21px; letter-spacing: -.04em; color: var(--ink); }
.brand img { width: 30px; height: 30px; border-radius: 9px; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: 999px;
  background: linear-gradient(180deg, #fff, #fbfbfb); border: 1px solid rgba(255, 255, 255, .9); box-shadow: var(--puffy);
  color: var(--ink); font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.pill:hover { transform: translateY(-1px); }
.pill:active { transform: scale(.97); }

/* ---------- Документ ---------- */
main.doc { max-width: 760px; margin: 0 auto; padding: 56px 24px 120px; }
.docs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 56px; padding: 5px; border-radius: 22px; background: var(--wash); width: fit-content; }
.docs a { padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--soft); text-decoration: none; transition: color .2s, background .3s var(--ease), box-shadow .3s var(--ease); }
.docs a:hover { color: var(--ink); }
.docs a[aria-current="page"] { color: var(--ink); background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 16px rgba(0, 0, 0, .06); }

h1, h2, h3 { color: var(--ink); font-weight: 500; margin: 0; }
main.doc h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.05; letter-spacing: -.042em; text-wrap: balance; }
.meta { display: inline-flex; margin: 18px 0 0; padding: 4px 12px; border-radius: 999px; background: var(--wash); font-size: 13.5px; color: var(--soft); line-height: 1.6; }
main.doc h1 + .meta + * { margin-top: 40px; }
main.doc h2 { margin: 56px 0 14px; font-size: 22px; line-height: 1.3; letter-spacing: -.025em; scroll-margin-top: 90px; }
main.doc p { margin: 0 0 14px; }
main.doc p, main.doc li { overflow-wrap: anywhere; }
main.doc b, main.doc strong { color: var(--ink); font-weight: 600; }
main.doc ul { margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 10px; }
main.doc li { position: relative; padding-left: 22px; }
main.doc li::before { content: ""; position: absolute; left: 4px; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: #8b7dff; }

/* Таблицы */
main.doc table { width: 100%; margin: 18px 0 22px; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; font-size: 15px; line-height: 1.5; }
main.doc th, main.doc td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--line); }
main.doc tr:last-child td { border-bottom: 0; }
main.doc th { background: var(--wash); font-weight: 600; color: var(--ink); font-size: 14px; }
main.doc td:first-child { font-weight: 600; color: var(--ink); white-space: nowrap; }

/* ---------- Страница «Спасибо» после оплаты ---------- */
main.home { max-width: 620px; margin: 0 auto; padding: 120px 24px 140px; text-align: center; }
.orb {
  width: 96px; height: 96px; margin: 0 auto 32px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #f1f0ff 0%, #9c8cff 35%, #4b3fd6 75%, #1e1a6b 100%);
  box-shadow: 0 0 0 10px rgba(139, 125, 255, .08), 0 20px 50px rgba(75, 63, 214, .35);
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px); } }
main.home h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1; letter-spacing: -.046em; }
main.home .lead { margin: 22px auto 0; font-size: 19px; line-height: 1.55; color: var(--soft); text-wrap: balance; }
main.home .meta { display: block; margin: 28px auto 0; padding: 0; background: none; font-size: 14.5px; color: var(--muted); text-wrap: balance; }

/* ---------- Футер, как на лендинге ---------- */
.foot { padding: 28px 32px 36px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.7; color: var(--muted); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 28px; align-items: center; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot a { color: var(--soft); text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot p { margin: 0; }

/* Появление страницы */
main { animation: in .9s var(--ease) both; }
@keyframes in { from { opacity: 0; transform: translateY(16px); filter: blur(6px); } }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { padding: 0 16px; height: 60px; }
  .brand { font-size: 19px; }
  main.doc { padding: 36px 20px 96px; }
  .docs { width: auto; margin-bottom: 40px; border-radius: 18px; }
  .docs a { padding: 7px 12px; font-size: 13px; }
  main.doc h2 { margin-top: 44px; font-size: 20px; }
  main.doc table { font-size: 14px; display: block; overflow-x: auto; }
  main.doc th, main.doc td { padding: 12px; }
  main.home { padding-top: 88px; }
  main.home .lead { font-size: 17px; }
  .foot { padding: 24px 20px 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Футер всегда внизу, даже на короткой странице */
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; width: 100%; }
.meta { margin-top: 22px; }
@media (max-width: 640px) {
  .docs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -20px; margin-right: -20px; border-radius: 0; padding: 5px 20px; background: none; gap: 4px; }
  .docs::-webkit-scrollbar { display: none; }
  .docs a { flex: none; background: var(--wash); }
}
main.doc .meta { margin: 24px 0 0; }

/* Страница 404: кнопка «На главную» */
main.home .cta { margin: 36px 0 0; }
.pill-dark { background: linear-gradient(180deg, #2a2a2c, #111); border-color: #000; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 12px 28px rgba(0, 0, 0, .16); height: 52px; padding: 0 28px; font-size: 16px; }

/* Короткие страницы (404, «Спасибо»): содержимое по центру между шапкой и футером */
main.home { display: flex; flex-direction: column; justify-content: center; align-items: center; padding-top: 64px; padding-bottom: 64px; }
main.home > * { max-width: 100%; }

/* Футер: документы спрятаны под кнопку «Документы», меню открывается вверх */
.foot-l { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; }
.docs-menu { position: relative; }
.docs-menu summary {
  list-style: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 12px;
  border-radius: 999px; background: var(--wash); color: var(--soft); font-size: 14px; font-weight: 500;
  cursor: pointer; user-select: none; transition: background .2s, color .2s;
}
.docs-menu summary::-webkit-details-marker { display: none; }
.docs-menu summary:hover, .docs-menu[open] summary { color: var(--ink); background: #ececf0; }
.docs-menu summary svg { width: 16px; height: 16px; flex: none; }
.docs-menu .chev { transform: rotate(180deg); transition: transform .35s var(--ease); }
.docs-menu[open] .chev { transform: none; }
.docs-pop {
  position: absolute; left: 0; bottom: calc(100% + 10px); z-index: 60; display: grid; min-width: 290px; padding: 8px;
  border-radius: 20px; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 18px 48px rgba(0, 0, 0, .12);
  transform-origin: bottom left; animation: docs-pop-in .35s var(--ease);
}
@keyframes docs-pop-in { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.foot .docs-pop a { display: block; padding: 11px 14px; border-radius: 12px; font-size: 15px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.foot .docs-pop a:hover { background: var(--wash); }
.foot .docs-pop a[aria-current="page"] { font-weight: 600; }

/* Кнопка «Документы» справа: меню выравнивается по её правому краю */
.docs-pop { left: auto; right: 0; transform-origin: bottom right; }
.foot-in { flex-wrap: nowrap; }
