/***************************************************
 * LAYOUT QCM
 **************************************************/
 /* =========================
   THEME VARIABLES
========================= */

:root {
  --qcm-bg: #f6f7fb;
  --qcm-card-bg: #ffffff;
  --qcm-text: #1f2937;      /* TEXTE NOIR */
  --qcm-text-muted: #6b7280;
  --qcm-border: #e5e7eb;
  --qcm-accent: #6366f1;
}

body.dark,
html.dark {
  --qcm-bg: #0f172a;
  --qcm-card-bg: #111827;
  --qcm-text: #f9fafb;      /* TEXTE BLANC */
  --qcm-text-muted: #9ca3af;
  --qcm-border: #1f2937;
  --qcm-accent: #818cf8;
}

.qcm-site-title {
    margin-top: 18px;
    margin-bottom: 4px;
    font-size: 26px;
}
.qcm-site-subtitle {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 14px;
    opacity: 0.8;
}

/* Bannière */
.qcm-banner {
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}
body.qcm-dark .qcm-banner {
    background: rgba(76,29,149,0.85);
    border: 1px solid rgba(251,191,36,0.8);
}
body.qcm-light .qcm-banner {
    background: #e0ecff;
    border: 1px solid #3b82f6;
}

/* Progress + timer top row */
.qcm-progress-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    position: relative;
}

.qcm-progress-bar {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148,163,184,0.4);
}

.qcm-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #22c55e, #eab308, #f97316);
    transition: width 0.3s ease-out;
}

.qcm-progress-info {
    font-size: 12px;
    opacity: 0.85;
}

/***************************************************
 * TIMER CIRCULAIRE
 **************************************************/
.qcm-timer-circle {
    width: 70px;
    height: 70px;
    position: relative;
}

.qcm-timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.qcm-timer-bg {
    fill: none;
    stroke: rgba(148,163,184,0.4);
    stroke-width: 6;
}

.qcm-timer-progress {
    fill: none;
    stroke: var(--qcm-accent);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 163; /* 2πr ~ 2 * PI * 26 */
    stroke-dashoffset: 163;
    transition: stroke 0.3s;
}

.qcm-timer-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

/***************************************************
 * CARD PRINCIPALE
 **************************************************/
.qcm-card {
    border-radius: 18px;
    padding: 20px 18px 18px;
    margin-bottom: 26px;
    box-shadow: 0 18px 45px rgba(15,23,42,0.4);
    border: 1px solid rgba(148,163,184,0.4);
}
body.qcm-dark .qcm-card {
    background: radial-gradient(circle at top left, rgba(148,163,253,0.2), #020617 55%);
}
body.qcm-light .qcm-card {
    background: #ffffff;
}

/***************************************************
 * ECRAN D'ACCUEIL
 **************************************************/
.qcm-welcome h2 {
    margin-top: 0;
    margin-bottom: 8px;
}
.qcm-welcome p {
    margin-top: 0;
    font-size: 14px;
    opacity: 0.9;
}

.qcm-mode-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.qcm-btn {
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.qcm-btn-primary {
    background: var(--qcm-accent);
    color: white;
}
.qcm-btn-primary:hover {
    filter: brightness(1.05);
}
.qcm-btn-secondary {
    background: transparent;
    border-color: rgba(148,163,184,0.7);
}
.qcm-btn-secondary:hover {
    background: rgba(148,163,184,0.15);
}

/***************************************************
 * QUESTIONS
 **************************************************/
.qcm-question-area {
    animation: qcm-slide-in 0.4s ease-out;
}

.qcm-question-title {
    margin-top: 0;
    margin-bottom: 14px;
    font-size: 18px;
}

.qcm-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.qcm-option {
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: 1px solid rgba(148,163,184,0.4);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.qcm-option input {
    transform: scale(1.15);
}

body.qcm-dark .qcm-option {
    background: rgba(15,23,42,0.9);
}
body.qcm-light .qcm-option {
    background: #f9fafb;
}

.qcm-option:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15,23,42,0.35);
}
.qcm-option {
    color: var(--qcm-text);
}

/* Etats sélection + correction */
.qcm-option-selected {
    border-color: var(--qcm-accent);
    box-shadow: 0 0 0 1px var(--qcm-accent-soft);
}

.qcm-option-correct {
    border-color: #22c55e;
    background: rgba(34,197,94,0.12);
    animation: qcm-pulse-green 0.45s ease;
}
.qcm-option-wrong {
    border-color: #ef4444;
    background: rgba(239,68,68,0.12);
    animation: qcm-pulse-red 0.45s ease;
}

/***************************************************
 * FOOTER QUESTION
 **************************************************/
.qcm-footer-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/***************************************************
 * RESULTATS
 **************************************************/
.qcm-results h2 {
    margin-top: 0;
}

.qcm-result-block {
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 10px;
    font-size: 14px;
}

.qcm-result-block.ok {
    border: 1px solid rgba(34,197,94,0.9);
    background: rgba(34,197,94,0.1);
}
.qcm-result-block.nok {
    border: 1px solid rgba(239,68,68,0.9);
    background: rgba(239,68,68,0.1);
}

.qcm-results-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}

