/* ---------------------------------------------------------------
   SearchArea — comptes
   Reprend la palette d'origine : sidebar #f2f2f2, primaire #007bff.
   Un seul fichier, plus de <style> dispersés dans chaque page.
   --------------------------------------------------------------- */

:root {
    --bg:        #ffffff;
    --surface:   #f2f2f2;
    --border:    #dcdcdc;
    --text:      #333333;
    --muted:     #6b6b6b;
    --primary:   #007bff;
    --primary-d: #0062cc;
    --danger:    #c62828;
    --radius:    5px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

a { color: var(--primary); }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* --- Barre du haut ------------------------------------------- */
.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.brand {
    font-size: 1.15rem;
    font-weight: bold;
    color: var(--text);
    text-decoration: none;
}
.topnav a {
    margin-left: 16px;
    color: var(--text);
    text-decoration: none;
}
.topnav a:hover { color: var(--primary); }

.page { padding: 20px; }

/* --- Mise en page compte : sidebar + contenu ------------------ */
.container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
}
.menu {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    width: 240px;
    flex-shrink: 0;
}
.menu h2 {
    margin: 12px 0 4px;
    font-size: 1.1rem;
    word-break: break-word;
}
.menu ul { list-style: none; margin: 16px 0 0; padding: 0; }
.menu li { margin-bottom: 10px; }
.menu a { color: var(--text); text-decoration: none; }
.menu a:hover, .menu a.current { color: var(--primary); font-weight: bold; }

.content { flex: 1; min-width: 280px; }
.content h1 { margin-top: 0; font-size: 1.5rem; }

/* --- Carte centrée (connexion, inscription) ------------------- */
.auth-card, .profile {
    max-width: 520px;
    margin: 0 auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.profile { max-width: 720px; text-align: center; }

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}
.card h2 { margin-top: 0; font-size: 1.15rem; }
.card.danger { border-color: var(--danger); }
.card.danger h2 { color: var(--danger); }

/* --- Images -------------------------------------------------- */
.avatar {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--bg);
    background: var(--surface);
}
.avatar.big { width: 150px; height: 150px; margin-top: -75px; }
.avatar.small { width: 44px; height: 44px; }

.banner {
    width: 100%;
    max-height: 240px;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface);
    margin-bottom: 16px;
}
.banner img { width: 100%; height: 240px; object-fit: cover; display: block; }
.banner.small, .banner.small img { height: 110px; }

/* --- Formulaires --------------------------------------------- */
label {
    display: block;
    margin: 16px 0 6px;
    font-weight: bold;
    font-size: 0.92rem;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    background: var(--bg);
    color: var(--text);
}
textarea { resize: vertical; }

input:focus, textarea:focus, button:focus, a:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.hint { color: var(--muted); font-size: 0.85rem; margin: 6px 0 0; }
.muted { color: var(--muted); }
.field-error { color: var(--danger); font-size: 0.88rem; margin: 6px 0 0; }

/* --- Boutons -------------------------------------------------- */
button, .btn {
    display: inline-block;
    margin-top: 18px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
.primary, button.primary { background: var(--primary); color: #fff; }
.primary:hover, button.primary:hover { background: var(--primary-d); text-decoration: none; }
.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.secondary:hover { background: #e6e6e6; text-decoration: none; }
.danger-btn { background: var(--danger); color: #fff; }

.link-btn {
    background: none;
    border: none;
    color: var(--danger);
    padding: 0;
    margin: 6px 0 0;
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: underline;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.inline { display: inline; }

/* --- Messages ------------------------------------------------- */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert-success { background: #e8f5e9; border-color: #a5d6a7; color: #1b5e20; }
.alert-error   { background: #fdecea; border-color: #f5c6c2; color: #8b1a12; }

/* --- Divers --------------------------------------------------- */
.infos { margin: 20px 0; }
.infos dt { font-weight: bold; margin-top: 12px; font-size: 0.9rem; }
.infos dd { margin: 2px 0 0; }

.bio { white-space: normal; word-break: break-word; }

.comment-list { list-style: none; margin: 24px 0 0; padding: 0; }
.comment {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
}
.comment-body { flex: 1; min-width: 0; }
.comment-body p { margin: 0 0 4px; word-break: break-word; }
.comment-meta { font-size: 0.88rem; }
.comment-meta span { margin-left: 8px; }

.sitefooter {
    margin-top: 40px;
    padding: 20px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}

code {
    background: var(--surface);
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.88em;
    word-break: break-all;
}

@media (max-width: 640px) {
    .container { flex-direction: column; }
    .menu { width: 100%; }
    .avatar.big { margin-top: -60px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
