/* ============================================================
 *  A.S.H. — Stile specifico: preventivo
 *  GENERATO dalla fase 1: non modificare a mano senza aggiornare
 *  anche le altre pagine. Vedi includes/layout/head.php.
 * ============================================================ */

/* ================= PALETTE BIANCO & ORO (come homepage) ================= */

        
        :root {
            --oro:        #c9a24b;
            --oro-scuro:  #a9822f;
            --oro-testo:  #7c5f20; /* oro profondo: leggibile su bianco (WCAG AA) */
            --oro-chiaro: #f5edd9;
            --crema:      #faf8f3;
            --scuro:      #2e3b42;
            --testo:      #4a5158;
        }

        body {
            font-family: 'Montserrat', sans-serif;
            color: var(--testo);
            background-color: #faf7ef;
            overflow-x: hidden;
        }

        .title-underline.a-sinistra { margin-left: 0; }

        .menu-servizi .dropdown-item:hover,
        .menu-servizi .dropdown-item:focus {
            background: var(--oro-chiaro);
            color: var(--oro-testo);
            transform: translateX(4px);
        }

/* Su desktop il sottomenu si apre anche al passaggio del mouse */

        
        @media (min-width: 992px) {
            .navbar .dropdown:hover > .dropdown-menu {
                display: block;
                animation: comparsa .25s ease;
            }

            .menu-servizi::before {
                content: "";
                position: absolute;
                top: -.6rem;
                left: 0;
                right: 0;
                height: .6rem;
            }
        }

/* ================= HERO PAGINA ================= */

        
        .hero-servizio {
            min-height: 58vh;
            display: flex;
            align-items: center;
            position: relative;
            overflow: hidden;
            background: var(--scuro);
            padding: 9.5rem 0 4.5rem;
        }

        .hero-servizio .hero-bg {
            position: absolute;
            inset: 0;
            background: url('../../media/richiedi%20preventivo/01-hero-preventivo-cantiere.jpg') center center / cover no-repeat;
            /* Stessa foto in WebP: i browser che non conoscono image-set()
               scartano questa riga e restano sul JPEG qui sopra. */
            background-image: image-set(url('../../assets/ottimizzate/media/richiedi%20preventivo/01-hero-preventivo-cantiere-900.webp') type('image/webp') 1x);
            animation: kenburns 22s ease-in-out infinite alternate;
            will-change: transform;
        }

