/* ============================================
   I NOSTRI ALLOGGI: racconto a scorrimento su mappa 3D, griglia delle case, metodo, valutazione.
   La mappa è "sticky" sotto l'header: le misure sono offset statici in CSS (niente posizioni calcolate in JS
   al resize, che su questa pagina in passato facevano ricaricare la mappa su mobile).
   ============================================ */

.al {
  --al-top: 87px;                                    /* altezza header sticky, misurata: 87px oltre 1100px */
  --al-bar: 0px;                                     /* barra CTA fissa in basso (solo mobile) */
  --al-h: calc(100vh - var(--al-top) - var(--al-bar));
  --al-glass: rgba(20, 21, 24, 0.93);              /* pieno quanto basta: niente sfocatura dal vivo sopra la mappa */
  --al-line: rgba(255, 255, 255, 0.09);
  --al-orange: #FF883A;
}
@supports (height: 100svh) { .al { --al-h: calc(100svh - var(--al-top) - var(--al-bar)); } }
@media (max-width: 1100px) { .al { --al-top: 89px; } }
@media (max-width: 960px) { .al { --al-top: 117px; } }    /* il menu va su due righe */
@media (max-width: 900px) { .al { --al-top: 67px; --al-bar: calc(84px + env(safe-area-inset-bottom, 0px)); } }

/* --------------------------------------------
   1. RACCONTO
   -------------------------------------------- */
