:root {
  --bg: #000;
  --card-bg: rgba(142, 142, 148, 0.2);
  --card-border: rgba(142, 142, 148, 0.2);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.5);
  --divider: rgba(142, 142, 148, 0.25);
  --accent: #ffd60a;
  --pill-bg: rgba(255, 255, 255, 0.05);
  --layout-max-width: 600px;
  --layout-gutter: 24px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

html { scrollbar-gutter: stable; }

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 102px 10px 32px;
  position: relative;
  min-height: 100vh;
}

body.menu-open { overflow: hidden; }

.page {
  width: 100%;
  max-width: var(--layout-max-width);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
  opacity: 0;
  transition: opacity 240ms ease;
}
body.is-loaded .page { opacity: 1; }

/* ---------- preloader ----------
   Fixed overlay below the nav. Two skeleton cards with shimmer bars.
   Fades out once config.json + menu finished rendering. */
.preloader {
  position: fixed;
  left: 0;
  right: 0;
  top: 102px;
  bottom: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 0 10px 32px;
  background: var(--bg);
  pointer-events: none;
  transition: opacity 240ms ease, visibility 0s linear 240ms;
}
body.is-loaded .preloader {
  opacity: 0;
  visibility: hidden;
}

.preloader__card {
  box-sizing: border-box;
  width: 100%;
  max-width: 600px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 30px;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}
.preloader__row {
  padding: 0 16px;
  display: flex;
}
.preloader__row--image {
  padding: 0 32px;
}
.skeleton-bar {
  width: 100%;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  position: relative;
  overflow: hidden;
}
.skeleton-bar--image {
  height: 120px;
  border-radius: 26px;
}
.skeleton-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
  to { transform: translateX(100%); }
}

/* Stop the shimmer once the page is revealed — belt-and-suspenders
   alongside the JS that removes #preloader from the DOM. Avoids any
   wasted compositor work if the element lingers for a frame. */
body.is-loaded .skeleton-bar::after {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-bar::after { animation: none; }
  body.is-loaded .preloader { transition-duration: 0s; }
  body.is-loaded .page { transition-duration: 0s; }
}

/* ---------- top nav (fixed, content capped at 600px) ---------- */
.page-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 0;
  box-shadow: none;
}
.page-nav__inner {
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: 24px var(--layout-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 70px;
}

.connect-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  height: 34px;
  background: var(--pill-bg);
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.3);
  border-radius: 100px;
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.connect-pill__label {
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.03px;
}
.connect-pill__brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: -0.04px;
}
.connect-pill__brand img { display: block; }

/* Skeleton: until config loads, hide children and overlay a rectangle.
   min-width on brand reserves space for the name so the pill width
   doesn't jump when app.js fills in the text. overflow:hidden on the
   pill clips both pseudo-elements to the rounded shape. */
body:not(.is-loaded) .connect-pill > * { visibility: hidden; }

body:not(.is-loaded) .connect-pill::after {
  content: '';
  position: absolute;
  inset: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 100px;
}
body:not(.is-loaded) .connect-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.14) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
  body:not(.is-loaded) .connect-pill::before { animation: none; }
}

.menu-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.04px;
  line-height: 22px;
  cursor: pointer;
  font-family: inherit;
  opacity: 1;
  filter: blur(0);
  transition: opacity 320ms ease, filter 320ms ease;
}
.menu-btn:hover { color: var(--accent); }

.page-nav__inner > :first-child {
  opacity: 1;
  transition: opacity 240ms ease;
}

body.menu-open .page-nav__inner > :first-child {
  opacity: 0;
  pointer-events: none;
}

body.menu-open .menu-btn {
  opacity: 0;
  filter: blur(8px);
  pointer-events: none;
}

