/* =========================================================
   DataGrade — interface élève (minimaliste, pensée fullscreen)
   ========================================================= */

body.eleve-app {
    background: var(--bg);
    overflow: visible;
    margin: 0;
    min-height: 100vh;
}
body.eleve-app .bg-decor { display: none; }

.eleve-topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 28px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}
.eleve-topbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 17px;
    margin-right: auto;
}
.eleve-topbar__brand .brand__mark { width: 28px; height: 28px; }
.eleve-topbar__who {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 24px;
    border-right: 1px solid var(--line);
}
.eleve-topbar__name {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink);
    font-size: 14.5px;
    line-height: 1.2;
}
.eleve-topbar__class {
    font-size: 12px;
    color: var(--ink-muted);
}

.eleve-topbar__clock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--violet-50);
    color: var(--violet-700);
    border: 1px solid var(--violet-100);
    border-radius: var(--r-full);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-right: 12px;
}
.eleve-topbar__clock-warn {
    color: var(--coral-500);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 11px;
    margin-left: 4px;
    padding: 2px 6px;
    background: var(--rose-50);
    border-radius: 4px;
}

.eleve-topbar__nav {
    display: flex;
    gap: 6px;
    align-items: center;
}
/* Liens nav stylés en « pills » (chips) — lisibles comme des boutons dès
   l'état par défaut, plus du simple texte. */
.eleve-topbar__nav a {
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-soft);
    text-decoration: none;
    transition: all .15s var(--ease-out);
    border: 1px solid transparent;
}
/* Chip subtil par défaut sur les liens principaux (sauf l'icône ⚙ et Quitter) */
.eleve-topbar__nav a:not(.eleve-topbar__logout):not(.eleve-topbar__icon) {
    background: var(--violet-50);
    border-color: var(--line);
}
.eleve-topbar__nav a:hover {
    background: var(--violet-100);
    color: var(--violet-700);
    border-color: var(--violet-200);
    transform: translateY(-1px);
}
.eleve-topbar__nav a.is-active {
    background: var(--violet-500);
    color: #fff;
    border-color: var(--violet-500);
    box-shadow: 0 2px 10px -2px rgba(124, 58, 237, .45);
}
.eleve-topbar__nav a.is-active:hover {
    background: var(--violet-600);
    color: #fff;
}
/* Bouton-icône (⚙) : compact, sans chip de fond, juste un hover discret */
.eleve-topbar__icon {
    font-size: 16px;
    line-height: 1;
    padding: 8px 12px !important;
}
.eleve-topbar__logout {
    color: var(--ink-muted) !important;
}
.eleve-topbar__logout:hover {
    background: var(--rose-50) !important;
    color: var(--coral-500) !important;
    border-color: var(--coral-400) !important;
}

.eleve-main {
    padding: 32px 28px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ---------- Layout 2 colonnes : contenu + side rules ---------- */

.eleve-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    align-items: start;
}
@media (max-width: 900px) {
    .eleve-grid { grid-template-columns: 1fr; }
}

.eleve-rules {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 24px;
    position: sticky;
    top: 88px;
}
.eleve-rules h3 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 15px;
    color: var(--ink);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.eleve-rules ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.eleve-rules li {
    display: flex;
    gap: 10px;
    font-size: 13.5px;
    color: var(--ink-soft);
    line-height: 1.5;
}
.eleve-rules .rule-icon {
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1;
}
.eleve-rules strong {
    color: var(--ink);
    font-weight: 600;
}

/* ---------- États (waiting, no results...) ---------- */

.eleve-state {
    text-align: center;
    padding: 48px 24px;
}
.eleve-state__img {
    max-width: 280px;
    width: 100%;
    height: auto;
    margin: 0 auto 20px;
    filter: drop-shadow(0 12px 24px rgba(124, 58, 237, 0.18));
    animation: float-y 5s ease-in-out infinite;
}
@keyframes float-y {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
.eleve-state__title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    color: var(--ink);
    margin-bottom: 8px;
}
.eleve-state__lead {
    color: var(--ink-soft);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.55;
}
.eleve-state__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: var(--violet-50);
    border: 1px solid var(--violet-100);
    color: var(--violet-700);
    border-radius: var(--r-full);
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 20px;
}
.eleve-state__badge .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--violet-500);
    animation: pulse-soft 1.6s ease-in-out infinite;
}
@keyframes pulse-soft {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.7); }
}

/* ---------- Liste résultats ---------- */

