*{
    box-sizing:border-box;
}

:root{
    --bg:#f4f6fb;
    --dark:#101827;
    --dark2:#172033;
    --text:#101827;
    --muted:#667085;
    --card:#ffffff;
    --line:#e5e7eb;
    --purple:#6d4df2;
    --purple2:#eef2ff;
    --green-bg:#dcfce7;
    --green:#166534;
    --yellow-bg:#fef9c3;
    --yellow:#854d0e;
    --orange-bg:#ffedd5;
    --orange:#9a3412;
    --red-bg:#fee2e2;
    --red:#991b1b;
    --blue-bg:#dbeafe;
    --blue:#1e40af;
}

body{
    margin:0;
    font-family:Arial, Helvetica, sans-serif;
    background:var(--bg);
    color:var(--text);
}

.app-header{
    background:linear-gradient(135deg,var(--dark),var(--dark2));
    color:white;
    padding:28px 18px 44px;
    border-bottom-left-radius:26px;
    border-bottom-right-radius:26px;
}

.app-header h1{
    margin:0;
    font-size:30px;
    line-height:1.05;
    font-weight:900;
    letter-spacing:-0.5px;
}

.app-header p{
    margin:10px 0 0;
    color:#d1d5db;
    font-size:16px;
}

.app-container{
    padding:18px;
    max-width:1200px;
    margin:-26px auto 0;
}

.card{
    background:var(--card);
    border-radius:24px;
    padding:22px;
    margin-bottom:18px;
    box-shadow:0 12px 35px rgba(16,24,39,.08);
}

.card-soft{
    background:rgba(255,255,255,.92);
    border:1px solid rgba(229,231,235,.9);
}

.card h2{
    margin:0 0 12px;
    font-size:24px;
    letter-spacing:-0.3px;
}

.card p{
    line-height:1.45;
}

.muted{
    color:var(--muted);
    font-size:15px;
}

.hero-score{
    display:flex;
    flex-direction:column;
    gap:22px;
}

.score-number{
    font-size:64px;
    font-weight:950;
    line-height:.9;
    letter-spacing:-2px;
}

.score-label{
    margin-top:10px;
    color:var(--muted);
    font-size:16px;
}

.status{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:11px 16px;
    border-radius:999px;
    font-weight:900;
    font-size:14px;
    margin-top:16px;
}

.status-dot{
    width:8px;
    height:8px;
    border-radius:50%;
    background:currentColor;
}

.ottima,
.green{
    background:var(--green-bg);
    color:var(--green);
}

.stabile,
.yellow{
    background:var(--yellow-bg);
    color:var(--yellow);
}

.attenzione,
.orange{
    background:var(--orange-bg);
    color:var(--orange);
}

.critica,
.red{
    background:var(--red-bg);
    color:var(--red);
}

.nuova,
.blue{
    background:var(--blue-bg);
    color:var(--blue);
}

.kpi-grid{
    display:grid;
    grid-template-columns:1fr;
    gap:14px;
}

.kpi-card{
    background:#f8fafc;
    border-radius:20px;
    padding:18px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
}

.kpi-title{
    font-size:15px;
    color:#111827;
    margin-bottom:8px;
}

.kpi-value{
    font-size:28px;
    font-weight:950;
    letter-spacing:-0.5px;
}

.kpi-icon{
    width:48px;
    height:48px;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:24px;
    background:#eef2ff;
    flex-shrink:0;
}

.icon-purple{
    background:#ede9fe;
    color:#6d28d9;
}

.icon-green{
    background:#dcfce7;
    color:#166534;
}

.icon-blue{
    background:#dbeafe;
    color:#1e40af;
}

.icon-yellow{
    background:#fef3c7;
    color:#92400e;
}

.notice-card{
    display:flex;
    gap:16px;
    align-items:flex-start;
}

.notice-icon{
    width:54px;
    height:54px;
    border-radius:16px;
    background:#ede9fe;
    color:#6d28d9;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:26px;
    flex-shrink:0;
}

.notice-line{
    width:1px;
    background:#e5e7eb;
    align-self:stretch;
}

.form-grid{
    display:grid;
    grid-template-columns:1fr;
    gap:16px;
    margin-top:18px;
}

.form-group label{
    display:block;
    font-weight:900;
    margin-bottom:8px;
    font-size:14px;
}

.input-wrap{
    display:flex;
    align-items:center;
    border:1px solid #d1d5db;
    border-radius:14px;
    overflow:hidden;
    background:white;
}

.input-prefix,
.input-suffix{
    background:#f3f4f6;
    padding:15px 16px;
    font-weight:900;
    color:#111827;
    border-right:1px solid #d1d5db;
}

.input-suffix{
    border-right:0;
    border-left:1px solid #d1d5db;
}

.input-wrap input{
    border:0;
    width:100%;
    padding:15px 16px;
    font-size:16px;
    outline:none;
    background:white;
}

input,
select{
    width:100%;
    padding:15px 16px;
    border-radius:14px;
    border:1px solid #d1d5db;
    font-size:16px;
    outline:none;
    background:white;
}

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    width:100%;
    border:0;
    text-decoration:none;
    background:var(--dark);
    color:white;
    padding:16px 20px;
    border-radius:14px;
    font-size:16px;
    font-weight:900;
    cursor:pointer;
}

