:root {
    color-scheme: light;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #202941;
    background: #f6f8fc;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    --color-primary: #354bd4;
    --color-primary-dark: #2839b4;
    --color-text: #202941;
    --color-muted: #65708a;
    --color-border: #e3e8f2;
    --color-surface: #ffffff;
    --color-background: #f6f8fc;
    --radius-card: 18px;
    --shadow-card: 0 8px 24px rgba(32, 41, 65, 0.06);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    margin: 0;
    line-height: 1.6;
    background: var(--color-background);
    color: var(--color-text);
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: var(--color-primary);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--color-primary-dark);
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
.button,
.bouton {
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

:focus-visible {
    outline: 3px solid rgba(53, 75, 212, 0.35);
    outline-offset: 3px;
}

.site-header {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem max(5%, calc((100% - 1120px) / 2));
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 2px 12px rgba(32, 41, 65, 0.025);
}

.logo {
    flex-shrink: 0;
    color: var(--color-text);
    font-weight: 850;
    font-size: 1.28rem;
    letter-spacing: -0.045em;
    text-decoration: none;
}

.logo:hover {
    color: var(--color-primary);
}

.site-header nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.15rem;
}

.site-header nav a {
    padding: 0.4rem 0.15rem;
    color: #47516a;
    font-size: 0.95rem;
    font-weight: 650;
    text-decoration: none;
}

.site-header nav a:hover {
    color: var(--color-primary);
}

.site-header form {
    margin: 0;
}

.site-header button,
.site-header form button {
    padding: 0.58rem 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: #fff;
    color: var(--color-text);
    font-weight: 700;
    cursor: pointer;
}

.site-header button:hover,
.site-header form button:hover {
    border-color: #c8d0e5;
    background: #f7f8ff;
}

.container {
    width: min(1120px, 100%);
    margin-inline: auto;
    padding: 2rem 1.25rem 4rem;
}

main > section + section {
    margin-top: 2.5rem;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(2rem, 6vw, 4.5rem);
    border: 1px solid #e0e5ff;
    border-radius: 28px;
    background: linear-gradient(125deg, #eef1ff 0%, #f8f9ff 55%, #fff 100%);
}

.hero::after {
    position: absolute;
    right: -65px;
    bottom: -110px;
    width: 300px;
    height: 300px;
    border: 42px solid rgba(89, 105, 224, 0.08);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero .eyebrow,
.eyebrow {
    margin: 0 0 0.75rem;
    color: var(--color-primary);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(2.3rem, 6vw, 4.25rem);
    line-height: 1.06;
    letter-spacing: -0.055em;
}

.hero p:not(.eyebrow) {
    max-width: 650px;
    margin: 1.1rem 0 0;
    color: #59647e;
    font-size: clamp(1rem, 2vw, 1.15rem);
}

h2 {
    margin: 0 0 1rem;
    font-size: clamp(1.45rem, 3vw, 1.9rem);
    line-height: 1.25;
    letter-spacing: -0.025em;
}

h3 {
    line-height: 1.3;
    letter-spacing: -0.015em;
}

.quiz-grid,
.category-grid,
.categories-grid,
.categorie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr));
    gap: 1.15rem;
}

.quiz-card,
.category-card,
.categorie-card {
    min-width: 0;
    overflow: hidden;
    padding: 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.quiz-card:hover,
.category-card:hover,
.categorie-card:hover {
    transform: translateY(-3px);
    border-color: #d3daf5;
    box-shadow: 0 14px 32px rgba(32, 41, 65, 0.09);
}

.quiz-card h2,
.quiz-card h3,
.category-card h2,
.category-card h3,
.categorie-card h2,
.categorie-card h3 {
    margin: 0.35rem 0 0.65rem;
    font-size: 1.2rem;
}

.quiz-card p,
.category-card p,
.categorie-card p {
    color: #59647b;
}

.quiz-meta,
.meta,
.quiz-card .quiz-meta {
    margin: 0 0 0.55rem;
    color: #5864c9;
    font-size: 0.84rem;
    font-weight: 750;
}

.chapter {
    color: var(--color-muted);
    font-size: 0.9rem;
}

.quiz-card img,
.category-card img,
.categorie-card img,
.quiz-image,
.category-image,
.categorie-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0 0 1rem;
    border-radius: 12px;
    background: #eef1f8;
    object-fit: cover;
}

