@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Inter+Tight:wght@600;700;800;900&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
    --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
    --font-heading: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

    --bg: #06080d;
    --bg-alt: #0a0e15;
    --bg-elevated: #10151f;
    --bg-elevated-2: #161d2b;
    --border: #212b3b;
    --border-light: #2a3548;

    --text: #f4f6f8;
    --text-body: #c3cad4;
    --text-muted: #8792a2;
    --text-dim: #5c6779;

    --red-500: #ef4444;
    --red-600: #dc2626;
    --red-900: #7f1d1d;
    --yellow-400: #facc15;
    --yellow-300: #fde047;

    --service-sdis97: #ef4444;
    --service-samu: #38bdf8;
    --service-police: #3b82f6;
    --service-pms: #f97316;
    --service-civil: #22c55e;

    --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 84px; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text-body);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1; }
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.15; margin: 0 0 .5em; color: var(--text); }
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--yellow-400); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 1.25rem; }

/* ── Boutons ─────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: .5rem;
    font-family: var(--font-heading); font-weight: 700; font-size: .92rem;
    padding: .7rem 1.5rem; border-radius: 999px; border: 1px solid transparent;
    cursor: pointer; text-decoration: none; transition: transform .15s ease, filter .15s ease, background .15s ease;
    white-space: nowrap;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red-600); color: #fff; }
.btn-light { background: #fff; color: #0f172a; }
.btn-outline-light { background: transparent; color: var(--text); border-color: rgba(255,255,255,.28); }
.btn-outline-light:hover { border-color: rgba(255,255,255,.55); background: rgba(255,255,255,.06); }
.btn-discord { background: var(--yellow-400); color: #171200; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: .45rem 1rem; font-size: .82rem; }
.btn-danger { background: var(--red-900); color: #fff; }

/* ── Header public ───────────────────────────────────── */
.site-header {
    background: rgba(6,8,13,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,.06);
    position: sticky; top: 0; z-index: 30;
}
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: 72px; }
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-heading); font-weight: 800; color: #fff; font-size: 1rem; letter-spacing: .02em; text-transform: uppercase; }
.brand img { border-radius: 50%; }
.site-nav { display: flex; align-items: center; gap: 1.6rem; margin-left: auto; }
.site-nav a:not(.btn) { color: var(--text-body); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; }
.site-nav a:not(.btn).active, .site-nav a:not(.btn):hover { color: #fff; text-decoration: none; }
.site-nav a:not(.btn).active { color: var(--yellow-400); }
.site-nav .nav-actions { display: flex; align-items: center; gap: .75rem; margin-left: .5rem; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: .5rem; }
.nav-toggle span { width: 24px; height: 2px; background: #fff; display: block; }

@media (max-width: 900px) {
    .nav-toggle { display: flex; }
    .site-nav {
        position: absolute; top: 72px; left: 0; right: 0; background: #06080d;
        border-bottom: 1px solid var(--border);
        flex-direction: column; align-items: stretch; gap: 0; padding: .5rem 1.25rem 1.25rem;
        display: none;
    }
    .site-nav.open { display: flex; }
    .site-nav a:not(.btn) { padding: .8rem 0; border-bottom: 1px solid var(--border); }
    .site-nav .nav-actions { flex-direction: column; align-items: stretch; margin: 1rem 0 0; }
}

/* ── Hero ────────────────────────────────────────────── */
.hero {
    position: relative; color: #fff; text-align: center;
    background: linear-gradient(180deg, rgba(6,8,13,.55) 0%, rgba(6,8,13,.75) 55%, var(--bg) 100%), url('/assets/img/hero.png') center 30%/cover no-repeat;
    margin-top: -72px;
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: calc(72px + 3rem) 0 4rem;
}
.hero .wrap { width: 100%; }
.hero-logo { width: 120px; height: 120px; margin: 0 auto 1.5rem; border-radius: 50%; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.5rem); font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; margin: .5rem 0 0; }
.hero h1 .line-main { display: block; }
.hero h1 .line-accent { color: var(--yellow-400); display: block; }
.hero h1 .line-sub { display: block; font-size: .34em; color: var(--text-muted); font-weight: 600; letter-spacing: .25em; margin-top: .3em; }
.hero p.lead { color: var(--text-body); max-width: 620px; margin: 1.5rem auto 0; font-size: 1.08rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.hero-scroll {
    display: inline-flex; flex-direction: column; align-items: center; gap: .4rem;
    margin-top: 3rem; color: var(--text-muted); font-family: var(--font-mono);
    font-size: .72rem; text-transform: uppercase; letter-spacing: .16em;
}
.hero-scroll:hover { color: #fff; text-decoration: none; }
.hero-scroll svg { width: 18px; height: 18px; animation: hero-scroll-bounce 1.8s ease-in-out infinite; }
@keyframes hero-scroll-bounce {
    0%, 100% { transform: translateY(0); opacity: .6; }
    50% { transform: translateY(6px); opacity: 1; }
}

/* ── Sections / cards ────────────────────────────────── */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2.75rem; }
.section-head p { color: var(--text-muted); }
.section-head-left { margin-bottom: 2.25rem; }
.grid { display: grid; gap: 1.5rem; }
.grid-news { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

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

.eyebrow { font-family: var(--font-mono); color: var(--yellow-400); letter-spacing: .18em; text-transform: uppercase; font-size: .76rem; font-weight: 600; display: block; margin-bottom: .5rem; }
.section-title { font-family: var(--font-heading); font-weight: 900; text-transform: uppercase; font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: -.01em; margin: 0; }
.section-title .accent { color: var(--yellow-400); }

/* ── Le Projet ───────────────────────────────────────── */
.project-text { max-width: 820px; }
.project-text p { color: var(--text-body); }
.project-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-top: 2.5rem; }
@media (max-width: 900px) { .project-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .project-grid { grid-template-columns: 1fr; } }
.project-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; }
.project-card .icon { width: 34px; height: 34px; color: var(--yellow-400); margin-bottom: .9rem; }
.project-card h3 { font-size: .92rem; text-transform: uppercase; letter-spacing: .03em; margin-bottom: .4rem; }
.project-card p { color: var(--text-muted); font-size: .85rem; margin: 0; }

/* ── Nos services ────────────────────────────────────── */
.services-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2.25rem; flex-wrap: wrap; gap: 1rem; }
.services-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.25rem; }
@media (max-width: 900px) {
    .services-grid { grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); overflow-x: auto; padding-bottom: .5rem; }
}
.service-card-v2 {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem; position: relative; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem;
}
.service-card-v2::before {
    content: ''; position: absolute; inset: -6px;
    background: url('/assets/img/hero.png') center/cover no-repeat;
    filter: blur(3px) brightness(.55);
    transform: scale(1.08);
    pointer-events: none;
}
.service-card-v2::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(6,8,13,.6) 0%, rgba(6,8,13,.92) 100%),
                radial-gradient(circle at 30% 0%, var(--accent) 0%, transparent 55%);
    pointer-events: none;
}
.service-card-v2 .service-media { display: block; margin: 0 auto; position: relative; z-index: 1; }
.service-card-v2:not(.is-photo) .service-media { max-height: 64px; max-width: 100%; width: auto; height: auto; object-fit: contain; }
.service-card-v2.is-photo .service-media { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.service-card-v2 h3 { color: var(--accent); font-size: 1.02rem; text-transform: uppercase; margin-bottom: .6rem; position: relative; z-index: 1; letter-spacing: .01em; }
.service-card-v2 p { color: var(--text-muted); font-size: .84rem; position: relative; z-index: 1; margin: 0; }
.service-tag {
    display: inline-block; align-self: center; margin-top: auto; padding: .3rem .7rem; border: 1px solid var(--border-light);
    border-radius: 999px; font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim);
    position: relative; z-index: 1;
}

