/* ==========================================================================
   Amburgheria Creativa — Frontend cliente (stile app delivery)
   Mobile-first. Caricare DOPO bootstrap.

   NB: i NOMI delle classi sono un contratto usato da tutte le pagine.
       Si possono cambiare i valori, non i nomi.
   ========================================================================== */

:root {
  /* Brand */
  --app-brand:        #ff7a00;
  --app-brand-600:    #f06d00;
  --app-brand-700:    #d15c00;
  --app-brand-soft:   rgba(255, 122, 0, .13);
  --app-brand-tint:   #fff5eb;
  --app-brand-grad:   linear-gradient(135deg, #ff8a1f 0%, #ff6a00 100%);

  /* Inchiostro — leggermente caldo, non grigio freddo */
  --app-ink:          #1a1614;
  --app-ink-2:        #4a423d;
  --app-muted:        #857a73;
  --app-faint:        #b3aaa4;

  /* Superfici — base calda: fa risaltare il cibo */
  --app-bg:           #faf7f4;
  --app-surface:      #ffffff;
  --app-surface-2:    #f7f3ef;
  --app-line:         #efe9e3;
  --app-line-2:       #e3dbd3;

  /* Stati */
  --app-success:      #17915a;
  --app-success-soft: #e8f7ef;
  --app-danger:       #d93a2b;
  --app-danger-soft:  #fdedeb;
  --app-warning:      #e8890c;
  --app-info:         #1d7fd6;

  /* Forme */
  --app-radius:       20px;
  --app-radius-sm:    14px;
  --app-radius-pill:  999px;

  /* Ombre: morbide, calde, a più livelli */
  --app-shadow-sm:    0 1px 2px rgba(60, 40, 25, .05),
                      0 1px 3px rgba(60, 40, 25, .04);
  --app-shadow:       0 2px 6px rgba(60, 40, 25, .06),
                      0 8px 20px -8px rgba(60, 40, 25, .10);
  --app-shadow-lg:    0 4px 12px rgba(60, 40, 25, .08),
                      0 20px 44px -16px rgba(60, 40, 25, .22);
  --app-shadow-brand: 0 6px 18px -4px rgba(255, 122, 0, .45);

  /* Misure */
  --app-header-h:     60px;
  --app-tabbar-h:     66px;
  --app-maxw:         720px;

  --app-ease:         .2s cubic-bezier(.4, 0, .2, 1);
  --app-spring:       .34s cubic-bezier(.34, 1.42, .5, 1);
  --app-safe-b:       env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

body.app {
  margin: 0;
  background: var(--app-bg);
  color: var(--app-ink);
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  padding-bottom: calc(var(--app-tabbar-h) + var(--app-safe-b));
}
body.app.no-tabbar { padding-bottom: 0; }

.app h1, .app h2, .app h3, .app h4 {
  letter-spacing: -.028em;
  font-weight: 800;
  color: var(--app-ink);
}
.app a { color: var(--app-brand-700); text-decoration: none; }
.app img { max-width: 100%; }
.app ::selection { background: var(--app-brand-soft); }

/* Entrata morbida del contenuto */
@keyframes appFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.app-shell > * { animation: appFadeUp .34s cubic-bezier(.2,.8,.2,1) both; }
@media (prefers-reduced-motion: reduce) {
  .app-shell > *, .app-toast, .app-sheet { animation: none !important; transition: none !important; }
}

.app-shell {
  max-width: var(--app-maxw);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--app-bg);
  position: relative;
}
.app-container { padding: 16px; }

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 900;
  height: var(--app-header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: rgba(255, 253, 251, .82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}

.app-header__back {
  width: 38px; height: 38px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--app-surface);
  color: var(--app-ink);
  border: 1px solid var(--app-line);
  box-shadow: var(--app-shadow-sm);
  font-size: 1.05rem;
  transition: transform var(--app-ease);
}
.app-header__back:active { transform: scale(.9); }

.app-header__title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-header__title small {
  display: block;
  font-size: .72rem;
  font-weight: 500;
  color: var(--app-muted);
  letter-spacing: 0;
}

.app-header__brand { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; }
.app-header__logo {
  width: 36px; height: 36px; flex: 0 0 auto;
  border-radius: 12px;
  object-fit: cover;
  background: var(--app-brand-grad);
  display: grid; place-items: center;
  color: #fff; font-size: 1.1rem;
  box-shadow: var(--app-shadow-brand);
}

.app-header__cart {
  position: relative;
  width: 42px; height: 42px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--app-brand-grad);
  color: #fff;
  font-size: 1.05rem;
  box-shadow: var(--app-shadow-brand);
  transition: transform var(--app-ease);
}
.app-header__cart:active { transform: scale(.9); }
.app-header__cart:hover { color: #fff; }

.cart-badge {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 21px; height: 21px;
  padding: 0 6px;
  display: none;
  align-items: center; justify-content: center;
  border-radius: var(--app-radius-pill);
  background: var(--app-ink);
  color: #fff;
  font-size: .7rem; font-weight: 800;
  border: 2.5px solid var(--app-bg);
}
.cart-badge.show { display: flex; }
.cart-badge.bump { animation: badgeBump .45s cubic-bezier(.34,1.56,.5,1); }
@keyframes badgeBump {
  0% { transform: scale(1); } 45% { transform: scale(1.4) rotate(-6deg); } 100% { transform: scale(1); }
}

/* --------------------------------------------------------------------------
   Bottom tab bar
   -------------------------------------------------------------------------- */
.app-tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 950;
  height: calc(var(--app-tabbar-h) + var(--app-safe-b));
  padding-bottom: var(--app-safe-b);
  display: flex;
  background: rgba(255, 253, 251, .9);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid rgba(0, 0, 0, .05);
}
.app-tabbar__inner { max-width: var(--app-maxw); margin: 0 auto; width: 100%; display: flex; }