.button,
.bouton,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 42px;
    padding: 0.7rem 1rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--color-primary);
    color: #fff;
    font-weight: 750;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.button:hover,
.bouton:hover,
button.button:hover {
    transform: translateY(-1px);
    background: var(--color-primary-dark);
    color: #fff;
    box-shadow: 0 6px 14px rgba(53, 75, 212, 0.2);
}

.button:active,
.bouton:active,
button:active {
    transform: translateY(0);
}

button:not(.site-header button) {
    font-weight: 700;
}

input,
select,
textarea {
    max-width: 100%;
    border: 1px solid #cfd6e5;
    border-radius: 10px;
    background: #fff;
    color: var(--color-text);
}

input,
select,
textarea {
    padding: 0.7rem 0.8rem;
}

label {
    color: #303b54;
    font-weight: 700;
}

.filtres,
.categories,
.form-card,
.panel,
.vide {
    padding: clamp(1rem, 3vw, 1.5rem);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: #fff;
    box-shadow: var(--shadow-card);
}

.filtres-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.filtres-grid label,
.categories label {
    display: block;
    margin-bottom: 0.45rem;
}

.filtres-grid select,
.categories select {
    width: 100%;
}

.site-footer {
    margin-top: 2rem;
    padding: 2rem 1.25rem;
    border-top: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-muted);
    text-align: center;
}

.site-footer p {
    margin: 0;
}
/* Menu du membre dans l'en-tête */
.header-user-menu {
    position: relative;
    margin-left: auto;
}

.header-user-menu summary {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    list-style: none;
    padding: 6px 10px;
    border-radius: 30px;
    transition: background 0.2s;
}

.header-user-menu summary::-webkit-details-marker {
    display: none;
}

.header-user-menu summary:hover,
.header-user-menu[open] summary {
    background: #f1f5f9;
}

.header-avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    background: #eef2ff;
    font-size: 1.45rem;
    font-weight: 700;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-user-pseudo {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.header-chevron {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-right: 1.8px solid #64748b;
    border-bottom: 1.8px solid #64748b;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
    margin: 0 3px 4px 2px;
}

.header-user-menu[open] .header-chevron {
    transform: rotate(225deg) translateY(-2px);
    margin-bottom: -4px;
}

.header-dropdown {
    position: absolute;
    z-index: 1000;
    top: calc(100% + 8px);
    right: 0;
    width: 210px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.header-dropdown a,
.header-dropdown button {
    display: block;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #334155;
    text-align: left;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
}

.header-dropdown a:hover,
.header-dropdown button:hover {
    background: #f1f5f9;
}

.header-dropdown form {
    margin: 4px 0 0;
    padding-top: 4px;
    border-top: 1px solid #e2e8f0;
}

.header-dropdown button {
    color: #dc2626;
}

@media (max-width: 700px) {
    .header-user-pseudo {
        display: none;
    }

    .header-user-menu summary {
        padding: 4px;
    }

    .header-dropdown {
        right: 0;
    }
    
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.7rem;
        padding: 1rem 1.1rem;
    }

    .site-header nav {
        width: 100%;
        gap: 0.35rem 0.9rem;
    }

    .container {
        padding: 1.25rem 1rem 3rem;
    }

    .hero {
        border-radius: 20px;
    }

    .hero::after {
        right: -150px;
        bottom: -160px;
    }
}
/* Identité visuelle du logo Quizenligne */

.site-header .logo {
    color: #253b70;
    font-size: 25px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.site-header .logo span {
    color: #4779e8;
}

.site-header .logo:hover {
    text-decoration: none;
}
.site-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.site-logo-image {
    display: block;
    width: 350px;
    height: auto;
    max-height: 180px;
    object-fit: contain;
}

@media (max-width: 600px) {
    .site-logo-image {
        width: 165px;
        max-height: 50px;
    }
}
@media (max-width: 420px) {
    .quiz-grid,
    .category-grid,
    .categories-grid,
    .categorie-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .quiz-card,
    .category-card,
    .categorie-card {
        padding: 1rem;
    }

    .button,
    .bouton {
        max-width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
