:root {
  --white: #ffffff;
  --black: #353333;
  --yellow: #ecb144;
  --bg: var(--black);
  --text: var(--white);
  --muted: rgb(255 255 255 / 66%);
  --faint: rgb(255 255 255 / 40%);
  --line: rgb(255 255 255 / 12%);
  --button: var(--white);
  --button-text: var(--black);
  --accent: var(--yellow);
  --row: rgb(255 255 255 / 6%);
  --popup: #353333;
  --popup-ghost: rgb(255 255 255 / 15%);
  --app: 375px;
  --gutter: 24px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html,
body {
  height: 100%;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.shell {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  min-height: 100svh;
  overflow: hidden;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: var(--bg);
  background-image: url("/assets/wave.svg?v=2");
  background-repeat: no-repeat;
  background-position: 22% 88%;
  background-size: cover;
}

.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  min-height: 100svh;
}

.page-home {
  padding:
    calc(48px + var(--safe-top))
    16px
    calc(32px + var(--safe-bottom));
}

.header {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: none;
  min-height: 56px;
}

.header-phone {
  display: none;
}

.header[hidden] {
  display: none;
}

.logo {
  display: none;
  width: 198px;
  height: auto;
}

.logo.is-ready {
  display: block;
}

.stack {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
  min-height: 0;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 343px;
  padding: 24px;
  border-radius: 12px;
  background: var(--popup);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 8%),
    0 12px 40px rgb(0 0 0 / 40%);
}

.page-legal .card {
  max-width: none;
}

.page-legal .card:has(.content) {
  flex: 1 1 auto;
  min-height: 0;
}

.page-legal:not(:has(.content)) .card {
  max-width: 440px;
  margin: 0 auto;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.hero h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
  letter-spacing: 0.01em;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0.01em;
}

.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 24px;
  border: 0;
  border-radius: 100px;
  background: var(--button);
  color: var(--button-text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover,
.btn:focus-visible {
  filter: brightness(0.94);
}

.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 24px;
  border: 0;
  border-radius: 100px;
  background: var(--popup-ghost);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: rgb(255 255 255 / 22%);
}

.divider {
  width: 100%;
  height: 1px;
  margin: 0;
  background: var(--line);
  border: 0;
}

.support-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 0 0;
}

.support-label {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.01em;
}

.support-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.support-phone img {
  width: 20px;
  height: 20px;
}

.support-phone:hover,
.support-phone:focus-visible {
  color: var(--yellow);
}

.page-legal {
  --gutter: 16px;
  height: 100%;
  height: 100dvh;
  height: 100svh;
  min-height: 0;
  overflow: hidden;
  padding:
    calc(12px + var(--safe-top))
    var(--gutter)
    calc(16px + var(--safe-bottom));
}

.card-title {
  margin: 0;
  align-self: flex-start;
  max-width: 100%;
  font-size: inherit;
  font-weight: inherit;
}

.card-back {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 4px;
  flex: none;
  max-width: 100%;
  min-height: 40px;
  margin: -8px 0 0 -8px;
  padding: 8px;
  color: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.card-back img {
  flex: none;
  width: 24px;
  height: 24px;
}

.card-back:hover,
.card-back:focus-visible {
  color: var(--yellow);
}

.legal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.content {
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.01em;
}

.content p,
.content ul,
.content ol {
  margin: 0 0 12px;
}

.content h2 {
  margin: 22px 0 8px;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
}

.content h2:first-child {
  margin-top: 0;
}

.content h3 {
  margin: 18px 0 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.content ul {
  padding-left: 18px;
}

.content a {
  color: var(--yellow);
}

.contacts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.contacts a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--row);
  color: var(--text);
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.contacts small {
  color: var(--text);
  font-size: 16px;
  line-height: 24px;
  text-align: right;
  overflow-wrap: anywhere;
}

@media (min-width: 768px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  .shell {
    width: 100%;
    min-height: 100dvh;
    overflow: visible;
  }

  .bg {
    background-position: 50% 50%;
  }

  .page-home {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 36px 56px 48px;
  }

  .header {
    justify-content: space-between;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
  }

  .header-phone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    text-decoration: none;
  }

  .header-phone img {
    width: 20px;
    height: 20px;
  }

  .header-phone:hover,
  .header-phone:focus-visible {
    color: var(--yellow);
  }

  .logo {
    width: 220px;
  }

  .stack {
    align-items: center;
    justify-content: center;
  }

  .card {
    max-width: 440px;
    padding: 32px;
  }

  .hero {
    align-items: center;
    text-align: center;
    max-width: none;
  }

  .hero h1 {
    font-size: 28px;
    line-height: 36px;
  }

  .lead {
    font-size: 16px;
    line-height: 24px;
  }

  .panel {
    max-width: none;
  }

  .support-block {
    display: none;
  }

  .page-legal {
    --gutter: 48px;
    max-width: 920px;
    margin: 0 auto;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    padding-top: calc(32px + var(--safe-top));
    padding-bottom: calc(48px + var(--safe-bottom));
  }

  .card-back {
    font-size: 20px;
    line-height: 28px;
  }

  .page-legal:not(:has(.content)) {
    justify-content: center;
  }

  .legal-scroll {
    overflow: visible;
    flex: none;
  }

  .content {
    font-size: 16px;
    line-height: 24px;
  }

  .content h2 {
    font-size: 20px;
    line-height: 28px;
  }

  .contacts a {
    padding: 14px 16px;
    border-radius: 8px;
  }

  .contacts a:hover,
  .contacts a:focus-visible {
    background: rgb(255 255 255 / 10%);
  }
}

@media (min-width: 1024px) {
  .page-home {
    padding: 40px 72px 56px;
  }

  .logo {
    width: 240px;
  }

  .hero h1 {
    font-size: 32px;
    line-height: 40px;
    max-width: none;
  }
}

@media (max-height: 640px) {
  .page-home {
    padding-top: calc(24px + var(--safe-top));
    padding-bottom: calc(16px + var(--safe-bottom));
  }

  .hero h1 {
    font-size: 26px;
    line-height: 32px;
  }

  .stack {
    justify-content: flex-start;
    overflow: auto;
  }
}
