/* Thème de l'espace connecté : la nuit sur le noir.

   Chargé EN DERNIER sur chaque page de l'espace (après la feuille de la
   page) : il passe par-dessus les vingt copies de la coquille sans qu'il
   faille réécrire chaque feuille.

   Trois règles tiennent tout le reste :
   - le relief vient de la clarté seule : le fond #080808, la carte #111,
     le panneau posé dans une carte #1a1a1a ; aucune bordure, aucune ombre
     sur les cartes ;
   - l'or ne sert qu'aux données (une progression, un chiffre qui compte,
     une date) ; il ne touche ni les boutons, ni les onglets, ni le menu ;
   - le bouton principal est principal par inversion : une pilule blanche,
     le texte noir.

   Le mouvement ne sert qu'à répondre : un bouton s'enfonce quand on le
   presse, un menu glisse. Rien n'entre en scène au chargement. */

:root {
    --color-bg: #080808;
    --color-bg-alt: #111111;
    --color-bg-elevated: #1a1a1a;
    --color-border: #1a1a1a;
    --color-text-muted: #b4b4b4;

    --color-success: #5fd68a;
    --color-warning: #e5a93b;
    --color-danger: #ef6b7b;

    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-accent: none;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --app-meta: #949494;
    --app-nav: #bbbbbb;
    --app-control: #1a1a1a;
    --app-control-hover: #222222;
    --app-sidebar: 232px;
    --app-gouttiere: 29px;
    --app-ease: cubic-bezier(0.23, 1, 0.32, 1);
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--color-accent-light);
    color: #080808;
}

/* --- Coquille : la barre latérale et la page partagent le même fond,
   séparées par un filet. --------------------------------------------- */

.app {
    grid-template-columns: var(--app-sidebar) minmax(0, 1fr);
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--app-sidebar);
    height: 100vh;
    padding: 0 12px 24px;
    background: var(--color-bg);
    border-right: 1px solid var(--color-border);
}

.rtl .sidebar {
    right: 0;
    left: auto;
    border-right: 0;
    border-left: 1px solid var(--color-border);
}

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 64px;
    margin: 0 -12px 8px;
    padding: 0 22px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

.sidebar .logo,
.sidebar .brand-logo {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 8px;
    background: var(--color-text);
    color: #080808;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
}

.sidebar .brand strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.15;
}

.sidebar .brand span {
    display: block;
    color: var(--app-meta);
    font-size: 12px;
}

/* Les intitulés de groupe : en minuscules, en gris, sans espacement. */
.sidebar .menu-title {
    margin: 20px 10px 4px;
    color: var(--app-meta);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

/* Une ligne de menu tous les 34 px. L'élément actif ne change que de
   gris : son libellé passe en blanc. */
.sidebar .nav a,
.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    margin: 0;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--app-nav);
    font-size: 14px;
    font-weight: 400;
    transition: color 150ms ease, background-color 150ms ease;
}

.sidebar .nav a.active,
.sidebar .nav-link.active {
    background: none;
    color: var(--color-text);
    font-weight: 500;
}

@media (hover: hover) and (pointer: fine) {
    .sidebar .nav a:hover,
    .sidebar .nav-link:hover {
        background: var(--color-bg-alt);
        color: var(--color-text);
    }
}

.sidebar .nav a:focus-visible,
.sidebar .nav-link:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: -2px;
}

/* Les glyphes (▤ ☏ ♟…) n'étaient pas de la même famille et n'apprenaient
   rien que le libellé ne dise déjà. */
.sidebar .nav-icon {
    display: none;
}

.sidebar .selecteur-langue,
.sidebar select {
    width: calc(100% - 20px);
    min-height: 36px;
    margin: 20px 10px 0;
    padding: 0 34px 0 14px;
    border: 0;
    border-radius: 999px;
    background: var(--app-control) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23bbbbbb' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 14px center;
    color: var(--color-text);
    font-size: 13px;
    appearance: none;
}

