/* ================================================================
   Sourdosphère — main.css
   Palette : vert forêt #1a3a2e · teal #1D9E75 · gris chaud #F1EFE8
   ================================================================ */

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

:root {
    --green-dark:   #1a3a2e;
    --green-mid:    #1D9E75;
    --green-light:  #E1F5EE;
    --green-border: #9FE1CB;
    --purple-light: #EEEDFE;
    --purple-mid:   #534AB7;
    --purple-text:  #3C3489;
    --amber-light:  #FAEEDA;
    --amber-text:   #633806;
    --blue-light:   #E6F1FB;
    --blue-text:    #0C447C;
    --gray-bg:      #F7F6F2;
    --gray-light:   #F1EFE8;
    --gray-border:  #D3D1C7;
    --gray-mid:     #888780;
    --gray-text:    #444441;
    --white:        #ffffff;
    --black:        #1a1a18;
    --danger:       #E24B4A;
    --danger-light: #FCEBEB;

    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  16px;
    --radius-xl:  24px;
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.07);
    --shadow-md:  0 4px 16px rgba(0,0,0,0.08);
    --topbar-h:   58px;
    --mobile-nav-h: 62px;
    --max-w:      680px;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--gray-bg);
    color: var(--black);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: var(--topbar-h);
    padding-bottom: var(--mobile-nav-h);
}

a { color: var(--green-mid); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: var(--font); cursor: pointer; }

/* ── Topbar ───────────────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--topbar-h);
    background: var(--green-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    gap: 1rem;
}

.topbar__logo {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.3px;
    text-decoration: none;
    flex-shrink: 0;
}
.topbar__logo:hover { text-decoration: none; }
.topbar__logo-dot, .logo-dot { color: var(--green-mid); }

.topbar__nav { display: flex; align-items: center; gap: 0.25rem; }
.topbar__link {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
}
.topbar__link:hover, .topbar__link.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

.topbar__actions { display: flex; align-items: center; gap: 0.5rem; }

.topbar__notif {
    position: relative;
    color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    padding: 0.35rem;
    border-radius: 50%;
    transition: background 0.15s;
}
.topbar__notif:hover { background: rgba(255,255,255,0.1); }

.notif-badge {
    position: absolute;
    top: 0; right: 0;
    min-width: 16px; height: 16px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
    border: 2px solid var(--green-dark);
}

.topbar__avatar img {
    width: 34px; height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.2);
    transition: border-color 0.15s;
}
.topbar__avatar:hover img { border-color: var(--green-mid); }

/* ── Mobile nav ───────────────────────────────────────────────── */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--mobile-nav-h);
    background: var(--white);
    border-top: 1px solid var(--gray-border);
    align-items: center;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--gray-mid);
    font-size: 10px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: color 0.15s;
    text-decoration: none;
}
.mobile-nav__item:hover,
.mobile-nav__item.active { color: var(--green-mid); text-decoration: none; }

