/* BLACKBOX — design system
   Références : terminaux financiers, banques privées, presse haut de gamme.
   Sombre, dense en information, très peu de couleur — l'accent doré est
   réservé aux éléments qui comptent vraiment (CTA, montants, alertes). */

:root {
    --bg: #08080a;
    --bg-raised: #101013;
    --bg-card: #131316;
    --bg-hover: #1a1a1f;
    --border: #232328;
    --border-soft: #1a1a1e;

    --text: #e8e8ea;
    --text-dim: #9a9aa2;
    --text-faint: #5c5c64;

    --accent: #c9a24b;
    --accent-dim: #8a7136;
    --accent-contrast: #0a0a0a;

    --blue: #5b8bc9;
    --red: #c9524b;
    --green: #4bc98a;
    --orange: #d18a3e;

    --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

    --radius: 6px;
    --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.02) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.01em; margin: 0 0 .5em; }
p { margin: 0 0 1em; color: var(--text-dim); }

::selection { background: var(--accent); color: var(--accent-contrast); }

/* ---------------------------------------------------------------------- */
/* Primitives                                                              */
/* ---------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5em;
    padding: .65em 1.3em;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-raised);
    color: var(--text);
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--bg-hover); border-color: #2c2c33; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: #d9b25c; border-color: #d9b25c; }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: rgba(201, 82, 75, .1); }
.btn-block { width: 100%; }
.btn-sm { padding: .4em .9em; font-size: .8rem; }

.link-btn {
    background: none; border: none; color: var(--text-dim); cursor: pointer;
    font-size: .85rem; padding: 0; font-family: inherit;
}
.link-btn:hover { color: var(--text); }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}

.badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    padding: .15em .55em;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-contrast);
    letter-spacing: .02em;
}
.badge-outline {
    background: transparent; border: 1px solid var(--border); color: var(--text-dim);
    font-family: var(--font-mono); text-transform: uppercase;
}
.badge-breaking { background: var(--red); color: #fff; }
.badge-featured { background: var(--accent); color: var(--accent-contrast); }
.badge-sponsored { background: var(--blue); color: #fff; }
.badge-standard { background: var(--border); color: var(--text-dim); }
.badge-verified { background: var(--blue); color: #fff; }

.mono { font-family: var(--font-mono); letter-spacing: .01em; }
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.text-accent { color: var(--accent); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }

input[type=text], input[type=password], input[type=email], input[type=number], input[type=url],
select, textarea {
    width: 100%;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .7em .85em;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: .92rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-dim); }
label { display: block; font-size: .8rem; color: var(--text-dim); margin-bottom: .4em; letter-spacing: .01em; }
.field { margin-bottom: 1.1em; }
.field-hint { font-size: .78rem; color: var(--text-faint); margin-top: .35em; }

.flash { padding: .9em 1.2em; border-radius: var(--radius); margin: 1rem 1.5rem 0; font-size: .9rem; }
.flash-success { background: rgba(75, 201, 138, .12); border: 1px solid rgba(75, 201, 138, .35); color: var(--green); }
.flash-error { background: rgba(201, 82, 75, .12); border: 1px solid rgba(201, 82, 75, .35); color: #e7938d; }
.flash-info { background: rgba(91, 139, 201, .12); border: 1px solid rgba(91, 139, 201, .35); color: #9fbfe8; }

table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; color: var(--text-faint); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; padding: .6em .8em; border-bottom: 1px solid var(--border); }
td { padding: .7em .8em; border-bottom: 1px solid var(--border-soft); }
tr:hover td { background: var(--bg-hover); }

/* ---------------------------------------------------------------------- */
/* Shell public                                                            */
/* ---------------------------------------------------------------------- */

.nav-public {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 2.5rem;
    border-bottom: 1px solid var(--border-soft);
    position: sticky;
    top: 0;
    background: rgba(8, 8, 10, .9);
    backdrop-filter: blur(8px);
    z-index: 10;
}
.brand { display: flex; align-items: center; gap: .5em; font-weight: 700; letter-spacing: .04em; font-size: 1rem; }
.brand-mark { color: var(--accent); }
.nav-public nav { display: flex; gap: 2rem; }
.nav-public nav a { font-size: .85rem; color: var(--text-dim); letter-spacing: .01em; }
.nav-public nav a:hover { color: var(--text); }

.shell-main { min-height: 70vh; }
.shell-public .shell-main { max-width: 1200px; margin: 0 auto; padding: 0 2.5rem; }

