@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Rajdhani:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

h1{
    background: url(../css/style.css);
}
:root {
    --bg:            #06060e;
    --bg-card:       #0a0a18;
    --bg-card-2:     #0f0f22;
    --bg-input:      #0c0c1e;
    --border:        #1a1a3a;
    --border-neon:   #6020c0;

    --text:          #e8e8ff;
    --text-muted:    #5a5a8a;
    --text-dim:      #9090c0;

    --purple:        #9b30ff;
    --purple-dark:   #5a10a0;
    --purple-light:  #cc88ff;
    --cyan:          #00ffea;
    --cyan-dark:     #00a090;
    --pink:          #ff2060;
    --yellow:        #ffe000;
    --green:         #00ff88;

    --danger:        #ff2060;
    --success:       #00ff88;

    --font:          'Rajdhani', 'Arial Narrow', sans-serif;
    --font-mono:     'Space Mono', monospace;
    --max-width:     1100px;
    --radius:        2px;
    --radius-lg:     4px;
}

html { scroll-behavior: smooth; }

body {
    cursor: url(pointeur.cur), crosshair;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 55% 45% at 15% 20%, rgba(155,48,255,.18) 0%, transparent 65%),
        radial-gradient(ellipse 45% 35% at 88% 8%,  rgba(0,255,234,.10) 0%, transparent 60%),
        radial-gradient(ellipse 35% 50% at 75% 85%, rgba(155,48,255,.12) 0%, transparent 65%),
        radial-gradient(ellipse 60% 30% at 5%  70%, rgba(255,32,96,.07)  0%, transparent 60%);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(155,48,255,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(155,48,255,.05) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.7) 10%, rgba(0,0,0,.7) 90%, transparent 100%);
}

header, footer, main, .container { position: relative; z-index: 1; }

a { color: var(--purple-light); text-decoration: none; transition: color .15s; }
a:hover { color: var(--cyan); }
img { max-width: 100%; display: block; }

/* ── Speed lines ── */
/* Les speed lines sont gérées en JS pour être vraiment aléatoires */

/* ── Layout ── */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
main.container { flex: 1; padding-top: 2.5rem; padding-bottom: 4rem; }

/* ── Header HUD ── */
.site-header {
    background: rgba(6,6,14,.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 200;
}
.site-header::after {
    content: '';
    display: block;
    height: 2px;
    background: linear-gradient(90deg, var(--purple) 0%, var(--cyan) 50%, var(--purple) 100%);
    background-size: 200% 100%;
    animation: scanbar 3s linear infinite;
}
@keyframes scanbar {
    0%   { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 58px;
    position: relative;
}
.header-inner::before, .header-inner::after {
    content: '';
    position: absolute;
    width: 8px; height: 8px;
    border-color: var(--purple);
    border-style: solid;
}
.header-inner::before { top: 8px; left: 0; border-width: 2px 0 0 2px; }
.header-inner::after  { bottom: 8px; right: 0; border-width: 0 2px 2px 0; }

.logo {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 5px;
    text-transform: uppercase;
    text-decoration: none;
    text-shadow: 0 0 10px rgba(0,255,234,.5);
    position: relative;
    padding: 2px 6px;
}
.logo::before, .logo::after {
    content: '';
    position: absolute;
    width: 5px; height: 5px;
    border-color: var(--cyan);
    border-style: solid;
    opacity: .7;
}
.logo::before { top: 0; left: 0; border-width: 1px 0 0 1px; }
.logo::after  { bottom: 0; right: 0; border-width: 0 1px 1px 0; }
.logo:hover { color: var(--cyan); animation: glitch-text .35s steps(3) forwards; }

.main-nav { display: flex; gap: 1.5rem; flex: 1; }
.main-nav a {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: .7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    transition: color .15s;
    position: relative;
    padding: 2px 0 2px 14px;
}
.main-nav a::before {
    content: '▶';
    font-size: .5rem;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cyan);
    opacity: 0;
    transition: opacity .15s;
}
.main-nav a:hover, .main-nav a.active { color: var(--cyan); text-shadow: 0 0 8px rgba(0,255,234,.5); }
.main-nav a:hover::before, .main-nav a.active::before { opacity: 1; }
.nav-admin { color: var(--purple-light) !important; }
.nav-admin:hover { color: var(--purple-light) !important; text-shadow: 0 0 8px rgba(155,48,255,.6) !important; }

.nav-auth { display: flex; align-items: center; gap: .75rem; }
.nav-user {
    font-size: .65rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--font-mono);
}
.nav-user::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    animation: ping 2s ease-in-out infinite;
}
@keyframes ping {
    0%,100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .3; transform: scale(.6); }
}