/* ---------- content cards ---------- */
.card {
  box-sizing: border-box;
  width: 100%;
  max-width: 600px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 30px;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.card--head {
  gap: 6px;
  align-items: stretch;
}

.card__title {
  margin: 0;
  width: 100%;
  padding: 0 16px;
  font-size: 19px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.02px;
  color: var(--text);
  text-align: left;
}

.card__subtitle {
  margin: 0;
  width: 100%;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.06px;
  color: var(--text-muted);
  text-align: left;
}

/* Support links live inside .card__subtitle of the head card.
   They're brighter (75% white vs 50% muted) and underlined to read as links. */
.support-link {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 160ms ease;
}
.support-link:hover { color: var(--accent); }

.card__divider {
  width: 100%;
  height: 2px;
  background: var(--divider);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.8);
}

/* text block in body card */
.block-text {
  padding: 0 16px;
  font-size: 17px;
  font-weight: 400;
  line-height: 30px;
  color: var(--text);
}
.block-text p { margin: 0; }
.block-text p + p { margin-top: 0; }
.block-text ol,
.block-text ul {
  margin: 0;
  padding-left: 22px;
}
.block-text li { margin: 0; }

/* Steps list — numbered steps with screenshots inline.
   The image lives INSIDE the <li> so numbering stays continuous (1 → 5)
   even though images are interleaved. Reset the image's own horizontal
   padding so it lines up under the step text instead of double-padding. */
.block-text .steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.block-text .steps > li { padding-left: 4px; }
.block-text .steps .block-image {
  padding: 12px 0 4px;
  margin-left: -22px;
  margin-right: -16px;
}
.block-text a {
  color: var(--text);
  text-decoration: underline;
}
.block-text--underline { text-decoration: underline; }

/* Document pages (oferta/terms/privacy): smaller body text per Figma —
   15/500 white, nested ordered lists, occasional inline links. */
.block-text--doc {
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.06px;
  color: var(--text);
}
.block-text--doc ol,
.block-text--doc ul {
  margin: 0;
  padding-left: 22px;
}
.block-text--doc ol ol,
.block-text--doc ul ol,
.block-text--doc ol ul {
  margin-top: 8px;
}
.block-text--doc li { margin: 0 0 8px; }
.block-text--doc li:last-child { margin-bottom: 0; }
.block-text--doc li > p { margin: 4px 0 0; }
.block-text--doc strong { font-weight: 600; }
.block-text--doc a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}
.block-text--doc a:hover { color: var(--accent); }
.block-text--doc p { margin: 0 0 8px; }
.block-text--doc p:last-child { margin-bottom: 0; }
.block-text--doc hr {
  border: 0;
  border-top: 2px solid var(--divider);
  margin: 12px 0;
}

.block-subhead {
  padding: 0 16px;
  font-size: 17px;
  font-weight: 700;
  line-height: 22px;
  letter-spacing: 0.04px;
  color: var(--text);
}

/* image block — border-radius 26 on the inner container */
.block-image {
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.block-image__inner {
  width: 100%;
  border-radius: 26px;
  overflow: hidden;
  display: block;
  background: rgba(255, 255, 255, 0.04);
}
.block-image__inner img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- menu overlay ---------- */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear 280ms;
  isolation: isolate;
}
.menu-overlay.is-open {
  visibility: visible;
  pointer-events: auto;
  transition: visibility 0s linear 0s;
}

.menu-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 50%);
  mask-image: linear-gradient(to right, transparent 0%, black 50%);
  pointer-events: none;
  opacity: 0;
}
.menu-overlay__blur {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
}
.menu-overlay__blur--2 {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(to right, transparent 20%, black 50%);
  mask-image: linear-gradient(to right, transparent 20%, black 50%);
}
.menu-overlay__blur--3 {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(to right, transparent 35%, black 50%);
  mask-image: linear-gradient(to right, transparent 35%, black 50%);
}
.menu-overlay.is-open::before,
.menu-overlay.is-open .menu-overlay__blur {
  opacity: 1;
}

.menu-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(270deg, #000000 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms ease;
}
.menu-overlay.is-open::after { opacity: 1; }

