@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-light: #EEF2FF;
  --secondary: #64748B;
  --success: #10B981;
  --success-light: #ECFDF5;
  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --bg: #F8FAFC;
  --card-bg: #FFFFFF;
  --border: #E2E8F0;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(79,70,229,0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navbar */
.navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary);
  text-decoration: none;
}
.navbar-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  flex: 1;
}
.container-narrow {
  max-width: 580px;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,70,229,0.25);
}
.btn-secondary {
  background: #fff;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover {
  background: #059669;
}
.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}
.btn-lg {
  padding: 0.9rem 1.6rem;
  font-size: 1.1rem;
  border-radius: var(--radius-md);
}
.btn-block {
  width: 100%;
}

/* Forms */
.form-group {
  margin-bottom: 1.15rem;
}
.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.35rem;
}
.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-main);
  background: #fff;
  transition: border-color 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-secondary { background: #F1F5F9; color: var(--text-muted); }

/* Alerts */
.alert {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
  font-weight: 500;
}
.alert-success { background: var(--success-light); border: 1px solid #A7F3D0; color: #065F46; }
.alert-warning { background: var(--warning-light); border: 1px solid #FDE68A; color: #92400E; }
.alert-danger { background: var(--danger-light); border: 1px solid #FECACA; color: #991B1B; }
.alert-info { background: var(--primary-light); border: 1px solid #C7D2FE; color: var(--primary-hover); }

/* Camera & Upload Area */
.camera-dropzone {
  border: 2px dashed #CBD5E1;
  background: #FAFBFD;
  border-radius: var(--radius-lg);
  padding: 2.2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.camera-dropzone:hover {
  border-color: var(--primary);
  background: #F5F7FF;
}
.camera-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  display: inline-block;
}
.thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.thumb-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(220,38,38,0.9);
  color: #fff;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb-blur-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(217, 119, 6, 0.95);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  pointer-events: none;
}
.pronote-tip-box {
  margin-top: 0.85rem;
  padding: 0.75rem 1rem;
  background: #F0FDF4;
  border: 1px dashed #86EFAC;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.86rem;
  color: #166534;
}
.pronote-tip-box .tip-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

/* Stepper élève 2 étapes */
.stepper-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}
.step-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #F1F5F9;
  color: #64748B;
  transition: all 0.2s ease;
}
.step-pill.active {
  background: #EEF2FF;
  color: #4F46E5;
}
.step-pill.done {
  background: #ECFDF5;
  color: #059669;
}
.step-pill .step-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #94A3B8;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
}
.step-pill.active .step-badge {
  background: #4F46E5;
}
.step-pill.done .step-badge {
  background: #059669;
}
.stepper-sep {
  width: 20px;
  height: 2px;
  background: #E2E8F0;
}

.pronote-upload-zone {
  border: 2px dashed #86EFAC;
  background: #F0FDF4;
  border-radius: 16px;
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #166534;
}
.pronote-upload-zone:hover {
  background: #DCFCE7;
  border-color: #4ADE80;
}
.pronote-preview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-top: 0.75rem;
}
.pronote-preview-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #86EFAC;
}
.step-summary-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}

/* Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  margin: 0.2rem 0;
}
.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Timeline Quiz Items */
.quiz-timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.quiz-timeline-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.quiz-score-pill {
  font-weight: 800;
  font-size: 1.1rem;
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  color: #fff;
}
.quiz-score-pill.good { background: #059669; }
.quiz-score-pill.medium { background: #D97706; }
.quiz-score-pill.low { background: #DC2626; }

/* Interactive Quiz Page */
.quiz-header {
  text-align: center;
  margin-bottom: 1.75rem;
}
.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: #E2E8F0;
  border-radius: 9999px;
  margin: 1rem 0;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}
.q-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}
.q-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.q-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  padding: 1rem 1.2rem;
  border: 2px solid var(--border);
  background: #fff;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}
.q-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: #F8FAFF;
}
.q-btn.correct {
  border-color: #059669 !important;
  background: #ECFDF5 !important;
  color: #065F46 !important;
}
.q-btn.wrong {
  border-color: #DC2626 !important;
  background: #FEF2F2 !important;
  color: #991B1B !important;
}
.q-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.q-explication-box {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  margin-top: 1rem;
  display: none;
}
.q-explication-box.ok {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
}
.q-explication-box.err {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}

/* Score Circle */
.score-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  margin: 1.5rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.score-circle.good { background: #059669; }
.score-circle.medium { background: #D97706; }
.score-circle.low { background: #DC2626; }
.score-circle .big { font-size: 2.2rem; line-height: 1; }
.score-circle .sub { font-size: 0.9rem; opacity: 0.95; }

/* Responsive adjustments */
@media (max-width: 640px) {
  .navbar { padding: 0.75rem 1rem; }
  .card { padding: 1.15rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .q-btn { padding: 0.85rem 1rem; font-size: 0.98rem; }
}
