/* ============================================================
   Portale licenze — tema 2.0 (2026-09-06), stesso stile del sito
   ------------------------------------------------------------
   Si applica SOLO quando <body> ha la classe .mai-theme, che _Layout.cshtml
   mette sulle pagine dei controller visibili agli utenti (Home, Account,
   Licenses). Le pagine admin (DataTables, form CRUD) restano con Bootstrap
   4 com'è: sono strumenti interni e non hanno un banco di prova visivo.
   Tutte le regole sono scoped su body.mai-theme; gli !important servono a
   battere le utility di Bootstrap (bg-white, border, p-3…) che li usano.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@600;700&display=swap');

body.mai-theme {
    --p-bg: #0b0d14;
    --p-card: #131726;
    --p-card-2: #1a1f31;
    --p-input: #0b0e17;
    --p-line: rgba(255, 255, 255, 0.10);
    --p-line-2: rgba(255, 255, 255, 0.16);
    --p-text: #eef1f8;
    --p-muted: #aab2c8;
    --p-dim: #8b93aa;
    --p-violet: #8b7cff;
    --p-violet-2: #b8adff;
    --p-orange: #ff6b35;
    --p-orange-2: #ff9466;
    --p-green: #3ddc97;
    --p-red: #ff7b7b;
    --p-yellow: #ffc857;
    --p-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --p-display: 'Space Grotesk', 'Inter', sans-serif;

    font-family: var(--p-font);
    color: var(--p-text);
    background:
        radial-gradient(900px 500px at 15% -10%, rgba(139, 124, 255, 0.20) 0%, transparent 60%),
        radial-gradient(700px 420px at 90% 10%, rgba(255, 107, 53, 0.14) 0%, transparent 60%),
        var(--p-bg);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body.mai-theme h1, body.mai-theme h2, body.mai-theme h3,
body.mai-theme h4, body.mai-theme h5, body.mai-theme h6 {
    font-family: var(--p-display);
    letter-spacing: -0.02em;
    color: var(--p-text);
}
body.mai-theme h2 { font-size: 1.8rem; margin-bottom: 1rem; }
body.mai-theme h4 { font-size: 1.35rem; }
body.mai-theme h6, body.mai-theme p { color: var(--p-muted); }
body.mai-theme hr { border-top: 1px solid var(--p-line); }
body.mai-theme a { color: var(--p-orange-2); }
body.mai-theme a:hover { color: var(--p-orange); }
body.mai-theme .text-muted { color: var(--p-dim) !important; }
body.mai-theme .text-warning { color: var(--p-yellow) !important; }
body.mai-theme .text-danger { color: var(--p-red) !important; }
body.mai-theme .text-success { color: var(--p-green) !important; }
body.mai-theme code {
    color: var(--p-violet-2);
    background: rgba(139, 124, 255, 0.12);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.9em;
}

/* ---------- Navbar ---------- */
body.mai-theme .navbar.backgroundNav {
    background: rgba(11, 13, 20, 0.82) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--p-line);
    padding: 0.55rem 1.25rem;
}
body.mai-theme .navbar-brand img { height: 36px; width: auto; }
body.mai-theme .navbar .nav-link {
    color: var(--p-muted) !important;
    font-weight: 600 !important;
    border-radius: 8px;
    transition: color .2s, background .2s;
}
body.mai-theme .navbar .nav-link:hover { color: var(--p-text) !important; background: rgba(255, 255, 255, 0.06); }
body.mai-theme .navbar .nav-link .fa-user-circle { color: var(--p-violet-2); }
body.mai-theme .navbar-toggler.bg-light {
    background: transparent !important;
    border: 1px solid var(--p-line-2);
    border-radius: 10px;
}
body.mai-theme .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(238,241,248,0.9)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}
body.mai-theme .navbar select {
    background: transparent !important;
    color: var(--p-text) !important;
    border: 1px solid var(--p-line-2) !important;
    border-radius: 10px !important;
    padding: 5px 8px !important;
    font-family: var(--p-font);
}
body.mai-theme .navbar select option { color: var(--p-text) !important; background: var(--p-card); }
/* Dropdown admin (visibile all'admin anche sulle pagine utente) */
body.mai-theme .dropdown-menu.backgroundNav {
    background: var(--p-card) !important;
    border: 1px solid var(--p-line-2);
    border-radius: 12px;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7);
    padding: 6px;
}
body.mai-theme .dropdown-item.backgroundNav {
    background: transparent !important;
    color: var(--p-muted) !important;
    border-radius: 8px;
}
body.mai-theme .dropdown-item.backgroundNav:hover { background: rgba(255, 255, 255, 0.06) !important; color: var(--p-text) !important; }
body.mai-theme .dropdown-toggle.nav-link.backgroundNav { background: transparent !important; }
body.mai-theme .navbar-collapse.show, body.mai-theme .navbar-collapse.collapsing {
    background: var(--p-card);
    border: 1px solid var(--p-line-2);
    border-radius: 14px;
    margin-top: 8px;
    padding: 8px;
}

