:root {
    --color-bg: #202124;
    --color-surface: #2b2c30;
    --color-surface-alt: #303136;
    --color-primary: #ffb300; /* jaune orangé */
    --color-primary-soft: rgba(255, 179, 0, 0.14);
    --color-primary-strong: #ff9800;
    --color-text: #f5f5f5;
    --color-text-muted: #a9abb3;
    --color-border: #3b3c42;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-full: 999px;
    --shadow-soft: 0 14px 30px rgba(26, 7, 84, 0.12);
    --shadow-subtle: 0 4px 12px rgba(26, 7, 84, 0.06);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #3b3c42 0, #202124 45%, #15161a 100%);
    color: var(--color-text);
}

img,
video {
    max-width: 100%;
    display: block;
}

button,
input,
textarea {
    font-family: inherit;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(16px);
    background: linear-gradient(to bottom, rgba(32, 33, 36, 0.96), rgba(32, 33, 36, 0.92));
    border-bottom: 1px solid rgba(255, 179, 0, 0.18);
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 14px;
    background: radial-gradient(circle at 0 0, #ffeb3b, #ff9800);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 10px 24px rgba(255, 179, 0, 0.5);
}

.logo-text {
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 1rem;
}

.nav-main {
    display: flex;
    gap: 0.4rem;
}

.nav-item {
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: 0.18s ease background, 0.18s ease color;
}

.nav-item-active,
.nav-item:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary-strong);
}

.app-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.section-header h1 {
    font-size: 1.2rem;
    margin: 0;
}

.btn {
    border: none;
    cursor: pointer;
    border-radius: var(--radius-full);
    padding: 0.5rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: 0.18s ease all;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-strong));
    color: #fff;
    box-shadow: 0 10px 20px rgba(115, 89, 255, 0.45);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(115, 89, 255, 0.55);
}

.btn-ghost {
    background: rgba(115, 89, 255, 0.04);
    color: var(--color-primary-strong);
    border: 1px solid rgba(115, 89, 255, 0.18);
}

.btn-ghost:hover {
    background: rgba(115, 89, 255, 0.08);
}

.icon-button {
    border: none;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    transition: 0.18s ease background, 0.18s ease transform;
}

.icon-button:hover {
    background: rgba(115, 89, 255, 0.06);
    transform: translateY(-1px);
}

.feed,
.groups,
.profile,
.notifications {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.post-card {
    background: linear-gradient(145deg, rgba(48, 49, 54, 0.96), rgba(43, 44, 48, 0.95));
    border-radius: var(--radius-lg);
    padding: 0.8rem 0.8rem 0.75rem;
    box-shadow: var(--shadow-subtle);
    border: 1px solid rgba(59, 60, 66, 0.9);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 14px;
    background: radial-gradient(circle at 0 0, #ffeb3b, var(--color-primary-strong));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.avatar-large {
    width: 70px;
    height: 70px;
    border-radius: 26px;
    font-size: 1.4rem;
}

.post-meta {
    display: flex;
    flex-direction: column;
}

.post-author {
    font-weight: 600;
    font-size: 0.9rem;
}

.post-date {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.post-content p {
    margin: 0.2rem 0 0.4rem;
    font-size: 0.9rem;
}

.post-media {
    border-radius: var(--radius-md);
    overflow: hidden;
    max-height: 340px;
    object-fit: cover;
    box-shadow: var(--shadow-soft);
}

.post-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.3rem;
}

.post-actions .count {
    font-size: 0.8rem;
}

.empty-state {
    padding: 1rem;
    border-radius: var(--radius-md);
    background: rgba(255, 179, 0, 0.06);
    border: 1px dashed rgba(255, 179, 0, 0.38);
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.group-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.group-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.7rem;
    align-items: center;
    padding: 0.8rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, rgba(48, 49, 54, 0.96), rgba(43, 44, 48, 0.95));
    border: 1px solid rgba(59, 60, 66, 0.9);
}

.group-avatar {
    width: 42px;
    height: 42px;
    border-radius: 16px;
    background: radial-gradient(circle at 0 0, #ffeb3b, var(--color-primary-strong));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.group-info h2 {
    margin: 0 0 0.1rem;
    font-size: 0.95rem;
}

.group-meta {
    margin: 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.group-description {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
}

.group-actions {
    display: flex;
}

.profile-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(140deg, #ffb300, #ff9800);
    color: #fff;
    box-shadow: var(--shadow-soft);
}

.profile-main h1 {
    margin: 0 0 0.2rem;
    font-size: 1.25rem;
}

.profile-username {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.profile-bio {
    margin: 0.45rem 0 0.5rem;
    font-size: 0.85rem;
}

.profile-stats {
    display: flex;
    gap: 0.9rem;
    font-size: 0.8rem;
}

.profile-stats span strong {
    font-size: 0.9rem;
}

.notification-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.notification-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 0.8rem;
    border-radius: var(--radius-md);
    background: rgba(43, 44, 48, 0.96);
    border: 1px solid rgba(59, 60, 66, 0.9);
}

.notification-item p {
    margin: 0;
    font-size: 0.85rem;
}

.notification-excerpt {
    margin-top: 0.1rem;
    color: var(--color-text-muted);
}

.notification-date {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal.open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(18px);
}

.modal-content {
    position: relative;
    width: min(480px, 100% - 2rem);
    background: #26272b;
    border-radius: 20px;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.65);
    padding: 0.75rem 0.9rem 0.8rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-bottom: 0.4rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1rem;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
}

.field span {
    font-weight: 500;
}

.field input[type="file"],
.field textarea {
    border-radius: 14px;
    border: 1px solid rgba(255, 179, 0, 0.6);
    padding: 0.55rem 0.7rem;
    font-size: 0.85rem;
    background: rgba(32, 33, 36, 0.9);
}

.field textarea {
    resize: vertical;
    min-height: 90px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* --- Auth pages (login / register) --- */

.auth-main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border-radius: 18px;
    padding: 1.3rem 1.2rem 1.1rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(59, 60, 66, 0.9);
}

.auth-card h1 {
    margin: 0 0 0.9rem;
    font-size: 1.3rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-bottom: 0.8rem;
}

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
    background: rgba(13, 13, 17, 0.85);
    color: var(--color-text);
    outline: none;
    transition: 0.18s ease border-color, 0.18s ease box-shadow, 0.18s ease background;
}

.auth-form input::placeholder {
    color: var(--color-text-muted);
}

.auth-form input:focus {
    border-color: rgba(255, 179, 0, 0.85);
    box-shadow: 0 0 0 1px rgba(255, 179, 0, 0.5);
    background: rgba(18, 18, 24, 0.95);
}

.form-errors {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0.65rem 0.7rem;
    border-radius: 14px;
    background: rgba(255, 82, 82, 0.08);
    border: 1px solid rgba(255, 82, 82, 0.7);
    font-size: 0.8rem;
}

.form-errors li + li {
    margin-top: 0.25rem;
}

.auth-switch {
    margin: 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.auth-switch a {
    color: var(--color-primary-strong);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

@media (min-width: 768px) {
    .app-main {
        padding-top: 1.3rem;
    }

    .post-card {
        padding: 0.95rem 1rem 0.9rem;
    }

    .section-header h1 {
        font-size: 1.35rem;
    }
}