.mobile-nav__item--publish {
    background: var(--green-dark);
    color: #fff;
    width: 48px; height: 48px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
    margin-bottom: 4px;
}
.mobile-nav__item--publish:hover { color: #fff; background: #0e2820; }

.mobile-nav__avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

/* ── Main content ─────────────────────────────────────────────── */
.main-content {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 1.25rem 1rem;
}

/* ── Boutons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.btn--primary {
    background: var(--green-dark);
    color: #fff;
    border-color: var(--green-dark);
}
.btn--primary:hover { background: #0e2820; text-decoration: none; color: #fff; }

.btn--outline {
    background: transparent;
    color: var(--green-mid);
    border-color: var(--green-mid);
}
.btn--outline:hover { background: var(--green-light); text-decoration: none; }

.btn--ghost {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-color: rgba(255,255,255,0.25);
}
.btn--ghost:hover { background: rgba(255,255,255,0.2); text-decoration: none; color: #fff; }

.btn--danger {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}
.btn--danger:hover { background: var(--danger); color: #fff; text-decoration: none; }

.btn--sm  { font-size: 0.82rem; padding: 0.4rem 0.85rem; }
.btn--lg  { font-size: 1rem;    padding: 0.75rem 1.5rem;  }
.btn--full { width: 100%; }

/* ── Formulaires ──────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 1rem; }

.form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form__group { display: flex; flex-direction: column; gap: 0.35rem; }

.form__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-text);
}

.required { color: var(--danger); }

.form__input,
.form__select,
.form__textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    font-size: 1rem;
    font-family: var(--font);
    border: 1.5px solid var(--gray-border);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--black);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}
.form__input:focus,
.form__select:focus,
.form__textarea:focus {
    border-color: var(--green-mid);
    box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.15);
}
.form__textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

.form__input-wrap { position: relative; }
.form__input-wrap .form__input { padding-right: 2.5rem; }
.form__eye {
    position: absolute;
    right: 0.65rem; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--gray-mid);
    padding: 4px;
    display: flex; align-items: center;
}
.form__eye:hover { color: var(--black); }

.form__hint {
    font-size: 0.78rem;
    color: var(--gray-mid);
}

.form__checkbox {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
}
.form__checkbox input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--green-mid);
    cursor: pointer;
    flex-shrink: 0;
}
.form__checkbox-label { font-size: 0.9rem; }

.form__section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-light);
}

/* ── Auth pages ───────────────────────────────────────────────── */
.auth-wrapper {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-md);
}
.auth-card--wide { max-width: 600px; }

.auth-card__logo {
    text-align: center;
    margin-bottom: 1.75rem;
}
.logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--green-dark);
}
.auth-card__tagline {
    font-size: 0.875rem;
    color: var(--gray-mid);
    margin-top: 0.25rem;
}

.auth-card__switch {
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-mid);
    margin-top: 1.25rem;
}

/* ── Alertes ──────────────────────────────────────────────────── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}
.alert--error {
    background: var(--danger-light);
    color: #7a1f1f;
    border: 1px solid #f0a0a0;
}
.alert--success {
    background: var(--green-light);
    color: #0a4a30;
    border: 1px solid var(--green-border);
}

.flash {
    position: fixed;
    top: calc(var(--topbar-h) + 0.75rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-md);
    max-width: 90vw;
}
.flash--success {
    background: var(--green-dark);
    color: #fff;
}
.flash__close {
    background: none; border: none;
    color: inherit; opacity: 0.7;
    font-size: 1rem; cursor: pointer;
    padding: 0;
}
.flash__close:hover { opacity: 1; }

/* ── Badges accessibilité ─────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    flex-shrink: 0;
}
.badge--lsf      { background: var(--green-light);  color: #0F6E56; }
.badge--subtitles { background: var(--purple-light); color: var(--purple-text); }
.badge--event    { background: var(--amber-light);   color: var(--amber-text); }
.badge--job      { background: var(--blue-light);    color: var(--blue-text); }
.badge--trade    { background: var(--gray-light);    color: var(--gray-text); }

/* ── Error page ───────────────────────────────────────────────── */
.error-page {
    text-align: center;
    padding: 4rem 1rem;
}
.error-page__code  { font-size: 5rem; font-weight: 700; color: var(--gray-border); line-height: 1; }
.error-page__title { font-size: 1.5rem; margin: 0.5rem 0; }
.error-page__text  { color: var(--gray-mid); margin-bottom: 1.5rem; }

