/* =============================================================================
   Accélérateur Business — système de design
   Direction : neutre chaud, B2B premium, sans clichés "SaaS générique IA".
   ============================================================================= */

:root {
    /* Palette */
    --c-bg:           #faf9f5;        /* crème chaude */
    --c-surface:      #ffffff;
    --c-surface-alt:  #fbf9f4;
    --c-text:         #1c1917;        /* charbon chaud */
    --c-text-soft:    #44403c;
    --c-muted:        #78716c;        /* stone-500 */
    --c-border:       #e7e5e4;
    --c-border-strong:#d6d3d1;

    /* Couleurs sémantiques */
    --c-primary:      #8b6914;        /* or chaud — couleur signature du logo */
    --c-primary-dark: #6d530f;
    --c-primary-soft: #f7edd6;
    --c-accent:       #b45309;        /* ambre brûlé */
    --c-accent-soft:  #fef0d9;
    --c-success:      #15803d;
    --c-success-soft: #dcfce7;
    --c-warning:      #a16207;
    --c-warning-soft: #fef3c7;
    --c-danger:       #991b1b;
    --c-danger-soft:  #fee2e2;
    --c-info:         #0369a1;
    --c-info-soft:    #e0f2fe;

    /* Rayons / ombres */
    --radius:         12px;
    --radius-sm:      8px;
    --radius-pill:    999px;
    --shadow-xs:      0 1px 1px rgba(28, 25, 23, .03);
    --shadow-sm:      0 1px 2px rgba(28, 25, 23, .05), 0 1px 3px rgba(28, 25, 23, .04);
    --shadow:         0 4px 12px rgba(28, 25, 23, .06), 0 2px 4px rgba(28, 25, 23, .04);
    --shadow-lg:      0 12px 32px rgba(28, 25, 23, .08), 0 4px 8px rgba(28, 25, 23, .04);

    /* Espacement */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 20px;
    --s-6: 24px;
    --s-8: 32px;
    --s-10: 40px;
    --s-12: 48px;
    --s-16: 64px;

    /* Typographie */
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --leading-tight: 1.15;
    --leading-snug:  1.3;
    --leading-base:  1.55;

    /* Container */
    --container-w: 1180px;
}

/* --- Reset léger --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--c-bg);
    color: var(--c-text);
    line-height: var(--leading-base);
    font-size: 15px;
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
img, svg, video { max-width: 100%; display: block; }
img { height: auto; }
button { font: inherit; cursor: pointer; }
a { color: var(--c-primary); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--c-primary-dark); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: var(--leading-tight);
    letter-spacing: -0.015em;
    color: var(--c-text);
    margin: 0 0 var(--s-3);
    font-weight: 600;
}
h1 { font-size: 1.875rem; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; margin-top: var(--s-8); }
h3 { font-size: 1.0625rem; }
p  { margin: 0 0 var(--s-3); }

.muted { color: var(--c-muted); }
.small { font-size: .8125rem; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-sm { margin-top: var(--s-2); }
.mt-md { margin-top: var(--s-4); }
.mt-lg { margin-top: var(--s-8); }
.link { color: var(--c-primary); font-weight: 500; }

/* --- Mise en page ------------------------------------------------------- */
.container {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 var(--s-6);
    width: 100%;
}
main.container { flex: 1; padding-top: var(--s-8); padding-bottom: var(--s-10); }

/* --- En-tête / nav ------------------------------------------------------ */
.topbar {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: saturate(180%) blur(6px);
}
.topbar-inner {
    display: flex;
    align-items: center;
    gap: var(--s-6);
    min-height: 64px;
    padding-top: var(--s-3);
    padding-bottom: var(--s-3);
    flex-wrap: nowrap;
}
.brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.brand:hover { text-decoration: none; opacity: .88; }
.brand-logo {
    height: 52px;
    width: auto;
    display: block;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav-link {
    padding: var(--s-2) var(--s-4);
    border-radius: var(--radius-sm);
    color: var(--c-text-soft);
    font-size: .92rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--c-bg); color: var(--c-text); text-decoration: none; }
.nav-link.active {
    background: var(--c-text);
    color: var(--c-surface);
}