.app-tab {
  flex: 1 1 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  color: var(--app-faint);
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: -.01em;
  position: relative;
  transition: color var(--app-ease);
}
.app-tab i { font-size: 1.3rem; line-height: 1; transition: transform var(--app-spring); }
.app-tab.is-active { color: var(--app-brand); }
.app-tab.is-active i { transform: translateY(-2px) scale(1.08); }
/* indicatore attivo */
.app-tab.is-active::after {
  content: '';
  position: absolute; top: 6px;
  width: 26px; height: 3px; border-radius: 3px;
  background: var(--app-brand);
}
.app-tab:active i { transform: scale(.86); }
.app-tab .cart-badge { top: 4px; right: 50%; margin-right: -22px; border-color: #fffdfb; }

/* --------------------------------------------------------------------------
   Bottoni
   -------------------------------------------------------------------------- */
/* NB: i selettori sono raddoppiati (.app .app-btn) perche' devono battere
   ".app a" (specificita' 0-1-1). Con la sola ".app-btn" (0-1-0) il testo dei
   pulsanti-link eredita l'arancione dei link e diventa illeggibile. */
.app-btn,
.app .app-btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border: 0;
  border-radius: var(--app-radius-pill);
  background: var(--app-brand-grad);
  color: #fff;
  font-size: .95rem;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: -.01em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--app-ease), box-shadow var(--app-ease), filter var(--app-ease);
  box-shadow: var(--app-shadow-brand);
}
.app .app-btn:hover { color: #fff; filter: brightness(1.04); }
.app .app-btn:active { transform: scale(.97); box-shadow: 0 2px 8px -2px rgba(255,122,0,.5); }
.app .app-btn--block { display: flex; width: 100%; }
.app .app-btn--lg { padding: 17px 26px; font-size: 1.02rem; }
.app .app-btn--ghost {
  background: var(--app-surface);
  color: var(--app-ink);
  border: 1.5px solid var(--app-line-2);
  box-shadow: var(--app-shadow-sm);
}
.app .app-btn--ghost:hover { background: var(--app-surface-2); color: var(--app-ink); filter: none; }
.app .app-btn--dark { background: var(--app-ink); box-shadow: 0 6px 18px -4px rgba(0,0,0,.4); }
.app .app-btn--dark:hover { background: #000; color: #fff; }
.app .app-btn:disabled { opacity: .45; pointer-events: none; box-shadow: none; }

/* --------------------------------------------------------------------------
   Hero (home)
   -------------------------------------------------------------------------- */
.app-hero {
  position: relative;
  min-height: 380px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 52px 22px 44px;
  color: #fff;
  background: linear-gradient(165deg, #3a2a1c 0%, #1a1614 100%);
  overflow: hidden;
}
/* L'immagine deve VEDERSI: niente opacita' ridotta, solo un velo leggero
   in basso per tenere leggibili titolo e sottotitolo.
   ATTENZIONE: il selettore e' rinforzato perche' ".app-hero > *" (piu' sotto,
   stessa specificita' ma successivo) gli toglieva "position:absolute",
   facendo collassare il livello a altezza 0: l'immagine spariva. */
.app-hero .app-hero__bg,
.app-hero > .app-hero__bg {
  position: absolute !important;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.app-hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg,
      rgba(26,22,20,.10) 0%,
      rgba(26,22,20,.28) 45%,
      rgba(26,22,20,.72) 100%);
}
/* i contenuti stanno sopra immagine e velo — il livello immagine e' escluso */
.app-hero > *:not(.app-hero__bg) { position: relative; z-index: 1; }
.app-hero__logo {
  width: 148px; height: 148px;
  border-radius: 50%;
  object-fit: contain;
  padding: 8px;
  margin-bottom: 18px;
  box-shadow: 0 18px 44px -12px rgba(0,0,0,.55);
  background: rgba(255,255,255,.94);
  border: 0;
}
/* NB: il selettore deve battere ".app h1" (specificita' 0-1-1), altrimenti
   il titolo eredita il colore scuro e diventa illeggibile sull'hero. */
.app .app-hero__title,
.app-hero .app-hero__title {
  color: #fff;
  font-size: 2.05rem;
  line-height: 1.08;
  letter-spacing: -.035em;
  margin: 0 0 8px;
  text-shadow: 0 2px 20px rgba(0,0,0,.45);
}
.app .app-hero__subtitle,
.app-hero .app-hero__subtitle {
  color: rgba(255,255,255,.88);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 24px;
  text-shadow: 0 1px 10px rgba(0,0,0,.35);
}

/* Pill stato apertura */
.app-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 15px;
  border-radius: var(--app-radius-pill);
  font-size: .8rem; font-weight: 800;
  letter-spacing: -.01em;
  margin-bottom: 18px;
  backdrop-filter: blur(8px);
}
.app-status::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 26%, transparent);
}
.app-status--open   { background: rgba(23,145,90,.16);  color: #4ade80; }
.app-status--closed { background: rgba(217,58,43,.18);  color: #fca5a5; }
/* varianti su fondo chiaro */
.app-container .app-status--open   { background: var(--app-success-soft); color: var(--app-success); }
.app-container .app-status--closed { background: var(--app-danger-soft);  color: var(--app-danger); }

/* --------------------------------------------------------------------------
   Quick actions (home)
   -------------------------------------------------------------------------- */
.app-quick {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 18px 16px 6px;
}
.app-quick__item {
  display: flex; flex-direction: column; gap: 9px;
  padding: 18px 16px;
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-sm);
  color: var(--app-ink);
  transition: transform var(--app-ease), box-shadow var(--app-ease);
}
.app-quick__item:active { transform: scale(.96); }
.app-quick__item:hover { color: var(--app-ink); box-shadow: var(--app-shadow); }
.app-quick__ic {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--app-brand-soft);
  color: var(--app-brand);
  font-size: 1.35rem;
}
.app-quick__item img.app-quick__ic { object-fit: cover; padding: 0; }
.app-quick__t { font-weight: 800; font-size: .95rem; letter-spacing: -.015em; }
.app-quick__s { font-size: .78rem; color: var(--app-muted); }

