html, body {
  overscroll-behavior: none;
}

body.onboarding-open {
  overflow: hidden;
}

/* =========================
   ONBOARDING CONTAINER
========================= */

.onboarding {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh; /* 🔥 usa dvh */
  background: #ffffff;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Nascondi solo onboarding quando ha hidden */
.onboarding.hidden {
  display: none;
}


/* =========================
   TESTI (scoped solo onboarding)
========================= */

.onboarding h2 {
  font-size: 26px;
  color: #000;
  margin-bottom: 10px;
}

.onboarding p {
  font-size: 16px;
  color: #000;
  opacity: .8;
}


/* =========================
   SLIDER
========================= */

.onboarding-slider {
  display: flex;
  flex: 1;
  transition: transform .4s ease;
}

.slide {
  width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding-bottom: 160px; /* spazio per bottone fisso */
  box-sizing: border-box;
}

.slide-img {
  width: 100%;
  height: 50vh;
  object-fit: cover;
}

.slide-content {
  padding: 25px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}


/* =========================
   DOTS
========================= */

.dots {
  position: fixed;
  bottom: 95px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 1000000;
}

.dots span {
  width: 8px;
  height: 8px;
  background: #ccc;
  border-radius: 50%;
  transition: background .3s ease;
}

.dots .active {
  background: #2f45ff;
}


/* =========================
   BOTTONE NAVIGAZIONE
========================= */

.onboarding-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  padding: 16px;
  border: none;
  border-radius: 30px;
  background: #2f45ff;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  z-index: 1000000;
}


/* =========================
   SAFE AREA iOS
========================= */

@supports(padding: env(safe-area-inset-bottom)) {

  .onboarding-btn {
    bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .dots {
    bottom: calc(95px + env(safe-area-inset-bottom));
  }
}


/* =========================
   INPUT NOME
========================= */

#onboardingNameInput {
  font-size: 16px; /* evita zoom iOS */
  width: 88%;
  padding: 16px;
  margin-top: 20px;
  border-radius: 10px;
  border: 1px solid #E1E1E1;
  outline: none;
}

#onboardingNameInput:focus {
  border-color: #2f45ff;
}

/* INSTALL SLIDE */

.install-logo {
  width:140px;
  margin-top:40px;
  margin-bottom:30px;
}

.install-image {
  width:75%;
  max-width:320px;
  margin-top:20px;
}

/* Layout slide install più ariosa */
.slide:first-child {
  justify-content:flex-start;
}

/* =========================
   INSTALL (APPLE WALLET STYLE)
========================= */

.wallet-install{
  width: 100%;
  max-width: 520px;
  padding: 26px 22px 10px;
  text-align: center;
  box-sizing: border-box;
  animation: walletEnter .7s cubic-bezier(.25,1,.3,1);
}

@keyframes walletEnter{
  0%{ transform: translateY(80px) scale(.92); opacity: 0; }
  100%{ transform: translateY(0) scale(1); opacity: 1; }
}

.wallet-app-icon{
  width: 110px;
  border-radius: 26px;
  box-shadow: 0 12px 30px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.4);
  margin: 30px auto 18px;
  animation: walletPulse 2.6s ease-in-out infinite;
}

@keyframes walletPulse{
  0%,100%{ transform: scale(1); }
  50%{ transform: scale(1.05); }
}

.wallet-guide{
  width: 82%;
  max-width: 340px;
  margin: 18px auto 0;
  border-radius: 18px;
  display: block;
}

.wallet-hint{
  margin-top: 6px;
  font-size: 14px;
  color: #333;
  opacity: .85;
}

/* =========================
   iOS SPOTLIGHT ENTERPRISE
========================= */
/*.ios-spotlight-enterprise{
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 140px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(12px);
  z-index: 1000001; 
  pointer-events: none;
  animation: fadeSpot .35s ease;
} */

/* assicura bottone sempre sopra spotlight */
.onboarding-btn, .dots { z-index: 1000002; }

@keyframes fadeSpot{
  from { opacity: 0; }
  to { opacity: 1; }
}

.install-focus-mask{
  position:fixed;
  bottom:0;
  left:0;
  width:100%;
  height:140px;

  background:linear-gradient(
    to top,
    rgba(0,0,0,.55),
    rgba(0,0,0,.35),
    transparent
  );

  backdrop-filter:blur(8px);
  pointer-events:none;
  z-index:99999;
}

.install-app-icon{
  width:96px;
  height:96px;
  border-radius:24px;
  margin:25px auto 15px;

  box-shadow:
    0 12px 30px rgba(0,0,0,.25),
    inset 0 1px 0 rgba(255,255,255,.35);

  animation:installPulse 2.6s ease-in-out infinite;
}

@keyframes installPulse{
  0%,100%{ transform:scale(1); }
  50%{ transform:scale(1.06); }
}