.menu-overlay__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--layout-max-width);
  height: 100%;
  padding: 24px var(--layout-gutter) 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 30px;
  overflow-y: auto;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 240ms ease, transform 280ms cubic-bezier(0.2, 0.6, 0.2, 1);
}
.menu-overlay.is-open .menu-overlay__inner {
  opacity: 1;
  transform: translateX(0);
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 30px;
  width: 100%;
}

.menu-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: var(--text);
}
.menu-row__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
}
.menu-row__label,
.menu-row__platform {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: -0.04px;
  text-align: right;
}
.menu-row__sep {
  display: inline-block;
  width: 3px;
  height: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  flex-shrink: 0;
}
.menu-row__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text);
}
.menu-row__icon img,
.menu-row__icon svg { display: block; }
.menu-row__icon svg { width: 20px; height: 20px; }

.menu-row.is-active {
  color: var(--accent);
}
.menu-row.is-active .menu-row__label,
.menu-row.is-active .menu-row__platform,
.menu-row.is-active .menu-row__icon {
  color: var(--accent);
}

/* Dropdown — single root <li> wraps the toggle row and the sub <ul>.
   The chevron points right when closed; CSS rotates it 90° when open. */
.menu-dropdown {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  width: 100%;
}
.menu-dropdown__head {
  /* Visually identical to a regular .menu-row, but it's a <button> so
     we need to reset the default button styling. */
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: var(--text);
}
.menu-row__icon--chevron {
  transition: transform 220ms cubic-bezier(0.2, 0.6, 0.2, 1);
}
.menu-dropdown.is-open .menu-row__icon--chevron {
  transform: rotate(90deg);
}

/* Sublist — animated max-height + opacity. Items right-aligned, no icons. */
.menu-sublist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 30px;
  width: 100%;
  /* collapsed state */
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: max-height 280ms cubic-bezier(0.2, 0.6, 0.2, 1),
              margin-top 280ms cubic-bezier(0.2, 0.6, 0.2, 1),
              opacity 200ms ease;
}
.menu-dropdown.is-open .menu-sublist {
  margin-top: 30px;
  max-height: 400px;   /* generous — collapses room for ~10 rows */
  opacity: 1;
  pointer-events: auto;
}
.menu-row--sub .menu-row__label {
  color: inherit;
}
.menu-row--sub.is-active .menu-row__label {
  color: var(--accent);
}

.menu-row--close .menu-row__label {
  color: var(--text);
}
.menu-row--close .menu-row__icon { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 619px) {
  body { padding: 102px 10px 32px; }
  .card { border-radius: 30px; }
}

@media (min-width: 620px) {
  body { padding: 102px 16px 48px; gap: 24px; }
}
/* ---------- document pages ---------- */
body:is([data-page="oferta"], [data-page="terms"], [data-page="privacy"]) {
  padding: 94px 0 50px;
  gap: 0;
}

body:is([data-page="oferta"], [data-page="terms"], [data-page="privacy"]) .page {
  max-width: var(--layout-max-width);
  gap: 6px;
  opacity: 1;
  transition: none;
}

body:is([data-page="oferta"], [data-page="terms"], [data-page="privacy"]) .preloader {
  display: none;
}

body:is([data-page="oferta"], [data-page="terms"], [data-page="privacy"]) .page-nav {
  border-bottom: 0;
  box-shadow: none;
}

body:is([data-page="oferta"], [data-page="terms"], [data-page="privacy"]) .page-nav::after {
  content: none;
}

body:is([data-page="oferta"], [data-page="terms"], [data-page="privacy"]) .page-nav__inner {
  height: 70px;
  padding: 24px var(--layout-gutter);
}

.connect-pill--return {
  height: 22px;
  padding: 0;
  gap: 0;
  overflow: visible;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: -0.04px;
  white-space: nowrap;
}

.connect-pill--return::before,
.connect-pill--return::after {
  display: none;
}

