html { scroll-behavior: smooth; }

body {
    background:
        radial-gradient(circle at 10% 10%, rgba(59, 130, 246, 0.12), transparent 40%),
        radial-gradient(circle at 90% 0%, rgba(14, 116, 144, 0.1), transparent 35%),
        linear-gradient(160deg, #f6f9fc 0%, #eef3f8 45%, #e8eff6 100%);
    background-attachment: fixed;
    color: #1f2937;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fadeIn { animation: fadeIn 0.8s ease-out; }

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
.slide-in-up { animation: slideInUp 0.6s ease-out forwards; }

@keyframes countUp {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.counter-number {
    display: inline-block;
    animation: countUp 0.8s ease-out forwards;
    font-variant-numeric: tabular-nums;
}
.stat-value { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.modal-backdrop { background-color: rgba(0,0,0,0.5); backdrop-filter: blur(4px); }

@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; }

/* ═══════════ LAYOUT FIXE ═══════════ */
#public-header {
    position: fixed !important;
    top: 0; left: 0; right: 0;
    z-index: 9999 !important;
    border-bottom: 1px solid rgba(191, 219, 254, 0.8);
}

.public-nav-link {
    display: inline-flex;
    align-items: center;
    border-radius: 10px;
    padding: 0.45rem 0.75rem;
    transition: all 0.2s ease;
}

.public-nav-link:hover {
    background: rgba(59, 130, 246, 0.08);
    color: #1d4ed8;
}

.public-activity-strip {
    position: relative;
    overflow: hidden;
    height: 38px;
    border-top: 1px solid rgba(191, 219, 254, 0.5);
    border-bottom: 1px solid rgba(191, 219, 254, 0.5);
    background: linear-gradient(90deg, rgba(219, 234, 254, 0.75), rgba(224, 242, 254, 0.75));
    white-space: nowrap;
}

.public-activity-strip-spacer {
    height: 8px;
}

.public-activity-track {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    gap: 0.9rem;
    padding-top: 0.1rem;
    padding-right: 1.2rem;
    width: max-content;
    min-width: 100%;
    flex-wrap: nowrap;
    flex-shrink: 0;
    will-change: transform;
    backface-visibility: hidden;
}

.public-activity-track-a {
    animation: publicTickerA 18s linear infinite;
}

.public-activity-track-b {
    animation: publicTickerB 18s linear infinite;
}

.public-activity-item {
    color: #1e3a8a;
    font-size: 0.83rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    flex: 0 0 auto;
}

.public-activity-sep {
    color: #2563eb;
    opacity: 0.7;
    flex: 0 0 auto;
}

@keyframes publicTickerA {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

@keyframes publicTickerB {
    0% { transform: translate3d(100%, 0, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

#public-footer {
    position: fixed !important;
    bottom: 0; left: 0; right: 0;
    z-index: 9998 !important;
}

/* Zone de contenu entre header et footer */
/* header h-14 (56px) + spacer 4px + ticker 38px + spacer 8px = ~106px ≈ 6.6rem */
#public-content {
    padding-top: 6.8rem;
    padding-bottom: 3rem;
    min-height: 100vh;
    overflow-y: auto;
}

#public-page-content {
    transition: opacity 0.18s ease;
}

/* ═══════════ LOADER ═══════════ */
#public-loader {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}
#public-loader.hidden { display: none !important; }

.public-spinner {
    width: 48px; height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.public-progress {
    width: 180px; height: 3px;
    background: #e5e7eb; border-radius: 2px; overflow: hidden;
}
.public-progress-bar {
    height: 100%;
    background: linear-gradient(90deg,#3b82f6,#8b5cf6);
    border-radius: 2px;
    animation: progress-public 1.2s ease-in-out infinite;
}
@keyframes progress-public { 0%{width:0} 60%{width:75%} 100%{width:100%} }

/* Active nav link */
.public-nav-link.active {
    color: #2563eb !important;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.12);
}

@media (max-width: 1023px) {
    #public-content {
        padding-top: 6.6rem;
    }

    .public-activity-item {
        font-size: 0.77rem;
    }
}

