/* TRASFORMAZIONE RADIOBUTTONLIST IN SWITCH/TOGGLE */
.radio-switch {
    display: inline-flex;
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem; /* Standard Bootstrap radius */
    overflow: hidden;
    background-color: white;
}

    /* Nascondiamo il vero input radio (il pallino) ma lo lasciamo accessibile */
    .radio-switch input[type="radio"] {
        position: absolute;
        clip: rect(0,0,0,0);
        pointer-events: none;
    }

    /* Stile delle etichette (che diventano i bottoni) */
    .radio-switch label {
        flex: 1; /* Si dividono lo spazio equamente */
        text-align: center;
        padding: 0.6rem 1rem;
        cursor: pointer;
        margin-bottom: 0;
        font-weight: 500;
        color: #6c757d; /* Grigio spento */
        transition: all 0.2s ease-in-out;
        border-left: 1px solid #dee2e6; /* Separatore */
    }

    /* Rimuovo il bordo al primo elemento */
    .radio-switch input[type="radio"]:first-child + label {
        border-left: none;
    }

    /* STATO ATTIVO (Quando il radio è checkato) */
    .radio-switch input[type="radio"]:checked + label {
        background-color: #0d6efd; /* Bootstrap Primary Blue */
        color: white;
        box-shadow: inset 0 3px 5px rgba(0,0,0,0.125); /* Effetto premuto */
    }

    /* Hover effect */
    .radio-switch label:hover {
        background-color: #f8f9fa;
    }

    .radio-switch input[type="radio"]:checked + label:hover {
        background-color: #0b5ed7; /* Darker blue on hover active */
    }

/* Verifica email e reinvio: conserva la larghezza della scheda su desktop. */
.email-verification-card { max-width: 500px; }
.recaptcha-feedback:not([hidden]) {
    display: block;
}

/* Feedback condiviso: i messaggi dei campi non scompaiono con i toast. */
.field-feedback { display: block; flex-basis: 100%; order: 99; }
.form-feedback-toasts { z-index: 1090; max-width: 100%; }


