/* =============================================================================
   INDPNS AUTH — app.css
   Styles PARTAGÉS par toutes les pages connectées (barre du haut + barre
   latérale + zone de contenu). Une seule source de vérité : modifiez ici et
   TOUTES les pages sont mises à jour.
   ============================================================================= */

:root {
    --bg: #000000;
    --bg-card: #000000;
    --surface: #0A0A0A;
    --surface-hover: #141414;
    --border: #3C3C3C;
    --border-focus: #8AB4F8;
    --border-hover: #5F6368;
    --text: #E8EAED;
    --text-secondary: #9AA0A6;
    --text-muted: #5F6368;
    --blue: #8AB4F8;
    --blue-hover: #A5C7FA;
    --blue-dark: #669DF6;
    --error: #F28B82;
    --error-bg: rgba(242, 139, 130, 0.1);
    --warning: #FDD663;
    --success: #81C995;
    --success-bg: rgba(129, 201, 149, 0.1);
    --radius: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --sidebar-width: 260px;
    --topbar-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; overflow-x: hidden; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

body.sidebar-locked { overflow: hidden; }

a:focus-visible, button:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   BARRE DE PROGRESSION (navigation)
   --------------------------------------------------------------------------- */
.nav-progress {
    position: fixed; top: 0; left: 0; height: 2px; width: 0;
    background: linear-gradient(90deg, var(--blue-dark), var(--blue));
    z-index: 1000; opacity: 0; pointer-events: none;
    transition: width .4s ease, opacity .25s ease;
}
.nav-progress.active { opacity: 1; width: 75%; transition: width 8s cubic-bezier(.1,.7,.2,1); }
.nav-progress.done   { opacity: 0; width: 100%; transition: width .2s ease, opacity .4s ease .1s; }

/* ---------------------------------------------------------------------------
   TOP BAR  —  [menu] [logo]  ......  [avatar] [</>] [bouclier] [déconnexion]
   (le texte « Indpns Auth » a été retiré : seul le logo reste)
   --------------------------------------------------------------------------- */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-h);
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 12px;
}

.top-bar-left { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }

.top-bar-menu-btn,
.top-bar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: color .15s ease, background .15s ease, border-color .15s ease, transform .1s ease;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.top-bar-menu-btn:hover,
.top-bar-btn:hover { color: var(--text); background: var(--surface-hover); border-color: var(--border-hover); }
.top-bar-menu-btn:active,
.top-bar-btn:active { transform: scale(.94); }
.top-bar-menu-btn svg, .top-bar-btn svg { width: 20px; height: 20px; }

/* Texte additionnel éventuel dans un bouton : toujours masqué (icônes seules) */
.top-bar-btn span { display: none; }

