/*
 * LICATA IN COMUNE UI 2.0
 * Restyling grafico del sito esistente
 */

:root{
    --navy:#063b68;
    --navy-dark:#032b4e;
    --blue:#0868c9;
    --blue-soft:#eaf3ff;
    --cyan:#16a0d5;
    --green:#16a765;
    --green-soft:#e8f8f0;
    --orange:#f59e0b;
    --orange-soft:#fff4df;
    --purple:#6657d9;
    --red:#d92d20;
    --surface:#ffffff;
    --surface-soft:#f6f8fb;
    --bg:#eef3f8;
    --text:#10243a;
    --muted:#687689;
    --line:#dfe7ef;
    --shadow-sm:0 5px 18px rgba(3,43,78,.07);
    --shadow-md:0 16px 45px rgba(3,43,78,.12);
    --radius:18px;
}

body{
    background:
        radial-gradient(circle at 10% 0%,rgba(22,160,213,.08),transparent 28rem),
        linear-gradient(180deg,#f5f8fb 0%,#edf3f8 100%);
    color:var(--text);
}

h1,h2,h3{
    letter-spacing:-.025em;
}

.app-header{
    height:76px;
    background:rgba(255,255,255,.94);
    backdrop-filter:blur(14px);
    box-shadow:0 1px 0 var(--line);
}

.brand-v2{
    gap:12px;
}

.brand-logo-v2{
    width:44px;
    height:44px;
    border-radius:15px;
    background:
        linear-gradient(145deg,#0c75da,#063b68);
    box-shadow:0 8px 20px rgba(8,104,201,.24);
    font-size:.88rem;
    letter-spacing:.03em;
}

.brand-copy strong{
    color:var(--navy);
    font-size:1.02rem;
}

.brand-copy small{
    margin-top:3px;
    color:#7a8798;
}

.navigation-v2 a{
    position:relative;
    color:#35475b;
    padding:10px 2px;
    transition:.2s ease;
}

.navigation-v2 a:not(.btn):hover{
    color:var(--blue);
}

.navigation-v2 a:not(.btn)::after{
    content:"";
    position:absolute;
    right:0;
    bottom:3px;
    left:0;
    height:2px;
    border-radius:999px;
    background:var(--blue);
    transform:scaleX(0);
    transition:.2s ease;
}

.navigation-v2 a:not(.btn):hover::after,
.navigation-v2 a.is-current::after{
    transform:scaleX(1);
}

.nav-register{
    border-radius:12px;
    box-shadow:0 8px 18px rgba(8,104,201,.2);
}

.app-container{
    padding-top:34px;
}

.panel,
.auth-card,
.features article,
.service-note,
.kpi,
.report-card,
.empty{
    border:1px solid rgba(223,231,239,.95);
    border-radius:var(--radius);
    background:rgba(255,255,255,.97);
    box-shadow:var(--shadow-sm);
}

.panel,
.auth-card{
    position:relative;
    overflow:hidden;
}

.panel::before,
.auth-card::before{
    content:"";
    position:absolute;
    top:0;
    right:0;
    left:0;
    height:3px;
    background:linear-gradient(90deg,var(--blue),var(--cyan));
    opacity:.88;
}

.page-head{
    margin-bottom:24px;
}

.page-head h1{
    color:var(--navy-dark);
    font-size:clamp(1.85rem,3vw,2.65rem);
}

.eyebrow{
    color:var(--blue);
    letter-spacing:.15em;
}

.btn{
    min-height:44px;
    border-radius:12px;
    background:linear-gradient(135deg,var(--blue),#0757ae);
    box-shadow:0 7px 18px rgba(8,104,201,.16);
    transition:
        transform .15s ease,
        box-shadow .15s ease,
        opacity .15s ease;
}

.btn:hover{
    transform:translateY(-1px);
    box-shadow:0 10px 25px rgba(8,104,201,.22);
}

.btn.secondary{
    background:#edf3f8;
    color:var(--navy);
    box-shadow:none;
}

.btn.danger{
    background:linear-gradient(135deg,#df3d31,#b42318);
}

input,
select,
textarea{
    border-radius:12px;
    border-color:#cfdbe6;
    background:#fbfdff;
    transition:.18s ease;
}

input:focus,
select:focus,
textarea:focus{
    background:#fff;
    border-color:var(--blue);
    box-shadow:0 0 0 4px rgba(8,104,201,.1);
}

.hero{
    min-height:570px;
}

.hero h1{
    color:var(--navy-dark);
    font-size:clamp(2.7rem,5vw,4rem);
}

.hero p{
    max-width:660px;
}

.hero-card{
    position:relative;
}

.hero-card::before{
    content:"";
    position:absolute;
    width:340px;
    height:340px;
    border-radius:50%;
    background:
        radial-gradient(circle,rgba(22,160,213,.22),rgba(22,160,213,0));
}

.phone-mock{
    position:relative;
    z-index:1;
    border:8px solid var(--navy-dark);
    border-radius:42px;
    box-shadow:0 36px 80px rgba(3,43,78,.27);
}

.phone-content{
    background:
        linear-gradient(180deg,#edf6ff,#f8fbfd);
}

.features{
    gap:20px;
}

.features article{
    padding:26px;
    transition:.18s ease;
}

.features article:hover{
    transform:translateY(-3px);
    box-shadow:var(--shadow-md);
}

.features article span{
    display:grid;
    place-items:center;
    width:54px;
    height:54px;
    border-radius:16px;
    background:var(--blue-soft);
}

.kpi-grid{
    gap:16px;
}

.kpi{
    position:relative;
    overflow:hidden;
    min-height:128px;
    padding:22px;
}

.kpi::after{
    content:"";
    position:absolute;
    right:-20px;
    bottom:-32px;
    width:105px;
    height:105px;
    border-radius:50%;
    background:rgba(8,104,201,.07);
}

.kpi:nth-child(2)::after{
    background:rgba(245,158,11,.1);
}

.kpi:nth-child(3)::after{
    background:rgba(102,87,217,.09);
}

.kpi:nth-child(4)::after{
    background:rgba(22,167,101,.1);
}

.kpi span{
    position:relative;
    z-index:1;
    color:#66788b;
}

.kpi strong{
    position:relative;
    z-index:1;
    color:var(--navy-dark);
    font-size:2.25rem;
}

.panel-head h2{
    color:var(--navy-dark);
}

.report-card{
    position:relative;
    padding:19px 20px;
    transition:.18s ease;
}

.report-card:hover{
    transform:translateY(-2px);
    border-color:#c4d8ea;
    box-shadow:0 11px 28px rgba(3,43,78,.1);
}

.status{
    gap:5px;
    padding:7px 10px;
    border-radius:999px;
}

.status-new{
    background:#e9f3ff;
    color:#075caa;
}

.status-assigned{
    background:#f1efff;
    color:#5746c7;
}

.status-working{
    background:var(--orange-soft);
    color:#a86100;
}

.status-closed{
    background:var(--green-soft);
    color:#0a7c47;
}

.table-wrap{
    border:1px solid var(--line);
    border-radius:14px;
    overflow:auto;
}

table{
    background:#fff;
}

thead{
    background:#f5f8fb;
}

th{
    color:#64778a;
}

tbody tr{
    transition:.15s ease;
}

tbody tr:hover{
    background:#f7fbff;
}

.timeline{
    position:relative;
}

.timeline>div{
    position:relative;
    grid-template-columns:20px 1fr;
}

.timeline>div>span{
    width:14px;
    height:14px;
    border:3px solid #dcecff;
    background:var(--blue);
    box-shadow:0 0 0 3px #f4f9ff;
}

.timeline>div:not(:last-child)::after{
    content:"";
    position:absolute;
    top:19px;
    bottom:-4px;
    left:6px;
    width:2px;
    background:#d8e7f4;
}

.map,
#adminMap{
    border:1px solid #cfdce8;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.6);
}

.auth-card{
    max-width:620px;
    padding:34px;
}

.auth-card h1{
    color:var(--navy-dark);
    text-align:center;
}

.auth-card>.muted{
    text-align:center;
}

.checkbox{
    border-radius:13px;
    border-color:#dce6ef;
    background:#f6f9fc;
}

.user-pill{
    background:#edf5ff;
    color:var(--navy);
}

.site-footer.footer-v2{
    background:
        linear-gradient(135deg,var(--navy-dark),var(--navy));
    border-top:3px solid #0c75da;
}

.footer-v2 strong,
.footer-v2 span{
    display:block;
}

.footer-v2 span{
    margin-top:5px;
    color:#a8bfd1;
}

/* Navigazione inferiore mobile */

.mobile-bottom-nav{
    display:none;
}

@media(max-width:900px){

    body.is-authenticated{
        padding-bottom:
            calc(78px + env(safe-area-inset-bottom));
    }

    .app-header{
        height:68px;
    }

    .brand-logo-v2{
        width:40px;
        height:40px;
    }

    .site-navigation.navigation-v2 a::after{
        display:none;
    }

    .site-navigation.navigation-v2 a{
        padding:12px 14px;
    }

    .app-container{
        padding-top:22px;
    }

    .mobile-bottom-nav{
        position:fixed;
        right:8px;
        bottom:
            calc(8px + env(safe-area-inset-bottom));
        left:8px;
        z-index:38;
        display:grid;
        grid-template-columns:repeat(5,1fr);
        min-height:66px;
        padding:7px 5px;
        border:1px solid rgba(214,226,237,.95);
        border-radius:20px;
        background:rgba(255,255,255,.96);
        box-shadow:0 14px 38px rgba(3,43,78,.2);
        backdrop-filter:blur(18px);
    }

    .mobile-bottom-nav a{
        position:relative;
        display:flex;
        min-width:0;
        align-items:center;
        justify-content:center;
        flex-direction:column;
        gap:3px;
        color:#6f7e8f;
        font-size:.58rem;
        font-weight:700;
    }

    .mobile-bottom-nav a.is-current{
        color:var(--blue);
    }

    .bottom-icon{
        font-size:1.32rem;
        line-height:1;
    }

    .bottom-primary{
        margin-top:-23px;
    }

    .bottom-plus{
        display:grid;
        place-items:center;
        width:48px;
        height:48px;
        margin-bottom:2px;
        border:5px solid #f3f7fa;
        border-radius:50%;
        background:linear-gradient(135deg,#0a78e1,#0757ae);
        color:#fff;
        font-size:1.65rem;
        line-height:1;
        box-shadow:0 9px 20px rgba(8,104,201,.3);
    }

    .hero{
        min-height:auto;
    }

    .hero-card{
        margin-top:8px;
    }

    .kpi{
        min-height:110px;
    }

    .auth-card{
        padding:24px 19px;
    }

    .site-footer.footer-v2{
        margin-bottom:
            calc(72px + env(safe-area-inset-bottom));
    }
}

@media(max-width:480px){

    .brand-copy strong{
        font-size:.96rem;
    }

    .page-head h1{
        font-size:2rem;
    }

    .panel{
        padding:18px;
    }

    .kpi-grid{
        grid-template-columns:1fr 1fr !important;
    }

    .kpi{
        min-height:105px;
        padding:17px;
    }

    .kpi strong{
        font-size:1.85rem;
    }
}


/* Licata in Comune UI 2.1 */

.brand-logo-image{
    overflow:visible;
    padding:0;
    background:transparent;
    box-shadow:none;
}

.brand-logo-image img{
    display:block;
    width:46px;
    height:46px;
    object-fit:contain;
    filter:drop-shadow(0 6px 9px rgba(3,43,78,.15));
}

.nav-register,
.nav-register:visited{
    color:#ffffff !important;
}

.auth-card form > .btn,
.auth-card form > button.btn{
    margin-top:14px;
}

.panel.form-grid > .checkbox.full{
    margin-top:24px;
    margin-bottom:18px;
    padding:18px 16px;
    border-width:2px;
}

.report-photo,
.photo-preview-grid img{
    cursor:zoom-in;
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        opacity .18s ease;
}

.report-photo:hover,
.photo-preview-grid img:hover{
    transform:translateY(-2px);
    box-shadow:0 12px 28px rgba(3,43,78,.18);
}

.photo-lightbox{
    position:fixed;
    inset:0;
    z-index:10050;
    display:grid;
    place-items:center;
    padding:
        calc(20px + env(safe-area-inset-top))
        20px
        calc(20px + env(safe-area-inset-bottom));
    background:rgba(3,20,35,.91);
    backdrop-filter:blur(5px);
}

.photo-lightbox[hidden]{
    display:none;
}

.photo-lightbox-image{
    display:block;
    max-width:min(1180px,94vw);
    max-height:88dvh;
    object-fit:contain;
    border-radius:14px;
    box-shadow:0 30px 80px rgba(0,0,0,.42);
}

.photo-lightbox-close{
    position:fixed;
    top:calc(14px + env(safe-area-inset-top));
    right:16px;
    z-index:10051;
    display:grid;
    place-items:center;
    width:46px;
    height:46px;
    padding:0;
    border:1px solid rgba(255,255,255,.35);
    border-radius:50%;
    background:rgba(255,255,255,.13);
    color:#ffffff;
    font-size:1.65rem;
    cursor:pointer;
}

.photo-lightbox-caption{
    position:fixed;
    right:18px;
    bottom:calc(14px + env(safe-area-inset-bottom));
    left:18px;
    color:#ffffff;
    font-size:.85rem;
    text-align:center;
}

.mail-status{
    display:inline-flex;
    align-items:center;
    gap:5px;
    padding:6px 9px;
    border-radius:999px;
    font-size:.75rem;
    font-weight:800;
}

.mail-status.sent{
    background:#e8f8f0;
    color:#087747;
}

.mail-status.failed{
    background:#fff0ee;
    color:#b42318;
}

@media(max-width:900px){
    .brand-logo-image img{
        width:40px;
        height:40px;
    }

    .panel.form-grid > .checkbox.full{
        margin-top:28px;
        margin-bottom:22px;
    }
}
