@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap");

:root {
    /* Base — nuit urbaine */
    --bg: #0a0c11;
    --bg-panel: #12151c;
    --bg-panel-2: #171b24;
    --bg-input: #0d0f15;
    --border: #262b38;
    --border-strong: #3a4152;

    /* Texte */
    --text: #e7e9ee;
    --text-muted: #848ca0;
    --text-dim: #565d6e;

    /* Accent — éclairage sodium des rues */
    --accent: #f5a623;
    --accent-ink: #1a1200;
    --accent-hover: #ffb84d;
    --link: #6fb7ff;

    /* États */
    --danger: #e5484d;
    --success: #3dd68c;

    /* Types de patch note */
    --type-maj: #f5a623;
    --type-update: #5b8def;
    --type-fix: #e5484d;
    --type-nouveaute: #b18cff;
    --type-ajustement: #3dd68c;
    --type-autre: #848ca0;

    --radius: 5px;
    --radius-sm: 3px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(
            ellipse 900px 500px at 15% -10%,
            rgba(245, 166, 35, 0.06),
            transparent 60%
        ),
        var(--bg);
    color: var(--text);
    font-family:
        "IBM Plex Sans",
        system-ui,
        -apple-system,
        sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

a {
    color: var(--link);
}

h1,
h2,
.display {
    font-family: "Bebas Neue", "IBM Plex Sans", sans-serif;
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1.05;
}
h1 {
    font-size: 2.6rem;
    margin: 0 0 6px;
}
h2 {
    font-size: 1.5rem;
    margin: 0;
}

.container {
    max-width: 880px;
    margin: 0 auto;
    padding: 36px 20px 70px;
}

/* ---------- Barre de navigation ---------- */
.topbar {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 0 24px;
    height: 60px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    font-family: "Bebas Neue", sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.03em;
    color: var(--text);
    text-decoration: none;
    border-right: 1px solid var(--border);
    padding-right: 24px;
    height: 60px;
    display: flex;
    align-items: center;
}
.logo span {
    color: var(--accent);
}

.topbar nav {
    display: flex;
    gap: 22px;
    flex: 1;
    height: 100%;
}
.topbar nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    height: 100%;
    border-bottom: 2px solid transparent;
}
.topbar nav a:hover {
    color: var(--text);
    border-bottom-color: var(--border-strong);
}

.account {
    display: flex;
    align-items: center;
    gap: 14px;
}
.user-profile-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
}
.user-chip {
    color: var(--text-dim);
    font-size: 0.78rem;
    font-family: "IBM Plex Mono", monospace;
}

.avatar {
    display: inline-flex;
    width: 36px;
    height: 36px;
    max-width: 36px;
    max-height: 36px;
    aspect-ratio: 1 / 1;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 50%;
    background: var(--bg-panel-2);
    border: 1px solid var(--border-strong);
    color: var(--accent);
    font-family: "IBM Plex Mono", monospace;
    font-weight: 700;
    object-fit: cover;
}
img.avatar {
    display: block;
    width: 36px !important;
    height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    object-fit: cover;
}
.avatar-xs {
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    font-size: 0.65rem;
    vertical-align: middle;
}
.avatar-sm {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    font-size: 0.75rem;
}
.avatar-lg {
    width: 64px !important;
    height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
    font-size: 1.8rem;
}

/* ---------- Boutons ---------- */
.btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--accent-ink);
    text-decoration: none;
    border: 1px solid var(--accent);
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.15s,
        border-color 0.15s;
}
.btn:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);
}
.btn-ghost:hover {
    background: var(--bg-panel-2);
    border-color: var(--text-dim);
}
.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: #ff5b60;
    border-color: #ff5b60;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
}

/* ---------- Alertes ---------- */
.flash {
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 0.88rem;
    border-left: 3px solid;
}
.flash-error {
    background: rgba(229, 72, 77, 0.08);
    border-color: var(--danger);
    color: #ffb3b5;
}
.flash-success {
    background: rgba(61, 214, 140, 0.08);
    border-color: var(--success);
    color: #a7f2ce;
}

/* ---------- Panneaux ---------- */
.card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 18px;
}

.subtitle {
    color: var(--text-muted);
    margin: 0 0 20px;
}

/* ---------- Filtres par type ---------- */
.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.chip {
    background: var(--bg-panel-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
}
a.chip:hover {
    color: var(--text);
    border-color: var(--border-strong);
}
label.chip {
    color: var(--text);
    display: inline-flex;
    align-items: center;
}

/* ---------- Badges de type ---------- */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #0a0c11;
}

/* ---------- Liste des patch notes : registre / bulletin ---------- */
.patchnote-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}
.patchnote-meta {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-top: 6px;
    font-family: "IBM Plex Mono", monospace;
}
.patchnote-content {
    white-space: pre-wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Cartes de patch note dans les listes : accent gauche coloré par type,
   posé via style="border-left-color:..." depuis le PHP */
.card.note-entry {
    border-left: 4px solid var(--border-strong);
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* ---------- Formulaires ---------- */
form label {
    display: block;
    margin: 16px 0 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    font-size: 0.92rem;
    font-family: inherit;
}
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}
textarea {
    min-height: 180px;
    resize: vertical;
    line-height: 1.55;
}
input[type="color"] {
    padding: 3px;
    height: 40px;
    cursor: pointer;
}
input[type="checkbox"] {
    margin-right: 8px;
    accent-color: var(--accent);
    width: auto;
}
input[type="file"] {
    width: 100%;
    color: var(--text-muted);
    font-size: 0.88rem;
    cursor: pointer;
}
input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 9px 14px;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--accent-ink);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.15s,
        border-color 0.15s;
}
input[type="file"]::file-selector-button:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}
.form-help {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin: 6px 0 0;
}
.profile-card {
    max-width: 620px;
}
.profile-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.profile-heading h2 {
    margin-bottom: 4px;
}
.author-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---------- Tableaux (admin) ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
}
th,
td {
    padding: 11px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
tr:last-child td {
    border-bottom: none;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.status-brouillon {
    color: var(--accent);
}
.status-publie {
    color: var(--success);
}

.footer {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.78rem;
    padding: 40px 0 20px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.empty-state {
    text-align: center;
    color: var(--text-dim);
    padding: 50px 0;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

@media (max-width: 640px) {
    .topbar {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 16px;
        gap: 12px;
    }
    .logo {
        border-right: none;
        padding-right: 0;
        height: auto;
    }
    .topbar nav {
        order: 3;
        width: 100%;
        gap: 16px;
        height: auto;
    }
    h1 {
        font-size: 2rem;
    }
}
