:root {
  --primary: #1a56a0;
  --primary-dark: #0f3a72;
  --primary-light: #e8f0fb;
  --accent: #e8a020;
  --accent-dark: #c47d00;
  --success: #2a9d5c;
  --danger: #d94040;
  --bg: #f0f4fa;
  --surface: #ffffff;
  --text: #1c1e26;
  --text-muted: #6b7280;
  --border: #dde3ef;
  --radius: 10px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 4px rgba(26, 86, 160, 0.08);
  --shadow: 0 4px 20px rgba(26, 86, 160, 0.12);
  --shadow-lg: 0 8px 40px rgba(26, 86, 160, 0.18);
  --font-main: 'Nunito', sans-serif;
  --font-heading: 'Raleway', sans-serif;
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1100;
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
  color: var(--primary-dark);
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  letter-spacing: 0.5px;
}

.brand-name span {
  color: var(--accent);
}

.burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
  z-index: 1100;
}

.burger:hover {
  background: rgba(255, 255, 255, 0.12);
}

.burger span {
  display: block;
  height: 2.5px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s, width 0.3s;
  transform-origin: center;
}

.burger span:nth-child(2) {
  width: 70%;
}

.burger.open span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.burger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.burger.open span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 60, 0.55);
  z-index: 900;
  backdrop-filter: blur(2px);
}

.drawer-overlay.visible {
  display: block;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: min(320px, 88vw);
  background: var(--primary-dark);
  z-index: 950;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.15);
}

.drawer__close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 22px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.drawer__close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.drawer__nav {
  padding: 12px 0 24px;
  flex: 1;
}

.menu-level {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.menu-level__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
  gap: 8px;
}

.menu-level__toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.menu-level__toggle.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}

.menu-level__badge {
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.menu-level__arrow {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: transform 0.3s;
}

.menu-level__toggle.active .menu-level__arrow {
  transform: rotate(180deg);
  opacity: 1;
}

.menu-level__body {
  display: none;
  background: rgba(0, 0, 0, 0.15);
}

.menu-level__body.open {
  display: block;
}

.menu-type {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.menu-type__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 20px 11px 32px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s, color 0.2s;
  justify-content: space-between;
}

.menu-type__toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.menu-type__toggle.active {
  color: var(--accent);
}

.menu-type__icon {
  font-size: 14px;
}

.menu-type__label {
  flex: 1;
}

.menu-type__arrow {
  width: 14px;
  height: 14px;
  opacity: 0.5;
  transition: transform 0.3s;
  flex-shrink: 0;
}

.menu-type__toggle.active .menu-type__arrow {
  transform: rotate(180deg);
  opacity: 1;
}

.menu-type__body {
  display: none;
}

.menu-type__body.open {
  display: block;
}

.menu-subject__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px 10px 48px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, padding-left 0.2s;
  cursor: pointer;
}

.menu-subject__link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  padding-left: 54px;
}

.menu-subject__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-physique {
  background: #60a5fa;
}

.dot-chimie {
  background: #34d399;
}

.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px 80px;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, var(--primary-dark) 0%, #1a3a6e 45%, #0d2a55 100%);
  z-index: 0;
}

.hero__shapes {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.06;
}

.shape-1 {
  width: 500px;
  height: 500px;
  background: var(--accent);
  top: -150px;
  right: -100px;
}

.shape-2 {
  width: 300px;
  height: 300px;
  background: #60a5fa;
  bottom: -80px;
  left: -60px;
}

.shape-3 {
  width: 200px;
  height: 200px;
  background: var(--accent);
  bottom: 30%;
  left: 20%;
  opacity: 0.04;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(32px, 7vw, 58px);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero__title em {
  color: var(--accent);
  font-style: normal;
}

.hero__subtitle {
  font-size: clamp(15px, 3vw, 18px);
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.hero__ctas {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: var(--primary-dark);
  box-shadow: 0 4px 20px rgba(232, 160, 32, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(232, 160, 32, 0.55);
  filter: brightness(1.05);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.18);
}

.section {
  padding: 70px 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.section__title {
  font-family: var(--font-heading);
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800;
  color: var(--primary-dark);
  text-align: center;
  margin-bottom: 8px;
}

.section__subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 48px;
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.level-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  border: 1px solid var(--border);
}

.level-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.level-card__header {
  padding: 28px 28px 20px;
  position: relative;
}

.level-card__badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.level-card__title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}

.level-card__desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.level-card__actions {
  padding: 0 20px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.subject-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  cursor: pointer;
  background: #fff;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  text-align: left;
  text-decoration: none;
}

.subject-btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  background: var(--primary-light);
}

.subject-btn__type {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.subject-btn__name {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary-dark);
}

.subject-btn__icon {
  font-size: 18px;
  margin-bottom: 6px;
}

.theme-tc .level-card__badge {
  background: #fef3c7;
  color: #92400e;
}

.theme-tc .level-card__title {
  color: #b45309;
}

.theme-1bac .level-card__badge {
  background: #dbeafe;
  color: #1e40af;
}

.theme-1bac .level-card__title {
  color: var(--primary);
}

.theme-2bac .level-card__badge {
  background: #d1fae5;
  color: #065f46;
}

.theme-2bac .level-card__title {
  color: #059669;
}

.stats-bar {
  background: var(--primary-dark);
  padding: 32px 20px;
}

.stats-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  padding: 16px 32px;
  position: relative;
  flex: 1;
  min-width: 120px;
}

.stat-item + .stat-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: rgba(255, 255, 255, 0.15);
}

.stat-num {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.footer {
  background: var(--text);
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 32px 20px;
  font-size: 13px;
}

.footer strong {
  color: var(--accent);
}

.page-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 800;
  overflow-y: auto;
}

.page-overlay.visible {
  display: block;
}

.page-overlay__inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 28px;
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: background 0.2s;
  border: none;
  background: rgba(26, 86, 160, 0.08);
}

.page-back:hover {
  background: rgba(26, 86, 160, 0.14);
}

.page-header {
  margin-bottom: 32px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.breadcrumb span {
  color: var(--text-muted);
}

.breadcrumb strong {
  color: var(--primary);
}

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.page-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
}

.filter-btn.active,
.filter-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lesson-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
  text-decoration: none;
}

.lesson-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateX(4px);
}

.lesson-card__num {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lesson-card__info {
  flex: 1;
  min-width: 0;
}

.lesson-card__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lesson-card__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

.tag-pdf {
  background: #fef9c3;
  color: #854d0e;
}

.tag-html {
  background: #dbeafe;
  color: #1e40af;
}

.tag-video {
  background: #fce7f3;
  color: #9d174d;
}

.lesson-card__arrow {
  color: var(--text-muted);
  font-size: 18px;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .navbar {
    padding: 0 40px;
  }

  .hero {
    padding: 80px 40px 100px;
  }

  .levels-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .level-card__actions {
    grid-template-columns: 1fr;
  }
}
