/* Modulo contatti: sezione scura con video di sfondo sfocato (foglie d'acero)
   e cornice luminosa che gira intorno al riquadro del modulo. */
.bm-fv {
    position: relative !important;
    isolation: isolate;
    background: transparent !important;
    color: #f4f1ec !important;
}
.bm-fv-bg {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(50% - 50vw);
    width: 100vw;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: #0b0806 center / cover no-repeat;
}
.bm-fv-bg video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.bm-fv-bg.is-playing video { opacity: 1; }
/* Velatura scura per leggere i testi */
.bm-fv-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, #0a0a0a 0, rgba(10,10,10,.25) 140px, rgba(10,10,10,.2) calc(100% - 140px), #0a0a0a 100%),
        radial-gradient(ellipse 70% 60% at 50% 55%, rgba(0,0,0,.55) 0%, rgba(0,0,0,.25) 100%);
}

/* Testi della sezione */
.bm-fv .bm-section-label { color: #e8bd52 !important; }
.bm-fv h2 {
    color: #fff !important;
    text-shadow: 0 2px 20px rgba(0,0,0,.65);
}
.bm-fv .bm-section-desc {
    color: rgba(255,255,255,.9) !important;
    text-shadow: 0 1px 12px rgba(0,0,0,.8);
}

/* Riquadro del modulo */
.bm-fv-box {
    position: relative;
    background: rgba(12,9,8,.74) !important;
    border: 0 !important;
    border-radius: 18px !important;
    box-shadow: 0 30px 80px rgba(0,0,0,.55) !important;
    animation: none !important;
}
.bm-fv-box > :not(.bm-fv-glow) { position: relative; z-index: 1; }

/* Cornice luminosa: tratti colorati che corrono lungo il bordo in senso orario */
.bm-fv-glow,
.bm-fv-glow span {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}
.bm-fv-glow { z-index: 0; }
.bm-fv-glow svg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    display: block;
}
.bm-fv-seg {
    fill: none;
    stroke-linecap: butt;
    animation: bmFvRun 6s linear infinite;
}
@keyframes bmFvRun {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -1000px; }
}
.bm-fv-box:not(.is-visible) .bm-fv-seg { animation-play-state: paused; }
/* Bordo netto e sottile */
.bm-fv-edge .bm-fv-seg { stroke-width: 1.5px; }
/* Luce che entra nel riquadro (tagliata al bordo) */
.bm-fv-in { overflow: hidden; }
.bm-fv-blur { filter: blur(10px); opacity: .7; }
.bm-fv-in .bm-fv-seg { stroke-width: 18px; }
/* Alone appena fuori dal riquadro */
.bm-fv-out { filter: blur(7px); opacity: .9; }
.bm-fv-out .bm-fv-seg { stroke-width: 3px; }

/* Campi del modulo */
.bm-fv #contactForm input,
.bm-fv #contactForm textarea,
.bm-fv #contactForm select {
    background: rgba(0,0,0,.55) !important;
    border: 1px solid rgba(255,255,255,.2) !important;
    color: #fff !important;
    border-radius: 6px !important;
}
.bm-fv #contactForm input::placeholder,
.bm-fv #contactForm textarea::placeholder { color: rgba(255,255,255,.55) !important; }
.bm-fv #contactForm input:focus,
.bm-fv #contactForm textarea:focus,
.bm-fv #contactForm select:focus {
    border-color: #e8bd52 !important;
    box-shadow: 0 0 0 3px rgba(232,189,82,.2);
}
.bm-fv #contactForm input:-webkit-autofill {
    -webkit-text-fill-color: #fff;
    box-shadow: 0 0 0 1000px #17120e inset;
}
.bm-fv #contactForm select option { background: #17120e; color: #fff; }
.bm-fv .form-group label { color: #e8bd52 !important; }
.bm-fv .submit-btn { border-radius: 6px !important; }

/* Pagine Statue: modulo nella finestra a comparsa. Il video fa da sfondo alla finestra,
   la cornice sta su un contenitore esterno (.bm-fv-mframe) perche' il riquadro puo' scorrere. */
#contact-modal.bm-fv-modal {
    background: #0a0a0a !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}
#contact-modal.bm-fv-modal > .bm-fv-bg {
    position: fixed;
    inset: 0;
    width: auto;
    z-index: 0;
}
.bm-fv-mframe.bm-fv-box {
    z-index: 1;
    width: 100%;
    max-width: 420px;
    flex: 0 0 auto;
    animation: contactFadeIn .5s ease-out !important;
}
#contact-modal.bm-fv-modal .contact-form-wrap {
    background: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border: 0 !important;
    border-radius: 18px !important;
    box-shadow: none !important;
    animation: none !important;
}

@media (max-width: 600px) {
    .bm-fv-box,
    #contact-modal.bm-fv-modal .contact-form-wrap { border-radius: 14px !important; }
    .bm-fv-blur { filter: blur(8px); }
    .bm-fv-in .bm-fv-seg { stroke-width: 14px; }
    .bm-fv-out { filter: blur(6px); }
}
/* "Riduci movimento": la cornice resta ferma, il video non parte (vedi bm-form-video.js) */
@media (prefers-reduced-motion: reduce) {
    .bm-fv-seg { animation: none; }
}