/* hero-bg-mobile: sui telefoni basta la variante piu' piccola,
           lo schermo e' stretto e la foto pesa meno della meta'. */

        
        @media (max-width: 767.98px) {
            .hero-servizio .hero-bg { background-image: image-set(url('../../assets/ottimizzate/media/richiedi%20preventivo/01-hero-preventivo-cantiere-800.webp') type('image/webp') 1x); }
        }

        @keyframes kenburns {
            from { transform: scale(1); }
            to   { transform: scale(1.1) translate(-1.5%, -1%); }
        }

        .hero-servizio .hero-overlay {
            position: absolute;
            inset: 0;
            background:
                linear-gradient(100deg, rgba(24, 30, 34, .92) 0%, rgba(24, 30, 34, .72) 45%, rgba(24, 30, 34, .35) 100%),
                linear-gradient(0deg, rgba(169, 130, 47, .18), rgba(169, 130, 47, .18));
        }

        .hero-servizio .hero-badge {
            background: rgba(255, 255, 255, .14);
            color: #ecd9a8;
            backdrop-filter: blur(4px);
        }

        .hero-servizio h1 {
            font-weight: 800;
            font-size: clamp(2.1rem, 4.6vw, 3.3rem);
            line-height: 1.12;
            color: #ffffff;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .hero-servizio h1 .gold {
            background: linear-gradient(135deg, #e8cc82, var(--oro));
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .hero-servizio .lead { max-width: 620px; color: rgba(255, 255, 255, .88); }

        .hero-servizio .btn-outline-scuro { border-color: #fff; color: #fff; }

        .hero-servizio .btn-outline-scuro:hover { background: #fff; color: var(--scuro); }

/* Breadcrumb nell'hero */

        
        .breadcrumb-servizio {
            display: inline-flex;
            flex-wrap: wrap;
            align-items: center;
            gap: .35rem;
            margin-bottom: 2.5rem;
            padding: 0;
            font-size: .82rem;
            font-weight: 600;
            letter-spacing: .6px;
        }

        .breadcrumb-servizio a {
            color: rgba(255, 255, 255, .85);
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: .4rem;
            transition: color .2s ease;
        }

        .breadcrumb-servizio a:hover { color: #e8cc82; }

        .breadcrumb-servizio .separatore { color: rgba(255, 255, 255, .45); font-size: .7rem; }

        .breadcrumb-servizio .corrente { color: #e8cc82; }

/* ================= MODULO PREVENTIVO ================= */

        
        #richiesta { padding: 5.5rem 0; background: linear-gradient(180deg, #fdfbf5 0%, #faf7ef 100%); }

/* Card del modulo: bianca, con filo oro sul bordo alto */

        
        .card-modulo {
            position: relative;
            background: #fff;
            border: 1px solid #eee6d4;
            border-radius: 22px;
            padding: 2.4rem 2rem;
            overflow: hidden;
            box-shadow: 0 22px 50px rgba(46, 59, 66, .12);
        }

        .card-modulo::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 5px;
            background: linear-gradient(90deg, var(--oro-scuro), var(--oro) 45%, #e8cc82 70%, var(--oro-scuro));
        }

        .card-modulo .form-label {
            font-size: .78rem;
            font-weight: 700;
            letter-spacing: .8px;
            text-transform: uppercase;
            color: var(--scuro);
        }

        .card-modulo .form-control,
        .card-modulo .form-select {
            border: 1px solid #ecdfc0;
            border-radius: 12px;
            padding: .7rem .95rem;
            font-size: .92rem;
            color: var(--scuro);
            background-color: #fffdf8;
            transition: border-color .25s ease, box-shadow .25s ease;
        }

        .card-modulo .form-control:focus,
        .card-modulo .form-select:focus {
            border-color: var(--oro);
            box-shadow: 0 0 0 .2rem rgba(201, 162, 75, .2);
        }

        .card-modulo .form-control::placeholder { color: #b3aa97; }

        .card-modulo .form-check-input:checked {
            background-color: var(--oro-scuro);
            border-color: var(--oro-scuro);
        }

        .card-modulo .form-check-input:focus {
            border-color: var(--oro);
            box-shadow: 0 0 0 .2rem rgba(201, 162, 75, .2);
        }

        .card-modulo .form-check-label { font-size: .82rem; line-height: 1.6; }

/* Campo "Allega documenti": bottone del file input in stile oro */

        
        .card-modulo input[type="file"]::file-selector-button {
            background: var(--oro-chiaro);
            color: var(--oro-testo);
            font-weight: 700;
            font-size: .82rem;
            border: 1px solid #ecdfc0;
            border-radius: 8px;
            padding: .45rem 1rem;
            margin-right: .9rem;
            transition: background .25s ease, color .25s ease;
        }

        .card-modulo input[type="file"]::file-selector-button:hover {
            background: linear-gradient(135deg, #d9b866, var(--oro));
            color: var(--scuro);
        }

        .nota-allegati {
            font-size: .76rem;
            line-height: 1.6;
            color: #8b9199;
            margin-top: .45rem;
        }

        .nota-allegati i { color: var(--oro-scuro); }

/* Honeypot: fuori schermo, invisibile agli utenti */

        
        .campo-azienda {
            position: absolute;
            left: -9999px;
            width: 1px;
            height: 1px;
            overflow: hidden;
        }

/* Colonna laterale: vantaggi del preventivo A.S.H. */

        
        .card-vantaggio {
            position: relative;
            display: flex;
            align-items: flex-start;
            gap: 1rem;
            background: #fff;
            border: 1px solid #eee6d4;
            border-radius: 16px;
            padding: 1.2rem 1.3rem;
            overflow: hidden;
            box-shadow: 0 10px 26px rgba(169, 130, 47, .10);
            transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
        }

        .card-vantaggio:hover {
            transform: translateY(-4px);
            border-color: var(--oro);
            box-shadow: 0 16px 36px rgba(169, 130, 47, .22);
        }

        .card-vantaggio .icona-vantaggio {
            flex-shrink: 0;
            width: 46px;
            height: 46px;
            border-radius: 13px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            color: #fff;
            background: linear-gradient(135deg, #d9b866, var(--oro-scuro));
            box-shadow: 0 8px 18px rgba(169, 130, 47, .35);
        }

        .card-vantaggio h5 {
            font-size: .88rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: .5px;
            margin-bottom: .25rem;
        }

        .card-vantaggio p {
            margin: 0;
            font-size: .82rem;
            line-height: 1.6;
        }

/* Riquadro contatto diretto nella colonna laterale */

        
        .card-diretto {
            position: relative;
            background: linear-gradient(160deg, #fbf1d9 0%, #fdf8ec 100%);
            border: 1px solid var(--oro);
            border-radius: 16px;
            padding: 1.4rem 1.3rem;
            overflow: hidden;
        }

        .card-diretto h5 {
            font-size: .88rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: .5px;
        }

        .card-diretto p { font-size: .82rem; line-height: 1.6; }

/* Recapiti come bottoni: tutta la riga è cliccabile, su desktop e telefono */

        
        .card-diretto a.recapito {
            display: flex;
            align-items: center;
            gap: .8rem;
            background: #fff;
            border: 1px solid #ecdfc0;
            border-radius: 12px;
            padding: .75rem 1rem;
            color: var(--oro-testo);
            font-weight: 700;
            font-size: .9rem;
            text-decoration: none;
            transition: background .25s ease, border-color .25s ease, transform .25s ease, box-shadow .25s ease;
        }

        .card-diretto a.recapito i {
            flex-shrink: 0;
            width: 36px;
            height: 36px;
            border-radius: 10px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 1.05rem;
            color: #fff;
            background: linear-gradient(135deg, #d9b866, var(--oro-scuro));
            box-shadow: 0 6px 14px rgba(169, 130, 47, .3);
            transition: transform .25s ease;
        }

        .card-diretto a.recapito .freccia {
            margin-left: auto;
            width: auto;
            height: auto;
            background: none;
            box-shadow: none;
            color: var(--oro-scuro);
            font-size: .85rem;
            transition: transform .25s ease;
        }

        .card-diretto a.recapito:hover {
            background: var(--oro-chiaro);
            border-color: var(--oro);
            transform: translateY(-2px);
            box-shadow: 0 10px 24px rgba(169, 130, 47, .22);
        }

        .card-diretto a.recapito:hover i { transform: rotate(-6deg) scale(1.08); }

        .card-diretto a.recapito:hover .freccia { transform: translateX(4px) rotate(0) scale(1); }

/* WhatsApp: icona nel suo verde ufficiale */

        
        .card-diretto a.recapito i.bi-whatsapp { background: #25d366; box-shadow: 0 6px 14px rgba(37, 211, 102, .35); }

/* Avvisi esito invio */

        
        .avviso {
            border-radius: 14px;
            padding: 1rem 1.2rem;
            font-size: .9rem;
            font-weight: 600;
            display: flex;
            align-items: flex-start;
            gap: .7rem;
            margin-bottom: 1.4rem;
        }

        .avviso i { font-size: 1.15rem; flex-shrink: 0; }

        .avviso.ok {
            background: #eef7ea;
            color: #35682d;
            border: 1px solid #cbe5c2;
        }

        .avviso.errore {
            background: #fbeeec;
            color: #8f3125;
            border: 1px solid #eccfc9;
        }

        .avviso ul { margin: .3rem 0 0; padding-left: 1.1rem; font-weight: 500; }

/* ================= COME FUNZIONA ================= */

        
        #come-funziona {
            padding: 5.5rem 0;
            background: linear-gradient(180deg, #f4edda 0%, #f9f4e8 100%);
            position: relative;
            overflow: hidden;
        }

/* Bordo oro in alto (come le sezioni della homepage) */

        
        #come-funziona::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 6px;
            background: linear-gradient(90deg, var(--oro-scuro) 0%, var(--oro) 25%, #e8cc82 50%, var(--oro) 75%, var(--oro-scuro) 100%);
        }

/* Bagliore dorato di fondo */

        
        #come-funziona .bagliore {
            position: absolute;
            top: -180px;
            right: -140px;
            width: 520px;
            height: 520px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(201, 162, 75, .16), transparent 65%);
            pointer-events: none;
        }

        .card-fase {
            position: relative;
            display: flex;
            flex-direction: column;
            height: 100%;
            background: linear-gradient(160deg, #fffefb 0%, #fdf8ec 100%);
            border: 1px solid #e6d5a8;
            border-radius: 18px;
            padding: 1.8rem 1.5rem 1.5rem;
            box-shadow: 0 12px 30px rgba(169, 130, 47, .10);
            transition: transform .3s ease, background .3s ease, border-color .3s ease, box-shadow .3s ease;
        }

        .card-fase:hover {
            transform: translateY(-6px);
            border-color: var(--oro);
            box-shadow: 0 20px 44px rgba(169, 130, 47, .22);
        }

/* Numero della fase in oro sfumato */

        
        .card-fase .fase {
            font-size: 2.1rem;
            font-weight: 800;
            line-height: 1;
            margin-bottom: .8rem;
            background: linear-gradient(135deg, var(--oro), var(--oro-scuro));
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }

        .card-fase h5 {
            color: var(--scuro);
            font-size: .95rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: .5px;
            margin-bottom: .5rem;
        }

        .card-fase p {
            font-size: .85rem;
            line-height: 1.65;
            margin: 0 0 1.2rem;
        }

/* Barra di avanzamento: cresce dalla fase 01 alla 04 */

        
        .card-fase .barra-fase {
            margin-top: auto;
            height: 4px;
            border-radius: 2px;
            background: rgba(169, 130, 47, .15);
            overflow: hidden;
        }

        .card-fase .barra-fase span {
            display: block;
            height: 100%;
            border-radius: 2px;
            background: linear-gradient(90deg, var(--oro-scuro), var(--oro));
        }

/* ================= MOBILE: MENU E TABLET ================= */

        
        @media (max-width: 991.98px) {
            .hero-servizio { min-height: 0; padding: 7.5rem 0 3.2rem; }
            .card-modulo { padding: 1.8rem 1.3rem; }

            /* Campi con testo ad almeno 16px: evita lo zoom automatico su iPhone */
            .card-modulo .form-control,
            .card-modulo .form-select {
                font-size: 1rem;
                padding: .78rem 1rem;
            }

            /* Menu a discesa: pannello comodo, voci grandi da toccare */
            .navbar-collapse {
                margin-top: .7rem;
                padding: .3rem .1rem .9rem;
                border-top: 1px solid #eee6d4;
                max-height: calc(100dvh - 84px);
                overflow-y: auto;
            }

            .navbar .nav-link {
                margin: 0;
                padding: .7rem .3rem;
                font-size: 1rem;
            }

            /* Nel menu aperto niente sottolineatura animata: si evidenzia col colore */
            .navbar .nav-link::after { display: none; }

            .navbar .nav-link.active { color: var(--oro-testo); }

            /* Ombra sotto la barra quando il menu è aperto */
            .navbar:has(.navbar-collapse.show) { box-shadow: 0 4px 24px rgba(46, 59, 66, .12); }

            /* Sottomenu Servizi: pannello piatto color crema, senza ombre */
            .menu-servizi {
                box-shadow: none;
                margin: .2rem 0 .6rem;
                background: #fbf8f0;
            }

            .menu-servizi .dropdown-item { padding: .68rem .9rem; }

            /* Bottone preventivo: a tutta larghezza, comodo per il pollice */
            .navbar .nav-item .btn-oro {
                display: block;
                width: 100%;
                text-align: center;
                margin-top: .4rem;
                padding: .75rem 1rem !important;
                font-size: .95rem;
            }

            /* Feedback immediato al tocco */
            .btn-oro:active, .btn-bianco:active { transform: scale(.97); }
        }

/* ================= MOBILE: TELEFONI ================= */

        
        @media (max-width: 575.98px) {
            /* Ritmo verticale più compatto: meno vuoto tra le sezioni */
            #richiesta, #come-funziona { padding: 3.6rem 0; }

            /* Righe impilate: gutter orizzontale standard e respiro ridotto */
            .row.g-5 { --bs-gutter-x: 1.5rem; --bs-gutter-y: 2.4rem; }

            /* Bottone di invio a tutta larghezza: più facile da premere */
            .card-modulo button[type="submit"],
            .card-modulo .btn-oro {
                display: flex;
                justify-content: center;
                width: 100%;
                padding-top: .85rem;
                padding-bottom: .85rem;
            }

            footer { padding-top: 3.2rem; }
            footer a { overflow-wrap: anywhere; }
            .footer-bottom { margin-top: 2rem; }

            /* Pulsanti flottanti: rispettano le aree sicure di iPhone */
            .btn-whatsapp {
                right: max(16px, env(safe-area-inset-right));
                bottom: max(18px, env(safe-area-inset-bottom));
            }

            .btn-top {
                right: max(21px, env(safe-area-inset-right));
                bottom: 88px;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            .hero-servizio .hero-bg { animation: none; }
        }