/* ---------- Contenitore e card ---------- */
body.mai-theme .backgroundWhite {
    background: transparent !important;
    border: 0 !important;
}
body.mai-theme .bg-white {
    background: var(--p-card) !important;
    border: 1px solid var(--p-line);
}
body.mai-theme .bg-white.p-3 { padding: 2rem 1.75rem !important; }
body.mai-theme .bg-white.p-5 { padding: 2.5rem !important; }
body.mai-theme .bg-light { background: var(--p-card-2) !important; border: 1px solid var(--p-line); }
body.mai-theme section.bg-light { background: transparent !important; border: 0; }
body.mai-theme .shadow-lg { box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8) !important; }
body.mai-theme .rounded { border-radius: 20px !important; }
body.mai-theme .row.center { margin-top: 2.5rem; }

/* ---------- Form ---------- */
body.mai-theme label { color: var(--p-muted); font-weight: 600; font-size: 0.9rem; }
body.mai-theme .form-control {
    background: var(--p-input);
    border: 1px solid var(--p-line-2);
    color: var(--p-text);
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    height: auto;
}
body.mai-theme .form-control:focus {
    background: var(--p-input);
    color: var(--p-text);
    border-color: var(--p-violet);
    box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.25);
}
body.mai-theme .form-check-label { font-weight: 500; }
body.mai-theme .validation-summary-errors, body.mai-theme .validation-summary-errors ul {
    color: var(--p-red);
    margin: 0 0 0.75rem;
    padding-left: 1.1rem;
}

/* ---------- Bottoni ---------- */
body.mai-theme .btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.6rem 1.15rem;
    border: 1px solid transparent;
    transition: transform .2s, background .2s, border-color .2s, box-shadow .2s;
}
body.mai-theme .btn:hover { transform: translateY(-1px); }
body.mai-theme .btn-primary, body.mai-theme .btn-success {
    background: var(--p-orange);
    border-color: var(--p-orange);
    color: #14080a;
    box-shadow: 0 8px 30px -8px rgba(255, 107, 53, 0.7);
}
body.mai-theme .btn-primary:hover, body.mai-theme .btn-success:hover,
body.mai-theme .btn-primary:focus, body.mai-theme .btn-success:focus {
    background: var(--p-orange-2);
    border-color: var(--p-orange-2);
    color: #14080a;
    box-shadow: 0 14px 34px -8px rgba(255, 107, 53, 0.8);
}
body.mai-theme .btn-secondary, body.mai-theme .btn-warning {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--p-line-2);
    color: var(--p-text);
}
body.mai-theme .btn-secondary:hover, body.mai-theme .btn-warning:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--p-text);
}
body.mai-theme .btn-lg { padding: 0.8rem 1.5rem; border-radius: 12px; }
body.mai-theme .btn-group-sm .btn { padding: 0.35rem 0.7rem; font-size: 0.85rem; }

/* ---------- Avvisi, liste, badge, tabelle ---------- */
body.mai-theme .alert {
    border-radius: 14px;
    border: 1px solid var(--p-line-2);
    background: var(--p-card-2);
    color: var(--p-muted);
}
body.mai-theme .alert-info {
    background: rgba(139, 124, 255, 0.12);
    border-color: rgba(139, 124, 255, 0.35);
    color: var(--p-text);
}
body.mai-theme .alert-heading { color: var(--p-text); }
body.mai-theme .alert p, body.mai-theme .alert .lead { color: var(--p-muted); }
body.mai-theme .list-group-item {
    background: transparent;
    border-color: var(--p-line);
    color: var(--p-muted);
}
body.mai-theme .badge { border-radius: 6px; padding: 0.35em 0.6em; font-weight: 700; }
body.mai-theme .badge-secondary { background: rgba(139, 124, 255, 0.2); color: var(--p-violet-2); }
body.mai-theme .badge-success { background: rgba(61, 220, 151, 0.18); color: var(--p-green); }
body.mai-theme .badge-danger { background: rgba(255, 123, 123, 0.18); color: var(--p-red); }
body.mai-theme .table {
    color: var(--p-text);
    background: var(--p-card);
    border: 1px solid var(--p-line);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
}
body.mai-theme .table thead th {
    border-top: 0;
    border-bottom: 1px solid var(--p-line-2);
    color: var(--p-dim);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--p-card-2);
}
body.mai-theme .table td { border-top: 1px solid var(--p-line); vertical-align: middle; }
body.mai-theme .table-hover tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

/* ---------- Piè di pagina (solo pagine col tema) ---------- */
body.mai-theme .mai-footer {
    margin-top: 3rem;
    padding: 1.5rem 1.25rem 2rem;
    border-top: 1px solid var(--p-line);
    color: var(--p-dim);
    font-size: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: center;
}
body.mai-theme .mai-footer a { color: var(--p-muted); }

@media (max-width: 767px) {
    body.mai-theme .bg-white.p-3 { padding: 1.5rem 1.1rem !important; }
    body.mai-theme .table { display: block; overflow-x: auto; }
}