/* ── Utilitaires ──────────────────────────────────────────────── */
.desktop-only { display: flex; }
.mobile-only  { display: none; }
.text-muted   { color: var(--gray-mid); }
.text-sm      { font-size: 0.875rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

/* ================================================================
   FIL D'ACTUALITÉ
   ================================================================ */

/* ── Feed header ──────────────────────────────────────────────── */
.feed-header { margin-bottom: 1rem; }

.quick-post {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: box-shadow 0.15s;
}
.quick-post:hover { box-shadow: var(--shadow-sm); text-decoration: none; }
.quick-post__avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.quick-post__placeholder { flex: 1; color: var(--gray-mid); font-size: 0.95rem; }

.feed-welcome {
    background: var(--green-dark);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    color: #fff;
}
.feed-welcome__title { font-size: 1.4rem; font-weight: 600; margin-bottom: 0.5rem; }
.feed-welcome__text  { opacity: 0.8; margin-bottom: 1.25rem; }
.feed-welcome__actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ── Post card ────────────────────────────────────────────────── */
.post-list { display: flex; flex-direction: column; gap: 0.75rem; }

.post-card {
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.post-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem 0.6rem;
    gap: 0.5rem;
}

.post-card__author {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    min-width: 0;
}
.post-card__author:hover .post-card__name { text-decoration: underline; }

.post-card__avatar {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.post-card__name {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.post-card__time {
    display: block;
    font-size: 0.78rem;
    color: var(--gray-mid);
}

.post-card__badges { display: flex; gap: 4px; flex-shrink: 0; }

.post-card__content {
    padding: 0 1rem 0.75rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--black);
    white-space: pre-line;
    word-break: break-word;
}
.post-card__content--lg { font-size: 1rem; }

.post-card__media img,
.post-card__media video {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    display: block;
    background: var(--gray-light);
}

/* ── Actions post ─────────────────────────────────────────────── */
.post-card__actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem 0.65rem;
    border-top: 1px solid var(--gray-light);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.875rem;
    color: var(--gray-mid);
    background: none;
    border: none;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    text-decoration: none;
    font-family: var(--font);
}
.action-btn:hover { color: var(--black); background: var(--gray-light); text-decoration: none; }
.action-btn--liked { color: #D85A30; }
.action-btn--liked:hover { color: #D85A30; }
.action-btn--danger:hover { color: var(--danger); }
.action-btn--static { cursor: default; }
.action-btn--static:hover { background: none; color: var(--gray-mid); }
.action-btn--right { margin-left: auto; }

.like-form { display: inline-flex; }

/* ── Post détail ──────────────────────────────────────────────── */
.post-detail { display: flex; flex-direction: column; gap: 1rem; }
.post-card--detail .post-card__content { font-size: 1.05rem; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    color: var(--gray-mid);
    text-decoration: none;
    padding: 0.35rem 0;
}
.back-link:hover { color: var(--black); }

/* ── Commentaires ─────────────────────────────────────────────── */
.comments { background: var(--white); border: 1px solid var(--gray-border); border-radius: var(--radius-lg); padding: 1.25rem 1rem; }
.comments__title { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.comments__login-prompt { font-size: 0.875rem; color: var(--gray-mid); padding: 0.5rem 0; }

.comment-form {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--gray-light);
}
.comment-form__avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; margin-top: 2px; }
.comment-form__right { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.comment-form__textarea { min-height: 70px; font-size: 0.9rem; }

.comment-list { display: flex; flex-direction: column; gap: 0.85rem; }

.comment { display: flex; gap: 0.65rem; align-items: flex-start; }
.comment__avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment__body { flex: 1; background: var(--gray-light); border-radius: var(--radius-md); padding: 0.6rem 0.85rem; }
.comment__header { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.25rem; }
.comment__name { font-weight: 500; font-size: 0.875rem; color: var(--black); text-decoration: none; }
.comment__name:hover { text-decoration: underline; }
.comment__time { font-size: 0.75rem; color: var(--gray-mid); }
.comment__text { font-size: 0.9rem; line-height: 1.5; word-break: break-word; }

/* ── Création de post ─────────────────────────────────────────── */
.create-post { display: flex; flex-direction: column; gap: 1rem; }

.create-post__header { display: flex; align-items: center; gap: 1rem; }
.create-post__title  { font-size: 1.2rem; font-weight: 600; }

.create-post__form {
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.create-post__author {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}
.create-post__author-name { font-weight: 500; }

.create-post__textarea { font-size: 1rem; min-height: 120px; border: none; padding: 0; resize: none; box-shadow: none !important; }
.create-post__textarea:focus { border: none; box-shadow: none !important; }

.create-post__char-count { text-align: right; font-size: 0.78rem; color: var(--gray-mid); margin-top: -0.5rem; }

.create-post__accessibility {
    background: var(--gray-light);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
}
.create-post__accessibility-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-text);
    margin-bottom: 0.65rem;
}
.create-post__checkboxes { display: flex; flex-direction: column; gap: 0.5rem; }

/* ── Upload média ─────────────────────────────────────────────── */
.media-upload { border: 1.5px dashed var(--gray-border); border-radius: var(--radius-md); overflow: hidden; }
.media-upload__input { display: none; }
.media-upload__label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 1.5rem;
    cursor: pointer;
    color: var(--gray-mid);
    transition: background 0.15s;
    text-align: center;
}
.media-upload__label:hover { background: var(--gray-light); }
.media-upload__hint { font-size: 0.75rem; }

.media-upload__preview { position: relative; }
.media-upload__preview img,
.media-upload__preview video { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.media-upload__remove {
    position: absolute;
    top: 8px; right: 8px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px; height: 28px;
    font-size: 13px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* ── Empty state ──────────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    color: var(--gray-mid);
    text-align: center;
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-lg);
}
.empty-state__icon { opacity: 0.4; }

/* ================================================================
   PROFIL
   ================================================================ */

.profile { display: flex; flex-direction: column; gap: 1.5rem; }

/* ── En-tête profil ───────────────────────────────────────────── */
.profile-header {
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.profile-header__avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.profile-header__avatar {
    width: 90px; height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gray-light);
    display: block;
}
.profile-header__lsf-badge {
    position: absolute;
    bottom: 0; right: 0;
    font-size: 1.2rem;
    background: var(--white);
    border-radius: 50%;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--gray-light);
}

