/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.5;
}

/* ===== HEADER ===== */
header {
    background: #0f172a;
    color: white;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-container {
    max-width: 1400px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.site-title a {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.menu-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
}
.main-nav {
    display: flex;
    align-items: center;
}
.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}
.nav-menu a {
    color: white;
    text-decoration: none;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.search-bar-desktop input {
    padding: 0.5rem;
    border-radius: 6px;
    border: none;
}
.user-links a {
    color: white;
    text-decoration: none;
    margin-left: 1rem;
}
.btn-signup {
    background: #f59e0b;
    padding: 0.4rem 1rem;
    border-radius: 30px;
}
.search-bar-mobile {
    display: none;
}

/* responsive header */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    .main-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        background: #0f172a;
        padding: 1rem;
    }
    .main-nav.active {
        display: flex;
    }
    .nav-menu {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    .search-bar-desktop {
        display: none;
    }
    .search-bar-mobile {
        display: block;
        margin-top: 1rem;
    }
    .search-bar-mobile input {
        padding: 0.5rem;
        width: 80%;
    }
    .header-actions .user-links {
        display: none;
    }
}

/* ===== MAIN ===== */
main {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
    text-align: center;
    padding: 4rem 2rem;
    border-radius: 32px;
    margin-bottom: 3rem;
}
.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.hero-search {
    display: flex;
    max-width: 500px;
    margin: auto;
    margin-top: 2rem;
}
.hero-search input {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 40px 0 0 40px;
}
.hero-search button {
    background: #f59e0b;
    border: none;
    padding: 0 1.5rem;
    border-radius: 0 40px 40px 0;
    cursor: pointer;
    font-weight: bold;
}

/* ===== CATEGORIES ===== */
.categories {
    margin-bottom: 3rem;
}
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.cat-card {
    background: white;
    padding: 1rem;
    text-align: center;
    border-radius: 16px;
    text-decoration: none;
    color: #1e293b;
    font-weight: bold;
    transition: transform 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.cat-card:hover {
    transform: translateY(-3px);
    background: #fef9c3;
}

/* ===== GRILLE ÉPREUVES ===== */
.epreuves-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}
.carte, .carte-epreuve {
    background: white;
    border-radius: 20px;
    padding: 1.2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
    position: relative;
}
.carte:hover, .carte-epreuve:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}
.badge-nouveau {
    background: #10b981;
    color: white;
}
.badge-premium {
    background: #f59e0b;
    color: white;
}
.badge.corrige {
    background: #3b82f6;
    color: white;
}
.meta {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0.5rem 0;
}
.btn, .btn-telecharger {
    display: inline-block;
    background: #0f172a;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 40px;
    text-decoration: none;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
}
.btn-telecharger {
    background: #3b82f6;
}
.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}
.btn-favori {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #ef4444;
}

/* ===== FILTRES ===== */
.filtres {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    background: white;
    padding: 1rem;
    border-radius: 40px;
}
.filtres select, .filtres button {
    padding: 0.5rem 1rem;
    border-radius: 40px;
    border: 1px solid #ddd;
}
.btn-filtrer {
    background: #0f172a;
    color: white;
}

/* ===== AUTH PAGES ===== */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}
.auth-container {
    background: white;
    padding: 2rem;
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px;
    text-align: center;
}
.auth-container input {
    width: 100%;
    padding: 0.75rem;
    margin: 0.5rem 0;
    border: 1px solid #ccc;
    border-radius: 40px;
}
.auth-container input[type="submit"] {
    background: #f59e0b;
    color: white;
    border: none;
    cursor: pointer;
}
.btn-register, .btn-compte {
    background: #0f172a;
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 40px;
    text-decoration: none;
    display: inline-block;
    margin-top: 1rem;
}

/* ===== DASHBOARD ===== */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}
.dashboard-card {
    background: white;
    padding: 1.5rem;
    border-radius: 20px;
    text-align: center;
}
.statut-gratuit {
    color: #f59e0b;
    font-weight: bold;
}
.btn-upgrade {
    background: #f59e0b;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 40px;
    text-decoration: none;
}

/* ===== PREMIUM ===== */
.offres {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 2rem 0;
}
.offre {
    background: white;
    border-radius: 24px;
    width: 280px;
    text-align: center;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.offre-header {
    background: #0f172a;
    color: white;
    padding: 1rem;
    font-size: 1.2rem;
}
.prix {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 1rem 0;
}
.offre ul {
    list-style: none;
    padding: 0;
    margin: 1rem;
}
.offre li {
    padding: 0.3rem;
}
.offre button {
    background: #f59e0b;
    border: none;
    padding: 0.7rem;
    width: 80%;
    margin-bottom: 1.5rem;
    border-radius: 40px;
    cursor: pointer;
    font-weight: bold;
}

/* ===== CTA PREMIUM ===== */
.cta-premium {
    background: #0f172a;
    color: white;
    text-align: center;
    padding: 3rem;
    border-radius: 40px;
    margin-top: 3rem;
}
.btn-premium {
    background: #f59e0b;
    color: #0f172a;
    padding: 0.8rem 2rem;
    border-radius: 40px;
    text-decoration: none;
    font-weight: bold;
}

/* ===== FOOTER ===== */
footer {
    background: #0f172a;
    color: white;
    margin-top: 4rem;
}
.footer-container {
    max-width: 1400px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding: 2rem;
}
.footer-col h4 {
    margin-bottom: 1rem;
}
.footer-col ul {
    list-style: none;
}
.footer-col a {
    color: white;
    text-decoration: none;
}
.socials a {
    margin-right: 1rem;
    font-size: 1.2rem;
}
.footer-bottom {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid #334155;
}

/* Bouton Premium descendu */
.cta-button-wrapper {
    margin-top: 2rem;
}
.btn-premium {
    display: inline-block;
    margin-top: 1rem;
}

/* Espacement bouton Passer Premium */
.button-wrapper {
    margin-top: 1.5rem;
}
.logout-wrapper {
    text-align: center;
    margin-top: 2rem;
}

/* Page Aide */
.aide-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}
.aide-card {
    background: white;
    padding: 1.5rem;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.aide-card i {
    font-size: 2rem;
    color: #f59e0b;
}