/* Effetti di scorrimento comuni a tutte le pagine */
.rv { animation: none !important; }
.fx { opacity: 0; transform: translateY(42px) scale(.985); transition: opacity .9s cubic-bezier(.2,.8,.2,1), transform 1s cubic-bezier(.2,.8,.2,1); transition-delay: var(--fxd, 0ms); }
.fx.fx-l { transform: translateX(-56px); }
.fx.fx-r { transform: translateX(56px); }
.fx.fx-h { transform: translateY(30px); }
.fx.in { opacity: 1; transform: none; }
.fx-zoom img { scale: 1.14; transition: scale 1.6s cubic-bezier(.2,.8,.2,1) !important; }
.fx-zoom.in img { scale: 1; }
.fx-zoom.in:hover img { scale: 1.06; }

#fx-bar { position: fixed; left: 0; top: 0; height: 4px; width: 100%; z-index: 100; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #006F3A, #F9A51C); pointer-events: none; }

#fx-top { position: fixed; right: 24px; bottom: 24px; z-index: 60; width: 60px; height: 60px; border: 0; padding: 0; border-radius: 50%; cursor: pointer;
  background: conic-gradient(#F9A51C var(--p, 0%), rgba(255,255,255,.35) 0); box-shadow: 0 16px 34px -14px rgba(0,60,30,.75);
  opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none; transition: opacity .35s, transform .35s cubic-bezier(.2,.8,.2,1); }