.profile-header__info { flex: 1; min-width: 0; }

.profile-header__top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.profile-header__username {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--green-dark);
}
.profile-header__badges { display: flex; gap: 4px; flex-wrap: wrap; }

.profile-header__bio {
    font-size: 0.92rem;
    color: var(--gray-text);
    line-height: 1.6;
    margin-bottom: 0.85rem;
}

.profile-header__stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.profile-stat { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.profile-stat__number { font-size: 1.1rem; font-weight: 700; color: var(--green-dark); }
.profile-stat__label  { font-size: 0.75rem; color: var(--gray-mid); }

.profile-header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.profile-header__since { font-size: 0.78rem; color: var(--gray-mid); }

/* ── Publications sur profil ──────────────────────────────────── */
.profile-posts__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.85rem;
    font-size: 0.82rem;
}

/* ── Édition profil ───────────────────────────────────────────── */
.profile-edit { display: flex; flex-direction: column; gap: 1rem; }
.profile-edit__header { display: flex; align-items: center; gap: 1rem; }
.profile-edit__title  { font-size: 1.2rem; font-weight: 600; }

.profile-edit__form {
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.profile-edit__avatar-section {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--gray-light);
    margin-bottom: 0.5rem;
}
.profile-edit__avatar-wrap { position: relative; flex-shrink: 0; }
.profile-edit__avatar-preview {
    width: 80px; height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gray-light);
    display: block;
}
.profile-edit__avatar-btn {
    position: absolute;
    bottom: 0; right: 0;
    background: var(--green-dark);
    color: #fff;
    border-radius: 50%;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}
