﻿html, body {
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #fafafa;
    color: #111;
    scroll-behavior: smooth;
}

/* Titoli */
h1:focus {
    outline: none;
}

/* 🔗 Link e pulsanti tipo link */
a,
.btn-link {
    color: #2b2b2b;
    text-decoration: none;
    transition: color 0.2s ease;
}

    a:hover,
    .btn-link:hover {
        color: #000;
    }

/* 🔘 Pulsante primario — compatibile con Bootstrap */
.btn-primary {
    color: #fff;
    background-color: #111;
    border-color: #111;
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

    .btn-primary:hover,
    .btn-primary:focus {
        background-color: #000;
        border-color: #000;
        transform: scale(1.02);
        box-shadow: 0 0 0 0.25rem rgba(17, 17, 17, 0.25);
    }

/* Focus generale su input e bottoni */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.15rem #fff, 0 0 0 0.25rem #888;
    outline: none;
}

/* 📦 Contenuto principale */
.content {
    padding-top: 1.1rem;
}

/* ✅ Validazione */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #0db060;
}

.invalid {
    outline: 1px solid #d92020;
}

.validation-message {
    color: #d92020;
}

/* ⚠️ Pannello errore Blazor */
#blazor-error-ui {
    background: #fff4f4;
    border-top: 1px solid #f5bebe;
    color: #000;
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.1);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
        font-weight: bold;
    }

/*  Error boundary Blazor */
.blazor-error-boundary {
    background: #d92020;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 8px;
}

    .blazor-error-boundary::after {
        content: "Si è verificato un errore.";
    }

/*  Loading spinner Blazor */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e6e6e6;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #111;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s;
        }

/* Testo di caricamento */
.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 600;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: #111;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Caricamento");
    }



/* Reset vecchi layout */
.page,
main,
.sidebar,
.top-row {
    all: unset;
}

/* Variabile altezza navbar */
:root {
    --navbar-height: 70px;
}

/* Navbar fissa in alto */
.navbar {
    width: 100%;
    height: var(--navbar-height);
    line-height: var(--navbar-height);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 👇 Aggiunge 15px extra sotto la navbar */
body:not(:has(.login-page)) {
    padding-top: calc(var(--navbar-height) + 15px) !important;
}

/* Reset padding per login */
body:has(.login-page) {
    padding-top: 0 !important;
}


/* Navbar look */
.navbar-brand {
    font-weight: 600;
    color: #fff !important;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    transition: background 0.2s ease;
}

    .nav-link:hover,
    .nav-link.active {
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff !important;
    }

.login-page body,
body:has(.login-page) {
    padding-top: var(--navbar-height) !important;
}