/* --------------------------------------------------------------------------
   Sezioni
   -------------------------------------------------------------------------- */
.app-section { padding: 8px 16px 4px; }
.app-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 16px 0 12px; }
.app-section__title { font-size: 1.2rem; font-weight: 800; margin: 0; }
.app-section__link { font-size: .82rem; font-weight: 700; }

/* --------------------------------------------------------------------------
   Barra categorie sticky (menu)
   -------------------------------------------------------------------------- */
.app-cats {
  position: sticky;
  top: var(--app-header-h);
  z-index: 850;
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: linear-gradient(180deg, var(--app-bg) 72%, rgba(250,247,244,0) 100%);
  backdrop-filter: blur(8px);
}
.app-cats::-webkit-scrollbar { display: none; }
.app-cat-chip {
  flex: 0 0 auto;
  padding: 9px 17px;
  border-radius: var(--app-radius-pill);
  background: var(--app-surface);
  border: 1.5px solid var(--app-line-2);
  color: var(--app-ink-2);
  font-size: .86rem; font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  transition: var(--app-ease);
}
.app-cat-chip.is-active {
  background: var(--app-brand-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--app-shadow-brand);
}
.app-cat-chip:active { transform: scale(.94); }

.app-cat-block { scroll-margin-top: calc(var(--app-header-h) + 56px); padding: 4px 16px; }
.app-cat-block__title {
  font-size: 1.3rem; font-weight: 800; margin: 20px 0 14px;
  display: flex; align-items: center; gap: 10px;
}
.app-cat-block__title::after {
  content: ''; flex: 1 1 auto; height: 1px; background: var(--app-line);
}

