@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700;900&family=DM+Mono:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: #f5f2eb;
    color: #1e1b16;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ── Topbar ── */
.topbar {
    background: #111211;
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: 0.5rem;
}
.logo-icon {
    background: #7c3aed;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: monospace;
    font-size: 15px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -2px;
    flex-shrink: 0;
}
.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.logo-passe  { font-size: 8px;  font-weight: 700; letter-spacing: 0.2em;  color: #666; text-transform: uppercase; }
.logo-hack   { font-size: 16px; font-weight: 900; color: #fff; text-transform: uppercase; letter-spacing: -0.01em; line-height: 1; }
.logo-dabord { font-size: 10px; font-weight: 900; color: #7c3aed; text-transform: uppercase; letter-spacing: 0.04em; }

/* Nav links */
.nav-link {
    font-size: 11px;
    font-weight: 700;
    color: #555;
    padding: 5px 11px;
    border-radius: 20px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.15s;
}
.nav-link:hover { color: #999; }
.nav-link.active { color: #a78bfa; }

/* Boutons topbar */
.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.topbar-user {
    font-size: 11px;
    color: #444;
    font-family: 'DM Mono', monospace;
    margin-right: 4px;
}
.topbar-btn {
    font-size: 11px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.topbar-btn-outline {
    color: #666;
    background: transparent;
    border: 1px solid #333;
}
.topbar-btn-outline:hover { border-color: #7c3aed; color: #a78bfa; }
.topbar-btn-fill {
    background: #7c3aed;
    color: #fff;
    border: 1px solid transparent;
}
.topbar-btn-fill:hover { background: #6d28d9; }
.topbar-btn-outline.active { border-color: #7c3aed; color: #a78bfa; }

/* Déconnexion */
.topbar-btn-deco {
    color: #555;
    background: transparent;
    border: 1px solid #333;
}
.topbar-btn-deco:hover { border-color: #c23050; color: #c23050; }

/* ── Layout ── */
.pth-wrapper {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ── Titres ── */
h1 {
    font-size: 24px;
    font-weight: 900;
    color: #1e1b16;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}
h1 span { color: #7c3aed; }

h2 {
    font-size: 11px;
    font-weight: 700;
    color: #8c8478;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding-bottom: 8px;
    border-bottom: 1.5px solid #d9d3c7;
    margin: 1.75rem 0 1rem;
}
.page-sub {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: #b0a898;
    margin-bottom: 1.5rem;
}

/* ── Formulaires ── */
label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #8c8478;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
select,
textarea {
    width: 100%;
    background: #f2efe8;
    border: 1.5px solid #d9d3c7;
    border-radius: 8px;
    color: #1e1b16;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    padding: 9px 13px;
    outline: none;
    transition: border-color 0.18s, background 0.18s;
    appearance: none;
    -webkit-appearance: none;
    margin-bottom: 1rem;
}
input:focus, select:focus, textarea:focus {
    border-color: #7c3aed;
    background: #fff;
}
input::placeholder { color: #b0a898; }

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238c8478' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 34px;
    cursor: pointer;
}
select option { background: #fff; }

/* ── Boutons ── */
button, .btn {
    display: inline-block;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background 0.15s, opacity 0.15s;
}

button[type="submit"], .btn-primary {
    background: #7c3aed;
    color: #fff;
}
button[type="submit"]:hover, .btn-primary:hover { background: #6d28d9; }

.btn-secondary {
    background: #dde5f7;
    color: #2f5faa;
}
.btn-secondary:hover { background: #cdd8f4; }

.btn-success {
    background: #dff0e3;
    color: #3a8a4e;
}
.btn-success:hover { background: #cce5d2; }

.btn-danger {
    background: #fde0e4;
    color: #c23050;
    border: 1px solid #f5b0b8;
}
.btn-danger:hover { background: #f5c8cc; }

/* ── Alertes ── */
p[style*="color:red"] {
    background: #fde0e4 !important;
    color: #aa2840 !important;
    border: 1px solid #f5b0b8;
    border-radius: 9px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 1rem;
}
p[style*="color:green"] {
    background: #ede9ff !important;
    color: #5b21b6 !important;
    border: 1px solid #c4b5fd;
    border-radius: 9px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 1rem;
}

/* ── Bloc admin ── */
.admin-panel {
    background: #111211;
    border-radius: 10px;
    padding: 11px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.25rem;
    font-size: 11px;
    font-weight: 700;
    color: #a78bfa;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.admin-panel a {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    color: #a78bfa;
    letter-spacing: 0.08em;
}
.admin-panel a:hover { color: #c4b5fd; }

/* ── Cartes équipes ── */
.team-card {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid #d9d3c7;
    background: #fff;
    margin-bottom: 8px;
    transition: border-color 0.15s;
}
.team-card:hover { border-color: #7c3aed; }

.team-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #ede9ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}
.team-name {
    font-size: 13px;
    font-weight: 700;
    color: #1e1b16;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.team-meta { font-size: 11px; color: #b0a898; font-family: 'DM Mono', monospace; margin-top: 2px; }
.team-right { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Barre de progression membres */
.members-bar {
    height: 4px;
    background: #f2efe8;
    border-radius: 2px;
    width: 80px;
    overflow: hidden;
}
.members-bar-fill { height: 100%; background: #7c3aed; border-radius: 2px; }
.members-pill { font-family: 'DM Mono', monospace; font-size: 11px; color: #8c8478; }

/* ── Badges ── */
.badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.badge-bts    { background: #dde5f7; color: #2f5faa; }
.badge-lycee  { background: #ede9ff; color: #5b21b6; }

/* ── Tableau ── */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #d9d3c7;
    margin-bottom: 1.5rem;
}
thead th {
    font-size: 10px;
    font-weight: 700;
    color: #8c8478;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 9px 14px;
    border-bottom: 1.5px solid #d9d3c7;
    text-align: left;
    background: #f2efe8;
}
tbody td {
    padding: 10px 14px;
    color: #1e1b16;
    border-bottom: 1px solid #f5f2eb;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #faf9f6; }
tbody td a { font-size: 12px; font-weight: 700; color: #7c3aed; letter-spacing: 0.04em; text-transform: uppercase; }
tbody td a.danger { color: #c23050; }

/* ── Pages auth ── */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 60px);
    padding: 2rem;
    background: #111211;
}
.auth-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 14px;
    padding: 2.25rem 2.5rem;
    width: 100%;
    max-width: 400px;
}
.auth-card h1 { color: #fff; margin-bottom: 4px; }
.auth-card h1 span { color: #7c3aed; }
.auth-card .page-sub { color: #555; margin-bottom: 1.75rem; }
.auth-card label { color: #555; }
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
    background: #111;
    border-color: #2a2a2a;
    color: #fff;
}
.auth-card input:focus { border-color: #7c3aed; background: #0d0d0d; }
.auth-card input::placeholder { color: #444; }
.auth-card button[type="submit"] { width: 100%; margin-top: 4px; }
.auth-card p { color: #555; font-size: 13px; }
.auth-card a { color: #a78bfa; font-weight: 700; }
.auth-card .divider { border-color: #2a2a2a; }

/* ── Utilitaires ── */
.divider { border: none; border-top: 1px solid #d9d3c7; margin: 1.5rem 0; }
.text-muted { color: #8c8478; font-size: 13px; }
.mono { font-family: 'DM Mono', monospace; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .pth-wrapper { padding: 1.5rem 1.25rem; }
    h1 { font-size: 20px; }
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
    .team-card { flex-wrap: wrap; }
    .team-right { flex-direction: row; align-items: center; gap: 10px; width: 100%; justify-content: space-between; }
    input[type="text"], input[type="email"], input[type="password"],
    input[type="url"], select, textarea { font-size: 16px; }
}

@media (max-width: 600px) {
    .topbar { padding: 0 1rem; gap: 0.5rem; flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; }
    .topbar-user { display: none; }
    .topbar-btn { padding: 5px 10px; font-size: 10px; }
    .nav-link { padding: 4px 8px; font-size: 10px; }
    .pth-wrapper { padding: 1rem; }
    h1 { font-size: 17px; }
    h2 { font-size: 10px; }
    .auth-page { padding: 0; align-items: flex-start; }
    .auth-card { border-radius: 0; min-height: 100vh; padding: 2rem 1.25rem; }
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 12px; white-space: nowrap; }
    .team-card { flex-direction: column; align-items: flex-start; gap: 8px; }
    .team-right { flex-direction: row; width: 100%; justify-content: space-between; align-items: center; }
    .admin-panel { flex-wrap: wrap; gap: 8px; }
    .admin-panel a { margin-left: 0; }
    div[style*="grid-template-columns"] { display: block !important; }
}