.top-bar-btn.dev   { color: var(--blue);    border-color: rgba(138, 180, 248, .35); background: rgba(138, 180, 248, .06); }
.top-bar-btn.dev:hover   { color: #000; background: var(--blue);    border-color: var(--blue); }
.top-bar-btn.admin { color: var(--warning); border-color: rgba(253, 214, 99, .35);  background: rgba(253, 214, 99, .06); }
.top-bar-btn.admin:hover { color: #000; background: var(--warning); border-color: var(--warning); }
.top-bar-btn.logout:hover { color: var(--error); border-color: rgba(242, 139, 130, .5); background: var(--error-bg); }
.top-bar-btn.primary { width: auto; padding: 0 16px; color: #000; background: var(--blue); border-color: var(--blue); font-weight: 600; font-size: 14px; }
.top-bar-btn.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #000; }
.top-bar-btn.text { width: auto; padding: 0 14px; font-size: 14px; font-weight: 500; }
.top-bar-btn.text span, .top-bar-btn.primary span { display: inline; }

.top-bar-brand { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.top-bar-brand img { height: 36px; width: auto; display: block; }

.top-bar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Avatar rond (profil) */
.top-bar-user {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
    flex-shrink: 0;
}
.top-bar-user:hover { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(138, 180, 248, .12); }
.top-bar-user:active { transform: scale(.94); }
.top-bar-user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
    color: #000; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px; overflow: hidden;
}
.top-bar-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.top-bar-user-name { display: none; } /* ← partie retirée */

/* ---------------------------------------------------------------------------
   LAYOUT
   --------------------------------------------------------------------------- */
.account-layout {
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - var(--topbar-h));
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(0, 0, 0, .6);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    z-index: 90;
    opacity: 0;
    transition: opacity .25s ease;
}
.sidebar-overlay.active { display: block; opacity: 1; }

/* ---------------------------------------------------------------------------
   SIDEBAR
   --------------------------------------------------------------------------- */
.account-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg);
    border-right: 1px solid var(--border);
    padding: 20px 14px 28px;
    position: sticky;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    height: calc(100dvh - var(--topbar-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    transition: transform .25s ease, margin-left .25s ease;
    z-index: 1;
}
.account-sidebar::-webkit-scrollbar { width: 6px; }
.account-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Desktop : le bouton menu replie la barre latérale */
@media (min-width: 901px) {
    body.sidebar-collapsed .account-sidebar { margin-left: calc(var(--sidebar-width) * -1); }
}

.account-sidebar-header {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 8px 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
    text-decoration: none;
}
.account-sidebar-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
    color: #000; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 18px; flex-shrink: 0; overflow: hidden;
}
.account-sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-sidebar-user { flex: 1; min-width: 0; }
.account-sidebar-name  { font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-sidebar-email { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.account-nav { display: flex; flex-direction: column; gap: 2px; }

.account-nav-section-label {
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .08em;
    padding: 14px 14px 6px;
}

.account-nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 14px; font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.account-nav-item:hover { background: var(--surface-hover); color: var(--text); }
.account-nav-item.active { background: rgba(138, 180, 248, .1); color: var(--blue); font-weight: 600; }
.account-nav-item.active::before {
    content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--blue);
}
.account-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.account-nav-item.danger { color: var(--error); }
.account-nav-item.danger:hover { background: var(--error-bg); color: var(--error); }

.account-nav-badge {
    margin-left: auto; font-size: 11px; font-weight: 600; padding: 2px 8px;
    border-radius: 9999px; background: rgba(253, 214, 99, .15); color: var(--warning);
    text-transform: uppercase; letter-spacing: .04em;
}
.account-nav-badge.new { background: rgba(138, 180, 248, .15); color: var(--blue); }

.account-nav-divider { height: 1px; background: var(--border); margin: 12px 0; }

/* ---------------------------------------------------------------------------
   CONTENU
   --------------------------------------------------------------------------- */
.account-main {
    flex: 1;
    padding: 32px 40px 60px;
    min-width: 0;
    max-width: 900px;
    animation: pageIn .28s ease both;
}
.account-main.wide { max-width: 1280px; }
.account-main.full { max-width: none; }

@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.account-main-header { margin-bottom: 32px; }
.account-main-title { font-size: 28px; font-weight: 500; color: var(--text); margin-bottom: 8px; letter-spacing: -.3px; }
.account-main-subtitle { font-size: 15px; color: var(--text-secondary); line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .account-main, .account-sidebar, .sidebar-overlay, .nav-progress { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .account-layout { position: relative; }

    .account-sidebar {
        position: fixed;
        top: var(--topbar-h);
        left: 0;
        bottom: 0;
        height: auto;
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0, 0, 0, .5);
        width: min(300px, 86vw);
        background: var(--surface);
        z-index: 95;
        visibility: hidden;
        transition: transform .25s ease, visibility 0s linear .25s;
    }
    .account-sidebar.open { transform: translateX(0); visibility: visible; transition: transform .25s ease; }

    .account-main { padding: 24px 16px 40px; }
}

@media (max-width: 480px) {
    .top-bar { padding: 0 12px; gap: 8px; }
    .top-bar-actions { gap: 8px; }
    .top-bar-menu-btn, .top-bar-btn { width: 40px; height: 40px; }
    .top-bar-user { width: 44px; height: 44px; }
    .top-bar-user-avatar { width: 32px; height: 32px; font-size: 14px; }
    .account-main-title { font-size: 22px; }
}

@media (max-width: 360px) {
    .top-bar-actions { gap: 6px; }
    .top-bar-menu-btn, .top-bar-btn { width: 38px; height: 38px; }
}