/* --------------------------------------------------------------------------
   Card prodotto (menu)
   -------------------------------------------------------------------------- */
.app-product {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-sm);
  margin-bottom: 12px;
  position: relative;
  transition: transform var(--app-ease), box-shadow var(--app-ease);
}
.app-product:hover { box-shadow: var(--app-shadow); }
.app-product:active { transform: scale(.99); }
.app-product__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-product__name { font-size: 1.02rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
.app-product__desc {
  font-size: .84rem; color: var(--app-muted); margin: 0 0 10px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.app-product__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.app-product__price { font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em; color: var(--app-ink); }
.app-product__price small { font-size: .72rem; font-weight: 600; color: var(--app-muted); }

.app-product__media { position: relative; flex: 0 0 104px; }
.app-product__img {
  width: 104px; height: 104px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--app-surface-2);
  box-shadow: 0 4px 12px -4px rgba(60,40,25,.2);
}
.app-product__add {
  position: absolute;
  right: -7px; bottom: -7px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 3px solid var(--app-surface);
  border-radius: 50%;
  background: var(--app-brand-grad);
  color: #fff;
  font-size: 1.05rem;
  box-shadow: var(--app-shadow-brand);
  cursor: pointer;
  transition: transform var(--app-spring);
}
.app-product__add:active { transform: scale(.82); }
.app-product__add:disabled { background: var(--app-faint); box-shadow: none; }

.app-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 7px; }
.app-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: var(--app-radius-pill);
  font-size: .66rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.app-badge--new  { background: var(--app-brand-soft); color: var(--app-brand-700); }
.app-badge--hot  { background: var(--app-danger-soft); color: var(--app-danger); }
.app-badge--baby { background: #e8f2fd; color: var(--app-info); }

/* --------------------------------------------------------------------------
   Card / superfici generiche
   -------------------------------------------------------------------------- */
.app-card {
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-sm);
  padding: 18px;
  margin-bottom: 14px;
}
.app-card__title {
  font-size: .95rem; font-weight: 800; letter-spacing: -.015em;
  margin: 0 0 14px; display: flex; align-items: center; gap: 9px;
}
.app-card__title i { color: var(--app-brand); }

.app-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; }
.app-row + .app-row { border-top: 1px solid var(--app-line); }
.app-row__label { color: var(--app-muted); font-size: .9rem; }
.app-row__value { font-weight: 700; }

/* --------------------------------------------------------------------------
   Carrello
   -------------------------------------------------------------------------- */
.cart-item {
  display: flex; gap: 13px;
  padding: 14px;
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-sm);
  margin-bottom: 12px;
}
.cart-item__img {
  width: 76px; height: 76px; border-radius: 14px; object-fit: cover;
  background: var(--app-surface-2); flex: 0 0 auto;
}
.cart-item__body { flex: 1 1 auto; min-width: 0; }
.cart-item__name { font-weight: 800; font-size: .97rem; letter-spacing: -.015em; margin: 0 0 4px; }
.cart-item__meta { font-size: .79rem; color: var(--app-muted); margin: 0 0 9px; }
.cart-item__meta .rem { color: var(--app-danger); }
.cart-item__meta .add { color: var(--app-success); }
.cart-item__foot { display: flex; align-items: center; justify-content: space-between; }
.cart-item__price { font-weight: 800; font-size: 1.02rem; }

