:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --glass: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg);
  background-image: radial-gradient(circle at top right, rgba(99, 102, 241, 0.1), transparent),
                    radial-gradient(circle at bottom left, rgba(79, 70, 229, 0.05), transparent);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  overflow-x: hidden;
}

.container {
  max-width: 800px;
  width: 100%;
  z-index: 1;
}

header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeInDown 0.8s ease-out;
}

h1 {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* --- Menu d'accueil --- */
.welcome-screen {
  text-align: center;
}

.btn-start {
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
  margin-top: 2rem;
}

.btn-start:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.4);
}

/* --- QCM Interface --- */
.qcm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  margin-bottom: 2rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--primary), #a855f7);
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-text {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 2rem;
}

.choices-grid {
  display: grid;
  gap: 1rem;
}

.choice-btn {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 1.25rem;
  border-radius: 1rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.05rem;
  position: relative;
  overflow: hidden;
}

.choice-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--primary);
  transform: translateX(5px);
}

.choice-btn.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.choice-btn.correct {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.choice-btn.wrong {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.explanation-box {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-left: 4px solid var(--primary);
  border-radius: 0.5rem;
  animation: slideInUp 0.4s ease-out;
}

.navigation-btns {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
}

.btn-nav {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--glass-border);
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-nav:hover:not(:disabled) {
  background: var(--surface-hover);
}

.btn-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-submit {
  background: var(--primary);
  color: white;
  border: none;
}

/* --- Score Screen --- */
.results-screen {
  text-align: center;
}

.score-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 8px solid var(--surface);
  margin: 0 auto 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

.score-value {
  font-size: 2.5rem;
  font-weight: 800;
}

.score-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  border-radius: 1rem;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}

.theme-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.theme-option input {
  accent-color: var(--primary);
  width: 1.2rem;
  height: 1.2rem;
}

/* --- Animations --- */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 640px) {
  body { padding: 1rem; }
  h1 { font-size: 2rem; }
  .card { padding: 1.5rem; }
  .question-text { font-size: 1.2rem; }
}