.user-menu { display: flex; align-items: center; gap: var(--s-3); flex-shrink: 0; }
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: 4px 14px 4px 4px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    color: var(--c-text);
    transition: border-color .15s, background .15s;
}
.user-chip:hover { text-decoration: none; border-color: var(--c-border-strong); background: var(--c-bg); }
.user-name { font-size: .88rem; font-weight: 500; }
.logout-form { display: inline; }
.btn-link {
    background: transparent;
    border: 0;
    color: var(--c-muted);
    font-size: .85rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}
.btn-link:hover { color: var(--c-text); background: var(--c-bg); }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    color: var(--c-muted);
    background: var(--c-surface);
    transition: color .15s, border-color .15s, background .15s;
}
.icon-btn:hover { color: var(--c-text); border-color: var(--c-border-strong); background: var(--c-bg); text-decoration: none; }
.icon-btn.active { color: var(--c-surface); background: var(--c-text); border-color: var(--c-text); }

/* Menu hamburger (mobile) */
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    width: 40px; height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    color: var(--c-text);
    cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; stroke: currentColor; }

/* Items affichés uniquement dans le menu burger (mobile) */
.nav-mobile-only { display: none !important; }
.nav-separator {
    height: 1px;
    background: var(--c-border);
    margin: var(--s-2) 0;
    border: 0;
    width: 100%;
}
.nav-link-button {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    color: var(--c-danger);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
}
.nav-link-button:hover { background: var(--c-bg); }
.nav-logout-form { margin: 0; }

/* --- Avatars ------------------------------------------------------------ */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    background: var(--c-primary-soft);
    color: var(--c-primary);
    border-radius: 50%;
    font-weight: 600;
    font-size: .78rem;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}
.avatar-sm { width: 28px; height: 28px; font-size: .72rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.05rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 1.75rem; }
.avatar-photo { object-fit: cover; background: var(--c-bg); }

.member-line { display: inline-flex; align-items: center; gap: var(--s-2); }

/* --- Boutons ------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.2;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s, transform .05s, box-shadow .15s;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
    background: var(--c-text);
    color: var(--c-surface);
    border-color: var(--c-text);
}
.btn-primary:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); }
.btn-ghost {
    background: var(--c-surface);
    color: var(--c-text);
    border-color: var(--c-border);
}
.btn-ghost:hover { background: var(--c-bg); border-color: var(--c-border-strong); }
.btn-danger {
    background: var(--c-surface);
    color: var(--c-danger);
    border-color: var(--c-border);
}
.btn-danger:hover { background: var(--c-danger-soft); border-color: #fecaca; }
.btn-sm { padding: 6px 12px; font-size: .82rem; border-radius: 6px; }
.btn-icon {
    padding: 6px 8px;
    font-size: .9rem;
    border-radius: 6px;
    min-width: 32px;
    line-height: 1;
}
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-link-admin {
    background: transparent; color: var(--c-muted); border: 0;
    padding: 9px 6px; font-size: .85rem;
}
.btn-link-admin:hover { color: var(--c-text); background: transparent; }

/* --- Cards & sections --------------------------------------------------- */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: var(--s-5);
    box-shadow: var(--shadow-xs);
    margin-bottom: var(--s-5);
}
.card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--s-4);
}
.card-head h2 { margin: 0; font-size: 1.0625rem; }

.page-head { margin: 0 0 var(--s-6); }
.page-head h1 { margin: 0 0 var(--s-1); }
.page-head p { margin: 0; }
.page-head-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: var(--s-3);
}
.page-head-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
    color: var(--c-muted);
    font-size: .88rem;
    font-weight: 500;
    margin: 0 0 var(--s-4);
}
.back-link:hover { color: var(--c-text); text-decoration: none; }

.profile-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s-3);
    margin: 0 0 var(--s-4);
}
.profile-toolbar .back-link { margin: 0; }
.toolbar-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* --- Hero (accueil anonyme) -------------------------------------------- */
.hero {
    text-align: center;
    padding: var(--s-16) var(--s-4) var(--s-12);
    max-width: 720px;
    margin: 0 auto;
}
.hero h1 {
    font-size: 2.75rem;
    letter-spacing: -0.03em;
    margin-bottom: var(--s-4);
}
.lead {
    font-size: 1.15rem;
    color: var(--c-text-soft);
    margin-bottom: var(--s-8);
    line-height: 1.45;
}
.hero-cta { display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--s-4);
    margin-top: var(--s-8);
}
.feature-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: var(--s-5);
    transition: border-color .15s, transform .15s;
}
.feature-card:hover { border-color: var(--c-border-strong); transform: translateY(-2px); }
.feature-card h3 { margin: 0 0 var(--s-1); }
.feature-card p { margin: 0; color: var(--c-muted); font-size: .92rem; }

