/* ============================================
   STMG SUMMER APP — Design System
   Style: ludique, énergique, lycéen
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,700;9..144,900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Couleurs matières */
  --sgn:        #FF6B35;   /* orange chaud */
  --sgn-soft:   #FFE5D9;
  --mgt:        #8B5CF6;   /* violet */
  --mgt-soft:   #EDE4FF;
  --eco:        #10B981;   /* vert émeraude */
  --eco-soft:   #D1FAE5;
  --droit:      #3B82F6;   /* bleu */
  --droit-soft: #DBEAFE;

  /* Système */
  --bg:         #FAF7F2;   /* crème */
  --bg-card:    #FFFFFF;
  --ink:        #1A1A2E;
  --ink-soft:   #4B5563;
  --muted:      #9CA3AF;
  --line:       #EDEAE3;

  --good:       #22C55E;
  --warn:       #F59E0B;
  --fire:       #FB923C;

  /* Ombres */
  --shadow-sm: 0 2px 0 rgba(26,26,46,0.08);
  --shadow-md: 0 4px 0 rgba(26,26,46,0.10);
  --shadow-lg: 0 6px 0 rgba(26,26,46,0.12);
  --shadow-pop: 0 8px 24px rgba(26,26,46,0.12);

  /* Rayons */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;

  /* Typo */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
}

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

html, body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img, svg { display: block; max-width: 100%; }

/* ============================================
   LAYOUT
   ============================================ */
.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  padding-bottom: 80px;
}

/* ============================================
   TOP BAR
   ============================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding: 12px 20px;
  background: var(--bg-card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--sgn), var(--mgt));
  display: grid; place-items: center;
  color: white;
  font-family: var(--font-display);
  font-weight: 900;
}
.topbar-stats {
  display: flex; gap: 20px; align-items: center;
}
.stat-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}
.stat-pill .icon { font-size: 18px; }
.stat-streak {
  background: linear-gradient(135deg, #FFE4B5, #FFB347);
  color: #8B4513;
}
.stat-xp {
  background: linear-gradient(135deg, #E0F2FE, #BAE6FD);
  color: #075985;
}
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FCD34D, #F59E0B);
  display: grid; place-items: center;
  font-weight: 800;
  color: white;
  font-size: 14px;
}

/* ============================================
   HEADERS
   ============================================ */