/* Stili trasferiti da Site.Master; valori originali conservati. */
/* Correzione visuale per SiteMapPath che usa span invece di li */
        .breadcrumb span {
            display: inline-flex;
            align-items: center;
        }

        .breadcrumb a:hover {
            text-decoration: underline !important;
        }
        /* Site.css */
        textarea.form-control {
            width: 100% !important;
            max-width: 100%;
            box-sizing: border-box; /* Per sicurezza */
        }
        /* Impostazione Font Globale: Lato */
        body, h1, h2, h3, h4, h5, h6, .navbar, .btn, .form-control {
            font-family: 'Lato', sans-serif !important;
        }

        /* Opzionale: rendiamo i testi un filo più leggeri per eleganza */
        body {
            font-weight: 400;
        }

        /* Titoli in grassetto */
        h1, h2, h3, .navbar-brand {
            font-weight: 700;
        }

        .hover-scale {
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

            .hover-scale:hover {
                transform: translateY(-2px); /* Si alza leggermente */
                box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important; /* Aumenta l'ombra */
            }


/* Stili trasferiti da Login.aspx; valori originali conservati. */
.login-page .login-card {
            background: #ffffff;
            border: none;
        }

        .login-page .btn-login {
            background-color: #0d6efd; /* O il tuo colore primario */
            border: none;
            font-weight: 600;
            padding: 12px;
            transition: all 0.3s;
        }

            .login-page .btn-login:hover {
                background-color: #0b5ed7;
                transform: translateY(-2px);
                box-shadow: 0 4px 8px rgba(13, 110, 253, 0.2);
            }

        .login-page .form-control:focus {
            box-shadow: none;
            border-color: #0d6efd;
        }

        .login-page .input-group-text {
            background-color: #fff;
            border-left: none;
            cursor: pointer;
        }
        /* Fix per il bordo sinistro dell'input quando c'è l'icona a destra */
        .login-page .pwd-input {
            border-right: none;
        }


/* Stili trasferiti da Registrazione.aspx; valori originali conservati. */
.registration-page .reg-shell {
            min-height: calc(100vh - 160px);
        }

        /* Pannello benefici */
        .registration-page .reg-benefits {
            border-radius: 1.25rem;
            overflow: hidden;
            position: relative;
            box-shadow: 0 .75rem 2rem rgba(0,0,0,.12);
            background: linear-gradient(135deg, #0d6efd 0%, #6f42c1 55%, #20c997 120%);
            color: #fff;
            padding-top: 1.75rem;
            padding-bottom: 1.75rem;
        }


            .registration-page .reg-benefits::before {
                content: "";
                position: absolute;
                inset: -60px;
                background: radial-gradient(circle at 20% 15%, rgba(255,255,255,.18), rgba(255,255,255,0) 55%), radial-gradient(circle at 85% 25%, rgba(255,255,255,.14), rgba(255,255,255,0) 52%), radial-gradient(circle at 70% 85%, rgba(0,0,0,.18), rgba(0,0,0,0) 60%);
                pointer-events: none;
            }

            .registration-page .reg-benefits .content {
                position: relative;
                z-index: 1;
            }

        .registration-page .benefit-pill {
            display: inline-flex;
            align-items: center;
            gap: .5rem;
            padding: .35rem .7rem;
            border-radius: 999px;
            background: rgba(255,255,255,.14);
            border: 1px solid rgba(255,255,255,.22);
            font-size: .85rem;
            white-space: nowrap;
        }

        .registration-page .benefit-card {
            border-radius: 1rem;
            background: rgba(255,255,255,.12);
            border: 1px solid rgba(255,255,255,.20);
            backdrop-filter: blur(6px);
        }

        .registration-page .benefit-ico {
            width: 42px;
            height: 42px;
            border-radius: 12px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: rgba(255,255,255,.18);
            border: 1px solid rgba(255,255,255,.22);
            flex: 0 0 auto;
        }

        /* Sezione "Per Titolari / Per Sostituti" */
        .registration-page .aud-box {
            border-radius: 1rem;
            background: rgba(255,255,255,.10);
            border: 1px solid rgba(255,255,255,.22);
            padding: 1rem;
        }

        .registration-page .aud-title {
            display: flex;
            align-items: center;
            gap: .6rem;
            font-weight: 700;
        }

        .registration-page .aud-list {
            margin: .6rem 0 0 0;
            padding: 0 0 0 1.1rem;
        }

            .registration-page .aud-list li {
                margin: .25rem 0;
                opacity: .92;
            }

        /* Card form */
        .registration-page .reg-card {
            box-shadow: 0 .75rem 2rem rgba(0,0,0,.10);
            border: 1px solid rgba(0,0,0,.06);
        }

/* Dichiarazioni precedentemente negli attributi style delle pagine. */
.login-page .login-layout { min-height: 80vh; }
.registration-page .password-toggle { cursor: pointer; }
.profile-photo-help { font-size: 0.75rem; }
.profile-owner-section { background-color: #f8fbff; }
.profile-substitute-section { background-color: #f9fffb; }
.profile-image { width: 150px; height: 150px; object-fit: cover; }
.profile-phone-verification { font-size: 0.75rem; }
.profile-address-actions { width: 50px; }

/* Profilo: sezioni per ruolo e navigazione rapida, senza cambiare i controlli server. */
body:has(.profile-section-nav) .site-navbar { position: sticky; top: 0; z-index: 1030; }
.profile-section { scroll-margin-top: calc(var(--profile-navbar-height, 0px) + 6rem); }
.profile-section-nav {
    position: sticky;
    top: var(--profile-navbar-height, 0px);
    z-index: 1020;
    padding-block: 0.75rem;
}
.profile-section-nav-inner { padding-inline: 0; }
.profile-section-nav.is-stuck {
    width: var(--profile-viewport-width, 100vw);
    margin-inline: calc(50% - var(--profile-viewport-width, 100vw) / 2);
    background-color: #fff;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08), inset 0 -1px #dee2e6;
}
.profile-section-nav.is-stuck .profile-section-nav-inner { padding-inline: 0.75rem; }
.profile-section-nav .btn { white-space: normal; }
@media (max-width: 575.98px) {
    .profile-section { scroll-margin-top: calc(var(--profile-navbar-height, 0px) + 10rem); }
    .profile-section-nav .btn { flex: 1 1 calc(50% - 0.5rem); }
}

/* Province selezionabili nel profilo del sostituto. */
.profile-provinces { list-style: none; padding: 0; columns: 3 14rem; }
.profile-provinces li { break-inside: avoid; padding: .35rem 0; }
.profile-provinces input { margin-right: .5rem; }
.profile-provinces label { cursor: pointer; }

/* Evidenzia l'intera sezione dopo la navigazione, senza spostare il contenuto. */
.profile-section-highlight {
    border-radius: 0.75rem;
    outline: 4px solid rgba(184, 134, 11, 0.85);
    outline-offset: 4px;
    box-shadow: 0 0 16px 5px rgba(184, 134, 11, 0.35);
    animation: profile-section-blink 2s ease-in-out;
}
@keyframes profile-section-blink {
    0%, 50%, 100% {
        outline-color: rgba(184, 134, 11, 0);
        box-shadow: 0 0 16px 5px rgba(184, 134, 11, 0);
    }
    25%, 75% {
        outline-color: rgba(184, 134, 11, 0.85);
        box-shadow: 0 0 16px 5px rgba(184, 134, 11, 0.35);
    }
}
@media (prefers-reduced-motion: reduce) {
    .profile-section-highlight { animation: none; }
}
/* Selettore territoriale del pilota: radio nativi, stato selezionato anche con bordo. */
.pilot-provinces { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .75rem; }
.pilot-provinces li { border: 1px solid #6c757d; border-radius: .5rem; padding: .65rem 1rem; }
.pilot-provinces li:has(input:checked) { border: 3px solid #285b95; background: #edf2f9; }
.pilot-provinces input { margin-right: .5rem; }
.pilot-provinces label { cursor: pointer; }

/* Accesso personale: ingresso compatto alla gestione del pilota nel profilo. */
.profile-access-card { display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; background: #fff; border: 1px solid #dce4ee; border-radius: 14px; box-shadow: 0 3px 12px rgba(23, 43, 77, .04); }
.profile-access-icon { display: grid; place-items: center; flex: 0 0 46px; height: 46px; border-radius: 12px; color: #1857a4; background: #eef4fc; font-size: 1.15rem; }
.profile-access-copy { flex: 1; min-width: 0; }
.profile-access-copy h2 { margin: 0 0 .3rem; font-size: 1rem; font-weight: 700; color: #24364b; }
.profile-access-copy p { margin: 0; font-size: .9rem; color: #566477; }
.profile-access-link { display: inline-flex; align-items: center; justify-content: center; gap: .75rem; padding: .6rem 1rem; border: 1px solid #b9cbe3; border-radius: 9px; color: #164f93; background: #fff; text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.profile-access-link:hover { color: #123e73; background: #eef4fc; border-color: #7497c5; }
.profile-access-link:focus-visible { outline: 3px solid #0d6efd; outline-offset: 3px; }
@media (max-width: 575.98px) {
    .profile-access-card { flex-wrap: wrap; padding: 1rem; gap: .85rem; }
    .profile-access-copy { flex-basis: calc(100% - 65px); }
    .profile-access-link { width: 100%; }
}

/* Footer pubblico condiviso: contenuti e navigazione su fondo blu. */
.site-footer { background: #102a48; color: #d2deed; border-top: 4px solid #397dcb; margin-top: 3rem; }
.site-footer-main { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 3rem; padding: 3.5rem 0 2.5rem; }
.site-footer-logo { display: inline-flex; padding: .65rem 1rem; background: #fff; border-radius: 12px; margin-bottom: 1.25rem; }
.site-footer-logo img { display: block; width: 180px; max-width: 100%; height: auto; }
.site-footer-brand p { max-width: 22rem; font-size: .95rem; line-height: 1.8; margin: 0 0 1.25rem; }
.site-footer-tag { display: inline-flex; align-items: center; gap: .6rem; font-size: .8rem; color: #b9d5f7; }
.site-footer-tag span { color: #86c8bc; font-size: .6rem; }
.site-footer h2 { margin: .4rem 0 1.25rem; font-size: .95rem; font-weight: 700; color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: .8rem; }
.site-footer a { color: #d2deed; text-decoration: none; }
.site-footer nav a { display: inline-block; padding: .15rem 0; font-size: .9rem; line-height: 1.5; }
.site-footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.site-footer a:focus-visible { outline: 3px solid #b9d5f7; outline-offset: 5px; border-radius: 3px; }
.site-footer-note { display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.5rem; background: #193654; border: 1px solid #36506e; border-radius: 12px; }
.site-footer-note-icon { font-size: 1.6rem; color: #b9d5f7; }
.site-footer-note p { margin: 0; font-size: .88rem; line-height: 1.7; }
.site-footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.5rem 0; margin-top: 2rem; border-top: 1px solid #36506e; font-size: .8rem; }
.site-footer-bottom p { margin: 0; }
@media (max-width: 991.98px) {
    .site-footer-main { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
}
@media (max-width: 575.98px) {
    .site-footer-main { grid-template-columns: 1fr; gap: 1.75rem; padding-top: 2.5rem; }
    .site-footer h2 { margin-bottom: .75rem; }
    .site-footer-note { padding: 1rem; align-items: flex-start; }
    .site-footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* Home: accesso al centro di controllo e attivazione delle province. */
.home-pilot-card { border-left: 4px solid #1857a4; }
.home-pilot-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; }
.home-pilot-primary { color: #fff; background: #1857a4; border-color: #1857a4; }
.home-pilot-primary:hover { color: #fff; background: #123e73; border-color: #123e73; }
@media (max-width: 991.98px) {
    .home-pilot-card { flex-wrap: wrap; }
    .home-pilot-card .profile-access-copy { flex-basis: calc(100% - 65px); }
    .home-pilot-actions { width: 100%; justify-content: flex-start; }
}
@media (max-width: 575.98px) {
    .home-pilot-actions { flex-direction: column; }
}

/* Menu account del frontend, coerente con la topbar personale. */
.frontend-avatar{display:flex;align-items:center;gap:.7rem;border:0;background:transparent;color:#fff;text-align:left;padding:.4rem .2rem}.frontend-avatar img{width:42px;height:42px;border-radius:50%;object-fit:cover;background:#eef4fc}.frontend-avatar small{display:block;color:#c4d0dd;font-size:.75rem}.frontend-avatar:focus-visible{outline:3px solid #b9d5f7;outline-offset:4px;border-radius:6px}.frontend-account .dropdown-menu{min-width:240px;padding:.5rem;border-radius:12px;box-shadow:0 8px 25px rgba(16,42,72,.15)}.frontend-account .dropdown-item{border-radius:6px;padding:.65rem .8rem}@media(max-width:991.98px){.frontend-account{align-self:flex-end}.frontend-account .dropdown-menu{position:absolute;right:0;left:auto}.frontend-avatar span{max-width:180px;overflow-wrap:anywhere}}

@media(max-width:575.98px){.frontend-avatar>span{display:none}.frontend-avatar img{width:36px;height:36px}.site-navbar .navbar-brand{font-size:1.15rem}}

/* Evidenziazione globale delle destinazioni di ancora: due pulsazioni in due secondi. */
.site-anchor-highlight{outline:5px solid rgba(230,174,20,.95);outline-offset:4px;box-shadow:0 0 20px 7px rgba(230,174,20,.4);border-radius:.75rem;animation:site-anchor-blink 2s ease-in-out}
@keyframes site-anchor-blink{0%,50%,100%{outline-color:rgba(230,174,20,0);box-shadow:0 0 20px 7px rgba(230,174,20,0)}25%,75%{outline-color:rgba(230,174,20,.95);box-shadow:0 0 20px 7px rgba(230,174,20,.4)}}
@media(prefers-reduced-motion:reduce){.site-anchor-highlight{animation:none}}
