/* ============================================
   FISCAL WATCH 1.0 - STILE
   Palette: blu polvere + lilla + menta
   ============================================ */

/* ---------- VARIABILI ---------- */
:root {
    /* Colori primari Fiscal Watch */
    --fw-primary: #60a5fa;
    --fw-primary-rgb: 96, 165, 250;
    --fw-secondary: #a78bfa;
    --fw-secondary-rgb: 167, 139, 250;
    --fw-accent: #34d399;
    --fw-accent-rgb: 52, 211, 153;
    --fw-warning: #fbbf24;
    
    /* Sfondo (stesso del portale) */
    --bg-dark-start: #0f172a;
    --bg-dark-end: #1e293b;
}

/* ---------- BASE ---------- */
body {
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    font-size: 0.94rem;
    background: linear-gradient(135deg, var(--bg-dark-start) 0%, var(--bg-dark-end) 100%);
    color: #f8fafc;
    min-height: 100vh;
}

/* ---------- NAVBAR ---------- */
.navbar {
    background: rgba(15, 23, 42, 0.9) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar-brand {
    font-family: 'Outfit', sans-serif;
}

/* Colore primario Fiscal Watch */
.navbar-brand .text-primary {
    color: var(--fw-primary) !important;
}

.nav-link {
    color: #94a3b8 !important;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: #f8fafc !important;
}

.navbar-nav .nav-item {
    display: flex;
    align-items: center;
}

.nav-action,
.nav-user {
    min-height: 34px;
    padding: 7px 11px !important;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 0.72rem;
    line-height: 1;
    white-space: nowrap;
}

.nav-action:hover,
.nav-action.active {
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.55);
    text-decoration: none;
}

.nav-action i,
.nav-user i {
    font-size: 0.84rem;
}

.nav-user {
    color: #cbd5e1;
    border-color: rgba(203, 213, 225, 0.14);
    background: rgba(255, 255, 255, 0.035);
    cursor: default;
}

@media (max-width: 991.98px) {
    .navbar-nav .nav-item {
        margin-top: 5px;
    }

    .navbar-nav .nav-action,
    .navbar-nav .nav-user {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Badge Fiscal Watch */
.badge-fw {
    background: rgba(96, 165, 250, 0.15) !important;
    color: var(--fw-primary) !important;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(96, 165, 250, 0.2);
}

/* ---------- HERO ---------- */
.hero-section {
    min-height: 70vh;
    background: linear-gradient(135deg, var(--bg-dark-start) 0%, var(--bg-dark-end) 100%);
    padding: 60px 0;
}

.hero-logo {
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.3));
}

.hero-section h1 {
    font-family: 'Outfit', sans-serif;
}

/* Colore primario Fiscal Watch nell'hero */
.hero-section .text-primary {
    color: var(--fw-primary) !important;
}

.divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--fw-primary), var(--fw-secondary));
    border-radius: 2px;
    margin: 20px auto;
}

.text-light-emphasis {
    color: #cbd5e1 !important;
}

/* ---------- BARRA DI RICERCA ---------- */
.form-control.bg-transparent {
    color: var(--fw-primary) !important;
    caret-color: var(--fw-primary);
}

.form-control.bg-transparent::placeholder {
    color: rgba(96, 165, 250, 0.7) !important;
    opacity: 1;
}

.search-filter {
    background-color: rgba(15, 23, 42, 0.75) !important;
    border-color: rgba(96, 165, 250, 0.25) !important;
    color: #f8fafc !important;
}

.search-filter option {
    background-color: #1e293b;
    color: #f8fafc;
}

/* ---------- BOTTONI ---------- */
.btn-primary {
    background: linear-gradient(135deg, var(--fw-primary), var(--fw-secondary)) !important;
    border: none !important;
    transition: all 0.3s;
    color: #0f172a !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #93c5fd, #c4b5fd) !important;
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -10px rgba(96, 165, 250, 0.4);
}

.btn-outline-primary {
    border-color: var(--fw-primary) !important;
    color: var(--fw-primary) !important;
}

.btn-outline-primary:hover {
    background: var(--fw-primary) !important;
    color: #0f172a !important;
}

.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #f8fafc !important;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* ---------- CARD ---------- */
.card-glass {
    background: rgba(30, 41, 59, 0.5) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 20px !important;
    transition: all 0.3s;
}

.card-glass:hover {
    transform: translateY(-5px);
    border-color: rgba(96, 165, 250, 0.2) !important;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
}

/* ---------- BADGE FISCAL WATCH ---------- */
.badge-fw-soft {
    background: rgba(96, 165, 250, 0.12) !important;
    color: var(--fw-primary) !important;
    border: 1px solid rgba(96, 165, 250, 0.15);
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 500;
}

.badge-secondary-soft {
    background: rgba(167, 139, 250, 0.12) !important;
    color: var(--fw-secondary) !important;
    border: 1px solid rgba(167, 139, 250, 0.15);
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 500;
}

.badge-accent-soft {
    background: rgba(52, 211, 153, 0.12) !important;
    color: var(--fw-accent) !important;
    border: 1px solid rgba(52, 211, 153, 0.15);
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 500;
}

/* ---------- TAG CLOUD ---------- */
.demo-banner {
    position: sticky;
    top: 0;
    z-index: 1030;
}

.tag-fw {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(96, 165, 250, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.15);
    border-radius: 20px;
    color: #e2e8f0;
    font-size: 0.9rem;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
}