/* ── Nos partenaires ──────────────────────────────────── */
.partners-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem; }
.partner-card {
    width: 230px; background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column;
    align-items: center; text-align: center; gap: .5rem;
}
.partner-logo { display: block; margin: 0 auto; max-height: 48px; max-width: 100%; width: auto; object-fit: contain; filter: grayscale(1) brightness(1.3); opacity: .85; }
.partner-card h3 { color: var(--text); font-size: .92rem; text-transform: uppercase; letter-spacing: .01em; margin: .4rem 0 0; }
.partner-card p { color: var(--text-muted); font-size: .82rem; margin: 0; }
.partner-link {
    margin-top: .4rem; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: center; color: var(--text-dim); text-decoration: none;
    font-size: .95rem;
}
.partner-link:hover { background: var(--bg-elevated-2); color: var(--text); }

/* ── Nos réseaux ──────────────────────────────────────── */
.socials-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem; }
.social-link {
    display: flex; flex-direction: column; align-items: center; gap: .6rem; width: 110px;
    padding: 1.25rem 1rem; background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-muted); text-decoration: none; font-size: .78rem;
    text-transform: uppercase; letter-spacing: .02em; transition: color .15s ease, border-color .15s ease;
}
.social-link svg { width: 26px; height: 26px; }
.social-link:hover { color: var(--yellow-400); border-color: var(--border-light); }