.result-card {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    text-decoration: none;
    color: inherit;
    margin-bottom: 12px;
    transition: all .2s;
}
.result-card:hover {
    border-color: var(--violet-200);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.result-card__score {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 28px;
    color: var(--violet-600);
    width: 84px;
    flex-shrink: 0;
    text-align: center;
}
.result-card__score small {
    font-size: 14px;
    color: var(--ink-muted);
    font-weight: 500;
}
.result-card__body {
    flex: 1;
    min-width: 0;
}
.result-card__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: var(--ink);
}
.result-card__meta {
    font-size: 13px;
    color: var(--ink-muted);
    margin-top: 2px;
}
.result-card__pending {
    color: var(--amber-500);
    font-weight: 600;
    font-size: 13.5px;
}

/* ============== Choix entre plusieurs quiz disponibles ============== */
.eleve-state__badge--ready { background: var(--emerald-50); color: #065F46; border-color: #34D399; }
.dot--ready { background: var(--emerald-500); }

.quiz-choices {
    list-style: none;
    padding: 0;
    margin: 22px 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.quiz-choice {
    background: white;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    transition: all .15s var(--ease-out);
}
.quiz-choice:hover {
    border-color: var(--violet-500);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px -8px rgba(124, 58, 237, .25);
}

/* 🛡️ Carte ÉVALUATION (anti-triche actif) : couleur vive rouge/rose +
   léger pulse pour signaler que c'est l'activité prioritaire. */
.quiz-choice--exam {
    border-color: #f43f5e;
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
    box-shadow: 0 4px 18px -6px rgba(244, 63, 94, .40);
    animation: examPulse 2.4s ease-in-out infinite;
}
.quiz-choice--exam:hover {
    border-color: #e11d48;
    box-shadow: 0 10px 28px -8px rgba(244, 63, 94, .55);
}
@keyframes examPulse {
    0%, 100% { box-shadow: 0 4px 18px -6px rgba(244, 63, 94, .40); }
    50%      { box-shadow: 0 4px 26px -4px rgba(244, 63, 94, .70); }
}
.quiz-choice__exam-flag {
    display: inline-block;
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: #fff;
    font-weight: 800;
    font-size: 11.5px;
    letter-spacing: 0.03em;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
    box-shadow: 0 2px 6px rgba(225, 29, 72, .35);
}
.quiz-choice--exam .quiz-choice__title { color: #9f1239; }
.quiz-choice--exam .quiz-choice__cta { color: #e11d48; }
@media (prefers-reduced-motion: reduce) {
    .quiz-choice--exam { animation: none; }
}
.quiz-choice__link {
    display: block;
    padding: 18px 22px;
    text-decoration: none;
    color: inherit;
    position: relative;
}
.quiz-choice__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    color: var(--ink);
    margin-bottom: 6px;
}
.quiz-choice__desc {
    font-size: 13.5px;
    color: var(--ink-soft);
    margin-bottom: 10px;
    line-height: 1.4;
}
.quiz-choice__meta {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    font-size: 12.5px; color: var(--ink-muted);
}
.quiz-choice__time, .quiz-choice__close {
    color: var(--ink-muted);
}
.quiz-choice__retake {
    color: #B45309;
    background: #FEF3C7;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
}
.quiz-choice__cta {
    margin-top: 10px;
    text-align: right;
    font-weight: 600;
    color: var(--violet-700);
    font-size: 13.5px;
    transition: transform .15s;
}
.quiz-choice:hover .quiz-choice__cta { transform: translateX(4px); }

@media (prefers-reduced-motion: reduce) {
    .eleve-state__img, .eleve-state__badge .dot { animation: none; }
}

/* ======================== Mobile (≤ 720px) ======================== */
@media (max-width: 720px) {
    .eleve-topbar {
        flex-wrap: wrap;
        gap: 10px 14px;
        padding: 10px 14px;
    }
    .eleve-topbar__brand { font-size: 15px; margin-right: auto; }
    .eleve-topbar__who {
        padding-right: 0;
        border-right: none;
        gap: 8px;
    }
    .eleve-topbar__class { display: none; } /* gain de place */
    .eleve-topbar__clock { font-size: 12px; padding: 5px 10px; margin-right: 0; }
    .eleve-topbar__nav {
        order: 99;        /* passe sous le reste */
        width: 100%;
        justify-content: flex-end;
    }
    .eleve-topbar__nav a {
        padding: 6px 10px;
        font-size: 13px;
    }

    .eleve-main { padding: 20px 14px; }
    .eleve-grid { grid-template-columns: 1fr; gap: 18px; }

    .eleve-state {
        padding: 24px 18px;
    }
    .eleve-state__img { max-width: 180px; }
    .eleve-state__title { font-size: 22px; }
    .eleve-rules ul li { font-size: 13.5px; }
}