.qty {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--app-surface-2);
  border: 1px solid var(--app-line-2);
  border-radius: var(--app-radius-pill);
  padding: 3px;
}
.qty__btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0; background: transparent;
  color: var(--app-ink);
  font-size: 1.15rem; font-weight: 700; cursor: pointer; border-radius: 50%;
  transition: background var(--app-ease), transform var(--app-ease);
}
.qty__btn:active { background: var(--app-line); transform: scale(.9); }
.qty__btn--danger { color: var(--app-danger); }
.qty__val { min-width: 28px; text-align: center; font-weight: 800; font-size: .97rem; }

/* --------------------------------------------------------------------------
   Barra fissa in basso
   -------------------------------------------------------------------------- */
.app-bottombar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--app-tabbar-h) + var(--app-safe-b));
  z-index: 940;
  padding: 12px 16px 14px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(250,247,244,0) 0%, rgba(250,247,244,.92) 42%);
}
.no-tabbar .app-bottombar { bottom: 0; padding-bottom: calc(14px + var(--app-safe-b)); }
.app-bottombar__inner { max-width: var(--app-maxw); margin: 0 auto; pointer-events: auto; }
.app-bottombar .app-btn { box-shadow: var(--app-shadow-lg), var(--app-shadow-brand); }
.app-bottombar__count {
  background: rgba(255,255,255,.26);
  border-radius: var(--app-radius-pill);
  padding: 3px 10px;
  font-size: .8rem; font-weight: 800;
}
.app-bottombar__total { margin-left: auto; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Checkout: step e scelte
   -------------------------------------------------------------------------- */
.app-steps { display: flex; gap: 6px; padding: 4px 16px 12px; }
.app-step { flex: 1 1 0; height: 4px; border-radius: 3px; background: var(--app-line-2); }
.app-step.is-done { background: var(--app-brand); }

.app-choice {
  display: flex; align-items: center; gap: 13px;
  padding: 15px;
  border: 1.5px solid var(--app-line-2);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--app-ease);
}
.app-choice:has(input:checked) {
  border-color: var(--app-brand);
  background: var(--app-brand-tint);
  box-shadow: 0 0 0 3px var(--app-brand-soft);
}
.app-choice:active { transform: scale(.99); }
.app-choice__ic {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 12px; background: var(--app-surface-2);
  color: var(--app-brand); font-size: 1.15rem; flex: 0 0 auto;
}
.app-choice__body { flex: 1 1 auto; }
.app-choice__t { font-weight: 700; font-size: .93rem; }
.app-choice__s { font-size: .79rem; color: var(--app-muted); }
.app-choice input { accent-color: var(--app-brand); width: 21px; height: 21px; flex: 0 0 auto; }

/* Form */
.app-field { margin-bottom: 15px; }
.app-label { display: block; font-size: .82rem; font-weight: 800; margin-bottom: 7px; color: var(--app-ink-2); letter-spacing: -.01em; }
.app-input, .app-select, .app-textarea {
  width: 100%;
  padding: 14px 15px;
  border: 1.5px solid var(--app-line-2);
  border-radius: var(--app-radius-sm);
  background: var(--app-surface);
  font-size: .95rem;
  font-family: inherit;
  color: var(--app-ink);
  transition: var(--app-ease);
}
.app-input:focus, .app-select:focus, .app-textarea:focus {
  outline: 0; border-color: var(--app-brand); box-shadow: 0 0 0 3px var(--app-brand-soft);
}
.app-input::placeholder, .app-textarea::placeholder { color: var(--app-faint); }
.app-textarea { min-height: 88px; resize: vertical; }

/* --------------------------------------------------------------------------
   Tracking
   -------------------------------------------------------------------------- */