.welcome { margin-bottom: var(--s-5); }
.welcome h1 { font-size: 1.5rem; margin-bottom: var(--s-1); }
.welcome p { margin: 0; }

/* --- Grilles & listes accueil ----------------------------------------- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: var(--s-4);
}
.list-item {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: 10px 0;
    border-bottom: 1px solid var(--c-border);
    color: var(--c-text);
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover { text-decoration: none; }
.list-item:hover .list-title { color: var(--c-primary); }
.list-date {
    font-size: .78rem;
    color: var(--c-muted);
    flex-shrink: 0;
    min-width: 88px;
    font-weight: 500;
}
.list-body { flex: 1; min-width: 0; }
.list-title { font-weight: 500; margin-bottom: 2px; }

/* --- Flash messages --------------------------------------------------- */
.flash {
    padding: var(--s-3) var(--s-4);
    border-radius: var(--radius-sm);
    margin-bottom: var(--s-3);
    border: 1px solid transparent;
    font-size: .9rem;
    display: flex;
    align-items: flex-start;
    gap: var(--s-2);
}
.flash::before {
    content: "";
    display: inline-block;
    width: 18px; height: 18px;
    flex-shrink: 0;
    background-repeat: no-repeat;
    background-size: contain;
    margin-top: 1px;
}
.flash-success { background: var(--c-success-soft); color: #14532d; border-color: #bbf7d0; }
.flash-success::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2315803d'%3E%3Cpath fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z' clip-rule='evenodd'/%3E%3C/svg%3E"); }
.flash-error   { background: var(--c-danger-soft); color: #7f1d1d; border-color: #fecaca; }
.flash-error::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23991b1b'%3E%3Cpath fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z' clip-rule='evenodd'/%3E%3C/svg%3E"); }
.flash-info    { background: var(--c-info-soft); color: #0c4a6e; border-color: #bae6fd; }
.flash-info::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%230369a1'%3E%3Cpath fill-rule='evenodd' d='M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z' clip-rule='evenodd'/%3E%3C/svg%3E"); }
.flash-warning { background: var(--c-warning-soft); color: #78350f; border-color: #fde68a; }
.flash-warning::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23a16207'%3E%3Cpath fill-rule='evenodd' d='M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z' clip-rule='evenodd'/%3E%3C/svg%3E"); }

/* --- Formulaires ------------------------------------------------------ */
.form { display: flex; flex-direction: column; gap: var(--s-4); }
.form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: .88rem;
    color: var(--c-text);
}
.form label > span { font-weight: 500; }
.form label small { color: var(--c-muted); font-size: .8rem; }
.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="tel"],
.form input[type="url"],
.form input[type="search"],
.form input[type="number"],
.form input[type="datetime-local"],
.form input[type="file"],
.form select,
.form textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-size: .92rem;
    background: var(--c-surface);
    color: var(--c-text);
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.form input:focus, .form select:focus, .form textarea:focus {
    outline: none;
    border-color: var(--c-text);
    box-shadow: 0 0 0 3px rgba(28, 25, 23, .08);
}
.form input[disabled], .form input:read-only {
    background: var(--c-bg);
    color: var(--c-muted);
    cursor: not-allowed;
}
.form textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-3);
}
.form-actions {
    display: flex;
    gap: var(--s-2);
    margin-top: var(--s-3);
    flex-wrap: wrap;
}
.form-inline { flex-direction: row; align-items: center; }
.form-inline input { flex: 1; }

.checkbox, .radio {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start;
    gap: var(--s-2);
    cursor: pointer;
    padding: 8px 0;
    font-size: .92rem;
}
.checkbox input, .radio input { margin-top: 3px; accent-color: var(--c-text); }
.radio-group {
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: var(--s-2) var(--s-4);
    background: var(--c-surface-alt);
}
.radio-group legend { font-weight: 500; padding: 0 6px; }

/* Champ mot de passe avec œil */
.password-field { position: relative; }
.password-field input { padding-right: 42px; }
.password-toggle {
    position: absolute;
    right: 6px; top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    padding: 6px;
    color: var(--c-muted);
    border-radius: 6px;
    line-height: 0;
}
.password-toggle:hover { color: var(--c-text); background: var(--c-bg); }