/***************************************************
 * PANNEAU SCORES
 **************************************************/
.qcm-hidden {
    display: none !important;
}

.qcm-scores-panel {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 150;
}

.qcm-scores-card {
    max-width: 420px;
    width: 90%;
    border-radius: 18px;
    padding: 18px 16px 16px;
}
body.qcm-dark .qcm-scores-card {
    background: rgba(15,23,42,0.96);
    border: 1px solid rgba(148,163,184,0.6);
}
body.qcm-light .qcm-scores-card {
    background: #ffffff;
    border: 1px solid rgba(148,163,184,0.6);
}

.qcm-scores-card h2 {
    margin-top: 0;
    margin-bottom: 10px;
}
.qcm-scores-card ul {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
}

/***************************************************
 * CONFETTIS
 **************************************************/
.qcm-confetti {
    position: fixed;
    width: 8px;
    height: 14px;
    top: -20px;
    border-radius: 2px;
    z-index: 200;
    pointer-events: none;
    opacity: 0.9;
    animation-name: qcm-confetti-fall;
    animation-timing-function: linear;
}

/***************************************************
 * ANIMATIONS
 **************************************************/
@keyframes qcm-slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes qcm-pulse-green {
    0% { transform: scale(1); }
    50% { transform: scale(1.01); box-shadow: 0 0 0 6px rgba(34,197,94,0.25); }
    100% { transform: scale(1); box-shadow: none; }
}

@keyframes qcm-pulse-red {
    0% { transform: scale(1); }
    50% { transform: scale(1.01); box-shadow: 0 0 0 6px rgba(239,68,68,0.25); }
    100% { transform: scale(1); box-shadow: none; }
}

@keyframes qcm-confetti-fall {
    0% {
        transform: translate3d(0,0,0) rotateZ(0deg);
    }
    100% {
        transform: translate3d(0,110vh,0) rotateZ(360deg);
    }
}

/***************************************************
 * RESPONSIVE
 **************************************************/
@media (max-width: 640px) {
    .qcm-footer-row {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .qcm-timer-circle {
        width: 60px;
        height: 60px;
    }
}
/*************************************************************
 * LANDING PAGE CAMPUSQCM – STYLE PREMIUM
 *************************************************************/

.campus-landing h1,
.campus-landing h2,
.campus-landing h3 {
    margin: 0;
}

/* HERO */
.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr);
    gap: 28px;
    align-items: center;
    margin-top: 24px;
    margin-bottom: 32px;
}

@media (max-width: 850px) {
    .landing-hero {
        grid-template-columns: 1fr;
    }
}

.landing-eyebrow {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
    margin-bottom: 6px;
}