.card--doc-head,
.card--doc-body {
  max-width: none;
  padding: 0 var(--layout-gutter);
  gap: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

.card--doc-head {
  gap: 6px;
}

.card--doc-head::after {
  content: '';
  width: 100%;
  height: 2px;
  flex: 0 0 2px;
  background: #9c1809;
}

.card--doc-head .card__title {
  width: 100%;
  margin: 0;
  padding: 0;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: normal;
  text-align: left;
}

.card--doc-body .doc-body {
  padding: 0;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 26px;
  letter-spacing: normal;
}

.doc-body > p:first-child {
  margin: 0 0 32px;
  font-size: 16px;
  font-weight: 500;
  line-height: 26px;
  letter-spacing: normal;
}

.doc-body p,
.doc-body ol,
.doc-body ul,
.doc-body li {
  margin-top: 0;
  margin-bottom: 0;
}

.doc-body ol,
.doc-body ul {
  padding-left: 20px;
}

.doc-body ol ol,
.doc-body ol ul,
.doc-body ul ol,
.doc-body ul ul {
  padding-left: 20px;
}

.doc-body strong { font-weight: 500; }

.doc-body a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.doc-body hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  margin: 12px 0;
}

/* ---------- instruction pages ---------- */
body.instruction-page {
  padding: 94px 0 48px;
  gap: 0;
}

body.instruction-page .page {
  width: 100%;
  max-width: var(--layout-max-width);
  gap: 32px;
  opacity: 1;
  transition: none;
}

body.instruction-page .preloader {
  display: none;
}

.instruction-heading {
  width: 100%;
  padding: 0 var(--layout-gutter);
}

.instruction-title {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  align-content: flex-start;
  width: 100%;
  column-gap: 8px;
  row-gap: 2px;
  margin: 0;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: normal;
}

.instruction-title__line,
.instruction-title__device,
.instruction-device {
  display: inline-flex;
  align-items: center;
}

.instruction-title__line {
  width: auto;
  max-width: 100%;
  min-height: 28px;
  flex: 0 1 auto;
}

.instruction-title__device-line {
  gap: 8px;
}

.instruction-title__device {
  flex: 0 1 auto;
  gap: 4px;
  min-width: 0;
}

.instruction-title__device > span:last-child {
  min-width: 0;
}

.instruction-device {
  width: auto;
  height: 28px;
  flex: 0 0 auto;
  justify-content: center;
}

.instruction-device img {
  display: block;
  width: auto;
  max-width: 46px;
  height: 28px;
  object-fit: contain;
}

.instruction-device--desktop img {
  width: 30px;
  height: 26px;
}

.instruction-stepper {
  width: 100%;
  padding: 0 var(--layout-gutter);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 25%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.instruction-steps {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.instruction-step {
  --connector-length: 32px;
  --note-tail: 16px;
  width: 100%;
  margin: 0;
  padding: 0;
}

.instruction-step:not(:last-child) {
  padding-bottom: 48px;
}

.instruction-step--has-note:not(:last-child) {
  padding-bottom: var(--note-tail);
}

.instruction-step__row {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  column-gap: 6px;
  width: 100%;
}

.instruction-step:not(:last-child) .instruction-step__row::after {
  content: '';
  position: absolute;
  top: calc(100% + 8px);
  left: 14px;
  width: 2px;
  height: var(--connector-length);
  background: rgba(255, 255, 255, 0.2);
}

.instruction-step__marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 24px;
  flex: 0 0 30px;
}

.instruction-step__marker img {
  display: block;
  width: 30px;
  height: 24px;
  object-fit: contain;
}

.instruction-step__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

.instruction-step__text {
  min-width: 0;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: normal;
}

.instruction-step--compact .instruction-step__text {
  font-size: 15px;
  letter-spacing: -0.06px;
}

.instruction-step__note {
  margin: 16px 0 0 36px;
  color: rgba(255, 255, 255, 0.75);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
  letter-spacing: normal;
}

@media (prefers-reduced-motion: reduce) {
  body.instruction-page .page {
    transition: none;
  }
}