/* ── Galerie ─────────────────────────────────────────── */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 200px; grid-auto-flow: dense; gap: 1rem; }
.gallery-grid a { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.gallery-grid a.gallery-featured { grid-column: span 2; grid-row: span 2; }
.gallery-grid a.gallery-tall { grid-row: span 2; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.gallery-grid a:hover img { transform: scale(1.06); }
@media (min-width: 701px) {
    .gallery-grid a.gallery-last { grid-column: 3; }
}
@media (max-width: 700px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; }
    .gallery-grid a.gallery-last { grid-column: 2; }
}
@media (max-width: 460px) {
    .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: 200px; }
    .gallery-grid a.gallery-featured, .gallery-grid a.gallery-tall { grid-column: span 1; grid-row: span 1; }
    .gallery-grid a.gallery-last { grid-column: 1; }
}

.lightbox {
    display: none; position: fixed; inset: 0; background: rgba(2,3,6,.92); z-index: 100;
    align-items: center; justify-content: center; padding: 3rem 1.5rem;
}
.lightbox:target { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 8px; }
.lightbox-close {
    position: absolute; top: 1.25rem; right: 1.75rem; color: #fff; font-size: 2.2rem; line-height: 1;
    text-decoration: none; font-weight: 300;
}

.news-card { display: flex; flex-direction: row; align-items: center; gap: 1rem; }
.news-card-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.news-card .news-date { font-family: var(--font-mono); font-size: .76rem; color: var(--text-dim); text-transform: uppercase; }
.news-card h3 a { color: var(--text); }
.news-card p { color: var(--text-muted); flex: 1; }
.news-card-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius); flex-shrink: 0; }

.enroll-card { max-width: 480px; margin: 0 auto; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; text-align: left; }
.enroll-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.enroll-icon { width: 44px; height: 44px; border-radius: 10px; background: rgba(59,130,246,.15); color: #3b82f6; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.enroll-icon svg { width: 22px; height: 22px; }
.enroll-head h3 { margin: 0; font-size: 1rem; text-transform: uppercase; letter-spacing: .02em; }
.enroll-head p { margin: 0; color: var(--text-dim); font-size: .8rem; }
.enroll-desc { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.5rem; }

/* ── Formulaires ─────────────────────────────────────── */
.form-card { max-width: 620px; margin: 0 auto; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .88rem; color: var(--text); }
.field .hint { color: var(--text-dim); font-size: .78rem; margin-top: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
    width: 100%; padding: .65rem .8rem; border: 1px solid var(--border-light); border-radius: 8px;
    font-family: var(--font-body); font-size: .95rem; background: var(--bg); color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--red-500); outline-offset: 1px; }