.rtl .sidebar .selecteur-langue,
.rtl .sidebar select {
    padding: 0 14px 0 34px;
    background-position: left 14px center;
}

.sidebar-footer {
    margin: 20px 10px 0;
    padding: 14px 16px;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--color-bg-alt);
}

.sidebar-footer p {
    margin-bottom: 4px;
    color: var(--app-meta);
    font-size: 12px;
}

.sidebar-footer strong {
    color: var(--color-text);
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.main {
    grid-column: 2;
    min-width: 0;
    padding: 0 var(--app-gouttiere) 56px;
}

/* --- La barre du haut : 64 px, un filet dessous, le titre à 24 px. --- */

.main > .top,
.main > .topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    min-height: 64px;
    margin: 0 calc(-1 * var(--app-gouttiere)) 29px;
    padding: 12px var(--app-gouttiere);
    border-bottom: 1px solid var(--color-border);
}

.main > .top h1,
.main > .topbar h1,
.page-title h1 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.main > .top p,
.main > .topbar p,
.page-title p {
    margin-top: 2px;
    color: var(--app-meta);
    font-size: 13px;
}

.back {
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 500;
    transition: color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .back:hover {
        color: var(--color-text);
    }
}

/* --- Les surfaces : une marche de clarté, ni bordure ni ombre. --- */

.card,
.panel,
.stat,
.stat-card,
.metric-card,
.project-card,
.form-panel,
.dashboard-card,
.content-card,
.section-card {
    border-color: transparent;
    border-radius: var(--radius-lg);
    background: var(--color-bg-alt);
    box-shadow: none;
}

.card:hover {
    border-color: transparent;
    box-shadow: none;
}

/* Les chiffres-clés dans une seule carte, séparés d'un filet : le fond
   de la rangée passe entre les cases (1 px), les cases sont des cartes. */
.main .stats,
.main .stats-grid {
    gap: 1px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #222222;
}

.main .stats > *,
.main .stats-grid > * {
    border-radius: 0;
    background: var(--color-bg-alt);
}

/* Les liens d'en-tête de section (« Tout voir → ») : gris, soulignés. */
.section-head a,
.panel-head a:not([class*="button"]):not([class*="btn"]) {
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: #444;
    text-underline-offset: 4px;
}

/* Les chiffres-clés : du texte, en blanc, en chiffres alignés. L'or est
   gardé pour la donnée qui avance (barres de progression). */
.stat strong,
.stat-card strong,
.metric-card strong,
.stat-value,
.progress-value {
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 24px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.stat span,
.stat-card span,
.stat-label {
    color: var(--app-meta);
}

/* Les barres de progression : un aplat d'or, la seule couleur des
   données. Les grandes cartes d'en-tête perdent leur halo doré. */
.fill,
.progress-fill,
.progress span,
.progress-bar .progress-value,
.progress-track .progress-value {
    background: var(--color-accent);
}

.profile-hero,
.project-card,
.hero.card {
    border-color: transparent;
    background: var(--color-bg-alt);
}

.card-head .avatar,
.hero .avatar {
    background: var(--color-bg-elevated);
    color: var(--color-text);
}

.empty,
.empty-state {
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
}

/* --- Boutons : le principal en pilule blanche, les autres en pilule
   grise ; ils s'enfoncent quand on les presse. --------------------- */

.btn-primary,
.button-primary,
.btn-or,
.btn,
.btn-secondary,
.button,
.button-secondary,
.small,
.small-button,
.today-button,
.filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: var(--app-control);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    box-shadow: none;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease, transform 160ms var(--app-ease);
}

.btn-primary,
.button-primary,
.btn-or {
    background: var(--color-text);
    color: #080808;
}

