/*
 * Train · guida all'installazione (app/js/installa.js), usata dalla landing e dalla
 * pagina d'invito. Passi con icone Phosphor; il passo da fare si accende a turno.
 */
.inst { display: grid; gap: var(--s-4); }
.inst__t { font-size: clamp(32px, 9vw, 44px); padding-right: 52px; }
.inst__sub { color: var(--c-text-2); max-width: 38ch; }
.inst__or { color: var(--c-text-3); font-size: var(--fs-small); text-align: center; }
.inst__steps { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: grid; gap: var(--s-2); }
.inst__step {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: var(--s-4);
  padding: var(--s-3); border-radius: var(--r-md); background: var(--c-surface-2); box-shadow: inset 0 0 0 1px var(--c-line);
  transition: background-color 400ms var(--ease-out), box-shadow 400ms var(--ease-out);
}
.inst__n {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 22px;
  background: var(--c-bg); color: var(--c-green-hi);
  transition: background-color 400ms var(--ease-out), color 400ms var(--ease-out), transform 500ms var(--ease-spring);
}
.inst__txt { min-width: 0; font-size: 16px; line-height: 1.5; }
.inst__txt b { font-weight: 800; }
.inst__step.is-on { background: var(--c-green-tint); box-shadow: inset 0 0 0 1.5px var(--c-green); }
.inst__step.is-on .inst__n { background: var(--c-green); color: var(--c-on-green); transform: scale(1.08); }
/* L'icona del tasto, come appare nel browser */
.ik { display: inline; padding: 1px 7px; margin: 0 1px; border-radius: 8px; background: var(--c-bg); box-shadow: inset 0 0 0 1px var(--c-line-strong); font-weight: 800; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.ik i { font-size: 15px; color: var(--c-green-hi); vertical-align: -2px; }
.ik i + span { margin-left: 4px; }
.inst__done { display: flex; align-items: center; gap: var(--s-3); color: var(--c-green-hi); font-weight: 800; }
.inst__done i { font-size: 26px; }
.inst__go i { font-size: 22px; }

/* Foglio dal basso (landing) */
.inst-dlg { padding: 0; border: 0; margin: 0; width: 100%; max-width: none; height: 100%; max-height: none; background: transparent; color: var(--c-text); }
.inst-dlg[open] { display: flex; align-items: flex-end; }
.inst-dlg::backdrop { background: rgb(5 7 6 / .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.inst-dlg__in {
  position: relative; width: 100%; max-height: 88dvh; overflow: auto; overscroll-behavior: contain;
  padding: var(--s-7) var(--gutter) calc(var(--s-7) + env(safe-area-inset-bottom));
  border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--c-surface); border-top: 1px solid var(--c-line);
}

/* Freccia sul bordo dello schermo verso il tasto del browser */
.inst-arrow {
  position: fixed; z-index: 2; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c-green); color: var(--c-on-green); font-size: 26px; pointer-events: none;
  opacity: 0; transition: opacity 300ms var(--ease-out);
  box-shadow: 0 10px 30px rgb(0 0 0 / .5);
}
.inst-arrow.is-on { opacity: 1; }
.inst-arrow[data-punta="giu-dx"] { right: 18px; bottom: calc(10px + env(safe-area-inset-bottom)); }
.inst-arrow[data-punta="giu"] { left: calc(50% - 28px); bottom: calc(10px + env(safe-area-inset-bottom)); }
.inst-arrow[data-punta="su-dx"] { right: 14px; top: calc(10px + env(safe-area-inset-top)); }
.inst-arrow[data-punta="su-dx"] i { rotate: 180deg; }
/* Con la freccia in basso il foglio lascia spazio sotto */
.inst-dlg:has(.inst-arrow.is-on[data-punta^="giu"]) .inst-dlg__in { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.inst-dlg:has(.inst-arrow.is-on[data-punta="su-dx"]) .inst-dlg__in { max-height: calc(100dvh - 90px); }

@media (prefers-reduced-motion: no-preference) {
  .inst-dlg[open] .inst-dlg__in { animation: i-up 420ms var(--ease-out) both; }
  .inst-dlg.is-closing .inst-dlg__in { animation: i-down 240ms var(--ease-out) both; }
  .inst__step { animation: i-in 600ms var(--ease-out) calc(var(--i) * 90ms + 120ms) both; }
  .inst-arrow.is-on[data-punta^="giu"] { animation: i-bob-d 1.2s var(--ease-out) infinite; }
  .inst-arrow.is-on[data-punta="su-dx"] { animation: i-bob-u 1.2s var(--ease-out) infinite; }
}
@keyframes i-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes i-down { to { transform: translateY(100%); } }
@keyframes i-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes i-bob-d { 0%, 100% { translate: 0 0; } 50% { translate: 0 8px; } }
@keyframes i-bob-u { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