.campus-landing h1 {
    font-size: clamp(32px, 4vw, 40px);
    font-weight: 700;
    margin-bottom: 8px;
}

.landing-hero-subtitle {
    font-size: 15px;
    opacity: 0.85;
    max-width: 480px;
}

.landing-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

.landing-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    opacity: 0.8;
}

/* Boutons landing */
.landing-btn {
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.landing-btn-primary {
    background: #4f46e5;
    color: #ffffff;
}
.landing-btn-primary:hover {
    filter: brightness(1.08);
}

body.qcm-dark .landing-btn-ghost {
    background: transparent;
    color: #e2e8f0;
    border-color: rgba(148,163,184,0.7);
}
body.qcm-dark .landing-btn-ghost:hover {
    background: rgba(148,163,184,0.14);
}

body.qcm-light .landing-btn-ghost {
    background: transparent;
    color: #111827;
    border-color: rgba(148,163,184,0.7);
}
body.qcm-light .landing-btn-ghost:hover {
    background: rgba(148,163,184,0.12);
}

/* Panneau stats hero */
.landing-hero-panel {
    border-radius: 18px;
    padding: 18px;
}

body.qcm-dark .landing-hero-panel {
    background: rgba(15,23,42,0.85);
    border: 1px solid rgba(148,163,184,0.45);
}
body.qcm-light .landing-hero-panel {
    background: #ffffff;
    border: 1px solid #d1d5db;
}

.landing-stat-card {
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 14px;
}
body.qcm-dark .landing-stat-card {
    background: radial-gradient(circle at top left, #4f46e5 0, #020617 55%);
}
body.qcm-light .landing-stat-card {
    background: radial-gradient(circle at top left, #6366f1 0, #ffffff 55%);
}

.landing-stat-card .label {
    font-size: 12px;
    opacity: 0.8;
}
.landing-stat-card .value {
    font-size: 28px;
    font-weight: 700;
    margin: 4px 0;
}
.landing-stat-card .hint {
    font-size: 13px;
    opacity: 0.9;
}

.landing-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.mini-card {
    border-radius: 12px;
    padding: 10px 12px;
}
body.qcm-dark .mini-card {
    background: rgba(15,23,42,0.85);
    border: 1px solid rgba(148,163,184,0.4);
}
body.qcm-light .mini-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}
.mini-label {
    font-size: 12px;
    opacity: 0.75;
}
.mini-value {
    font-size: 18px;
    font-weight: 600;
}
.mini-hint {
    font-size: 12px;
    opacity: 0.85;
}

/* Bar mini progression */
.landing-progress-mini p {
    margin: 0 0 4px 0;
    font-size: 13px;
}
.landing-progress-mini .bar-track {
    height: 7px;
    border-radius: 999px;
    overflow: hidden;
}
body.qcm-dark .landing-progress-mini .bar-track {
    background: rgba(15,23,42,0.9);
}
body.qcm-light .landing-progress-mini .bar-track {
    background: rgba(209,213,219,0.9);
}
.landing-progress-mini .bar-fill {
    width: 68%;
    height: 100%;
    background: #22c55e;
}
.landing-progress-mini .small {
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.75;
}

/* Sections génériques */
.landing-section {
    margin: 30px 0;
}
.landing-section-header {
    margin-bottom: 18px;
}
.landing-section-header h2 {
    font-size: 22px;
    margin-bottom: 6px;
}
.landing-section-header p {
    font-size: 14px;
    opacity: 0.85;
}

/* Grille 3 colonnes */
.landing-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 16px;
}
@media (max-width: 900px) {
    .landing-grid-3 {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}
@media (max-width: 650px) {
    .landing-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Cartes */
.landing-card {
    border-radius: 14px;
    padding: 14px 14px 16px;
    font-size: 14px;
}
body.qcm-dark .landing-card {
    background: rgba(15,23,42,0.85);
    border: 1px solid rgba(148,163,184,0.4);
}
body.qcm-light .landing-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
}
.landing-card h3 {
    font-size: 16px;
    margin-bottom: 6px;
}
.landing-card p {
    margin: 0 0 8px 0;
}
.landing-card ul {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
}

/* Cartes clicables (QCM dispo) */
.landing-card-link {
    text-decoration: none;
    display: block;
    color: inherit;
    position: relative;
    overflow: hidden;
}
.landing-card-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(15,23,42,0.25);
    transition: 0.18s ease-out;
}

/* Cartes “en préparation” */
.landing-card-disabled {
    opacity: 0.7;
}

.pill {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    margin-top: 4px;
}
body.qcm-dark .pill {
    background: rgba(34,197,94,0.1);
    color: #bbf7d0;
}
body.qcm-light .pill {
    background: rgba(34,197,94,0.12);
    color: #166534;
}
.pill-soon {
    background: rgba(234,179,8,0.14) !important;
    color: #facc15 !important;
}

/* Steps “comment ça marche” */
.landing-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 16px;
}
@media (max-width: 900px) {
    .landing-steps {
        grid-template-columns: 1fr;
    }
}
.step {
    border-radius: 14px;
    padding: 14px 14px 16px;
}
body.qcm-dark .step {
    background: rgba(15,23,42,0.8);
    border: 1px solid rgba(148,163,184,0.4);
}
body.qcm-light .step {
    background: #ffffff;
    border: 1px solid #e5e7eb;
}
.step-number {
    display: inline-flex;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 13px;
    margin-bottom: 6px;
}
body.qcm-dark .step-number {
    background: #4f46e5;
    color: #ffffff;
}
body.qcm-light .step-number {
    background: #6366f1;
    color: #ffffff;
}
.step h3 {
    font-size: 15px;
    margin-bottom: 4px;
}
.step p {
    font-size: 14px;
    opacity: 0.9;
}