.hero {
    padding: 7rem 0 5rem;
    text-align: center;
}
.hero .kicker {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: .72rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent-dim);
    padding: .35em 1em;
    border-radius: 999px;
    margin-bottom: 2rem;
}
.hero h1 { font-size: 3.2rem; line-height: 1.1; max-width: 780px; margin: 0 auto .6em; }
.hero p.lead { font-size: 1.15rem; max-width: 560px; margin: 0 auto 2.2em; }
.hero .actions { display: flex; gap: 1rem; justify-content: center; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin: 3rem 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin: 3rem 0; }
@media (max-width: 900px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.feature-card h3 { font-size: 1rem; }
.feature-card .icon { color: var(--accent); font-family: var(--font-mono); font-size: 1.4rem; margin-bottom: .8em; display: block; }

footer.site-footer {
    border-top: 1px solid var(--border-soft);
    padding: 3rem 2.5rem;
    margin-top: 5rem;
    color: var(--text-faint);
    font-size: .8rem;
    display: flex;
    justify-content: space-between;
}
footer.site-footer a { color: var(--text-faint); }
footer.site-footer a:hover { color: var(--text-dim); }

/* ---------------------------------------------------------------------- */
/* Shell app / admin                                                       */
/* ---------------------------------------------------------------------- */

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 232px;
    flex-shrink: 0;
    background: var(--bg-raised);
    border-right: 1px solid var(--border-soft);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar .brand { padding: 0 .6rem 1.5rem; }
.admin-tag { font-family: var(--font-mono); font-size: .6rem; color: var(--red); border: 1px solid var(--red); padding: .1em .4em; border-radius: 3px; }
.sidebar nav { display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.sidebar nav a {
    padding: .65em .9em;
    border-radius: var(--radius);
    font-size: .87rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sidebar nav a:hover { background: var(--bg-hover); color: var(--text); }
.sidebar nav a.active { background: var(--bg-hover); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.sidebar nav a .badge { margin-left: .5em; }
.sidebar nav a.admin-link { color: var(--red); margin-top: .6rem; border-top: 1px solid var(--border-soft); padding-top: 1em; border-radius: 0; }
.sidebar-secondary { margin-top: 1rem; }
.sidebar-secondary a { font-size: .8rem; color: var(--text-faint); padding: .5em .9em; display: block; }
.logout-form { padding-top: 1rem; border-top: 1px solid var(--border-soft); }

.app-content { flex: 1; padding: 2.5rem 3rem; max-width: 1100px; }
.shell-app .shell-main, .shell-admin .shell-main { display: block; }

.page-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 2rem; }
.page-header h1 { font-size: 1.5rem; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2.5rem; }
@media (max-width: 1000px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { padding: 1.3rem 1.4rem; }
.stat-card .stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin-bottom: .6em; }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; font-family: var(--font-mono); }
.stat-card .stat-sub { font-size: .78rem; color: var(--text-dim); margin-top: .3em; }

/* Messagerie */
.messenger { display: grid; grid-template-columns: 320px 1fr; gap: 1.5rem; height: calc(100vh - 5rem); }
.conv-list { overflow-y: auto; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--bg-card); }
.conv-item { display: block; padding: 1em 1.2em; border-bottom: 1px solid var(--border-soft); }
.conv-item:hover { background: var(--bg-hover); }
.conv-item .conv-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .3em; }
.conv-item .conv-title { font-weight: 600; font-size: .9rem; }
.conv-item .conv-preview { font-size: .82rem; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item .conv-time { font-size: .72rem; color: var(--text-faint); font-family: var(--font-mono); }

.conv-thread { display: flex; flex-direction: column; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--bg-card); overflow: hidden; }
.thread-header { padding: 1em 1.3em; border-bottom: 1px solid var(--border-soft); display: flex; justify-content: space-between; align-items: center; }
.thread-messages { flex: 1; overflow-y: auto; padding: 1.3rem; display: flex; flex-direction: column; gap: .9rem; }
.msg { max-width: 65%; }
.msg-own { align-self: flex-end; text-align: right; }
.msg-bubble { display: inline-block; padding: .7em 1em; border-radius: 10px; background: var(--bg-raised); border: 1px solid var(--border-soft); font-size: .9rem; text-align: left; }
.msg-own .msg-bubble { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.msg-meta { font-size: .7rem; color: var(--text-faint); margin-top: .3em; font-family: var(--font-mono); }
.msg-deleted { font-style: italic; color: var(--text-faint); }
.thread-composer { border-top: 1px solid var(--border-soft); padding: 1rem; display: flex; gap: .8rem; }
.thread-composer textarea { resize: none; height: 44px; }

.countdown { font-family: var(--font-mono); color: var(--orange); font-size: .78rem; }
.session-code { font-family: var(--font-mono); font-size: 1.1rem; color: var(--accent); letter-spacing: .05em; }

/* Press */
.press-feed { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; align-items: start; }
.article-row { display: flex; gap: 1.2rem; padding: 1.2rem 0; border-bottom: 1px solid var(--border-soft); }
.article-row .cover { width: 140px; height: 90px; background: var(--bg-raised); border-radius: var(--radius); flex-shrink: 0; object-fit: cover; }
.article-row h3 { font-size: 1.02rem; margin: 0 0 .3em; }
.article-row .meta { font-size: .76rem; color: var(--text-faint); }
.article-hero { padding: 1.6rem; margin-bottom: 1.5rem; border-color: var(--red); }
.article-hero h2 { font-size: 1.5rem; }
.sidebar-widget { margin-bottom: 1.5rem; }
.sidebar-widget h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin-bottom: .8em; }
.org-row { display: flex; justify-content: space-between; padding: .6em 0; border-bottom: 1px solid var(--border-soft); font-size: .85rem; }

.article-body { line-height: 1.8; font-size: 1.02rem; }
.article-body p { color: var(--text); }

.tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--border-soft); margin-bottom: 1.5rem; }
.tabs a { padding-bottom: .8em; font-size: .85rem; color: var(--text-dim); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--text); border-color: var(--accent); }

.empty-state { text-align: center; padding: 4rem 1rem; color: var(--text-faint); }
