/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --html:   #e44d26;
  --css:    #264de4;
  --js:     #b8860b;
  --bg:     #f0f2f5;
  --card:   #ffffff;
  --text:   #1a1a2e;
  --muted:  #555;
  --border: #e0e0e0;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,.08);
  --ease:   .2s ease;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

/* ===== SITE HEADER (index) ===== */
.site-header {
  background: #1a1a2e;
  color: #fff;
  text-align: center;
  padding: 2.8rem 1rem 2.2rem;
}

.site-header h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
.subtitle { opacity: .6; font-size: .88rem; margin-top: .4rem; }

/* ===== PILLS / BADGES ===== */
.pill {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .65rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

.pill-done     { background: #d1fae5; color: #065f46; }
.pill-current  { background: #fef3c7; color: #92400e; }
.pill-upcoming { background: #f1f5f9; color: #64748b; }
.pill-exam     { background: #f3e8ff; color: #7c3aed; }

/* ===== INDEX PAGE ===== */
.index-main { max-width: 1100px; margin: 0 auto; padding: 2.5rem 1rem 3rem; }

.index-intro { text-align: center; margin-bottom: 2rem; }
.index-intro h2 { font-size: 1.5rem; margin-bottom: .5rem; }
.index-intro p  { color: var(--muted); margin-bottom: 1rem; }

.legend { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

/* ===== WEEK GRID ===== */
.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.2rem;
}

.week-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: .75rem;
  border-top: 4px solid transparent;
  transition: transform var(--ease), box-shadow var(--ease);
}

.week-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,.13); }
.week-card.status-upcoming { opacity: .7; }
.week-card.status-exam { opacity: .85; }
.week-card.status-exam:hover { transform: none; cursor: default; }

.html-border { border-top-color: var(--html); }
.css-border  { border-top-color: var(--css);  }
.js-border   { border-top-color: var(--js);   }
.exam-border { border-top-color: #9ca3af;     }

.card-header { display: flex; align-items: center; justify-content: space-between; }

.week-label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

.week-card h3 { font-size: 1.05rem; line-height: 1.3; }

.card-topics {
  list-style: none;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.card-topics li { font-size: .85rem; color: var(--muted); padding-left: 1rem; position: relative; }
.card-topics li::before { content: '▸'; position: absolute; left: 0; color: #ccc; }

.topic-tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .55rem;
  border-radius: 4px;
  align-self: flex-start;
}

.html-tag { background: #fde8e2; color: #c0392b; }
.css-tag  { background: #e3e8fd; color: #1a3399; }
.js-tag   { background: #fef9e3; color: #8a6300; }
.exam-tag { background: #f3e8ff; color: #7c3aed; }

/* ===== MODULE PAGE TOP BAR ===== */
.module-topbar {
  background: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem 1.5rem;
  flex-wrap: wrap;
  gap: .5rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}

.home-link {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-weight: 600;
  font-size: .88rem;
  transition: color var(--ease);
}

.home-link:hover { color: #fff; }

.week-selector { display: flex; align-items: center; gap: .5rem; font-size: .82rem; }
.week-selector label { color: rgba(255,255,255,.55); }

.week-selector select {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  padding: .3rem .6rem;
  font-size: .82rem;
  cursor: pointer;
}

.week-selector select option { background: #1a1a2e; }

/* ===== MODULE BANNER ===== */
.module-banner {
  padding: 2.2rem 1.8rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.banner-html { background: linear-gradient(135deg, #c0392b, #e44d26); }
.banner-css  { background: linear-gradient(135deg, #1a3399, #264de4); }
.banner-js   { background: linear-gradient(135deg, #8a6300, #d4ac0d); color: #1a1a2e; }
.banner-exam { background: linear-gradient(135deg, #4b5563, #6b7280); }

.banner-num { font-size: 4rem; font-weight: 900; opacity: .18; line-height: 1; flex-shrink: 0; }

.banner-info h1 { font-size: clamp(1.4rem, 3vw, 2rem); }
.banner-sub { font-size: .88rem; opacity: .75; margin-top: .25rem; }

/* ===== MODULE CONTENT ===== */
.module-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.content-section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-title {
  background: #f5f6f8;
  border-bottom: 1px solid var(--border);
  padding: .9rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #333;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.section-body {
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}

.section-body p, .section-body li { color: var(--muted); }
.section-body h4 { font-size: .98rem; color: #333; }

.section-body ul {
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.section-body ol {
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

/* ===== CODE BLOCKS ===== */
pre {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  font-size: .86rem;
  line-height: 1.75;
}

code {
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}

pre code .tok-comment { color: #7f8ea3; font-style: italic; }
pre code .tok-string  { color: #a6e3a1; }
pre code .tok-keyword { color: #f38ba8; font-weight: 600; }
pre code .tok-number  { color: #fab387; }
pre code .tok-built   { color: #89dceb; }
pre code .tok-tag     { color: #f38ba8; }
pre code .tok-attr    { color: #89b4fa; }
pre code .tok-punc    { color: #bac2de; }
pre code .tok-selector { color: #f9e2af; }
pre code .tok-prop    { color: #89b4fa; }
pre code .tok-value   { color: #a6e3a1; }

p code, li code {
  background: #ebebeb;
  color: #c0392b;
  padding: .1em .35em;
  border-radius: 4px;
  font-size: .87em;
}

/* ===== INFO BOX ===== */
.info-box {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  border-radius: 0 8px 8px 0;
  padding: .85rem 1.1rem;
  font-size: .9rem;
  color: #1e40af;
}

.warn-box {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  border-radius: 0 8px 8px 0;
  padding: .85rem 1.1rem;
  font-size: .9rem;
  color: #92400e;
}

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: .6rem .9rem; border: 1px solid var(--border); }
th { background: #f5f6f8; font-weight: 700; color: #333; }
tr:nth-child(even) td { background: #fafafa; }

/* ===== PREV / NEXT NAV ===== */
.week-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1rem 2.5rem;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: var(--card);
  border: 2px solid var(--border);
  color: var(--text);
  padding: .65rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  transition: background var(--ease), border-color var(--ease), transform var(--ease);
}

.nav-btn:hover { background: #1a1a2e; border-color: #1a1a2e; color: #fff; transform: translateY(-2px); }
.nav-btn.prev::before { content: '← '; }
.nav-btn.next::after  { content: ' →'; }
.nav-placeholder { flex: 1; }

/* ===== DEMO CARDS ===== */
.demo-card {
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.demo-card h4 { font-size: 1rem; color: #333; }
.demo-card p  { color: var(--muted); font-size: .9rem; }

.counter-display {
  font-size: 3.5rem;
  font-weight: 900;
  text-align: center;
  color: #264653;
  line-height: 1;
  padding: .4rem 0;
  transition: color var(--ease);
}

.counter-buttons { display: flex; gap: .6rem; justify-content: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .5rem 1.2rem;
  border: none;
  border-radius: 7px;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: opacity var(--ease), transform var(--ease);
}

.btn:hover { opacity: .85; transform: translateY(-1px); }
.btn-success { background: #52b788; color: #fff; }
.btn-danger  { background: #e76f51; color: #fff; }
.btn-neutral { background: #aaa;    color: #fff; }
.btn-primary { background: #1a1a2e; color: #fff; }

.form-row { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .7rem; }
.form-row label { font-weight: 600; font-size: .88rem; color: #333; }
.form-row input, .form-row select, .form-row textarea {
  padding: .45rem .7rem;
  border: 1.5px solid #ccc;
  border-radius: 6px;
  font-size: .95rem;
  max-width: 100%;
  font-family: inherit;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: #264de4;
}

.error-msg { color: #c0392b; font-size: .88rem; min-height: 1.2rem; }
.success-msg { color: #065f46; font-size: .88rem; min-height: 1.2rem; }

.imc-result { font-weight: 700; font-size: 1rem; min-height: 1.4rem; }

.list-input-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.list-input-row input { flex: 1; min-width: 160px; padding: .45rem .7rem; border: 1.5px solid #ccc; border-radius: 6px; font-size: .95rem; }
.list-input-row input:focus { outline: none; border-color: #264de4; }

.dynamic-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.dynamic-list li { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: .45rem .8rem; display: flex; align-items: center; justify-content: space-between; animation: slideIn .2s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

.remove-btn { background: none; border: none; cursor: pointer; color: #e76f51; font-size: .85rem; transition: color var(--ease); }
.remove-btn:hover { color: #c1440e; }

.theme-buttons { display: flex; gap: .6rem; flex-wrap: wrap; }
.theme-btn {
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: 3px solid transparent; cursor: pointer;
  transition: transform var(--ease), border-color var(--ease);
}
.theme-btn:hover, .theme-btn.active { transform: scale(1.15); border-color: rgba(0,0,0,.3); }

.fetch-output {
  background: #1e1e2e; color: #cdd6f4; border-radius: 8px;
  padding: 1rem; font-family: 'Cascadia Code', Consolas, monospace;
  font-size: .82rem; line-height: 1.6; min-height: 60px; overflow-x: auto;
}

/* Démo fetch semaine 13 — cartes */
.fetch-status {
  font-size: 0.9rem;
  color: var(--muted, #5c6370);
  min-height: 1.35rem;
  margin: 0.5rem 0 0.75rem;
}
.fetch-cards-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
@media (min-width: 640px) {
  .fetch-cards-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
.fetch-post-card {
  background: #f8f9fb;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.fetch-post-title {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
}
.fetch-post-body {
  margin: 0;
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.45;
}

/* ===== EXAM PAGE ===== */
.exam-card {
  background: #f8f9fb;
  border: 2px dashed #9ca3af;
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.exam-icon { font-size: 3.5rem; }
.exam-card h3 { font-size: 1.3rem; }
.exam-card p  { color: var(--muted); max-width: 480px; }

/* ===== FOOTER ===== */
.site-footer {
  background: #1a1a2e;
  color: rgba(255,255,255,.45);
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: .82rem;
  margin-top: 1rem;
}

/* ===== RELÂCHE CARD (unnumbered, non-clickable) ===== */
.relache-card { cursor: default; }
.relache-card:hover { transform: none; box-shadow: var(--shadow); }

/* ===== EVAL BADGES ON WEEK CARDS ===== */
.card-evals { display: flex; gap: .35rem; flex-wrap: wrap; }
.eval-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 4px;
  white-space: nowrap;
}
.eval-quiz { background: #fef3c7; color: #92400e; }
.eval-tp   { background: #dbeafe; color: #1d4ed8; }
.eval-exam { background: #fce7f3; color: #9d174d; }

/* ===== EVALUATION CALENDAR ===== */
.eval-section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.8rem 2rem;
  margin-top: 2.5rem;
}

.eval-section h2 { font-size: 1.3rem; margin-bottom: 1.2rem; color: #1a1a2e; }
.eval-table-wrap { overflow-x: auto; }

.eval-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.eval-table th {
  background: #f5f6f8;
  padding: .65rem 1.1rem;
  text-align: left;
  font-weight: 700;
  color: #333;
  border-bottom: 2px solid var(--border);
}
.eval-table td { padding: .7rem 1.1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.eval-table tr:last-child td { border-bottom: none; }

.eval-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: .55rem;
  vertical-align: middle;
  flex-shrink: 0;
}
.eval-dot-quiz { background: #f59e0b; }
.eval-dot-tp   { background: #3b82f6; }
.eval-dot-exam { background: #ec4899; }

.eval-pct { font-weight: 700; color: #1a1a2e; }
.eval-total-row td { font-weight: 700; background: #f5f6f8; padding: .8rem 1.1rem; }

/* ===== QUIZ ===== */
.quiz-question {
  margin-bottom: 1.3rem;
  padding-bottom: 1.3rem;
  border-bottom: 1px solid var(--border);
}
.quiz-question:last-of-type { border-bottom: none; margin-bottom: .5rem; }
.q-text { font-weight: 600; color: #333; margin-bottom: .6rem; font-size: .95rem; }
.quiz-options { display: flex; flex-direction: column; gap: .4rem; }
.quiz-opt {
  text-align: left;
  background: #f8f9fa;
  border: 1.5px solid #ddd;
  border-radius: 7px;
  padding: .5rem .9rem;
  font-size: .88rem;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease);
  font-family: inherit;
  line-height: 1.4;
}
.quiz-opt:hover   { background: #eef2ff; border-color: #264de4; }
.quiz-opt.selected { background: #eef2ff; border-color: #264de4; }
.quiz-opt.correct  { background: #d1fae5; border-color: #059669; color: #065f46; }
.quiz-opt.wrong    { background: #fee2e2; border-color: #dc2626; color: #991b1b; }
.quiz-opt:disabled { cursor: not-allowed; opacity: .95; }
.quiz-feedback { font-size: .85rem; margin-top: .4rem; min-height: 1.1rem; }
.quiz-correct { color: #065f46; font-weight: 600; }
.quiz-wrong   { color: #991b1b; font-weight: 600; }
.quiz-warn    { color: #92400e; }
.quiz-result {
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  padding: .85rem 1rem;
  border-radius: 8px;
  margin-top: .5rem;
}
.quiz-perfect { background: #d1fae5; color: #065f46; }
.quiz-good    { background: #fef3c7; color: #92400e; }
.quiz-poor    { background: #fee2e2; color: #991b1b; }
.quiz-submit  { margin-top: .75rem; }
.is-hidden { display: none; }
.quiz-start {
  display: flex;
  justify-content: flex-start;
}
.quiz-start.is-hidden { display: none; }
.quiz-best-result {
  font-weight: 700;
  color: #1f2937;
  margin-bottom: .45rem;
}

/* ===== COURSE PROGRESSION ===== */
.course-progress {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .9rem 1rem;
  margin: 1rem auto 0;
  max-width: 520px;
  text-align: left;
}
.course-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .45rem;
}
.course-progress-head h3 {
  font-size: .95rem;
  color: #333;
}
.course-progress-head strong {
  color: #1a3399;
  font-size: 1rem;
}
.course-progress-bar {
  width: 100%;
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.course-progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #2563eb);
}
.course-progress p {
  margin-top: .45rem;
  font-size: .85rem;
  color: var(--muted);
}
.week-progress {
  margin-top: .25rem;
  font-size: .75rem;
  color: #374151;
  font-weight: 600;
}

.progress-summary .section-body p {
  font-weight: 700;
  color: #1f2937;
}
.progress-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}
.progress-check {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  font-weight: 600;
  color: #334155;
}
.progress-check input {
  accent-color: #16a34a;
}
.section-collapse-btn {
  border: none;
  background: transparent;
  color: #475569;
  font-size: .9rem;
  cursor: pointer;
  padding: 0 .2rem 0 0;
}
.section-collapse-btn:hover { color: #1e293b; }
.section-collapsed .section-body { display: none; }
.section-complete .section-title {
  background: #ecfdf5;
  border-bottom-color: #bbf7d0;
}

.week-quick-nav {
  position: sticky;
  top: 4.7rem;
  height: 0;
  overflow: visible;
  margin: 1rem 1rem 0 auto;
  z-index: 900;
}
.quick-nav-panel {
  width: 260px;
  max-height: calc(100vh - 8.5rem);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: .8rem .9rem;
  margin-left: auto;
}
.quick-nav-title {
  font-weight: 800;
  color: #1f2937;
  font-size: .9rem;
  margin-bottom: .45rem;
}
.quick-nav-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: grid;
  gap: .35rem;
}
.quick-nav-list a {
  text-decoration: none;
  color: #1d4ed8;
  font-weight: 600;
  font-size: .84rem;
  line-height: 1.35;
}
.quick-nav-list a:hover { text-decoration: underline; }

.html-playground {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.html-play-input {
  width: 100%;
  min-height: 180px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: .7rem .85rem;
  font-family: 'Cascadia Code', Consolas, monospace;
  font-size: .86rem;
  line-height: 1.45;
  resize: vertical;
}
.html-play-input:focus {
  outline: none;
  border-color: #264de4;
}
.html-play-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}
.html-play-frame {
  width: 100%;
  min-height: 180px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.css-playground {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.css-play-html {
  margin: 0;
}
.css-play-input {
  width: 100%;
  min-height: 470px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: .7rem .85rem;
  font-family: 'Cascadia Code', Consolas, monospace;
  font-size: .86rem;
  line-height: 1.45;
  resize: vertical;
}
.css-play-input:focus {
  outline: none;
  border-color: #264de4;
}
.css-play-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}
.css-play-frame {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

/* ===== PORTAIL MULTI-COURS ===== */
body.page-portal {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.portal-header {
  background: linear-gradient(135deg, #1e293b, #334155);
}

.portal-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1rem 3rem;
  flex: 1;
}

.portal-intro {
  text-align: center;
  color: var(--muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.portal-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.35rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  border: 1px solid var(--border);
  border-top: 4px solid #64748b;
  transition: transform var(--ease), box-shadow var(--ease);
}

.portal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.portal-card-dw1 { border-top-color: var(--js); }
.portal-card-po2 { border-top-color: #14b8a6; }

.portal-card-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.portal-card h2 {
  font-size: 1.25rem;
  line-height: 1.25;
}

.portal-card p {
  color: var(--muted);
  font-size: 0.9rem;
  flex: 1;
}

.portal-card-cta {
  font-weight: 700;
  font-size: 0.88rem;
  color: #0f766e;
}

.portal-card-dw1 .portal-card-cta { color: #8a6300; }

.portal-resources {
  margin-top: 2.5rem;
  padding: 1.25rem 1.5rem;
  background: #f8fafc;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.portal-resources h2 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.portal-footer {
  margin-top: auto;
}

/* ===== PROGRAMMATION OBJET 2 (thème) ===== */
body.course-po2 .module-topbar {
  background: linear-gradient(90deg, #134e4a, #115e59);
}

.po2-site-header {
  background: linear-gradient(135deg, #0f766e, #0d9488);
}

.po2-site-header .portal-back {
  margin-top: 0.5rem;
}

.portal-back-link {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
}

.portal-back-link:hover {
  color: #fff;
  text-decoration: underline;
}

.banner-po2 {
  background: linear-gradient(135deg, #0f766e, #2dd4bf);
  color: #042f2e;
}

.banner-po2 .banner-sub {
  color: rgba(4, 47, 46, 0.75);
}

.po2-border {
  border-top-color: #14b8a6;
}

.po2-tag {
  background: #ccfbf1;
  color: #0f766e;
}

a.resource-link {
  font-weight: 600;
  color: #0f766e;
}

a.resource-link:hover {
  text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .week-grid { grid-template-columns: 1fr; }
  .banner-num { display: none; }
  .module-content { padding: 1.2rem .75rem; }
  .section-body { padding: 1.1rem; }
  .eval-section { padding: 1.2rem; }
  .week-quick-nav { display: none; }
  .portal-grid { grid-template-columns: 1fr; }
}