/* CTA final */
.landing-cta {
    margin-bottom: 40px;
}
.landing-cta-inner {
    border-radius: 16px;
    padding: 20px 18px;
    text-align: center;
}
body.qcm-dark .landing-cta-inner {
    background: radial-gradient(circle at top left, #4f46e5 0, #020617 56%);
}
body.qcm-light .landing-cta-inner {
    background: radial-gradient(circle at top left, #4f46e5 0, #eff6ff 65%);
}
.landing-cta-inner h2 {
    margin-bottom: 8px;
    font-size: 20px;
}
.landing-cta-inner p {
    max-width: 560px;
    margin: 0 auto 14px;
    font-size: 14px;
}
.campus-page {
    padding: 80px 0 40px;
}

.campus-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.campus-page h1 {
    font-size: 32px;
    margin-bottom: 12px;
}

.campus-page p {
    opacity: 0.85;
}
.qcm-catalog {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.qcm-catalog-header {
    margin-bottom: 32px;
}

.qcm-catalog-header h1 {
    font-size: 32px;
    margin-bottom: 6px;
}

.qcm-catalog-header p {
    opacity: 0.8;
}

.qcm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.qcm-card {
    display: block;
    padding: 22px;
    border-radius: 18px;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(
        135deg,
        rgba(99,102,241,0.18),
        rgba(15,23,42,0.85)
    );
    border: 1px solid rgba(148,163,184,0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.qcm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.35);
}

.qcm-card-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.qcm-card h3 {
    font-size: 18px;
    margin-bottom: 6px;
}

.qcm-card-desc {
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 14px;
}

.qcm-card-action {
    font-size: 13px;
    font-weight: 600;
    color: #a5b4fc;
}
.qcm-card-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.qcm-card-badge {
  margin-top: 10px;
  display: inline-block;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(234,179,8,0.15);
  color: #facc15;
}
/* =========================================
   CARTES "NOS QCM" (CATALOGUE)
========================================= */

.qcm-catalog .qcm-card {
    display: block;
    padding: 22px;
    border-radius: 18px;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(
        135deg,
        rgba(99,102,241,0.18),
        rgba(15,23,42,0.85)
    );
    border: 1px solid rgba(148,163,184,0.25);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.qcm-catalog .qcm-card:hover:not(.qcm-card-disabled) {
    transform: translateY(-6px);
    box-shadow: 0 22px 45px rgba(0,0,0,0.45);
}

/* Icône */
.qcm-catalog .qcm-card-icon {
    font-size: 34px;
    margin-bottom: 10px;
}

/* Titre */
.qcm-catalog .qcm-card h3 {
    font-size: 18px;
    margin-bottom: 6px;
}

/* Description */
.qcm-catalog .qcm-card-desc {
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 14px;
}

/* Action */
.qcm-catalog .qcm-card-action {
    font-size: 13px;
    font-weight: 600;
    color: #a5b4fc;
}

/* Désactivé */
.qcm-catalog .qcm-card-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.3);
}

/* Badge */
.qcm-catalog .qcm-card-badge {
    margin-top: 10px;
    display: inline-block;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(234,179,8,0.15);
    color: #facc15;
}
/* =================================================
   QCM – SCOPE TOTAL (AUCUNE FUITE)
================================================= */

.qcm-app {
  --qcm-bg: #f6f7fb;
  --qcm-card-bg: #ffffff;
  --qcm-text: #1f2937;
  --qcm-text-muted: #6b7280;
  --qcm-border: #e5e7eb;
  --qcm-accent: #6366f1;
  --qcm-accent-soft: rgba(99,102,241,0.25);

  background: var(--qcm-bg);
  color: var(--qcm-text);
}

/* MODE DARK QCM */
.qcm-app.qcm-dark {
  --qcm-bg: #0f172a;
  --qcm-card-bg: #111827;
  --qcm-text: #f9fafb;
  --qcm-text-muted: #9ca3af;
  --qcm-border: #1f2937;
  --qcm-accent: #818cf8;
  --qcm-accent-soft: rgba(129,140,248,0.3);
}

/* =========================
   CARTES
========================= */
.qcm-app .qcm-card {
  background: var(--qcm-card-bg);
  border: 1px solid var(--qcm-border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.25);
}

/* =========================
   QUESTIONS
========================= */
.qcm-app .qcm-question-title {
  font-size: 18px;
  margin-bottom: 14px;
  color: var(--qcm-text);
}

.qcm-app .qcm-option {
  background: rgba(148,163,184,0.08);
  border: 1px solid var(--qcm-border);
  color: var(--qcm-text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.qcm-app .qcm-option:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.qcm-app .qcm-option-selected {
  border-color: var(--qcm-accent);
  box-shadow: 0 0 0 1px var(--qcm-accent-soft);
}

.qcm-app .qcm-option-correct {
  background: rgba(34,197,94,0.15);
  border-color: #22c55e;
}

.qcm-app .qcm-option-wrong {
  background: rgba(239,68,68,0.15);
  border-color: #ef4444;
}

/* =========================
   BOUTONS
========================= */
.qcm-app .qcm-btn-primary {
  background: var(--qcm-accent);
  color: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}
/* =========================================
   FIX TEXTE (LIGHT + DARK)
========================================= */

.qcm-app {
  color: var(--qcm-text);
}

.qcm-app .qcm-question-title,
.qcm-app .qcm-option,
.qcm-app label,
.qcm-app p,
.qcm-app span {
  color: var(--qcm-text);
}

.qcm-app .qcm-text-muted {
  color: var(--qcm-text-muted);
}
/* ============================
   FIX TEXTE QCM (SAFE)
============================ */

.qcm-app {
  color: var(--qcm-text);
}

.qcm-app h1,
.qcm-app h2,
.qcm-app h3,
.qcm-app p,
.qcm-app span,
.qcm-app label,
.qcm-app .qcm-question-title,
.qcm-app .qcm-option {
  color: var(--qcm-text);
}

.qcm-app .qcm-text-muted {
  color: var(--qcm-text-muted);
}
