:root {
    color-scheme: dark;
    --bg: #0b0f19;
    --card: #121826;
    --text: #e5e7eb;
    --muted: #9aa4b2;
    --accent: #7aa2ff;
    --accent-soft: rgba(122, 162, 255, 0.16);
    --border: #1f2a44;
    --shadow: 0 18px 40px rgba(3, 7, 18, 0.6);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.turnstile-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, rgba(122, 162, 255, 0.2), transparent 55%), var(--bg);
}

.turnstile-overlay {
    width: 100%;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.turnstile-card {
    width: min(440px, 100%);
    background: var(--card);
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 24px;
    text-align: center;
}

.turnstile-card h1 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.6rem;
}

.turnstile-card p {
    color: var(--muted);
    margin-top: 0;
    margin-bottom: 16px;
}

.turnstile-card .primary {
    margin-top: 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
}

.turnstile-error {
    margin-bottom: 12px;
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

header {
    padding: 32px 48px 12px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 16px;
    border: 1px solid #0b0f19;
    background: #0b0f19;
    box-shadow: var(--shadow);
}

.theme-switch label {
    font-size: 0.85rem;
    color: var(--muted);
}

.theme-switch select {
    background: #0b0f19;
    color: #e5e7eb;
    border: 1px solid #1f2a44;
    border-radius: 12px;
    padding: 6px 10px;
    outline: none;
    font-family: inherit;
}

.site-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

header h1 {
    margin: 0 0 6px;
    font-size: 2rem;
}

header p {
    margin: 0;
    color: var(--muted);
}

main {
    display: grid;
    grid-template-columns: minmax(260px, 300px) 1fr;
    gap: 24px;
    padding: 16px 48px 48px;
}

.panel {
    background: var(--card);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 20px;
    border: 1px solid var(--border);
}

.panel h2 {
    margin-top: 0;
    font-size: 1.1rem;
}

.annonce {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.annonce:last-child {
    border-bottom: none;
}

.annonce h3 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.annonce p {
    margin: 0;
    color: var(--muted);
    line-height: 1.4;
}

.categories {
    display: grid;
    gap: 12px;
}

.category-item {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    background: transparent;
    text-align: left;
}

.category-item.active {
    background: var(--accent-soft);
    border-color: rgba(47, 111, 237, 0.25);
}

.category-item h3 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.category-item p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.content-header h2 {
    margin: 0;
    font-size: 1.4rem;
}

.content-header span {
    color: var(--muted);
}

.content-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.ghost-link {
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
}

.search-bar {
    margin-bottom: 16px;
}

.search-bar input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-family: inherit;
}

.fact-list {
    display: grid;
    gap: 16px;
}

.fact-card {
    background: var(--card);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.fact-card h3 {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 1rem;
}

.fact-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.fact-group {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(18, 24, 38, 0.6);
}

.fact-group-title {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text);
}

.empty-state {
    padding: 24px;
    border-radius: 16px;
    background: #1b2336;
    border: 1px solid #2b3755;
    color: #eab308;
}

.footer-note {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

.admin-hint {
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 12px;
}

.admin-debug {
    margin: 20px 48px 48px;
    background: #0b0f19;
    border-radius: 18px;
    border: 1px solid var(--border);
    padding: 20px;
}

.admin-debug-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.admin-debug-console {
    background: #0b0f19;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    max-height: 180px;
    overflow: auto;
    font-size: 0.85rem;
    color: #cbd5f5;
    white-space: pre-wrap;
}

@media (max-width: 960px) {
    main {
        grid-template-columns: 1fr;
        padding: 16px 20px 36px;
    }

    header {
        padding: 24px 20px 8px;
    }

    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }
}

[data-theme="dusk"] {
    --bg: #0f1222;
    --card: #151a2e;
    --text: #e6e9f2;
    --muted: #a4a9c2;
    --accent: #8b9dff;
    --accent-soft: rgba(139, 157, 255, 0.18);
    --border: #242c46;
    --shadow: 0 18px 40px rgba(6, 9, 20, 0.65);
}

[data-theme="light"] {
    color-scheme: light;
    --bg: #f6f7fb;
    --card: #ffffff;
    --text: #1f2933;
    --muted: #6b7280;
    --accent: #2f6fed;
    --accent-soft: rgba(47, 111, 237, 0.12);
    --border: #e5e7eb;
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}