@media (hover: hover) and (pointer: fine) {
    .btn:hover,
    .btn-secondary:hover,
    .button:hover,
    .button-secondary:hover,
    .small:hover,
    .small-button:hover,
    .today-button:hover,
    .filter-button:hover {
        border-color: transparent;
        background: var(--app-control-hover);
        color: var(--color-text);
        box-shadow: none;
        transform: none;
    }

    .btn-primary:hover,
    .button-primary:hover,
    .btn-or:hover {
        background: #e6e6e6;
        color: #080808;
        box-shadow: none;
        transform: none;
    }
}

.btn-primary:active,
.button-primary:active,
.btn-or:active,
.btn:active,
.btn-secondary:active,
.button:active,
.button-secondary:active,
.small:active,
.small-button:active,
.today-button:active,
.filter-button:active,
.menu-button:active,
.icon-button:active,
.close:active,
.close-button:active {
    transform: scale(0.97);
}

.filter-button.active {
    background: var(--color-text);
    color: #080808;
}

.btn-primary:focus-visible,
.button-primary:focus-visible,
.btn:focus-visible,
.btn-secondary:focus-visible,
.button:focus-visible,
.small:focus-visible,
.small-button:focus-visible,
.filter-button:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 2px;
}

.btn-primary:disabled,
.button-primary:disabled,
.btn:disabled,
.btn-secondary:disabled,
.button:disabled,
.small-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.danger,
.danger-button,
.action.danger {
    color: var(--color-danger);
}

.menu-button,
.icon-button,
.close,
.close-button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: var(--app-control);
    color: var(--color-text);
    transition: background-color 150ms ease, transform 160ms var(--app-ease);
}

.lien-texte {
    color: var(--color-text);
}

/* --- Champs : 40 px, remplis, sans cadre ; le focus les cerne de blanc. --- */

.control,
.form-control,
.search,
.search-input,
.group input,
.group select,
.group textarea,
.form-group input,
.form-group select,
.form-group textarea {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: var(--app-control);
    color: var(--color-text);
    font-size: 14px;
    box-shadow: none;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.group textarea,
.form-group textarea,
textarea.control,
textarea.form-control {
    padding: 10px 14px;
}

.control:focus,
.form-control:focus,
.search:focus,
.search-input:focus,
.group input:focus,
.group select:focus,
.group textarea:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6b6b6b;
    background: var(--app-control-hover);
    box-shadow: none;
}

.group label,
.form-group label {
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 500;
}

::placeholder {
    color: #6f6f6f;
}

/* --- Pastilles : la teinte sur un fond sombre d'elle-même. --- */

.badge {
    border: 0;
    border-radius: 999px;
    padding: 4px 9px;
    font-weight: 500;
}

/* --- Fenêtres et messages. --- */

.overlay,
.modal-overlay {
    background: rgba(0, 0, 0, 0.72);
}

.modal {
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--color-bg-alt);
    box-shadow: none;
}

.toast {
    border: 0;
    border-radius: 999px;
    background: var(--color-text);
    color: #080808;
    font-weight: 500;
    transition: opacity 200ms ease, transform 200ms var(--app-ease);
}

.bandeau-abonnement {
    border: 0;
    border-radius: var(--radius-md);
    background: var(--color-bg-alt);
}