.btn-purple{
    background:linear-gradient(135deg,#6d4df2,#5937d6);
    color:white;
    box-shadow:0 8px 20px rgba(109,77,242,.25);
}

.btn-light{
    background:#eef2ff;
    color:#3730a3;
}

.action-row{
    margin-top:20px;
    display:flex;
    flex-direction:column;
    gap:12px;
}

.back-link{
    display:block;
    text-align:center;
    margin:22px 0 0;
    color:#4f46e5;
    text-decoration:none;
    font-weight:900;
}

.company-card,
.campaign-card{
    border:1px solid var(--line);
    border-radius:22px;
    padding:18px;
    margin-top:14px;
    background:white;
}

.card-title{
    font-size:20px;
    font-weight:950;
    letter-spacing:-0.3px;
}

.meta-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
    margin:16px 0;
}

.meta-box{
    background:#f8fafc;
    border-radius:18px;
    padding:14px;
    font-size:14px;
    color:var(--muted);
}

.meta-box strong{
    display:block;
    margin-top:6px;
    font-size:20px;
    color:var(--text);
}

@media(min-width:768px){

    .app-header{
        padding:36px 32px 58px;
    }

    .app-header h1{
        font-size:40px;
    }

    .app-container{
        padding:28px;
        margin:-38px auto 0;
    }

    .card{
        padding:28px;
    }

    .hero-score{
        flex-direction:row;
        align-items:center;
        justify-content:space-between;
    }

    .kpi-grid{
        grid-template-columns:repeat(4,1fr);
    }

    .form-grid{
        grid-template-columns:repeat(4,1fr);
    }

    .action-row{
        flex-direction:row;
        align-items:center;
    }

    .btn{
        width:auto;
        min-width:170px;
    }

    .company-card,
    .campaign-card{
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:18px;
    }

    .company-main,
    .campaign-main{
        flex:1;
    }

    .meta-grid{
        min-width:300px;
        margin:0;
    }
}
.score-circle{
    width:138px;
    height:138px;
    border-radius:50%;
    background:conic-gradient(#f59e0b 0 50%, #e5e7eb 50% 100%);
    display:none;
    align-items:center;
    justify-content:center;
}

.score-circle-inner{
    width:104px;
    height:104px;
    background:white;
    border-radius:50%;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    font-size:18px;
}

.score-circle-inner strong{
    font-size:34px;
    line-height:1;
}

.score-circle-inner span{
    color:#667085;
    font-weight:800;
}

@media(min-width:768px){
    .score-circle{
        display:flex;
    }
}
.benchmark-card{
    border:3px solid transparent !important;
}

.benchmark-card.ottima,
.benchmark-card.green{
    border-color:#16a34a !important;
    box-shadow:0 0 28px rgba(22,163,74,.18);
}

.benchmark-card.attenzione,
.benchmark-card.orange{
    border-color:#f59e0b !important;
    box-shadow:0 0 28px rgba(245,158,11,.18);
}

.benchmark-card.critica,
.benchmark-card.red{
    border-color:#dc2626 !important;
    box-shadow:0 0 28px rgba(220,38,38,.18);
}

.benchmark-card.nuova,
.benchmark-card.blue{
    border-color:#3b82f6 !important;
    box-shadow:0 0 28px rgba(59,130,246,.14);
}
/* LOADER CENTRO INSERZIONI */

.ci-loading{
    position:fixed;
    inset:0;
    background:rgba(16,24,39,.82);
    backdrop-filter:blur(5px);
    z-index:999999;
    display:none;
    align-items:center;
    justify-content:center;
    padding:20px;
}

.ci-loading-box{
    width:100%;
    max-width:520px;
    background:#fff;
    border-radius:24px;
    padding:32px;
    text-align:center;
    box-shadow:0 25px 60px rgba(0,0,0,.25);
}

.ci-loading-spinner{
    width:80px;
    height:80px;
    border-radius:50%;
    border:7px solid #e5e7eb;
    border-top:7px solid #6d4df2;
    margin:0 auto 24px;
    animation:ciSpin 1s linear infinite;
}

@keyframes ciSpin{
    from{transform:rotate(0deg);}
    to{transform:rotate(360deg);}
}

.ci-loading-title{
    font-size:28px;
    font-weight:900;
    color:#101827;
    margin-bottom:10px;
}

.ci-loading-text{
    font-size:16px;
    line-height:1.6;
    color:#667085;
}

.ci-loading-step{
    margin-top:20px;
    font-size:14px;
    color:#6d4df2;
    font-weight:800;
}

.ci-loading-progress{
    width:100%;
    height:10px;
    background:#eef2ff;
    border-radius:999px;
    overflow:hidden;
    margin-top:20px;
}

.ci-loading-progress span{
    display:block;
    height:100%;
    width:40%;
    background:linear-gradient(90deg,#6d4df2,#8b5cf6);
    animation:ciBar 2s infinite;
}

@keyframes ciBar{
    0%{transform:translateX(-100%);}
    100%{transform:translateX(300%);}
}