/* =====================================================
   STUDIUMNET — GLOBAL CSS
   À importer sur TOUTES les pages standard
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ─── VARIABLES ─── */
:root {
    --bg: #f5f2ff;
    --bg2: #ffffff;
    --card: #ffffff;
    --nav-bg: rgba(245, 242, 255, 0.88);
    --text: #1a1035;
    --text2: #5a5270;
    --muted: #9b92b3;
    --accent: #6c47ff;
    --accent2: #a78bfa;
    --a-light: rgba(108, 71, 255, 0.10);
    --border: rgba(108, 71, 255, 0.14);
    --shadow: 0 4px 24px rgba(108, 71, 255, 0.10);
    --shadow-h: 0 16px 40px rgba(108, 71, 255, 0.20);
    --r: 14px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── DARK MODE ─── */
body.dark-mode,
body.dark-mode-active {
    --bg: #0d0b1a;
    --bg2: #13101f;
    --card: #1a1630;
    --nav-bg: rgba(13, 11, 26, 0.92);
    --text: #f0eeff;
    --text2: #b8b0d4;
    --muted: #6e6890;
    --accent: #8b6fff;
    --accent2: #c4b5fd;
    --a-light: rgba(139, 111, 255, 0.13);
    --border: rgba(139, 111, 255, 0.18);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    --shadow-h: 0 16px 40px rgba(139, 111, 255, 0.22);
}

/* ─── GLOBAL LOADER (Anti-Flash) ─── */
.sn-global-loader {
    position: fixed; inset: 0; z-index: 999999;
    background: var(--bg); display: flex; align-items: center; justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.sn-global-loader.hidden {
    opacity: 0; visibility: hidden;
}
.sn-loader-spinner {
    width: 40px; height: 40px; border: 4px solid var(--border);
    border-top-color: var(--accent); border-radius: 50%;
    animation: sn-spin 1s linear infinite;
}
@keyframes sn-spin { to { transform: rotate(360deg); } }

/* ─── RESET ─── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

/* Orb déco */
body::before {
    content: '';
    position: fixed;
    top: -180px;
    right: -180px;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(108, 71, 255, .10) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -150px;
    left: -150px;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(167, 139, 250, .07) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ─── SKIP LINK ─── */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 10px;
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    z-index: 9999;
    font-weight: 600;
}

.skip-link:focus {
    left: 20px;
}

/* =====================================================
   LOGO + DROPDOWN NAV (fixe en haut à gauche)
   ===================================================== */
.top-left-logo {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    border: 1.5px solid var(--border);
    transition: all 0.3s var(--ease);
    cursor: pointer;
}

.top-left-logo:hover {
    transform: scale(0.95);
    box-shadow: var(--shadow-h);
}

.logo-sn {
    font-family: 'Syne', sans-serif;
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

/* Dropdown */
.dropdown-menu {
    position: fixed;
    top: 20px;
    left: 90px;
    opacity: 0;
    visibility: hidden;
    background: var(--card);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
    transition: all 0.25s var(--ease);
    border: 1.5px solid var(--border);
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    grid-auto-flow: column;
    grid-auto-columns: minmax(185px, auto);
    overflow-x: auto;
    overflow-y: hidden;
    max-width: calc(100vw - 110px);
    transform: translateX(-8px);
}

.dropdown-menu::-webkit-scrollbar {
    height: 4px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    color: var(--text2);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s var(--ease);
    border-right: 1px solid var(--border);
    white-space: nowrap;
}

.dropdown-item:hover {
    color: var(--accent);
    background: var(--a-light);
}

.dropdown-item-icon {
    width: 16px;
    color: var(--muted);
    flex-shrink: 0;
}

.dropdown-item:hover .dropdown-item-icon {
    color: var(--accent);
}

/* =====================================================
   COMPOSANTS COMMUNS
   ===================================================== */

/* --- Titres de section --- */
.page-header {
    padding: 40px 40px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.page-title {
    font-family: 'Syne', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text);
    line-height: 1.1;
}

.page-title .accent {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--text2);
    margin-top: 8px;
    line-height: 1.6;
}

/* --- Cards --- */
.sn-card {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.sn-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-h);
    border-color: var(--accent);
}

/* --- Boutons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.25s var(--ease);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #9b72ff);
    color: #fff;
    box-shadow: 0 6px 20px rgba(108, 71, 255, .28);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(108, 71, 255, .38);
}

.btn-ghost {
    background: transparent;
    color: var(--text2);
    border: 1.5px solid var(--border);
}

.btn-ghost:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--a-light);
}

/* --- Badge / tag --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--a-light);
    color: var(--accent);
    border: 1px solid var(--border);
}

/* --- Input / form --- */
.sn-input {
    width: 100%;
    padding: 11px 16px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--bg2);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.sn-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--a-light);
}

.sn-input::placeholder {
    color: var(--muted);
}

/* --- Section wrapper --- */
.sn-section {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* --- Grid helpers --- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* --- Footer --- */
footer,
.sn-footer {
    text-align: center;
    padding: 30px 40px;
    color: var(--muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 60px;
    position: relative;
    z-index: 1;
}

/* =====================================================
   DARK MODE — styles supplémentaires
   ===================================================== */
body.dark-mode .dropdown-menu,
body.dark-mode-active .dropdown-menu {
    background: var(--card);
    border-color: var(--border);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

body.dark-mode .top-left-logo,
body.dark-mode-active .top-left-logo {
    background: var(--card);
    border-color: var(--border);
}

/* Tous les backgrounds inline qui résistent */
body.dark-mode [style*="background: linear-gradient(135deg, #F2E6EE"],
body.dark-mode-active [style*="background: linear-gradient(135deg, #F2E6EE"] {
    background: var(--bg) !important;
}

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.anim-up {
    animation: fadeInUp 0.55s var(--ease) both;
}

.anim-down {
    animation: fadeInDown 0.55s var(--ease) both;
}

.anim-in {
    animation: fadeIn 0.55s var(--ease) both;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    body {
        padding-left: 0;
        padding-top: 80px;
    }

    .top-left-logo {
        top: 12px;
        left: 12px;
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }

    .logo-sn {
        font-size: 15px;
    }

    .dropdown-menu {
        top: 72px;
        left: 12px;
        max-width: calc(100vw - 24px);
    }

    .sn-section,
    .page-header {
        padding: 20px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}