/**
 * MINOMO — Guest Onboarding (welcome screen + città picker)
 * app.minomo.io · /app.html (guest, primo avvio)
 *
 * Wave GUEST-ONBOARDING · 2026-07-14.
 * Visual reference approvato da Vito (mockup interattivo, poi rimosso dal
 * repo prima del commit). Riusa i token di minomo-2026.css (--bg, --card,
 * --text, --orange, --logo-grad, ecc.) — nessun colore hardcoded fuori
 * scala salvo dove il mockup lo richiede esplicitamente (glow ambient).
 *
 * Convenzioni: `.ob-*` = onboarding-only (welcome overlay + city sheet,
 * riusata anche dal chip GUEST-ONLY in Home tramite openCityChangeSheet()).
 */

/* ============================================================
   Full-screen welcome overlay (WS-F1)
   ============================================================ */
.ob-overlay {
  position: fixed;
  inset: 0;
  z-index: 995; /* sopra header (5), bottom bar (200), MINA fab/modal/toast (250/900/990) */
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Overlay bloccato: niente rubber-band/overscroll né pan orizzontale
     (UAT Vito 2026-07-14: "la pagina non è fissa, si muove in più direzioni"). */
  overscroll-behavior: none;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(22px, env(safe-area-inset-top)) 20px calc(40px + env(safe-area-inset-bottom));
}

/* Mentre il welcome è aperto, blocca lo scroll/overscroll del documento sotto. */
body.ob-noscroll {
  overflow: hidden;
  overscroll-behavior: none;
}

/* ambient brand glow, echoes the logo gradient */
.ob-overlay::before {
  content: "";
  position: absolute;
  top: -140px;
  left: 50%;
  transform: translateX(-50%);
  width: 460px;
  height: 360px;
  background:
    radial-gradient(closest-side, rgba(155, 60, 255, 0.28), transparent 70%),
    radial-gradient(closest-side, rgba(245, 130, 32, 0.16), transparent 70%);
  background-position: 30% 20%, 75% 40%;
  background-repeat: no-repeat;
  filter: blur(8px);
  pointer-events: none;
  opacity: 0.9;
}

.ob-screen {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ob-brandrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}
.ob-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: block;
  object-fit: contain;
}
.ob-lang {
  font-family: inherit;
  font-size: 11px;
  color: var(--text-2);
  border: 1px solid var(--hairline);
  padding: 6px 12px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  display: flex;
  gap: 6px;
  align-items: center;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
}
.ob-lang:hover { border-color: var(--hairline-strong); }

.ob-hero { margin-bottom: 30px; }
.ob-hero h1 {
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 0 0 14px;
  color: var(--text);
}
.ob-hero h1 .ob-grad {
  background: var(--logo-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ob-hero p {
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.5;
  max-width: 34ch;
  margin: 0;
}

.ob-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
  display: block;
}

/* primary guest card — the two select rows + CTA */
.ob-card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 22px;
  padding: 18px 18px 20px;
}

.ob-select {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--card-elev);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 15px 16px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
  color: var(--text);
  font-size: 16.5px;
  font-weight: 600;
  text-align: left;
  font-family: inherit;
}
.ob-select:hover { border-color: var(--hairline-strong); }
.ob-select + .ob-select { margin-top: 10px; }
.ob-select .ob-flag { font-size: 20px; line-height: 1; flex-shrink: 0; }
.ob-select .ob-lab { flex: 1; min-width: 0; }
.ob-select .ob-lab small {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.02em;
  margin-bottom: 2px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  text-transform: uppercase;
}
.ob-select.ob-city .ob-lab small { color: var(--orange); }
.ob-select .ob-lab span:last-child {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ob-select .ob-chev { color: var(--text-3); font-size: 13px; flex-shrink: 0; }

.ob-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 16px 22px;
  font-size: 16.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, opacity 0.2s ease;
}
.ob-btn:active { transform: scale(0.97); }
.ob-btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.ob-btn-primary { background: var(--text); color: #000; margin-top: 16px; }
.ob-btn-primary:hover:not([disabled]) { opacity: 0.9; }

.ob-reassure {
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
  margin-top: 12px;
  letter-spacing: 0.01em;
}

.ob-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-3);
  font-size: 12px;
  margin: 26px 2px 18px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ob-divider::before, .ob-divider::after { content: ""; height: 1px; background: var(--hairline); flex: 1; }

.ob-account { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.ob-btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  text-decoration: none;
}
.ob-btn-ghost:hover { background: rgba(255, 255, 255, 0.04); }
.ob-btn-ghost.ob-accent { border-color: rgba(10, 132, 255, 0.5); color: var(--blue-soft); }
.ob-account .ob-hint { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 2px; }

/* ============================================================
   Country/City picker sheet — shared by the welcome overlay AND
   the guest-only Home city chip (openCityChangeSheet).
   ============================================================ */
.ob-sheet-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 997; /* above .ob-overlay (995) and .ob-modal-scrim (996) */
}
.ob-sheet-scrim.ob-on { opacity: 1; pointer-events: auto; }

.ob-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 460px;
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  border-radius: 24px 24px 0 0;
  padding: 10px 0 max(18px, env(safe-area-inset-bottom));
  z-index: 998;
  transition: transform 0.28s var(--ease);
  max-height: 70vh;
  overflow: auto;
}
.ob-sheet.ob-on { transform: translateX(-50%) translateY(0); }
.ob-sheet .ob-grip { width: 38px; height: 4px; border-radius: 2px; background: var(--hairline-strong); margin: 6px auto 10px; }
.ob-sheet h4 {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 6px 22px 10px;
  margin: 0;
}
.ob-opt {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 22px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.ob-opt:hover { background: rgba(255, 255, 255, 0.04); }
.ob-opt .ob-flag { font-size: 20px; }
.ob-opt .ob-check { margin-left: auto; color: var(--success); font-size: 16px; opacity: 0; }
.ob-opt.ob-sel .ob-check { opacity: 1; }
.ob-opt small { display: block; font-size: 12px; color: var(--text-3); font-weight: 500; }

/* Città sheet meta row (Wave GUEST-EXPLORE 2026-07-16, contract v3
   /onboarding/cities): non-zero event/merchant/POI counts under the city
   name, or a discreet "Nuova su MINOMO" pill for under_threshold cities.
   `.ob-opt-meta` is a `<small>` (inherits the block/12px/text-3 rule above);
   `.ob-badge-new` layers a pill look on top for the under_threshold case. */
.ob-opt-meta.ob-badge-new {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--orange-tint);
  color: var(--orange);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* Compact "change residence" modal used by the Home chip (WS-F2) —
   same select rows as the welcome card, no hero copy. */
.ob-modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 996;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.ob-modal {
  width: 100%;
  max-width: 460px;
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px max(20px, env(safe-area-inset-bottom));
}
.ob-modal h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 14px;
}
.ob-modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.ob-modal-actions .ob-btn { margin-top: 0; }
.ob-modal-actions .ob-btn-secondary {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--hairline-strong);
}