/* ── Badges ── */
.badge-role { font-size: .58rem; padding: 1px 6px; border-radius: 1px; text-transform: uppercase; letter-spacing: 1.5px; font-family: var(--font-mono); font-weight: 700; }
.badge-role.concepteur { background: rgba(155,48,255,.2); color: var(--purple-light); border: 1px solid var(--purple); box-shadow: 0 0 6px rgba(155,48,255,.3); }
.badge-role.evaluateur { background: rgba(0,255,234,.08); color: var(--cyan); border: 1px solid var(--cyan-dark); }

/* ── Footer ── */
.site-footer { background: var(--bg-card); border-top: 1px solid var(--border); padding: 1.5rem 0; }
.site-footer::before { content: ''; display: block; height: 2px; background: linear-gradient(90deg, transparent, var(--purple), var(--cyan), transparent); opacity: .5; margin-bottom: 1.5rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .7rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ── Glitch animations ── */
@keyframes glitch-text {
    0%   { text-shadow:  2px 0 var(--cyan),  -2px 0 var(--pink); transform: skewX(0deg); }
    25%  { text-shadow: -3px 0 var(--cyan),   3px 0 var(--pink); transform: skewX(-3deg); }
    50%  { text-shadow:  3px 0 var(--purple), -3px 0 var(--cyan); transform: skewX(2deg); }
    75%  { text-shadow: -2px 0 var(--pink),   2px 0 var(--purple); transform: skewX(-1deg); }
    100% { text-shadow: none; transform: skewX(0deg); }
}
@keyframes glitch-block {
    0%,95%,100% { clip-path: inset(0 0 100% 0); transform: translate(0); }
    96% { clip-path: inset(20% 0 40% 0); transform: translate(-3px, 0); }
    97% { clip-path: inset(50% 0 20% 0); transform: translate( 3px, 0); }
    98% { clip-path: inset(70% 0 5%  0); transform: translate(-2px, 0); }
    99% { clip-path: inset(0   0 0   0); transform: translate( 0,   0); }
}

.card-trace:hover h3, .btn:hover, .comp-card:hover h3 { animation: glitch-text .3s steps(3) forwards; }

/* ── Boutons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1.4rem;
    font-size: .9rem;
    font-family: var(--font);
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all .15s;
    position: relative;
    clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--purple), var(--purple-dark)); color: #fff; border: none; box-shadow: 0 0 20px rgba(155,48,255,.4); }
.btn-primary:hover { background: linear-gradient(135deg, var(--purple-light), var(--purple)); box-shadow: 0 0 30px rgba(204,136,255,.5); color: #fff; transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--text-dim); border: 1px solid var(--border-neon); }
.btn-secondary:hover { border-color: var(--purple-light); color: var(--text); background: rgba(155,48,255,.1); }
.btn-cyan { background: transparent; color: var(--cyan); border: 1px solid var(--cyan-dark); }
.btn-cyan:hover { background: rgba(0,255,234,.08); box-shadow: 0 0 16px rgba(0,255,234,.25); color: var(--cyan); }
.btn-danger { background: transparent; color: var(--pink); border: 1px solid rgba(255,32,96,.4); }
.btn-danger:hover { background: rgba(255,32,96,.1); box-shadow: 0 0 12px rgba(255,32,96,.3); }
.btn-sm { padding: .25rem .75rem; font-size: .72rem; clip-path: polygon(4px 0%, 100% 0%, calc(100% - 4px) 100%, 0% 100%); }

/* ── Formulaires ── */
.form-group { margin-bottom: 1.25rem; }
label { display: block; margin-bottom: .4rem; font-size: .65rem; color: var(--cyan); text-transform: uppercase; letter-spacing: 2px; font-family: var(--font-mono); }
input[type="text"], input[type="email"], input[type="password"], select, textarea {
    width: 100%; background: var(--bg-input); border: 1px solid var(--border); border-left: 2px solid var(--border-neon);
    color: var(--text); font-family: var(--font-mono); font-size: .88rem; padding: .6rem 1rem; transition: border-color .15s, box-shadow .15s; border-radius: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple); border-left-color: var(--cyan); box-shadow: 0 0 0 2px rgba(155,48,255,.15), -3px 0 0 var(--cyan); }
textarea { resize: vertical; min-height: 130px; }
select option { background: var(--bg-card); }