.hp-field { position: absolute; left: -9999px; top: -9999px; }
.auth-wrap { min-height: calc(100vh - 72px); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: var(--bg-alt); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand { justify-content: center; color: var(--text); margin-bottom: 1.5rem; }

/* ── Alerts / flash ──────────────────────────────────── */
.flash-wrap:empty { display: none; }
.alert { padding: .85rem 1.1rem; border-radius: 8px; margin: 1rem auto; max-width: 1160px; font-size: .92rem; border: 1px solid transparent; }
.alert-success { background: rgba(34,197,94,.1); color: #4ade80; border-color: rgba(34,197,94,.25); }
.alert-danger { background: rgba(239,68,68,.1); color: #f87171; border-color: rgba(239,68,68,.25); }
.alert-info { background: rgba(59,130,246,.1); color: #60a5fa; border-color: rgba(59,130,246,.25); }

/* ── Footer public ───────────────────────────────────── */
.site-footer { background: var(--bg-alt); color: var(--text-muted); padding: 2rem 0; border-top: 1px solid var(--border); }
.site-footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; font-size: .88rem; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: #fff; }
.site-footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* ── Espace staff ────────────────────────────────────── */
.staff-body { background: var(--bg-alt); }
.staff-shell { display: flex; min-height: 100vh; }
.staff-sidebar { width: 250px; background: var(--bg); border-right: 1px solid var(--border); color: #fff; display: flex; flex-direction: column; padding: 1.25rem 1rem; flex-shrink: 0; }
.staff-sidebar .brand { color: #fff; margin-bottom: 1.5rem; }
.staff-nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.staff-nav a { color: var(--text-muted); padding: .6rem .7rem; border-radius: 8px; font-weight: 600; font-size: .88rem; display: flex; justify-content: space-between; align-items: center; }
.staff-nav a:hover { background: var(--bg-elevated); text-decoration: none; color: #fff; }
.staff-nav a.active { background: var(--red-600); color: #fff; }
.staff-nav-title { color: var(--text-dim); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; margin: 1rem .7rem .3rem; }
.staff-nav .badge { background: var(--yellow-400); color: #171200; border-radius: 999px; font-size: .72rem; padding: .1rem .5rem; }
.staff-sidebar-footer { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1rem; display: flex; flex-direction: column; gap: .4rem; font-size: .84rem; }
.staff-sidebar-footer a { color: var(--text-muted); }
.staff-main { flex: 1; padding: 2rem; max-width: 1100px; }

.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.stat-card .stat-value { font-family: var(--font-heading); font-size: 1.8rem; font-weight: 800; color: var(--text); }
.stat-card .stat-label { color: var(--text-muted); font-size: .85rem; }

table { width: 100%; border-collapse: collapse; background: var(--bg-elevated); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--border); font-size: .88rem; color: var(--text-body); }
th { background: var(--bg-elevated-2); font-family: var(--font-heading); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
tr:last-child td { border-bottom: 0; }
.table-wrap { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.table-wrap table { border: 0; }
.actions-row { display: flex; gap: .5rem; align-items: center; }

.pill { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.pill-pending { background: rgba(250,204,21,.15); color: var(--yellow-300); }
.pill-accepted { background: rgba(34,197,94,.15); color: #4ade80; }
.pill-rejected { background: rgba(239,68,68,.15); color: #f87171; }
.pill-sysadmin { background: #a855f7; color: #fff; }
.pill-direction { background: var(--yellow-400); color: #1a1300; }
.pill-admin { background: var(--red-600); color: #fff; }
.pill-staff, .pill-recruteur { background: var(--bg-elevated-2); color: var(--text-body); }
.pill-inactive { background: var(--bg-elevated-2); color: var(--text-dim); }

.tabs { display: flex; gap: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.tabs a { padding: .45rem 1rem; border-radius: 999px; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-body); font-size: .84rem; font-weight: 600; }
.tabs a.active { background: var(--red-600); color: #fff; border-color: var(--red-600); }
.tabs a.active:hover { text-decoration: none; }

.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 780px) { .detail-grid { grid-template-columns: 1fr; } }
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--text-muted); }

/* ── Pages légales ───────────────────────────────────── */
.prose { max-width: 780px; margin: 0 auto; }
.prose h2 { margin-top: 2.25rem; font-size: 1.25rem; }
.prose h2:first-of-type { margin-top: 0; }
.prose p, .prose li { color: var(--text-body); }
.prose ul { padding-left: 1.2rem; margin: 0 0 1em; }
.prose li { margin-bottom: .4rem; }
.prose .updated { color: var(--text-dim); font-size: .85rem; margin-bottom: 2.5rem; }
.prose .placeholder { color: var(--yellow-400); }