.track-hero { text-align: center; padding: 30px 16px 10px; }
.track-hero__ic {
  width: 88px; height: 88px; margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--app-brand-soft); color: var(--app-brand);
  font-size: 2.3rem;
}
.track-steps { padding: 8px 16px 16px; }
.track-step { display: flex; gap: 15px; position: relative; padding-bottom: 28px; }
.track-step:last-child { padding-bottom: 0; }
.track-step__dot {
  width: 36px; height: 36px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--app-surface); border: 2px solid var(--app-line-2);
  color: var(--app-faint); font-size: 1rem; z-index: 1;
  transition: var(--app-ease);
}
.track-step::before {
  content: ''; position: absolute; left: 17px; top: 36px; bottom: 0;
  width: 2px; background: var(--app-line-2);
}
.track-step:last-child::before { display: none; }
.track-step__body { padding-top: 6px; }
.track-step__t { font-weight: 800; font-size: .96rem; letter-spacing: -.015em; }
.track-step__s { font-size: .81rem; color: var(--app-muted); }
.track-step.is-done .track-step__dot { background: var(--app-success); border-color: var(--app-success); color: #fff; }
.track-step.is-active .track-step__dot {
  background: var(--app-brand-grad); border-color: transparent; color: #fff;
  animation: pulse 1.8s infinite;
}
.track-step.is-done::before { background: var(--app-success); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,122,0,.5); }
  50%      { box-shadow: 0 0 0 10px rgba(255,122,0,0); }
}

/* --------------------------------------------------------------------------
   Stato vuoto
   -------------------------------------------------------------------------- */
.app-empty { text-align: center; padding: 64px 24px; }
.app-empty__ic { font-size: 3.6rem; color: var(--app-line-2); margin-bottom: 14px; }
.app-empty__t { font-weight: 800; font-size: 1.15rem; margin-bottom: 6px; letter-spacing: -.02em; }
.app-empty__s { color: var(--app-muted); font-size: .9rem; margin-bottom: 22px; }

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */
.app-toast-wrap {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--app-tabbar-h) + 20px + var(--app-safe-b));
  z-index: 1200;
  width: calc(100% - 32px);
  max-width: calc(var(--app-maxw) - 32px);
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.app-toast {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 17px;
  border-radius: 16px;
  background: rgba(26,22,20,.96);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: .9rem; font-weight: 700;
  letter-spacing: -.01em;
  box-shadow: var(--app-shadow-lg);
  transform: translateY(24px) scale(.96); opacity: 0;
  transition: transform var(--app-spring), opacity .24s;
}
.app-toast.show { transform: none; opacity: 1; }
.app-toast i { font-size: 1.2rem; }
.app-toast--success i { color: #4ade80; }
.app-toast--error { background: rgba(217,58,43,.97); }

/* --------------------------------------------------------------------------
   Bottom sheet
   -------------------------------------------------------------------------- */
.app-sheet-backdrop {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(26,22,20,.55);
  backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden;
  transition: var(--app-ease);
}
.app-sheet-backdrop.show { opacity: 1; visibility: visible; }
.app-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1101;
  max-width: var(--app-maxw); margin: 0 auto;
  background: var(--app-surface);
  border-radius: 26px 26px 0 0;
  max-height: 88vh;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .36s cubic-bezier(.2,.9,.2,1);
  box-shadow: 0 -8px 40px rgba(60,40,25,.24);
}
.app-sheet.show { transform: translateY(0); }
.app-sheet__handle { width: 44px; height: 5px; border-radius: 3px; background: var(--app-line-2); margin: 12px auto 4px; flex: 0 0 auto; }
.app-sheet__scroll { overflow-y: auto; padding: 8px 18px 16px; }
.app-sheet__foot { padding: 14px 18px calc(16px + var(--app-safe-b)); border-top: 1px solid var(--app-line); }

/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */
.app-muted { color: var(--app-muted); }
.app-mono  { font-variant-numeric: tabular-nums; }
.text-brand { color: var(--app-brand); }
.mt-safe { margin-top: 8px; }

/* Skeleton per i caricamenti */
.app-skel {
  background: linear-gradient(90deg, var(--app-surface-2) 25%, var(--app-line) 37%, var(--app-surface-2) 63%);
  background-size: 400% 100%;
  animation: skel 1.3s ease infinite;
  border-radius: var(--app-radius-sm);
}
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (min-width: 721px) {
  .app-shell { box-shadow: 0 0 0 1px var(--app-line), 0 30px 60px -30px rgba(60,40,25,.18); }

  /* L'hero esce dalla colonna e occupa tutta la larghezza, come nel sito
     originale: su desktop una foto grande rende molto meglio. */
  .app-hero {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    min-height: 460px;
  }
  .app-hero__logo { width: 190px; height: 190px; }
  .app .app-hero__title { font-size: 2.6rem; }
}