/* ── Alertes ── */
.alert { padding: .8rem 1rem; margin-bottom: 1rem; font-size: .78rem; font-family: var(--font-mono); border-left: 3px solid; clip-path: polygon(4px 0%, 100% 0%, calc(100% - 4px) 100%, 0% 100%); }
.alert-error   { background: rgba(255,32,96,.08);  border-color: var(--pink);  color: #ff80a0; }
.alert-success { background: rgba(0,255,136,.08);  border-color: var(--green); color: #60ffb0; }
.alert-info    { background: rgba(0,255,234,.08);  border-color: var(--cyan);  color: var(--cyan); }

/* ── Cards ── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-top: 2px solid var(--border-neon); padding: 1.75rem; position: relative; }
.card::after { content: ''; position: absolute; bottom: 0; right: 0; border-style: solid; border-width: 0 0 12px 12px; border-color: transparent transparent var(--bg) var(--bg); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.25rem; }

.card-trace {
    background: var(--bg-card); border: 1px solid var(--border); border-top: 2px solid transparent;
    padding: 1.25rem; transition: all .2s; position: relative; overflow: hidden;
}
.card-trace::before { content: ''; position: absolute; top: 0; left: 0; right: 100%; height: 2px; background: linear-gradient(90deg, var(--yellow), var(--purple), var(--cyan)); transition: right .3s ease; }
.card-trace::after  { content: ''; position: absolute; bottom: 0; right: 0; border-style: solid; border-width: 0 0 10px 10px; border-color: transparent transparent var(--bg) var(--bg); transition: border-color .2s; }
.card-trace:hover { border-color: var(--border-neon); background: var(--bg-card-2); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(155,48,255,.18); }
.card-trace:hover::before { right: 0; }
.card-trace:hover::after  { border-color: transparent transparent var(--bg-card-2) var(--bg-card-2); }
.card-trace h3 { font-size: 1rem; margin-bottom: .6rem; font-weight: 700; letter-spacing: .5px; }
.card-trace h3 a { color: var(--text); }
.card-trace h3 a:hover { color: var(--purple-light); }

/* ── Tags ── */
.tag { display: inline-block; font-size: .62rem; padding: 1px 8px; font-weight: 700; letter-spacing: 1px; margin-right: .3rem; margin-bottom: .25rem; font-family: var(--font-mono); clip-path: polygon(3px 0%, 100% 0%, calc(100% - 3px) 100%, 0% 100%); }
.tag-competence { background: rgba(155,48,255,.2); color: var(--purple-light); border: 1px solid rgba(155,48,255,.5); text-shadow: 0 0 6px rgba(204,136,255,.4); }
.tag-type       { background: rgba(255,255,255,.04); color: var(--text-muted); border: 1px solid var(--border); }
.tag-ac         { background: rgba(0,255,234,.1); color: var(--cyan); border: 1px solid rgba(0,255,234,.35); text-shadow: 0 0 6px rgba(0,255,234,.35); }

/* ── Titres ── */
.page-title { margin-bottom: 2rem; }
.page-title h1 { font-family: var(--font); font-size: 2.2rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: .3rem; line-height: 1.1; }
.page-title h1 span { color: var(--purple-light); }
.page-title p { color: var(--text-muted); font-size: .85rem; font-family: var(--font-mono); }

.section-title { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 3px; color: var(--cyan); font-family: var(--font-mono); text-shadow: 0 0 8px rgba(0,255,234,.3); }
.section-title::before { content: '//'; color: var(--purple); opacity: .8; }
.section-title::after  { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-neon), transparent); }

/* ── Filtres ── */
.filters { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.75rem; align-items: center; }
.filters select { width: auto; padding: .35rem .8rem; font-size: .72rem; border-radius: 0; }

/* ── Table admin ── */
.table-admin { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table-admin th { text-align: left; padding: .7rem 1rem; background: rgba(155,48,255,.08); color: var(--cyan); font-weight: 700; font-size: .65rem; text-transform: uppercase; letter-spacing: 2px; border-bottom: 1px solid var(--border-neon); font-family: var(--font-mono); }
.table-admin td { padding: .7rem 1rem; border-bottom: 1px solid rgba(26,26,58,.8); vertical-align: middle; }
.table-admin tr:last-child td { border-bottom: none; }
.table-admin tr:hover td { background: rgba(155,48,255,.06); }

/* ── Form centré ── */
.form-centered { max-width: 460px; margin: 3rem auto; }
.form-centered .card { padding: 2.25rem; }
.form-centered h1 { font-size: 1.8rem; margin-bottom: 1.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; }

/* ── Hero ── */
.hero { padding: 5rem 0 3.5rem; position: relative; }

.hero-eyebrow { font-family: var(--font-mono); font-size: .65rem; color: var(--cyan); text-transform: uppercase; letter-spacing: 4px; margin-bottom: 1.5rem; display: flex; align-items: center; gap: .75rem; text-shadow: 0 0 8px rgba(0,255,234,.4); }
.hero-eyebrow::before { content: ''; width: 24px; height: 2px; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }

.hero h1 { font-family: var(--font); font-size: clamp(2.8rem, 6vw, 4.5rem); font-weight: 700; line-height: 1.0; margin-bottom: 1.25rem; letter-spacing: 2px; text-transform: uppercase; }

.glitch { position: relative; color: var(--purple-light); display: inline-block; text-shadow: 0 0 20px rgba(204,136,255,.35); }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; font: inherit; opacity: 0; }
.glitch::before { color: var(--cyan); animation: glitch-block 4s infinite .1s; }
.glitch::after  { color: var(--pink); animation: glitch-block 4s infinite .25s; }

