:root {
  --color-white: #ffffff;
  --color-black: #000000;
  --color-brand-blue: #0961ab;
  --color-brand-purple: #a359a8;
  --color-logo-purple: #b861be;
  --color-close: #017afd;
  --color-dot-inactive: #d9d9d9;
  --color-home-indicator: #050c05;

  --font-brand: "Futura PT", "Century Gothic", "Trebuchet MS", sans-serif;
  --font-ui: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --font-header: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --app-width: 393px;
  --header-height: 60px;
  --content-padding: 12px;
  --content-width: 367px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-ui);
  background: #f0f0f0;
  color: var(--color-black);
  -webkit-font-smoothing: antialiased;
}

.onboarding {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  max-width: var(--app-width);
  margin: 0 auto;
  background: var(--color-white);
  overflow: hidden;
}

.onboarding__slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.onboarding__slide[hidden] {
  display: none !important;
}

.onboarding__slide--active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Header */
.app-header {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  height: var(--header-height);
  background: var(--color-white);
}

.app-header__bar {
  position: relative;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background: var(--color-white);
  border-radius: 10px 10px 0 0;
}

.app-header__close {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  padding: 0;
  background: none;
  font-family: var(--font-header);
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.32px;
  color: var(--color-close);
  cursor: pointer;
}

.app-header__title {
  margin: 0;
  font-family: var(--font-header);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.app-header__actions {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-header__icon {
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.app-header__icon--search {
  width: 18px;
  height: 18px;
}

.app-header__icon--more {
  width: 21px;
  height: 21px;
}

/* Splash */
.splash {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: var(--header-height) 24px 48px;
  cursor: pointer;
}

.splash__logo {
  width: 78px;
  height: auto;
}

.splash__brand {
  margin: 0;
  font-family: var(--font-brand);
  font-size: 40px;
  font-weight: 800;
  line-height: 40px;
  text-align: center;
  color: var(--color-brand-blue);
  text-transform: uppercase;
}

.splash__brand-line {
  display: block;
}

/* Hero with phone */
.onboarding-hero {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: -8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.onboarding-hero__inner {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: min(316px, 81vw);
  aspect-ratio: 316 / 708;
}

.onboarding-hero__phone {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.onboarding-hero__fade-top,
.onboarding-hero__fade-bottom {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  pointer-events: none;
  z-index: 3;
}

.onboarding-hero__fade-top {
  top: 39%;
  height: 50%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 33%,
    #ffffff 100%
  );
}

.onboarding-hero__fade-bottom {
  top: 57%;
  bottom: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 16%,
    #ffffff 50%
  );
}

.onboarding-hero__phone-screen {
  position: absolute;
  left: 50%;
  top: 3.67%;
  transform: translateX(-50%);
  width: 88.61%;
  height: 89.4%;
  object-fit: cover;
  object-position: top center;
  border-radius: 7%;
  z-index: 1;
  pointer-events: none;
}

.onboarding-hero__phone-frame {
  position: absolute;
  width: 248.73%;
  height: 111.02%;
  left: -74.38%;
  top: -11.02%;
  max-width: none;
  z-index: 2;
  pointer-events: none;
}

/* Content */
.onboarding-content {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 0 var(--content-padding) 24px;
}

.onboarding-content__text {
  width: 100%;
  max-width: var(--content-width);
  text-align: center;
}

.onboarding-content__title {
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: 400;
  line-height: 26px;
  letter-spacing: 0.48px;
}

.onboarding-content__description {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
}

.onboarding-content__description--narrow {
  max-width: 333px;
  margin-inline: auto;
}

/* Buttons */
.onboarding-actions {
  width: 100%;
  max-width: var(--content-width);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  border-radius: 10px;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 20px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn:active {
  opacity: 0.85;
}

.btn--outline {
  border: 1px solid var(--color-brand-purple);
  background: transparent;
  color: var(--color-brand-purple);
}

.btn--ghost {
  border: 0;
  background: transparent;
  color: var(--color-brand-purple);
}

.btn--primary {
  border: 0;
  background: var(--color-brand-purple);
  color: var(--color-white);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-bottom: 8px;
}

.pagination__dot {
  width: 6px;
  height: 6px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: var(--color-dot-inactive);
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.25s ease;
}

.pagination__dot--active {
  background: var(--color-brand-purple);
}

/* Home indicator */
.home-indicator {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 8px 0 max(12px, env(safe-area-inset-bottom));
}

.home-indicator__bar {
  width: 141px;
  height: 5px;
  border-radius: 10px;
  background: var(--color-home-indicator);
}

/* Last slide layout */
.onboarding__slide--last .onboarding-content {
  gap: 24px;
}

.onboarding__slide--last .onboarding-actions {
  margin-top: 4px;
}