.bandeau-abonnement a {
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --- Pas d'entrée en scène dans l'espace : la page est là, tout de suite. --- */

.reveal {
    opacity: 1;
    transform: none;
}

.reveal.is-visible {
    animation: none;
}

/* --- Téléphone : la barre latérale devient une feuille qui glisse. --- */

@media (max-width: 850px) {
    .app {
        display: block;
    }

    .sidebar {
        z-index: 950;
        width: min(300px, 86vw);
        transform: translateX(-105%);
        transition: transform 260ms var(--app-ease);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .rtl .sidebar {
        transform: translateX(105%);
    }

    .rtl .sidebar.open {
        transform: translateX(0);
    }

    .main {
        padding: 0 16px 40px;
    }

    .main > .top,
    .main > .topbar {
        min-height: 56px;
        margin: 0 -16px 20px;
        padding: 10px 16px;
    }

    .main > .top h1,
    .main > .topbar h1,
    .page-title h1 {
        font-size: 20px;
    }

    .menu-button {
        display: inline-grid;
        place-items: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar {
        transition: none;
    }
}

/* Les tuiles de type (plateforme, audio ou vidéo) : du texte gris sur
   une marche de clarté, jamais une teinte. */
.rang,
.campaign-icon,
.project-icon {
    border-radius: 10px;
    background: var(--color-bg-elevated);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
}

/* --- Pages d'entrée (connexion, inscription) : le panneau de gauche
   parle comme le site public, le formulaire comme l'espace. --- */

.presentation-panel {
    border-right: 1px solid var(--color-border);
    background: var(--color-bg);
}

.presentation-panel::before {
    display: none;
}

.presentation-panel .brand {
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0;
}

.presentation-panel .brand span {
    color: var(--color-text);
    font-size: 18px;
}

.presentation-panel .brand .brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--color-text);
    color: #080808;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
}

.presentation-label {
    margin-bottom: 20px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-text-muted);
    font-size: 15px;
    font-weight: 500;
    text-transform: none;
}

.presentation-content {
    max-width: 680px;
}

.presentation-content h1 {
    font-size: min(3.8vw, 72px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 0.95;
}

.presentation-content h1 span {
    color: var(--color-accent-light);
}

.presentation-content h1 span:first-child {
    color: var(--color-text);
}

.presentation-content p {
    font-size: 17px;
}

.career-step,
.benefit {
    border: 0;
    border-radius: 14px;
    background: var(--color-bg-alt);
}

.career-step-number,
.benefit-icon {
    border-radius: 999px;
    background: var(--color-bg-elevated);
    color: var(--color-text);
    font-weight: 600;
}

.career-step small,
.benefit small {
    color: var(--app-meta);
    font-size: 13px;
}

.form-panel {
    border: 0;
    background: var(--color-bg-alt);
}

.back-link,
.password-toggle {
    color: var(--color-text-muted);
    font-weight: 500;
}

.forgot-link,
.create-account a,
.login-account a,
.terms a,
.terms-liens a {
    color: var(--color-text);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: #555;
    text-underline-offset: 3px;
}

.language-selector {
    min-height: 36px;
    border: 0;
    border-radius: 999px;
    background: var(--color-bg-elevated);
}

.form-panel .form-group input,
.form-panel .form-group select {
    border: 1px solid transparent;
    background: var(--color-bg-elevated);
    box-shadow: none;
}

.form-panel .form-group input:focus,
.form-panel .form-group select:focus {
    border-color: #6b6b6b;
    box-shadow: none;
}

.role-card label {
    border: 1px solid transparent;
    background: var(--color-bg-elevated);
}

.role-card input:checked + label {
    border-color: var(--color-text);
    background: var(--color-bg-elevated);
    box-shadow: none;
}

.security-note {
    border: 0;
    background: var(--color-bg-elevated);
    color: var(--color-text-muted);
}

@media (max-width: 950px) {
    .presentation-content h1 {
        font-size: min(8vw, 56px);
    }
}

.stat em {
    color: var(--app-meta);
}

/* Tableaux : en-têtes en minuscules, chiffres alignés. */
.main th {
    color: var(--app-meta);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.main td {
    font-variant-numeric: tabular-nums;
}

/* « Construis ta carrière. » tient sur une ligne dans la colonne. */
@media (min-width: 951px) {
    .register-page .presentation-content h1 {
        font-size: min(3.2vw, 64px);
    }
}

/* Mot de passe oublié : le sigle comme dans la barre latérale. */
.marque-sigle {
    border-radius: 8px;
    background: var(--color-text);
    color: #080808;
    font-weight: 600;
}