.hero p { font-size: .95rem; color: var(--text-muted); max-width: 500px; margin-bottom: 2rem; line-height: 1.8; font-family: var(--font-mono); }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-stats { display: flex; gap: 0; margin-top: 3rem; border: 1px solid var(--border); border-top: 2px solid var(--border-neon); overflow: hidden; }
.hero-stat { flex: 1; padding: 1.1rem 1.5rem; border-right: 1px solid var(--border); position: relative; }
.hero-stat:last-child { border-right: none; }
.hero-stat-num { font-size: 1.8rem; font-weight: 700; font-family: var(--font-mono); color: var(--purple-light); line-height: 1; text-shadow: 0 0 12px rgba(204,136,255,.3); }
.hero-stat-label { font-size: .6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; margin-top: .3rem; font-family: var(--font-mono); }

/* ── Compétences ── */
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.comp-card { background: var(--bg-card); border: 1px solid var(--border); border-top: 2px solid transparent; padding: 1.25rem; cursor: pointer; transition: all .2s; text-decoration: none; display: block; position: relative; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); }
.comp-card:hover, .comp-card.active { border-color: var(--border-neon); border-top-color: var(--cyan); background: var(--bg-card-2); text-decoration: none; box-shadow: 0 4px 20px rgba(155,48,255,.15); }
.comp-card.active { border-top-color: var(--purple-light); box-shadow: 0 0 20px rgba(155,48,255,.2); }
.comp-card .comp-num { font-size: .6rem; color: var(--cyan); font-weight: 700; letter-spacing: 2px; text-transform: uppercase; font-family: var(--font-mono); margin-bottom: .5rem; text-shadow: 0 0 6px rgba(0,255,234,.3); }
.comp-card h3 { font-size: 1rem; color: var(--text); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.comp-card .comp-count { margin-top: .5rem; font-size: .62rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ── Détail trace ── */
.trace-detail-header { margin-bottom: 1.75rem; padding-bottom: 1.75rem; border-bottom: 1px solid var(--border); }
.trace-detail-header h1 { font-size: 1.8rem; margin-bottom: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.trace-meta { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.trace-argumentaire { background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--purple); padding: 1.75rem; margin-bottom: 1.75rem; line-height: 1.8; color: var(--text-dim); font-family: var(--font-mono); font-size: .88rem; box-shadow: -4px 0 16px rgba(155,48,255,.1); }

/* ── Commentaires ── */
.comments-section { margin-top: 2.5rem; }
.comments-section h2 { font-size: .65rem; margin-bottom: 1.25rem; color: var(--cyan); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 3px; text-shadow: 0 0 6px rgba(0,255,234,.3); }
.comment { background: var(--bg-card); border: 1px solid var(--border); border-left: 2px solid var(--border-neon); padding: 1rem 1.25rem; margin-bottom: .75rem; }
.comment-meta { font-size: .7rem; color: var(--text-muted); margin-bottom: .4rem; font-family: var(--font-mono); display: flex; align-items: center; gap: .5rem; }

/* ── Stats dashboard ── */
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-top: 2px solid var(--border-neon); padding: 1.5rem; text-align: center; position: relative; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px)); }
.stat-num { font-size: 2.4rem; font-weight: 700; font-family: var(--font-mono); color: var(--purple-light); line-height: 1; margin-bottom: .3rem; text-shadow: 0 0 14px rgba(204,136,255,.3); }
.stat-label { font-size: .6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; font-family: var(--font-mono); }

/* ── Divers ── */
.back-link { display: inline-flex; align-items: center; gap: .4rem; font-size: .7rem; color: var(--text-muted); margin-bottom: 1.25rem; font-family: var(--font-mono); transition: color .15s; letter-spacing: 1px; text-transform: uppercase; }
.back-link::before { content: '◀'; font-size: .5rem; }
.back-link:hover { color: var(--cyan); text-shadow: 0 0 6px rgba(0,255,234,.4); }

.glow-line { height: 1px; background: linear-gradient(90deg, transparent, var(--purple), var(--cyan), transparent); border: none; margin: 2.5rem 0; opacity: .35; }

@media (max-width: 768px) { .main-nav { display: none; } .hero h1 { font-size: 2.2rem; } .comp-grid { grid-template-columns: 1fr 1fr; } .hero-stats { flex-wrap: wrap; } .hero-stat { flex: 0 0 50%; } }
@media (max-width: 480px) { .comp-grid { grid-template-columns: 1fr; } .card-grid { grid-template-columns: 1fr; } .hero-stat { flex: 0 0 100%; } }
