* {
  box-sizing: border-box;
}

:root {
  --bg: #fff8fc;
  --panel: #ffffff;
  --text: #3d2f51;
  --text-soft: #6f5a8b;
  --lavender-strong: #b79ef5;
  --line: #eadcf7;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(circle at top, #ffeef6, var(--bg) 45%);
  color: var(--text);
}

.theme-toggle {
  position: fixed;
  top: 0.9rem;
  right: 1rem;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(140deg, #ffffff, #fff3fa 60%, #f4ecff);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  z-index: 1200;
  box-shadow: 0 8px 18px rgba(110, 99, 167, 0.18);
}

.theme-toggle:hover {
  border-color: var(--lavender-strong);
}

body.dark-mode {
  --bg: #0f1120;
  --panel: #171a2c;
  --text: #ece8ff;
  --text-soft: #c0b9e7;
  --lavender-strong: #8f79df;
  --line: #33385a;
  background: radial-gradient(circle at top, #1a1d33, var(--bg) 45%);
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
  padding: 2.5rem 0 5.5rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.1;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.back-link {
  display: inline-block;
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 600;
}

.back-link:hover {
  color: var(--text);
}

.badge {
  display: inline-block;
  margin: 0 0 0.6rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd9e8, #e7dbff);
  color: #513666;
  font-size: 0.85rem;
  font-weight: 700;
}

.hero {
  background: linear-gradient(140deg, #ffffff, #fff3fa 60%, #f4ecff);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.4rem;
  margin-bottom: 1.2rem;
}

.subtitle {
  margin: 0.7rem 0 0;
  color: var(--text-soft);
  line-height: 1.55;
}

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

.months-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 1rem;
}

.month {
  background: linear-gradient(145deg, var(--panel), #faf3ff);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
}

.month-name {
  font-weight: 700;
  color: var(--text);
}

body.dark-mode .hero {
  background: linear-gradient(140deg, #1b1f34, #171a2f 60%, #17152a);
}

body.dark-mode .month {
  background: linear-gradient(145deg, #1a1d31, #171a2d);
}

.month-note {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.legend {
  margin-top: 1rem;
  font-size: 0.92rem;
  color: var(--text-soft);
}

.tag {
  display: inline-block;
  margin-right: 0.35rem;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.tag.creche {
  background: #e7f7ea;
  border-color: #bde5c3;
  color: #2f6d40;
}

.tag.recherche-taff {
  background: #8fb297;
  border-color: #75907c;
  color: #194226;
}

.tag.lycee {
  background: #fff3cf;
  border-color: #f2dea0;
  color: #7f5d15;
}

.tag.formation-info {
  background: #e3f0ff;
  border-color: #b8d8ff;
  color: #1f4f8f;
}

.tag.job-usine {
  background: #fff1e5;
  border-color: #ffd0a8;
  color: #7f4617;
}

.tag.job-restauration {
  background: #ffe8cc;
  border-color: #ffc98f;
  color: #7a3d00;
}

@media (max-width: 640px) {
  .container {
    padding-top: 4.2rem;
  }

  .theme-toggle {
    top: 0.65rem;
    right: 0.65rem;
    width: 38px;
    height: 38px;
  }

  .hero {
    padding: 1.1rem;
  }
}