
/* ── Nav active state ─────────────────────────────────────────────────── */
.nav-active .mud-nav-link {
    background-color: var(--mud-palette-primary) !important;
    color: #fff !important;
    font-weight: 600;
    border-radius: var(--mud-default-borderradius);
}
.nav-active .mud-nav-link .mud-icon-root,
.nav-active .mud-nav-link .mud-nav-link-text {
    color: #fff !important;
}


/* ── Base ─────────────────────────────────────────────────────────────── */
html, body {
    font-family: 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Cookie Consent Banner ────────────────────────────────────────────── */
.cookie-banner-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 16px;
    pointer-events: none;
    display: flex;
    justify-content: center;
}

.cookie-banner {
    pointer-events: all;
    width: 100%;
    max-width: 720px;
    border-radius: 12px !important;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Liens ────────────────────────────────────────────────────────────── */
a, .btn-link {
    color: var(--mud-palette-primary);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

a:hover {
    opacity: 0.8;
}

/* ── Focus visible ────────────────────────────────────────────────────── */
.btn:focus,
.btn:active:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
    outline: none;
}

/* ── États de validation ──────────────────────────────────────────────── */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--mud-palette-success);
}

.invalid {
    outline: 1px solid var(--mud-palette-error);
}

.validation-message {
    color: var(--mud-palette-error);
    font-size: 0.75rem;
    margin-top: 4px;
}

/* ── Blazor error UI ──────────────────────────────────────────────────── */
#blazor-error-ui {
    background: #1E1B4B;
    color: #E2E8F0;
    bottom: 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.75rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
    font-size: 0.875rem;
}

#blazor-error-ui a {
    color: #A5B4FC;
    margin-left: 8px;
    text-decoration: underline;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
    transition: opacity 0.15s;
}

#blazor-error-ui .dismiss:hover {
    opacity: 1;
}

.blazor-error-boundary {
    background: #FEE2E2;
    border-left: 4px solid #DC2626;
    padding: 1rem 1rem 1rem 1.5rem;
    color: #7F1D1D;
    border-radius: 0 8px 8px 0;
}

.blazor-error-boundary::after {
    content: "Une erreur s'est produite.";
    font-weight: 600;
}

/* ── Loading progress (splash) ────────────────────────────────────────── */
.loading-progress {
    position: absolute;
    display: block;
    width: 6rem;
    height: 6rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: rgba(79, 70, 229, 0.15);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #4F46E5;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 600;
    color: #4F46E5;
    inset: calc(20vh + 4.5rem) 0 auto 0;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Chargement");
}

/* ── Misc ─────────────────────────────────────────────────────────────── */
h1:focus {
    outline: none;
}

code {
    color: #4F46E5;
    background: rgba(79, 70, 229, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875em;
}

/* ── Scrollbar (Webkit) ───────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.55);
}

/* ── Logo footer ──────────────────────────────────────────────────────── */
.brand-logo-footer {
    height: 36px;
    width: auto;
    display: block;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.mud-dark .brand-logo-footer {
    mix-blend-mode: normal;
    filter: brightness(0) invert(1);
}

/* ── Impression / PDF ────────────────────────────────────────────────── */
@media print {
    /* Masque tout ce qui n'est pas le contenu */
    .mud-appbar,
    .mud-drawer,
    .mud-drawer-overlay,
    nav,
    .no-print,
    .mud-button,
    .mud-icon-button,
    .mud-fab,
    .mud-snackbar-container {
        display: none !important;
    }

    /* Retire les marges et ombres */
    .mud-paper, .mud-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    /* Pleine largeur */
    .mud-main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 11pt;
    }

    /* Évite les coupures de page au milieu d'un bloc */
    .mud-paper, .mud-card {
        page-break-inside: avoid;
    }

    /* Les tableaux ne se coupent pas entre deux pages */
    table {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    thead {
        display: table-header-group;
    }
    tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* Saut de page propre avant chaque section principale */
    .print-page-break {
        page-break-before: always !important;
        break-before: page !important;
    }

    /* En-tête de page avec titre */
    .print-header {
        display: block !important;
        font-size: 18pt;
        font-weight: 700;
        margin-bottom: 12pt;
        border-bottom: 2px solid #1565C0;
        padding-bottom: 8pt;
        color: #1565C0;
    }
}

/* Masqué à l'écran, visible à l'impression */
.print-header {
    display: none;
}

/* ── Transitions globales ─────────────────────────────────────────────── */
.mud-nav-link,
.mud-button,
.mud-card,
.mud-paper {
    transition: background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

/* ══════════════════════════════════════════════════════════════
   LANDING NAVBAR — cv-nav
   Styles globaux pour LandingLayout (visiteurs non connectés)
   ══════════════════════════════════════════════════════════════ */

/* Reset landing */
body.cv-landing { margin: 0 !important; padding: 0 !important; }
body.cv-landing .mud-main-content { padding: 0 !important; margin-top: 0 !important; }

/* Navbar fixe */
.cv-nav {
    position: fixed !important;
    top: 0; left: 0; right: 0;
    z-index: 1300; /* au-dessus de MudBlazor (1200) */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 64px;
    background: rgba(30, 27, 75, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    box-sizing: border-box;
}

.cv-nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}
.cv-nav-logo span {
    font-weight: 800;
    font-size: 1.1rem;
    color: white;
    letter-spacing: -0.5px;
}

/* Links desktop */
.cv-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.cv-nav-link {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 7px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}
.cv-nav-link:hover { color: white; background: rgba(255, 255, 255, 0.07); }
.cv-nav-link.cv-active { color: white; background: rgba(99, 102, 241, 0.25); }

/* Actions */
.cv-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.cv-nav-ghost {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
    font-family: inherit;
}
.cv-nav-ghost:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.45); }

.cv-nav-solid {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    color: white;
    background: #4F46E5;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
    transition: all 0.2s;
    font-family: inherit;
}
.cv-nav-solid:hover { background: #4338CA; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(79,70,229,0.5); }

/* Hamburger */
.cv-nav-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
}
.cv-nav-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.25s;
}

/* Drawer mobile */
.cv-nav-drawer {
    display: none;
    position: fixed;
    top: 64px; left: 0; right: 0;
    z-index: 1299;
    background: rgba(20, 17, 60, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 16px 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-direction: column;
    gap: 4px;
}
.cv-nav-drawer.open { display: flex; }
.cv-nav-drawer .cv-nav-link {
    font-size: 1rem;
    padding: 12px 16px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.75);
}
.cv-nav-drawer .cv-nav-link:hover { color: white; background: rgba(255, 255, 255, 0.08); }
.cv-nav-drawer-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.cv-nav-drawer-actions .cv-nav-ghost,
.cv-nav-drawer-actions .cv-nav-solid {
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

/* Content offset */
.cv-landing-body { padding-top: 64px; }

/* Mobile */
@media (max-width: 768px) {
    .cv-nav { padding: 0 20px; }
    .cv-nav-links { display: none !important; }
    .cv-nav-actions { display: none !important; }
    .cv-nav-burger { display: flex !important; }
}