.tag-fw:hover {
    background: rgba(96, 165, 250, 0.18);
    transform: translateY(-2px);
    border-color: var(--fw-primary);
}

.tag-fw .count {
    color: var(--fw-primary);
    font-weight: 600;
    font-size: 0.7rem;
}

.tag-fw-manual {
    border-color: rgba(52, 211, 153, 0.35);
}

.tag-fw-manual .count {
    color: var(--fw-accent);
}

.tag-fw-personal {
    background: rgba(167, 139, 250, 0.18);
    border-color: rgba(167, 139, 250, 0.7);
    box-shadow: 0 0 0 1px rgba(196, 181, 253, 0.25);
    color: #f5f3ff;
}

.tag-fw-personal:hover {
    background: rgba(167, 139, 250, 0.26);
    border-color: rgba(196, 181, 253, 0.9);
}

.tag-fw-personal .count {
    color: #ddd6fe;
}

.tag-fw-personal::before {
    content: "personale";
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #e9d5ff;
    margin-right: 4px;
}

.tag-section {
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tag-section-personal {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.12), rgba(15, 23, 42, 0.52));
    border-color: rgba(196, 181, 253, 0.35);
}

.tag-section-global {
    background: rgba(15, 23, 42, 0.28);
    border-color: rgba(96, 165, 250, 0.15);
}

/* ---------- RISULTATI ---------- */
.result-item-fw {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px 20px;
    transition: all 0.3s;
    border-left: 3px solid var(--fw-primary);
}

.result-item-fw:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(96, 165, 250, 0.2);
    transform: translateY(-2px);
}

/* Badge fonte */
.badge-fonte {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
}

.badge-gse { background: rgba(96, 165, 250, 0.2); color: var(--fw-primary); }
.badge-mimit { background: rgba(167, 139, 250, 0.2); color: var(--fw-secondary); }
.badge-agenzia-entrate,
.badge-ade { background: rgba(52, 211, 153, 0.2); color: var(--fw-accent); }
.badge-mef { background: rgba(251, 191, 36, 0.2); color: var(--fw-warning); }
.badge-fiscooggi,
.badge-fo { background: rgba(244, 114, 182, 0.2); color: #f9a8d4; }
.badge-bancaditalia { background: rgba(45, 212, 191, 0.2); color: #5eead4; }
.badge-consob { background: rgba(251, 146, 60, 0.2); color: #fdba74; }
.badge-inps { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; }
.badge-invitalia { background: rgba(163, 230, 53, 0.2); color: #bef264; }
.badge-cdp { background: rgba(192, 132, 252, 0.2); color: #d8b4fe; }
.badge-gdf { background: rgba(248, 113, 113, 0.2); color: #fca5a5; }
.badge-adm { background: rgba(34, 211, 238, 0.2); color: #67e8f9; }
.badge-ivass { background: rgba(250, 204, 21, 0.2); color: #fde047; }
.badge-unioncamere { background: rgba(129, 140, 248, 0.2); color: #a5b4fc; }
.badge-dip-finanze { background: rgba(251, 113, 133, 0.2); color: #fda4af; }
.badge-personale { background: rgba(244, 114, 182, 0.2); color: #f9a8d4; }

/* ---------- DEMO BANNER ---------- */
.demo-banner {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.15);
    border-radius: 12px;
    padding: 12px 20px;
    color: var(--fw-warning);
}

/* ---------- MODALITÀ BADGE ---------- */
.mode-badge {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.75rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

.badge-demo {
    background: rgba(251, 191, 36, 0.15);
    color: var(--fw-warning);
    border-color: rgba(251, 191, 36, 0.2);
}

.badge-trial {
    background: rgba(52, 211, 153, 0.15);
    color: var(--fw-accent);
    border-color: rgba(52, 211, 153, 0.2);
}

.badge-full {
    background: rgba(96, 165, 250, 0.15);
    color: var(--fw-primary);
    border-color: rgba(96, 165, 250, 0.2);
}

/* ---------- FOOTER ---------- */
.footer {
    background: rgba(15, 23, 42, 0.9);
    padding: 40px 0 20px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer a {
    transition: color 0.3s;
}

.footer a:hover {
    color: var(--fw-primary) !important;
}

.footer-contact-details {
    line-height: 1.45;
}

.footer-contact-details address {
    margin: 0.5rem 0 0.35rem;
    font-style: normal;
}

.footer-contact-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0 0.35rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.privacy-notice {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1050;
    max-width: 360px;
    padding: 1rem;
    background: #0f172a;
    border: 1px solid rgba(96, 165, 250, 0.45);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    color: #e2e8f0;
}

.privacy-notice p {
    margin: 0;
    padding-right: 1.5rem;
}

.privacy-notice-close {
    position: absolute;
    top: 0.35rem;
    right: 0.5rem;
    border: 0;
    background: transparent;
    color: #e2e8f0;
    font-size: 1.25rem;
    line-height: 1;
}

.social-links a {
    font-size: 1.2rem;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .footer-contact-meta {
        font-size: 0.7rem;
    }

    .hero-section h1 {
        font-size: 2.5rem !important;
    }
    
    .hero-logo {
        height: 80px !important;
    }
    
    .mode-badge {
        top: 70px;
        right: 10px;
        font-size: 0.65rem;
        padding: 4px 12px;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem !important;
    }
    
    .btn-primary,
    .btn-outline-primary,
    .btn-outline-light {
        font-size: 0.9rem !important;
        padding: 10px 20px !important;
    }
}
/* ---------- MONITORING STATUS ---------- */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}
