/* Onboarding — 5 full-bleed screens */

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  background: #120c18;
  color: #fff;
}

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

.onboarding-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  pointer-events: none;
}

.onboarding-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.onboarding-slide picture {
  display: block;
  width: 100%;
  height: 100%;
}

.onboarding-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
}

.onboarding-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  pointer-events: none;
}

.onboarding-dots {
  position: absolute;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.onboarding-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: transform 0.2s ease, background 0.2s ease;
}

.onboarding-dots i.is-active {
  background: #fff;
  transform: scale(1.25);
}

.onboarding-next {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #2b2735;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(18, 12, 24, 0.28);
  font-family: "Onest", "Manrope", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.onboarding-next:hover {
  background: #fff;
  box-shadow: 0 12px 32px rgba(18, 12, 24, 0.34);
}

.onboarding-next:active {
  transform: scale(0.97);
}

body.onboarding-open .topbar,
body.onboarding-open .mobile-nav,
body.onboarding-open .shell,
body.onboarding-open .pwa-install-banner,
body.auth-open .topbar,
body.auth-open .mobile-nav,
body.auth-open .shell,
body.auth-open .pwa-install-banner {
  visibility: hidden;
  pointer-events: none;
}

body.onboarding-open,
body.auth-open {
  overflow: hidden;
}

/* Auth — full-bleed after onboarding */

.legal-sheet {
  position: fixed;
  inset: 0;
  z-index: 280;
  display: flex;
  flex-direction: column;
  background: #f6f3fa;
}

.legal-sheet-bar {
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
  background: #fff;
}

.legal-sheet-bar button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: #5f4b78;
  color: #fff;
  font-weight: 800;
}

.legal-sheet-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 230;
  display: grid;
  place-items: end stretch;
  background: #6ea8d8;
  color: #1a1520;
}

.auth-screen[hidden] {
  display: none !important;
}

.auth-screen-bg-picture {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.auth-screen-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
}

@media (min-width: 981px) {
  .onboarding-slide img {
    object-fit: cover;
    object-position: center top;
  }

  .auth-screen-bg {
    object-position: center center;
  }
}

.auth-screen-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.05) 42%,
    rgba(18, 16, 28, 0.28) 72%,
    rgba(18, 16, 28, 0.55) 100%
  );
  pointer-events: none;
}

.auth-screen-body {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  justify-items: center;
  padding: 28px 24px calc(36px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  animation: auth-rise 0.55s cubic-bezier(0.22, 0.85, 0.32, 1) both;
}

.auth-screen-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-shadow: 0 2px 16px rgba(12, 18, 32, 0.35);
}

.auth-screen-brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(12, 18, 32, 0.25));
}

.auth-screen-brand strong {
  font-family: "Unbounded", "Onest", system-ui, sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.auth-consent {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  width: min(420px, 100%);
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  color: #fff;
  background: rgba(20, 16, 28, 0.55);
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}

.auth-consent input {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: #fc3f1d;
}

.auth-consent a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-screen-lead {
  margin: 0 0 6px;
  max-width: 280px;
  color: rgba(255, 255, 255, 0.92);
  font-family: "Onest", "Manrope", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  text-shadow: 0 1px 12px rgba(12, 18, 32, 0.35);
}

.auth-yandex-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(100%, 320px);
  min-height: 54px;
  padding: 0 22px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: #000;
  box-shadow: 0 14px 36px rgba(8, 12, 24, 0.28);
  font-family: "Onest", "Manrope", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.auth-yandex-btn:hover:not(:disabled) {
  box-shadow: 0 16px 40px rgba(8, 12, 24, 0.34);
}

.auth-yandex-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.auth-yandex-btn:disabled {
  opacity: 1;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(16, 16, 18, 0.42);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.auth-yandex-btn.is-loading:disabled {
  opacity: 0.72;
  cursor: wait;
  pointer-events: none;
}

.auth-yandex-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.auth-yandex-icon svg {
  display: block;
  border-radius: 6px;
}

.auth-screen-error {
  margin: 0;
  max-width: 300px;
  color: #fff;
  background: rgba(180, 35, 24, 0.88);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.4;
}

@keyframes auth-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