.page-head {
  margin-bottom: 28px;
}
.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.page-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.025em;
}
.page-subtitle {
  color: var(--ink-soft);
  margin-top: 8px;
  font-size: 16px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.01em;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  user-select: none;
  text-transform: uppercase;
  font-size: 14px;
}
.btn:active { transform: translateY(2px); }
.btn-primary {
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: #2A2A45; }

.btn-success {
  background: var(--good);
  color: white;
  box-shadow: 0 4px 0 #16A34A;
}
.btn-success:hover { filter: brightness(1.05); }

.btn-ghost {
  background: var(--bg);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.btn-sgn   { background: var(--sgn);   color: white; box-shadow: 0 4px 0 #D9531E; }
.btn-mgt   { background: var(--mgt);   color: white; box-shadow: 0 4px 0 #6D3FCC; }
.btn-eco   { background: var(--eco);   color: white; box-shadow: 0 4px 0 #0E9F70; }
.btn-droit { background: var(--droit); color: white; box-shadow: 0 4px 0 #2566D8; }

/* ============================================
   BADGE / TAG
   ============================================ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.tag-sgn   { background: var(--sgn-soft);   color: #B8431F; }
.tag-mgt   { background: var(--mgt-soft);   color: #5B2DB0; }
.tag-eco   { background: var(--eco-soft);   color: #056F47; }
.tag-droit { background: var(--droit-soft); color: #1E4FBC; }

/* ============================================
   UTILITIES
   ============================================ */
.row { display: flex; gap: 16px; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.center { display: grid; place-items: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

@keyframes pop-in {
  0%   { transform: scale(0.9); opacity: 0; }
  60%  { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1); }
}
.pop-in { animation: pop-in 0.4s ease-out both; }

@keyframes fade-up {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.fade-up { animation: fade-up 0.5s ease-out both; }

/* ============================================
   DASHBOARD ADO — styles spécifiques
   ============================================ */
.hero {
  background: linear-gradient(135deg, #FF6B35 0%, #F59E0B 100%);
  border-radius: var(--r-xl);
  padding: 32px;
  color: white;
  position: relative;
  overflow: hidden;
  margin-bottom: 32px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.18) 0%, transparent 50%),
    radial-gradient(circle at 10% 90%, rgba(255,255,255,0.12) 0%, transparent 40%);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  position: relative;
}
.hero-eyebrow {
  font-size: 13px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 8px;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 4.5vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}
.hero-sub {
  font-size: 17px;
  opacity: 0.92;
  max-width: 520px;
}
.hero-cta { margin-top: 20px; display: inline-flex; }
.hero-cta .btn {
  background: white;
  color: var(--ink);
  box-shadow: 0 4px 0 rgba(0,0,0,0.25);
  text-decoration: none;
}

.mascot { width: 160px; height: 160px; flex-shrink: 0; }

.progress-card {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}
.day-card {
  background: var(--bg-card);
  border-radius: var(--r-md);
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.day-card:hover { transform: translateY(-2px); }
.day-card.today {
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow-md);
}
.day-card.today .day-status { color: rgba(255,255,255,0.7); }
.day-card.done {
  background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
}
.day-name {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: 6px;
}
.day-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 28px;
  line-height: 1;
  margin-bottom: 8px;
}
.day-subjects {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 8px;
  min-height: 12px;
}
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.dot-sgn   { background: var(--sgn); }
.dot-mgt   { background: var(--mgt); }
.dot-eco   { background: var(--eco); }
.dot-droit { background: var(--droit); }
.day-status {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
}
.checkmark {
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  background: var(--good);
  border-radius: 50%;
  display: grid; place-items: center;
  color: white; font-size: 13px;
  font-weight: 900;
}

.today-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}
@media (max-width: 880px) {
  .today-section { grid-template-columns: 1fr; }
}

.session-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.session-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.session-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
}
.session-time {
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 14px;
  margin-top: 4px;
}

.block-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.block {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: var(--bg);
  transition: transform 0.15s, background 0.15s;
}
.block:hover { transform: translateX(4px); }

.block-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 14px;
  color: white;
}
.block-icon-pause { background: var(--muted); color: white; font-size: 22px; }

.block-info h4 {
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 4px;
}
.block-info p {
  font-size: 13px;
  color: var(--ink-soft);
}
.block-action {
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

/* Side panel */
.side-stack { display: flex; flex-direction: column; gap: 16px; }

.streak-card {
  background: linear-gradient(135deg, #FFF7ED, #FED7AA);
  border-radius: var(--r-lg);
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.flame {
  font-size: 64px;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(251,146,60,0.4));
  margin-bottom: 8px;
}
.streak-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 48px;
  color: #C2410C;
  line-height: 1;
}
.streak-label {
  font-size: 13px;
  font-weight: 700;
  color: #9A3412;
  margin-top: 4px;
}

.badges-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.badges-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.badges-head h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
}
.badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.badge {
  aspect-ratio: 1;
  background: var(--bg);
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 26px;
  position: relative;
}
.badge.locked {
  opacity: 0.35;
  filter: grayscale(1);
}

/* Section heads + subjects progress */
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.subjects-progress { margin-bottom: 24px; }
.subj-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 720px) {
  .subj-grid { grid-template-columns: repeat(2, 1fr); }
}
.subj-card {
  background: var(--bg-card);
  border-radius: var(--r-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.subj-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}
.subj-card.sgn::before   { background: var(--sgn); }
.subj-card.mgt::before   { background: var(--mgt); }
.subj-card.eco::before   { background: var(--eco); }
.subj-card.droit::before { background: var(--droit); }

.subj-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 4px;
}
.subj-sub {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease-out;
}
.subj-card.sgn   .progress-fill { background: var(--sgn); }
.subj-card.mgt   .progress-fill { background: var(--mgt); }
.subj-card.eco   .progress-fill { background: var(--eco); }
.subj-card.droit .progress-fill { background: var(--droit); }

.subj-pct {
  display: flex; justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
}
.subj-pct .pct { color: var(--ink); }
.subj-pct .of  { color: var(--muted); }

/* Topbar logout link */
.logout-link {
  color: var(--ink-soft);
  font-size: 18px;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
}
.logout-link:hover { background: var(--bg); }

/* ============================================
   QUICK ACCESS BAR (dashboard ado)
   ============================================ */
.quick-access {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
@media (max-width: 880px) {
  .quick-access { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .quick-access { grid-template-columns: 1fr; }
}
.qa-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border-radius: var(--r-md);
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}
.qa-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.qa-emoji {
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.qa-text strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.qa-text span {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* ============================================
   BADGE ALERTES PARENT (Lot 6)
   ============================================ */
.parent-alerts-link {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}
.alert-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: #DC2626;
  color: white;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
  50%      { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}