/* --- Pages auth ------------------------------------------------------- */
.auth-card {
    max-width: 420px;
    margin: var(--s-16) auto;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: var(--s-8);
    box-shadow: var(--shadow);
}
.auth-card-wide { max-width: 580px; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: var(--s-4); }
.auth-links {
    margin-top: var(--s-4);
    text-align: center;
    font-size: .88rem;
    color: var(--c-muted);
}

/* --- Tabs ------------------------------------------------------------- */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--c-border);
    margin-bottom: var(--s-5);
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    padding: 10px 14px;
    color: var(--c-muted);
    font-size: .9rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}
.tab:hover { color: var(--c-text); text-decoration: none; }
.tab.active { color: var(--c-text); border-bottom-color: var(--c-text); }

/* --- Badges ----------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-size: .72rem;
    font-weight: 500;
    background: #f5f5f4;
    color: var(--c-text-soft);
    border: 1px solid var(--c-border);
    letter-spacing: 0;
}
.badge-soft { background: var(--c-primary-soft); color: var(--c-primary); border-color: transparent; }
.badge-success { background: var(--c-success-soft); color: #14532d; border-color: transparent; }
.badge-warning { background: var(--c-warning-soft); color: #78350f; border-color: transparent; }

.badge-promo { background: var(--c-accent-soft); color: var(--c-accent); border-color: transparent; }
.badge-opportunite { background: var(--c-success-soft); color: #14532d; border-color: transparent; }
.badge-autre { background: #e0e7ff; color: #3730a3; border-color: transparent; }
.badge-demande { background: #dbeafe; color: #1e40af; border-color: transparent; }
.badge-recommandation { background: #ede9fe; color: #5b21b6; border-color: transparent; }

/* --- Filtres / recherche --------------------------------------------- */
.filters {
    display: flex;
    gap: var(--s-2);
    align-items: center;
    flex-wrap: wrap;
}
.filters input[type="search"],
.filters select {
    padding: 10px 13px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    color: var(--c-text);
    font-size: .92rem;
    transition: border-color .15s, box-shadow .15s;
}
.filters input[type="search"] { flex: 1; min-width: 220px; }
.filters input[type="search"]:focus,
.filters select:focus {
    outline: none;
    border-color: var(--c-text);
    box-shadow: 0 0 0 3px rgba(28, 25, 23, .08);
}

/* --- Calendrier ------------------------------------------------------- */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: var(--s-4);
}
.event-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: var(--s-4);
    display: flex;
    gap: var(--s-4);
    box-shadow: var(--shadow-xs);
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.event-card:hover { border-color: var(--c-border-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.event-date {
    flex-shrink: 0;
    width: 64px;
    background: var(--c-text);
    color: var(--c-surface);
    border-radius: var(--radius-sm);
    text-align: center;
    padding: var(--s-3) 0;
    height: fit-content;
    box-shadow: var(--shadow-xs);
}
.event-day {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}
.event-month {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .75);
    margin-top: 2px;
}
.event-body { flex: 1; min-width: 0; }
.event-body h3 { margin: 0 0 4px; font-size: 1.0625rem; }
.event-body h3 a { color: var(--c-text); }
.event-body h3 a:hover { color: var(--c-primary); text-decoration: none; }
.event-body p { margin: 8px 0; color: var(--c-text-soft); font-size: .9rem; }
.event-actions {
    display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; margin-top: var(--s-3);
}

.event-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--s-4);
    flex-wrap: wrap;
}
.event-detail-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: var(--s-2); }
.agenda-links {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    flex-wrap: wrap;
    justify-content: flex-end;
    padding-top: var(--s-2);
}
.agenda-links > span { margin-right: var(--s-1); }
.event-description {
    margin: var(--s-4) 0;
    padding: var(--s-4) 0;
    border-top: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    line-height: 1.6;
    color: var(--c-text-soft);
}
.event-stats { margin-top: var(--s-2); }

.participants {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: var(--s-2);
}
.participant {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: 10px 12px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    color: var(--c-text);
    transition: border-color .15s, background .15s;
}
.participant:hover { background: var(--c-bg); border-color: var(--c-border-strong); text-decoration: none; }