.al-story { position: relative; padding: 0; background: #0E0F11; }
.al-map { position: sticky; top: var(--al-top); height: var(--al-h); z-index: 1; }
.al-map__inner { position: absolute; inset: 0; overflow: hidden; background: #0E0F11; }
.al-map__canvas { position: absolute; inset: 0; }
.al-map__canvas .maplibregl-canvas { outline: none; }

/* Leggibilità delle schede: velo a sinistra (desktop) e sfumature in alto e in basso verso la pagina. */
.al-map__shade {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    linear-gradient(90deg, rgba(14, 15, 17, 0.78) 0%, rgba(14, 15, 17, 0.35) 30%, rgba(14, 15, 17, 0) 52%),
    linear-gradient(180deg, rgba(14, 15, 17, 0.55) 0%, rgba(14, 15, 17, 0) 14%, rgba(14, 15, 17, 0) 84%, rgba(18, 18, 20, 0.9) 100%);
  transition: opacity 0.4s ease;
}

/* Le schede scorrono sopra la mappa: il livello non intercetta i clic, le schede sì. */
.al-steps { position: relative; z-index: 3; margin-top: calc(-1 * var(--al-h)); pointer-events: none; }
.al-step {
  min-height: var(--al-h); display: flex; align-items: center;
  padding: 48px 24px 48px max(24px, calc((100vw - 1300px) / 2 + 24px));
}
.al-step + .al-step { min-height: calc(var(--al-h) * 1.05); }
.al-card {
  pointer-events: auto; position: relative; width: min(430px, 100%);
  padding: 26px 26px 22px; border-radius: 20px;
  background: var(--al-glass); border: 1px solid var(--al-line);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  opacity: 0.28; transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.al-step.is-active .al-card { opacity: 1; transform: none; }
.al-card--hero { width: min(560px, 100%); padding: 34px 34px 28px; }

.al-h1 { font-size: clamp(2rem, 3.3vw, 3.05rem); line-height: 1.04; font-weight: 800; letter-spacing: -0.045em; margin: 0 0 16px; color: var(--c-ink); }
.al-h2 { font-size: clamp(1.7rem, 2.6vw, 2.4rem); line-height: 1.08; font-weight: 800; letter-spacing: -0.04em; margin: 0 0 14px; }
.al-lede { font-size: 1.06rem; line-height: 1.55; color: var(--c-ink-soft); margin: 0 0 22px; }
.al-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.al-cta .btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.al-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 26px 0 0; padding-top: 20px; border-top: 1px solid var(--al-line); }
.al-stats div { min-width: 0; }
.al-stats dt { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.04em; color: var(--c-ink); line-height: 1.1; }
.al-stats dd { margin: 4px 0 0; font-size: 0.72rem; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-ink-soft); }

.al-card__top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.al-card__num { font-size: 0.78rem; font-weight: 700; color: #241205; background: var(--al-orange); border-radius: 100px; padding: 3px 9px; letter-spacing: 0.02em; }
.al-card__eyebrow { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--al-orange); }
.al-card__title { font-size: clamp(1.7rem, 2.4vw, 2.2rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; margin: 0 0 10px; }
.al-card__title span { font-size: 0.95rem; font-weight: 500; letter-spacing: -0.01em; color: var(--c-ink-soft); margin-left: 6px; white-space: nowrap; }
.al-card__text { font-size: 0.97rem; line-height: 1.55; color: var(--c-ink-soft); margin: 0 0 16px; }

/* Case della zona: elenco compatto, scorrevole se sono tante. */
.al-houses { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: min(330px, 40vh); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3A3B42 transparent; margin-right: -8px; padding-right: 8px; }
.al-house {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 7px; border-radius: 12px;
  border: 1px solid transparent; background: rgba(255, 255, 255, 0.03); color: var(--c-ink);
  font: inherit; text-align: left; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease;
}
.al-house:hover, .al-house:focus-visible, .al-house.is-on { background: rgba(255, 136, 58, 0.09); border-color: rgba(255, 136, 58, 0.45); outline: none; }
.al-house__img { flex: none; width: 58px; height: 46px; border-radius: 8px; overflow: hidden; background: #24252A; }
.al-house__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.al-house__txt { flex: 1; min-width: 0; }
.al-house__txt b { display: block; font-size: 0.93rem; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-house__txt small { display: block; margin-top: 2px; font-size: 0.8rem; color: var(--c-ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-house__go { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--c-ink-soft); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s ease, stroke 0.15s ease; }
.al-house:hover .al-house__go { stroke: var(--al-orange); transform: translateX(2px); }
.al-houses--one .al-house { flex-direction: column; align-items: stretch; padding: 8px; }
.al-houses--one .al-house__img { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 10px; }
.al-houses--one .al-house__txt { padding: 4px 4px 2px; }
.al-houses--one .al-house__go { display: none; }

/* Capitoli: puntini a destra (desktop). */
.al-rail { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); z-index: 4; display: flex; flex-direction: column; gap: 4px; }
.al-rail button { position: relative; display: flex; align-items: center; justify-content: flex-end; width: 26px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; }
.al-rail i { display: block; width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); transition: all 0.25s ease; }
.al-rail button:hover i { background: rgba(255, 255, 255, 0.7); }
.al-rail button.is-on i { width: 10px; height: 10px; background: var(--al-orange); box-shadow: 0 0 0 4px rgba(255, 136, 58, 0.22); }
.al-rail span { position: absolute; right: 30px; white-space: nowrap; font-size: 0.78rem; font-weight: 600; color: var(--c-ink); background: rgba(20, 21, 24, 0.9); border: 1px solid var(--al-line); padding: 3px 9px; border-radius: 100px; opacity: 0; transform: translateX(6px); pointer-events: none; transition: all 0.2s ease; }
.al-rail button:hover span, .al-rail button:focus-visible span { opacity: 1; transform: none; }

.al-map__bar { position: absolute; top: 16px; right: 16px; z-index: 4; display: flex; gap: 8px; }
.al-chipbtn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 100px; cursor: pointer;
  font: inherit; font-size: 0.86rem; font-weight: 600; color: var(--c-ink);
  background: rgba(20, 21, 24, 0.92); border: 1px solid var(--al-line);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.al-chipbtn:hover { border-color: rgba(255, 136, 58, 0.6); }
.al-chipbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.al-chipbtn--solid { background: var(--al-orange); border-color: var(--al-orange); color: #241205; }
.al-chipbtn--solid:hover { background: #FFA968; }
.al-chipbtn[hidden] { display: none; }

.al-loader { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #0E0F11; color: var(--c-ink-soft); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; transition: opacity 0.7s ease, visibility 0.7s ease; }
.al-loader i { display: block; width: 120px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; position: relative; }
.al-loader i::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--al-orange); animation: al-load 1.1s ease-in-out infinite; }
@keyframes al-load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.al-story.is-ready .al-loader { opacity: 0; visibility: hidden; }

/* Esplorazione libera: la mappa si stacca a tutto schermo sotto l'header. */
html.al-lock, html.al-lock body { overflow: hidden; }
.al-story.is-explore .al-map__inner { position: fixed; top: var(--al-top); left: 0; right: 0; bottom: var(--al-bar); z-index: 95; }
.al-story.is-explore .al-map__shade, .al-story.is-explore .al-rail { opacity: 0; pointer-events: none; }
.al-story.is-explore .al-steps { visibility: hidden; }

/* Segnali delle case: un punto a terra e una colonna di luce. Etichette quando la camera è vicina. */
.al-pin, .al-zpin { padding: 0; border: 0; background: none; font: inherit; color: inherit; -webkit-appearance: none; appearance: none; }
.al-pin { width: 16px; height: 16px; cursor: pointer; }
.al-pin__dot { position: absolute; inset: 0; border-radius: 50%; background: var(--al-orange); border: 2px solid #FFE3CF; box-shadow: 0 0 0 4px rgba(255, 136, 58, 0.25), 0 0 18px rgba(255, 136, 58, 0.8); }
.al-pin__dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid rgba(255, 136, 58, 0.7); animation: al-ping 2.4s ease-out infinite; }
@keyframes al-ping { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(2.4); opacity: 0; } }
.al-pin__beam { position: absolute; left: 50%; bottom: 50%; width: 2px; height: 0; margin-left: -1px; border-radius: 2px; background: linear-gradient(to top, rgba(255, 136, 58, 0.95), rgba(255, 136, 58, 0)); box-shadow: 0 0 10px rgba(255, 136, 58, 0.6); transition: height 0.5s ease; pointer-events: none; }
.al-pin__label {
  position: absolute; left: 50%; bottom: 22px; transform: translate(-50%, 4px); white-space: nowrap;
  padding: 4px 10px; border-radius: 100px; font-size: 0.78rem; font-weight: 700; letter-spacing: -0.01em; color: var(--c-ink);
  background: rgba(20, 21, 24, 0.92); border: 1px solid rgba(255, 136, 58, 0.5); opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease, bottom 0.5s ease;
}
.al-map__canvas.is-near .al-pin__beam { height: 46px; }
.al-map__canvas.is-near .al-pin__label { bottom: 58px; }
.al-map__canvas.is-near .al-pin.is-zone .al-pin__label,
.al-pin:hover .al-pin__label, .al-pin.is-on .al-pin__label { opacity: 1; transform: translate(-50%, 0); }
.al-pin.is-on { z-index: 3; }
.al-pin.is-on .al-pin__dot { background: #FFF; border-color: var(--al-orange); }
.al-map__canvas.is-near .al-pin.is-on .al-pin__beam { height: 78px; }
.al-map__canvas.is-near .al-pin.is-on .al-pin__label { bottom: 90px; }
/* MapLibre scrive l'opacità dei segnali in linea (rilievo davanti): per nasconderli si usa visibility. */
.al-map__canvas.lv-region .al-pin, .al-map__canvas.lv-zone .al-pin { visibility: hidden; pointer-events: none; }
.al-map__canvas.lv-region .al-pin__dot::after, .al-map__canvas.lv-zone .al-pin__dot::after,
.al-map__canvas.is-off .al-pin__dot::after { animation: none; }

/* Da lontano: un segnale per zona, con il numero di case. */
.al-zpin { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.al-zpin b { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 100px; background: var(--al-orange); color: #241205; font-size: 0.85rem; font-weight: 800; box-shadow: 0 0 0 5px rgba(255, 136, 58, 0.22), 0 0 24px rgba(255, 136, 58, 0.7); }
.al-zpin span { font-size: 0.82rem; font-weight: 700; color: var(--c-ink); text-shadow: 0 1px 6px #000, 0 0 2px #000; white-space: nowrap; }
.al-zpin:hover b { background: #FFF; }
.al-map__canvas:not(.lv-zone) .al-zpin:not(.al-zpin--region),
.al-map__canvas:not(.lv-region) .al-zpin--region { visibility: hidden; pointer-events: none; }

.maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(20, 21, 24, 0.8) !important; color: var(--c-ink-soft); }
.maplibregl-ctrl-attrib a { color: var(--c-ink-soft) !important; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }
.maplibregl-ctrl-group { background: rgba(20, 21, 24, 0.9) !important; border: 1px solid var(--al-line); }
.maplibregl-ctrl-group button + button { border-top-color: var(--al-line) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.al-story:not(.is-explore) .maplibregl-ctrl-bottom-right { margin-bottom: 4px; }

/* Senza WebGL o senza script: niente mappa, le schede diventano sezioni normali. */
.al-story.no-map { background: var(--c-cream); }
.al-story.no-map .al-map { display: none; }
.al-story.no-map .al-steps { margin-top: 0; }
.al-story.no-map .al-step { min-height: 0; padding-top: 24px; padding-bottom: 24px; }
.al-story.no-map .al-card { opacity: 1; transform: none; width: min(760px, 100%); }

/* --------------------------------------------
   2. TUTTE LE CASE
   -------------------------------------------- */
.al-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: 24px 48px; margin-bottom: 28px; }
.al-head .h-lg { margin: 0; }
.al-head__lede { margin: 0; color: var(--c-ink-soft); font-size: 1.05rem; line-height: 1.55; max-width: 520px; }

.al-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.al-filter__btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 100px; border: 1px solid var(--c-border); background: transparent; color: var(--c-ink); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.15s ease; }
.al-filter__btn span { font-size: 0.78rem; font-weight: 700; color: var(--c-ink-soft); }
.al-filter__btn:hover { border-color: rgba(255, 136, 58, 0.6); }
.al-filter__btn.is-on { background: var(--al-orange); border-color: var(--al-orange); color: #241205; }
.al-filter__btn.is-on span { color: #241205; opacity: 0.7; }

.al-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.al-item { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--c-surface); border: 1px solid var(--c-border); transition: border-color 0.2s ease, transform 0.25s ease; }
.al-item:hover { border-color: rgba(255, 136, 58, 0.55); transform: translateY(-3px); }
.al-item[hidden] { display: none; }
.al-item__media { position: relative; display: block; width: 100%; aspect-ratio: 16 / 11; padding: 0; border: 0; background: #202126; cursor: zoom-in; overflow: hidden; }
.al-item__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.al-item:hover .al-item__media img { transform: scale(1.05); }
.al-item__ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--c-ink-soft); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.al-badges { position: absolute; top: 12px; left: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.al-badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 100px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em; color: #FFB88A; background: rgba(20, 21, 24, 0.78); border: 1px solid rgba(255, 136, 58, 0.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.al-badge--luxe { color: #F1C75B; border-color: rgba(232, 182, 62, 0.55); }
.al-item__count { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 100px; font-size: 0.74rem; font-weight: 600; color: #FFF; background: rgba(0, 0, 0, 0.6); }
.al-item__count svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.al-item__body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 14px; }
.al-item__loc { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--al-orange); }
.al-item__name { font-size: 1.18rem; font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; margin: 6px 0 4px; }
.al-item__meta { font-size: 0.88rem; color: var(--c-ink); margin: 0 0 6px; }
.al-item__sum { font-size: 0.88rem; line-height: 1.5; color: var(--c-ink-soft); margin: 0 0 12px; }
.al-item__foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding-top: 12px; border-top: 1px solid var(--c-border); }
.al-link { display: inline-flex; align-items: center; gap: 5px; padding: 4px 0; border: 0; background: none; font: inherit; font-size: 0.86rem; font-weight: 600; color: var(--c-ink); cursor: pointer; text-decoration: none; }
.al-link:hover { color: var(--al-orange); }
.al-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.al-link--guest { margin-left: auto; font-weight: 500; color: var(--c-ink-soft); }
.al-link--guest::after { content: "\2197"; font-size: 0.8em; }

/* --------------------------------------------
   3. METODO E PROVA
   -------------------------------------------- */
.al-method { background: var(--c-cream-deep); }
.al-method__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.al-mcard { padding: 22px; border-radius: 18px; background: var(--c-surface); border: 1px solid var(--c-border); }
.al-mcard__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(255, 136, 58, 0.12); color: var(--al-orange); margin-bottom: 16px; }
.al-mcard__icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.al-mcard h3 { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
.al-mcard p { font-size: 0.92rem; line-height: 1.55; color: var(--c-ink-soft); margin: 0; }

.al-proof { display: grid; grid-template-columns: 1.1fr 1fr; margin-top: 20px; border-radius: 22px; overflow: hidden; border: 1px solid rgba(232, 182, 62, 0.3); background: radial-gradient(120% 120% at 100% 0%, rgba(232, 182, 62, 0.1), transparent 55%), var(--c-surface); }
.al-proof__img { position: relative; min-height: 300px; background: #202126; }
.al-proof__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.al-proof__txt { padding: 34px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.al-proof__txt h3 { font-size: clamp(1.4rem, 2.1vw, 1.9rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; margin: 14px 0 10px; }
.al-proof__txt p { color: var(--c-ink-soft); line-height: 1.6; margin: 0 0 20px; }
.al-proof__cta { display: flex; flex-wrap: wrap; gap: 10px; }

/* --------------------------------------------
   4. VALUTAZIONE
   -------------------------------------------- */
.al-form__wrap { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 56px; align-items: start; }
.al-form__lede { font-size: 1.08rem; line-height: 1.55; color: var(--c-ink-soft); margin: 0 0 22px; }
.al-next { list-style: none; counter-reset: al; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.al-next li { counter-increment: al; position: relative; padding: 2px 0 0 46px; min-height: 34px; font-size: 0.95rem; color: var(--c-ink-soft); line-height: 1.45; }
.al-next li::before { content: counter(al); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 136, 58, 0.12); border: 1px solid rgba(255, 136, 58, 0.4); color: var(--al-orange); font-weight: 800; font-size: 0.9rem; }
.al-next b { display: block; color: var(--c-ink); font-weight: 700; }
.al-form__note { font-size: 0.92rem; color: var(--c-ink-soft); margin: 0 0 10px; }
.al-form__note a { color: var(--al-orange); font-weight: 600; }
.al-form__team { font-size: 0.92rem; color: var(--c-ink-soft); margin: 0 0 20px; }
.al-form__box { padding: 26px; border-radius: 20px; background: var(--c-surface); border: 1px solid var(--c-border); }
.al-faq { background: var(--c-cream-deep); }

/* --------------------------------------------
   5. SCHEDA DELLA CASA E FOTO A TUTTO SCHERMO
   -------------------------------------------- */
.al-panel {
  position: fixed; top: var(--al-top); right: 0; bottom: 0; z-index: 150; width: min(460px, 100vw);
  display: flex; flex-direction: column; background: #16171A; border-left: 1px solid var(--al-line);
  box-shadow: -30px 0 60px -30px rgba(0, 0, 0, 0.9); transform: translateX(104%); visibility: hidden;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.45s;
}
.al-panel.is-open { transform: none; visibility: visible; }
.al-panel:focus { outline: none; }
.al-panel__close { position: absolute; top: 12px; right: 12px; z-index: 3; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--al-line); background: rgba(20, 21, 24, 0.85); color: var(--c-ink); cursor: pointer; }
.al-panel__close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.al-panel__close:hover { border-color: var(--al-orange); }
.al-panel__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }

.al-gal { position: relative; aspect-ratio: 4 / 3; background: #202126; overflow: hidden; }
.al-gal__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: opacity 0.25s ease; }
.al-gal__btn { position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.55); color: #FFF; cursor: pointer; }
.al-gal__btn svg, .al-lb__btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.al-gal__btn:hover { background: var(--al-orange); color: #241205; }
.al-gal__prev { left: 10px; } .al-gal__next { right: 10px; }
.al-gal__n { position: absolute; left: 12px; bottom: 12px; padding: 3px 9px; border-radius: 100px; background: rgba(0, 0, 0, 0.6); color: #FFF; font-size: 0.76rem; font-weight: 600; }
.al-thumbs { display: flex; gap: 6px; padding: 8px 12px 0; overflow-x: auto; scrollbar-width: none; }
.al-thumbs::-webkit-scrollbar { display: none; }
.al-thumbs button { flex: none; width: 64px; height: 46px; padding: 0; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: #202126; cursor: pointer; opacity: 0.6; }
.al-thumbs button.is-on { border-color: var(--al-orange); opacity: 1; }
.al-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

.al-pbody { padding: 18px 22px 26px; }
.al-pbody .al-item__loc { display: block; }
.al-pbody h3 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.035em; line-height: 1.12; margin: 6px 0 12px; }
.al-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.al-facts li { padding: 5px 11px; border-radius: 100px; border: 1px solid var(--c-border); font-size: 0.84rem; color: var(--c-ink); }
.al-facts li.is-gold { border-color: rgba(232, 182, 62, 0.55); color: #F1C75B; }
.al-pbody p { color: var(--c-ink-soft); line-height: 1.6; margin: 0 0 14px; font-size: 0.95rem; }
.al-pown { margin: 18px 0 16px; padding: 16px; border-radius: 14px; background: rgba(255, 136, 58, 0.07); border: 1px solid rgba(255, 136, 58, 0.25); }
.al-pown b { display: block; font-size: 0.98rem; margin-bottom: 4px; }
.al-pown p { margin: 0 0 12px; font-size: 0.9rem; }
.al-pown .btn { width: 100%; justify-content: center; }
.al-pactions { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.al-sib { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; }
.al-sib span { width: 100%; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-ink-soft); }
.al-sib__btn { padding: 6px 12px; border-radius: 100px; border: 1px solid var(--c-border); background: rgba(255, 255, 255, 0.03); color: var(--c-ink); font: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer; }
.al-sib__btn small { font-weight: 400; color: var(--c-ink-soft); }
.al-sib__btn:hover { border-color: var(--al-orange); }

.al-lb { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; background: rgba(8, 8, 10, 0.96); }
.al-lb[hidden] { display: none; }
.al-lb img { max-width: calc(100vw - 120px); max-height: calc(100vh - 110px); object-fit: contain; border-radius: 6px; }
.al-lb__btn { position: absolute; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(20, 21, 24, 0.8); color: #FFF; cursor: pointer; }
.al-lb__btn:hover { border-color: var(--al-orange); color: var(--al-orange); }
.al-lb__prev { left: 18px; top: 50%; transform: translateY(-50%); }
.al-lb__next { right: 18px; top: 50%; transform: translateY(-50%); }
.al-lb__close { top: 16px; right: 16px; }
.al-lb__cap { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: var(--c-ink-soft); font-size: 0.88rem; }

/* --------------------------------------------
   RESPONSIVE
   -------------------------------------------- */
@media (max-width: 1100px) {
  .al-method__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  /* Mappa nella parte alta, scheda in basso sopra la barra CTA. */
  .al-map__shade { background: linear-gradient(180deg, rgba(14, 15, 17, 0.5) 0%, rgba(14, 15, 17, 0) 16%, rgba(14, 15, 17, 0) 42%, rgba(14, 15, 17, 0.7) 75%, rgba(14, 15, 17, 0.92) 100%); }
  .al-step { align-items: flex-end; padding: 16px 12px 14px; }
  .al-step + .al-step { min-height: var(--al-h); }
  .al-card, .al-card--hero { width: 100%; padding: 18px 18px 16px; border-radius: 18px; }
  .al-card--hero { padding: 22px 20px 18px; }
  .al-h1 { font-size: clamp(1.7rem, 7.4vw, 2.2rem); margin-bottom: 10px; }
  .al-h2 { font-size: clamp(1.5rem, 6.4vw, 1.9rem); }
  .al-lede { font-size: 0.97rem; margin-bottom: 16px; }
  .al-cta .btn { flex: 1 1 auto; justify-content: center; padding: 0.85em 1.1em; }
  /* in apertura la valutazione c'è già nella barra fissa in basso: la scheda resta compatta */
  .al-step--intro .al-cta .btn-accent { display: none; }
  .al-stats { gap: 6px; margin-top: 16px; padding-top: 14px; }
  .al-stats dt { font-size: 1.2rem; }
  .al-stats dd { font-size: 0.62rem; letter-spacing: 0.04em; }
  .al-card__title { font-size: 1.6rem; }
  .al-card__text { font-size: 0.9rem; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  /* Case della zona in fila orizzontale, scorrevoli col dito. */
  .al-houses { flex-direction: row; max-height: none; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; gap: 8px; margin: 0 -18px; padding: 0 18px 4px; scrollbar-width: none; }
  .al-houses::-webkit-scrollbar { display: none; }
  .al-houses li { flex: none; width: 74%; scroll-snap-align: start; }
  .al-houses--one li { width: 100%; }
  .al-houses--one .al-house { flex-direction: row; align-items: center; }
  .al-houses--one .al-house__img { width: 58px; height: 46px; aspect-ratio: auto; border-radius: 8px; }
  .al-houses--one .al-house__go { display: block; }
  .al-rail { display: none; }
  .al-map__bar { top: 12px; right: 12px; }
  .al-chipbtn { padding: 8px 12px; font-size: 0.8rem; }

  .al-head { grid-template-columns: 1fr; gap: 12px; }
  .al-filter { flex-wrap: nowrap; overflow-x: auto; margin: 0 -24px 22px; padding: 0 24px 4px; scrollbar-width: none; }
  .al-filter::-webkit-scrollbar { display: none; }
  .al-filter__btn { flex: none; }
  .al-proof { grid-template-columns: 1fr; }
  .al-proof__img { min-height: 0; aspect-ratio: 16 / 10; }
  .al-proof__txt { padding: 24px 20px; }
  .al-form__wrap { grid-template-columns: 1fr; gap: 28px; }
  .al-form__box { padding: 18px 16px; }

  /* Scheda della casa: foglio dal basso, sopra la barra CTA. */
  .al-panel { top: auto; left: 0; right: 0; width: 100%; max-height: 88vh; z-index: 200; border-left: 0; border-top: 1px solid var(--al-line); border-radius: 20px 20px 0 0; transform: translateY(104%); box-shadow: 0 -30px 60px -30px rgba(0, 0, 0, 0.9); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .al-panel.is-open { transform: none; }
  .al-panel__body { border-radius: 20px 20px 0 0; }
  .al-gal { aspect-ratio: 16 / 10; }
  .al-lb img { max-width: 100vw; max-height: calc(100vh - 140px); border-radius: 0; }
  .al-lb__prev, .al-lb__next { top: auto; bottom: 56px; transform: none; }
  .al-lb__prev { left: calc(50% - 58px); } .al-lb__next { right: calc(50% - 58px); }
  .al-lb__cap { bottom: 18px; }
}
@media (max-width: 560px) {
  .al-method__grid { grid-template-columns: 1fr; }
  .al-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .al-card, .al-panel, .al-pin__beam, .al-pin__label, .al-item, .al-item__media img { transition: none !important; }
  .al-pin__dot::after, .al-loader i::after { animation: none; }
}

/* Elementi nascosti dallo script (filtro, mappa assente): vince su display dei pulsanti. */
.al [hidden] { display: none !important; }
.al-step { scroll-margin-top: var(--al-top); }