.profile-edit__avatar-btn:hover { background: #0e2820; }
.profile-edit__avatar-hint { font-size: 0.78rem; color: var(--gray-mid); }

.profile-edit__actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding-top: 0.5rem;
}
.btn--ghost-cancel {
    background: transparent;
    color: var(--gray-mid);
    border: 1.5px solid var(--gray-border);
}
.btn--ghost-cancel:hover { background: var(--gray-light); color: var(--black); text-decoration: none; }

/* ── Mobile profil ────────────────────────────────────────────── */
@media (max-width: 600px) {
    .profile-header { flex-direction: column; align-items: center; text-align: center; }
    .profile-header__top { justify-content: center; }
    .profile-header__stats { justify-content: center; }
    .profile-header__actions { justify-content: center; }
    .profile-edit__form { padding: 1.25rem 1rem; }
}

/* ================================================================
   PROFIL
   ================================================================ */

.profile { display: flex; flex-direction: column; gap: 1rem; }

/* ── En-tête ──────────────────────────────────────────────────── */
.profile__header {
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.profile__avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.profile__avatar {
    width: 90px; height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gray-light);
}
.profile__lsf-dot {
    position: absolute;
    bottom: 2px; right: 2px;
    font-size: 18px;
    line-height: 1;
}

.profile__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.5rem; }

.profile__name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.profile__username {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--black);
    margin: 0;
}

.profile__bio {
    font-size: 0.95rem;
    color: var(--gray-text);
    line-height: 1.6;
    word-break: break-word;
}

.profile__since {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--gray-mid);
}

.profile__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
    flex-shrink: 0;
}
@media (max-width: 600px) {
    .profile__header { flex-direction: column; align-items: center; text-align: center; }
    .profile__actions { flex-direction: row; align-items: center; justify-content: center; width: 100%; }
    .profile__actions .btn { flex: 1; justify-content: center; }
    .profile__actions form { flex: 1; }
    .profile__actions form .btn { width: 100%; justify-content: center; }
}

/* Badges rôles */
.badge--admin { background: #1a3a2e; color: #fff; }
.badge--mod   { background: #EEEDFE; color: #3C3489; }
.badge--community { background: var(--gray-light); color: var(--gray-text); }

/* ── Stats ────────────────────────────────────────────────────── */
.profile__stats {
    display: flex;
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.profile__stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.5rem;
    gap: 3px;
    border-right: 1px solid var(--gray-light);
}
.profile__stat:last-child { border-right: none; }
.profile__stat-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--green-dark);
    line-height: 1;
}
.profile__stat-label {
    font-size: 0.75rem;
    color: var(--gray-mid);
    text-align: center;
}

/* ── Posts ────────────────────────────────────────────────────── */
.profile__posts-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 0.75rem;
}

/* ================================================================
   ÉDITION PROFIL
   ================================================================ */

.profile-edit { display: flex; flex-direction: column; gap: 1rem; }

.profile-edit__header { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.25rem; }
.profile-edit__title  { font-size: 1.2rem; font-weight: 600; }

.profile-edit__card {
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.profile-edit__section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-text);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-light);
    margin-bottom: 0.25rem;
}
.profile-edit__optional {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--gray-mid);
}

/* Avatar upload */
.profile-edit__avatar-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
}
.profile-edit__avatar-wrap { position: relative; flex-shrink: 0; }
.profile-edit__avatar-preview {
    width: 80px; height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gray-light);
    display: block;
}
.profile-edit__avatar-btn {
    position: absolute;
    bottom: 0; right: 0;
    width: 28px; height: 28px;
    background: var(--green-dark);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}
.profile-edit__avatar-btn:hover { background: #0e2820; }
.profile-edit__avatar-input { display: none; }
.profile-edit__avatar-hint  { font-size: 0.78rem; color: var(--gray-mid); line-height: 1.5; }

/* Compteur bio */
.profile-edit__char-count {
    text-align: right;
    font-size: 0.78rem;
    color: var(--gray-mid);
    margin-top: -0.5rem;
}

/* Footer form */
.profile-edit__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}