/* --- Annuaire --------------------------------------------------------- */
.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--s-5);
}
.member-card {
    display: block;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--c-text);
    box-shadow: var(--shadow-xs);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.member-card:hover {
    text-decoration: none;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--c-border-strong);
}

.member-photo {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    background: linear-gradient(135deg, var(--c-primary-soft) 0%, #e8e0d5 100%);
    color: var(--c-primary);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.member-photo img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s cubic-bezier(.2, .8, .2, 1);
    will-change: transform;
}
.member-card:hover .member-photo img { transform: scale(1.06); }
.member-initials {
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: -0.04em;
    color: var(--c-primary);
}

.member-info {
    padding: var(--s-4);
}
.member-info-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--s-2);
    margin-bottom: 3px;
}
.member-name { font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; line-height: 1.25; }
.member-activity { color: var(--c-text-soft); font-size: .9rem; margin-bottom: 2px; }

.video-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--c-text);
    color: var(--c-surface);
    padding: 3px 9px 3px 7px;
    border-radius: var(--radius-pill);
    font-size: .7rem;
    font-weight: 500;
    flex-shrink: 0;
    margin-top: 2px;
}
.video-badge svg { display: block; }

.profile { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: var(--s-8); }
.profile-head {
    display: flex;
    gap: var(--s-5);
    align-items: center;
    flex-wrap: wrap;
}
.profile-meta { flex: 1 1 240px; min-width: 240px; }
.profile-head h1 { margin-bottom: 4px; font-size: 1.625rem; }
.profile-activity { color: var(--c-text); font-weight: 500; font-size: 1.0625rem; margin-bottom: 2px; }
.profile-section { margin-top: var(--s-8); }
.profile-section h2 { margin-bottom: var(--s-3); margin-top: 0; }
.profile-section h2:first-child { margin-top: 0; }

.video-wrapper {
    position: relative; padding-top: 56.25%;
    background: #000; border-radius: var(--radius-sm); overflow: hidden;
}
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.member-video {
    width: 100%; max-height: 540px;
    border-radius: var(--radius-sm);
    background: #000; display: block;
}

.profile-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--s-4);
}
.profile-gallery-item { margin: 0; }
.profile-gallery-item img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: var(--radius-sm);
    display: block;
}
.profile-gallery-item figcaption,
.profile-video-item figcaption {
    margin-top: 6px;
    font-size: .88rem;
    color: var(--c-text-soft);
    font-weight: 500;
}
.profile-videos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: var(--s-4);
}
.profile-video-item { margin: 0; }
@media (max-width: 600px) {
    .profile-videos { grid-template-columns: 1fr; }
}

.media-preview { margin-bottom: var(--s-3); }
.media-thumb {
    position: relative;
    display: inline-block;
    line-height: 0;
}
.media-photo {
    width: 240px;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--c-border);
    display: block;
}
.media-video {
    width: 320px; max-width: 100%;
    border-radius: var(--radius-sm); background: #000;
    display: block;
}
.media-x {
    position: absolute;
    top: 8px; right: 8px;
    background: rgba(28, 25, 23, .85);
    color: #fff;
    border: 0;
    width: 30px; height: 30px;
    border-radius: 50%;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0 0 2px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background .15s;
}
.media-x:hover { background: var(--c-danger); }

.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { padding: 4px 0; }

.info-box {
    background: var(--c-info-soft);
    border: 1px solid #bae6fd;
    border-radius: var(--radius-sm);
    padding: var(--s-3) var(--s-4);
    font-size: .9rem;
}
.info-box strong { color: var(--c-info); }
.info-box p { margin: 4px 0 0; }

.info-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px var(--s-4);
    margin: var(--s-3) 0 0;
}
.info-grid dt { color: var(--c-muted); font-size: .88rem; }
.info-grid dd { margin: 0; }
@media (max-width: 600px) {
    .info-grid { grid-template-columns: 1fr; }
    .info-grid dt { margin-top: var(--s-2); }
}