#fx-top.on { opacity: 1; transform: none; pointer-events: auto; }
#fx-top span { position: absolute; inset: 4px; border-radius: 50%; background: #006F3A; display: grid; place-items: center; transition: background .25s; }
#fx-top svg { width: 30px; height: auto; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
#fx-top:hover span { background: #00592F; }
#fx-top:hover svg { transform: translateY(-4px); }
#fx-top:focus-visible { outline: 3px solid #F9A51C; outline-offset: 3px; }
@media (max-width: 960px) { #fx-top { bottom: 92px; right: 16px; width: 54px; height: 54px; } }

header.fx-scrolled { box-shadow: 0 12px 30px -20px rgba(0,0,0,.45) !important; }

@media (prefers-reduced-motion: reduce) {
  .fx, .fx.fx-l, .fx.fx-r, .fx.fx-h { opacity: 1; transform: none; clip-path: none; transition: none; }
  .fx-zoom img { scale: 1; }
}

.tile img, .qphoto img { top: -24px !important; bottom: auto !important; height: calc(100% + 48px) !important; }
.area img { height: calc(100% + 48px) !important; margin-top: -24px; }

/* Menu per smartphone e tablet */
#fx-menu-btn { display: none; position: fixed; z-index: 80; right: 18px; top: 18px; width: 48px; height: 48px; border: 0; border-radius: 12px; background: #006F3A; cursor: pointer; padding: 0; box-shadow: 0 10px 24px -12px rgba(0,60,30,.8); }
#fx-menu-btn i { position: absolute; left: 13px; right: 13px; height: 3px; border-radius: 2px; background: #fff; transition: transform .3s, opacity .2s, top .3s; }
#fx-menu-btn i:nth-child(1) { top: 15px; } #fx-menu-btn i:nth-child(2) { top: 22.5px; } #fx-menu-btn i:nth-child(3) { top: 30px; }
#fx-menu-btn.open i:nth-child(1) { top: 22.5px; transform: rotate(45deg); } #fx-menu-btn.open i:nth-child(2) { opacity: 0; } #fx-menu-btn.open i:nth-child(3) { top: 22.5px; transform: rotate(-45deg); }
#fx-menu { position: fixed; inset: 0; z-index: 75; background: #fff; display: flex; flex-direction: column; padding: 96px 24px 28px; overflow-y: auto; opacity: 0; pointer-events: none; transform: translateY(-12px); transition: opacity .3s, transform .3s; font-family: 'Urbanist', sans-serif; }
#fx-menu.open { opacity: 1; pointer-events: auto; transform: none; }
#fx-menu::before { content: ""; position: absolute; right: -40px; bottom: -20px; width: 320px; height: 110px; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 700 230'%3E%3Cpath d='M28 214 L350 24 L672 214' fill='none' stroke='%23006F3A' stroke-width='44' opacity='.08'/%3E%3C/svg%3E"); pointer-events: none; }
#fx-menu a.l { display: flex; justify-content: space-between; align-items: center; padding: 16px 4px; border-bottom: 1px solid #E3E7E4; color: #252525; text-decoration: none; font-size: 24px; font-weight: 800; }
#fx-menu a.l::after { content: "→"; color: #006F3A; font-size: 20px; }
#fx-menu a.l.on { color: #006F3A; box-shadow: inset 4px 0 0 #F9A51C; padding-left: 14px; }
#fx-menu .cta { margin-top: 24px; display: block; text-align: center; background: #F9A51C; color: #252525; text-decoration: none; font-weight: 800; font-size: 18px; padding: 17px; border-radius: 12px; }
#fx-menu .tel { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#fx-menu .tel a { display: block; text-align: center; border: 1px solid #CBD3CE; border-radius: 12px; padding: 12px 8px; color: #252525; text-decoration: none; font-weight: 800; font-size: 15px; }
#fx-menu .tel a span { display: block; font-family: 'Montserrat', sans-serif; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #006F3A; }
body.fx-lock { overflow: hidden; }

@media (max-width: 960px) {
  #fx-menu-btn { display: block; }
  #dc-root header .btn { display: none !important; }
  #dc-root .wrap { padding-left: 20px !important; padding-right: 20px !important; }
}
@media (min-width: 961px) { #fx-menu { display: none; } }

/* Ottimizzazioni per schermi piccoli */
@media (max-width: 700px) {
  #dc-root .h1 { font-size: 40px !important; }
  #dc-root .h2 { font-size: 32px !important; }
  #dc-root section { scroll-margin-top: 80px; }
  .hscroll { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px !important; margin: 0 -20px; padding: 4px 20px 18px; scrollbar-width: none; }
  .hscroll::-webkit-scrollbar { display: none; }
  .hscroll > * { flex: 0 0 82%; scroll-snap-align: start; }
  .qcard > div:nth-of-type(1) { padding: 38px 24px 34px !important; }
  .qcard h2 { font-size: 32px !important; }
  .qcard .btn { flex: 1 1 100%; text-align: center; }
  .qcard .qphoto { min-height: 260px !important; }
  #dc-root table { min-width: 0 !important; }
  #dc-root table thead { display: none; }
  #dc-root table, #dc-root table tbody, #dc-root table tr, #dc-root table td { display: block; width: 100%; }
  #dc-root table tr { padding: 14px 18px; border-bottom: 1px solid #EEF1EF; }
  #dc-root table td { border: 0 !important; padding: 2px 0 !important; text-align: left !important; }
  #dc-root table td:first-child { font-size: 18px; }
  ol[aria-label="Passaggi"] button > span:last-child { display: none; }
  ol[aria-label="Passaggi"] button > span:first-child { font-size: 16px !important; opacity: 1 !important; }
  ol[aria-label="Passaggi"] button { min-height: 48px !important; }
  #dc-root .viewer > div:last-child { padding: 24px !important; }
  #dc-root .masonry { columns: 2 !important; column-gap: 10px !important; }
  #dc-root .gitem { margin-bottom: 10px !important; }
  #dc-root .gcap { padding: 30px 10px 10px !important; }
  #dc-root .gcap .ur { font-size: 14px !important; }
  #dc-root .area { height: 200px !important; }
}
.pane h2, [role=tabpanel] h3 { line-height: 1.15; }

/* Prestazioni: griglie animate spostate con transform (gestite dalla scheda grafica, niente ridisegni) */
.hm .floor { animation: none !important; background-image: none !important; overflow: hidden; }
.hm .floor::before { content: ""; position: absolute; left: 0; right: 0; top: -240px; bottom: 0; animation: fx-run 14s linear infinite; will-change: transform;
  background-image: linear-gradient(rgba(0,111,58,.38) 2px,transparent 2px),linear-gradient(90deg,rgba(0,111,58,.38) 2px,transparent 2px),linear-gradient(rgba(0,111,58,.14) 1px,transparent 1px),linear-gradient(90deg,rgba(0,111,58,.14) 1px,transparent 1px);
  background-size: 240px 240px,240px 240px,60px 60px,60px 60px; }
@keyframes fx-run { from { transform: translateY(0); } to { transform: translateY(240px); } }
.pgrid { animation: none !important; background-image: none !important; overflow: hidden; }
.pgrid::before { content: ""; position: absolute; top: 0; bottom: 0; left: -48px; right: 0; animation: fx-slide 24s linear infinite; will-change: transform;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.07) 1px,transparent 1px); background-size: 48px 48px; }
@keyframes fx-slide { from { transform: translateX(0); } to { transform: translateX(48px); } }
@media (max-width: 960px) { #dc-root header, #dc-root header > div { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; } }
@media (prefers-reduced-motion: reduce) { .hm .floor::before, .pgrid::before { animation: none; } }

/* Smartphone: niente scorrimento orizzontale, nemmeno durante le animazioni */
html, body { overflow-x: clip; }
@media (max-width: 960px) {
  .fx.fx-l:not(.in), .fx.fx-r:not(.in) { transform: translateY(42px) scale(.985); }
  body.fx-home #fx-menu-btn { top: 30px; right: 36px; box-shadow: none; }
}
#dc-root dl > div { flex-wrap: wrap; }
#dc-root dl > div > * { min-width: 0; overflow-wrap: anywhere; }

/* Home su smartphone: casetta proporzionale e testata più compatta */
@media (max-width: 700px) {
  .hm .house { height: auto !important; aspect-ratio: 1 / 1; }
  .hm .house .wall { top: 24.3% !important; bottom: 1.3% !important; border-width: 2px !important; }
  .hm .house [role=group] { top: 34% !important; bottom: 5% !important; left: calc(11% + 14px) !important; right: calc(11% + 14px) !important; gap: 10px !important; }
  .hm .house .win { border-width: 4px !important; }
  .hm .house .win .sL { border-right-width: 2px !important; }
  .hm .house .win .sR { border-left-width: 2px !important; }
  .hm #top { padding-top: 118px !important; }
  .hm #top p.mo.up { font-size: 12px !important; letter-spacing: .1em; }
  .hm #top p.d2 { font-size: 17px !important; line-height: 1.6; }
  .hm #top .d3 .btn { flex: 1 1 100%; text-align: center; padding: 16px 20px !important; }
  .hm #top .wrap { gap: 32px !important; }
}
@media (max-width: 700px) { .hm .replay { margin: 0 auto; } .hm .replay:only-child { } .hm div:has(> .replay) { justify-content: center !important; } }

/* Altre pagine su smartphone */
@media (max-width: 700px) {
  .pcards { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .pcards .pcard { padding: 8px !important; }
  .pcards .pimg { height: 120px !important; }
  .pcards .pimg img { max-height: 104px !important; }
  .pcards .pcard > span:nth-of-type(2) { margin: 10px 2px 4px !important; font-size: 9px !important; }
  .pcards .pcard > span:nth-of-type(3) { margin: 0 2px 6px !important; font-size: 17px !important; line-height: 1.15; }
  .pcards .pcard > span:nth-of-type(4) { display: none !important; }
  .pcards .pcard > span:nth-of-type(5) { margin: 0 2px 4px !important; font-size: 13px !important; }
  .acts .btn { flex: 1 1 100%; text-align: center; justify-content: center; }
  .vcover .vplay { width: 72px !important; height: 72px !important; margin: -36px 0 0 -36px !important; }
  .vcover .vplay svg { width: 26px; height: 26px; }
  .vcover > div:last-child { left: 16px !important; right: 16px !important; bottom: 12px !important; justify-content: flex-end !important; }
  .vcover > div:last-child p { display: none; }
}

/* Moduli: campo trappola antispam, errori, foto allegate, WhatsApp */
.hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ferr { margin: 0 0 18px; padding: 12px 14px; border-radius: 10px; background: #FDECEA; color: #8A1C12; font-size: 15px; font-weight: 700; line-height: 1.45; }
#dc-root [aria-invalid="true"] { border-color: #C62828 !important; box-shadow: 0 0 0 3px rgba(198,40,40,.15) !important; }
#dc-root button.btn:disabled { opacity: .6; cursor: progress; }
.fthumbs { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.fthumbs li { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #E6F1EB; }
.fthumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fthumbs button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.wabtn { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #006F3A !important; text-decoration: none; font-weight: 800; font-size: 15px; padding: 13px 16px; border-radius: 10px; min-height: 48px; position: relative; }
.wabtn:hover { background: #F4F7F5; }
.wanote { display: flex; gap: 14px; align-items: flex-start; background: #E9F7EF; border: 1px solid #BFE3CD; border-radius: 14px; padding: 18px; color: #1F3A2B; font-size: 15px; line-height: 1.5; }
.wanote svg { flex: 0 0 auto; color: #1FA855; }
.waacts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.wago { display: inline-flex; align-items: center; gap: 10px; background: #1FA855; color: #fff !important; text-decoration: none; font-weight: 800; font-size: 16px; padding: 14px 22px; border-radius: 10px; min-height: 48px; }
.wago:hover { background: #178F47; }