/* --- Posts (HR & Marketplace) ---------------------------------------- */
.post-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: var(--s-5);
    margin-bottom: var(--s-4);
    box-shadow: var(--shadow-xs);
    transition: border-color .15s;
}
.post-card:hover { border-color: var(--c-border-strong); }
.post-card.is-closed { opacity: .55; }
.post-card.is-closed h3 { text-decoration: line-through; text-decoration-thickness: 1px; }
.post-detail { padding: var(--s-8); }
.post-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: var(--s-3); gap: var(--s-2);
}
.post-head-left { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.post-card h3 { margin: 0 0 var(--s-2); font-size: 1.0625rem; }
.post-card h3 a { color: var(--c-text); }
.post-card h3 a:hover { color: var(--c-primary); text-decoration: none; }
.post-card p { margin: 0 0 var(--s-3); color: var(--c-text-soft); font-size: .92rem; line-height: 1.55; }
.post-foot {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: var(--s-3); padding-top: var(--s-3);
    border-top: 1px solid var(--c-border);
    gap: var(--s-2); flex-wrap: wrap;
}
.post-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }

.contact-block { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.contact-fallback { font-size: .82rem; }
.copyable {
    display: inline-block;
    padding: 1px 8px;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 6px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: .85em;
    color: var(--c-text);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.copyable:hover { background: var(--c-surface); border-color: var(--c-border-strong); }
.copyable.copied { background: var(--c-success-soft); border-color: #bbf7d0; color: #14532d; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translate(-50%, 24px);
    background: var(--c-text);
    color: var(--c-surface);
    padding: 12px 18px;
    border-radius: 10px;
    font-size: .9rem;
    line-height: 1.4;
    max-width: calc(100vw - 32px);
    width: max-content;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    text-align: center;
}
.toast code {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: .9em;
}
.toast small { color: rgba(255, 255, 255, .7); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

/* --- Modale "Contacter" ----------------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s-4);
}
.modal[hidden] { display: none; }
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(28, 25, 23, .55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-card {
    position: relative;
    background: var(--c-surface);
    border-radius: var(--radius);
    padding: var(--s-6);
    max-width: 600px;
    width: 100%;
    max-height: calc(100vh - 32px);
    overflow: auto;
    box-shadow: var(--shadow-lg);
}
.modal-x {
    position: absolute;
    top: 10px; right: 10px;
    background: transparent;
    border: 0;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--c-muted);
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 6px;
}
.modal-x:hover { background: var(--c-bg); color: var(--c-text); }
.modal-row { margin-bottom: var(--s-4); }
.modal-label {
    display: block;
    font-size: .72rem;
    color: var(--c-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 500;
}
.modal-field {
    display: flex;
    align-items: center;
    gap: var(--s-2);
}
.modal-field > code,
.modal-field > .modal-readonly {
    flex: 1;
    padding: 8px 12px;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    word-break: break-word;
}
.modal-field > code { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.modal-body-text {
    width: 100%;
    padding: 10px 12px;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-family: inherit;
    line-height: 1.5;
    color: var(--c-text);
    resize: vertical;
}
.modal-copy-btn { flex-shrink: 0; }
.modal-copy-btn.copied {
    background: var(--c-success-soft);
    border-color: #bbf7d0;
    color: #14532d;
}
.modal-actions {
    display: flex;
    gap: var(--s-2);
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: var(--s-5);
    padding-top: var(--s-4);
    border-top: 1px solid var(--c-border);
}
body.modal-open { overflow: hidden; }
.post-author { margin: var(--s-3) 0; color: var(--c-muted); font-size: .9rem; }
.post-body { margin: var(--s-4) 0; white-space: pre-wrap; color: var(--c-text-soft); line-height: 1.6; }

/* --- Empty states ---------------------------------------------------- */
.empty {
    text-align: center;
    padding: var(--s-10) var(--s-5);
    background: var(--c-surface);
    border: 1px dashed var(--c-border-strong);
    border-radius: var(--radius);
    color: var(--c-muted);
}
.empty h3 { margin: 0 0 var(--s-2); color: var(--c-text); font-size: 1.0625rem; }
.empty p { margin: 0 0 var(--s-4); font-size: .92rem; }

/* --- Tableaux (admin) ----------------------------------------------- */
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td {
    padding: 12px var(--s-4);
    border-bottom: 1px solid var(--c-border);
    text-align: left;
    vertical-align: middle;
}
.table thead th {
    background: var(--c-surface-alt);
    color: var(--c-muted);
    font-weight: 500;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--c-surface-alt); }
.actions-cell { white-space: nowrap; }
.inline-form { display: inline-block; margin: 0; }
.inline-form + .inline-form, .inline-form + .btn, .inline-form + a { margin-left: 4px; }

/* --- Configuration admin ------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--s-3);
    margin-bottom: var(--s-5);
}
.stat {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: var(--s-4);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.stat:hover {
    border-color: var(--c-border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}
.stat-num {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--c-text);
    letter-spacing: -0.03em;
    line-height: 1;
}
.stat-label {
    color: var(--c-muted);
    font-size: .85rem;
    margin-top: var(--s-2);
    line-height: 1.4;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--s-4);
}

.card-head-actions { display: flex; gap: var(--s-2); align-items: center; }
.table-section-row td {
    background: var(--c-surface-alt) !important;
    color: var(--c-muted);
    font-weight: 500;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding-top: var(--s-3) !important;
    padding-bottom: var(--s-3) !important;
}
.table-section-row:hover td { background: var(--c-surface-alt) !important; }
.row-past td { color: var(--c-muted); }

.simple-list { list-style: none; padding: 0; margin: 0; }
.simple-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--s-2) 0;
    border-bottom: 1px solid var(--c-border);
    font-size: .92rem;
}
.simple-list li:last-child { border-bottom: 0; }

.member-stats {
    display: flex;
    gap: var(--s-4);
    flex-wrap: wrap;
    font-size: .9rem;
    color: var(--c-muted);
}
.member-stats strong {
    color: var(--c-text);
    font-size: 1.1rem;
    font-weight: 600;
}

.quick-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* --- Footer --------------------------------------------------------- */
.footer {
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
    margin-top: var(--s-12);
    padding: var(--s-4) 0;
    font-size: .85rem;
    color: var(--c-muted);
}
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-2); }

/* --- Boutons d'action submit avec état de chargement -------------- */
button[type="submit"].is-loading {
    color: transparent !important;
    pointer-events: none;
    position: relative;
}
button[type="submit"].is-loading::after {
    content: "";
    position: absolute;
    width: 16px; height: 16px;
    top: 50%; left: 50%;
    margin: -8px 0 0 -8px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-color: rgba(255, 255, 255, .25) rgba(255, 255, 255, .25) rgba(255, 255, 255, .9) rgba(255, 255, 255, .9);
    color: #fff;
    animation: spin .65s linear infinite;
}
.btn-ghost.is-loading::after,
.btn-danger.is-loading::after {
    border-color: rgba(28, 25, 23, .15) rgba(28, 25, 23, .15) var(--c-text) var(--c-text);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Responsive ----------------------------------------------------- */
@media (max-width: 768px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.125rem; }
    main.container { padding-top: var(--s-5); padding-bottom: var(--s-8); }
    .container { padding: 0 var(--s-4); }
    .topbar-inner { gap: var(--s-2); }
    .brand-tag { display: none; }
    .nav-toggle { display: inline-flex !important; }
    .nav {
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--c-surface);
        border-bottom: 1px solid var(--c-border);
        flex-direction: column;
        align-items: stretch;
        padding: var(--s-2);
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height .25s ease;
        box-shadow: var(--shadow);
    }
    .topbar.is-open .nav { max-height: 480px; overflow-y: auto; }
    .nav-link { padding: 12px 14px; border-radius: var(--radius-sm); }
    .nav-mobile-only { display: block !important; }
    .user-menu { margin-left: auto; gap: var(--s-2); }
    .user-name { display: none; }
    .user-chip { padding: 4px; border: 0; }
    .logout-form { display: none; }      /* déplacé dans le burger menu */
    .user-menu .icon-btn { display: none; } /* déplacé dans le burger menu */
    .page-head-flex { flex-direction: column; align-items: stretch; }
    .event-detail-side { text-align: left; align-items: flex-start; }
    .auth-card { margin: var(--s-6) auto; padding: var(--s-5); }
    .hero { padding: var(--s-10) var(--s-2); }
    .hero h1 { font-size: 2rem; }
    .profile { padding: var(--s-5); }
    .post-detail { padding: var(--s-5); }
}
@media (max-width: 420px) {
    .brand-name { font-size: .85rem; }
}
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .table th, .table td { padding: 8px var(--s-3); }
}

/* Print sobre */
@media print {
    .topbar, .footer, .form, button, .post-actions, .toolbar-actions { display: none !important; }
    body { background: white; }
    .card, .post-card, .event-card { box-shadow: none; border: 1px solid #ddd; }
}
