/* Cycle pages (maternelle, primaire, secondaire). One stylesheet for the three;
   each page sets its colours with a modifier class on <main>. */
.cycle {
  --cycle-fond: var(--fond-jaune-doux);
  --cycle-accent: var(--accent-soleil);
  --cycle-accent-texte: var(--action-texte);
  --cycle-valeur: var(--marque-prairie);
  --cycle-total: var(--fond-jaune-doux);
}
.cycle--primaire {
  --cycle-fond: var(--fond-menthe);
  --cycle-accent: var(--marque-prairie);
  --cycle-accent-texte: var(--texte-inverse);
  --cycle-valeur: var(--marque-prairie);
  --cycle-total: var(--fond-menthe);
}
.cycle--secondaire {
  --cycle-fond: var(--fond-secondaire);
  --cycle-accent: var(--accent-ciel);
  --cycle-accent-texte: var(--texte-inverse);
  --cycle-valeur: var(--accent-ciel);
  --cycle-total: var(--fond-secondaire);
}
.cycle section[id] { scroll-margin-top: 100px; }

/* ---------- Banner ---------- */
.cycle-bandeau { background: var(--cycle-fond); }
.cycle-bandeau > .container { position: relative; z-index: 1; }
.cycle-bandeau .bandeau__contenu { grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 48px; }
.cycle-bandeau .bandeau__contenu--composition { grid-template-columns: minmax(0, 1fr) minmax(0, 540px); }
.cycle-bandeau__motif { left: calc(50% + 470px); top: -50px; width: 340px; height: 340px; }
.cycle-bandeau h1 { color: var(--marque-foret); }

.selecteur-cycle { display: flex; flex-wrap: wrap; gap: 8px; }
.selecteur-cycle a {
  display: inline-flex; align-items: center; padding: 10px 18px; border-radius: 999px;
  background: var(--fond-carte); border: 1px solid var(--bordure-claire);
  font-weight: 700; font-size: 16px; line-height: 20px; color: var(--marque-foret); text-decoration: none;
}
.selecteur-cycle a:hover { background: var(--fond-menthe); }
.selecteur-cycle a[aria-current="page"] { background: var(--cycle-accent); border-color: var(--cycle-accent); color: var(--cycle-accent-texte); }

.reperes { display: flex; gap: 20px; }
.reperes li { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.reperes li + li { padding-left: 20px; border-left: 1px solid var(--bordure-claire); }
.reperes__valeur { font-size: 28px; line-height: 34px; color: var(--cycle-valeur); white-space: nowrap; }
.reperes__libelle { font-size: 14px; line-height: 20px; color: var(--texte-secondaire); }

/* Photo with its caption */
.cycle-photo { height: 460px; }
.cycle-photo__legende {
  position: absolute; left: 16px; bottom: 16px; right: 16px; width: fit-content;
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  background: var(--fond-carte); font-weight: 700; font-size: 14px; line-height: 20px; color: var(--marque-foret);
}
.cycle-photo__legende img { width: 16px; height: 16px; flex: none; }

/* Maternelle: photo with the sun, the blue shape and the motif */
.composition { position: relative; width: 100%; aspect-ratio: 540 / 480; }
.composition__soleil { position: absolute; right: 0; top: 0; width: 31.5%; aspect-ratio: 1; border-radius: 50%; background: var(--accent-soleil); }
.composition__forme { position: absolute; left: 0; bottom: 4.2%; width: 22.2%; aspect-ratio: 1; border-radius: 40px 40px 0 40px; background: var(--accent-ciel); }
.composition .cycle-photo { position: absolute; left: 7.4%; top: 6.25%; width: 87%; height: 91.7%; border-radius: 32px; }
.composition__motif { left: 0; top: 0; width: 56px; height: 56px; z-index: 2; }

/* ---------- Levels and ages ---------- */
.cycle-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: end; margin-bottom: 44px; }
.cycle-intro .stack { gap: 12px; align-items: flex-start; }
.niveaux { gap: 24px; }
.niveau { display: flex; flex-direction: column; gap: 12px; padding: 28px; border-radius: 28px; background: var(--cycle-fond); }
.niveau__pastille {
  display: flex; align-items: center; justify-content: center; width: 76px; height: 76px; border-radius: 50%;
  background: var(--cycle-accent); color: var(--cycle-accent-texte); font-weight: 700; font-size: 20px; line-height: 26px;
}

/* ---------- Programme ---------- */
.programme__motif { left: -110px; bottom: -80px; width: 300px; height: 300px; }
.programme { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.programme__texte { gap: 16px; align-items: flex-start; }
.domaines { gap: 20px; }
.domaine { display: flex; flex-direction: column; gap: 12px; padding: 24px; background: var(--fond-carte); border: 1px solid var(--bordure-claire); border-radius: 24px; }
.domaine__picto { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: var(--cycle-fond); }
.domaine__picto img { width: 26px; height: 26px; }

/* ---------- Fees and documents ---------- */
.frais-titre { gap: 12px; margin-bottom: 40px; }
.frais-dossier { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 24px; align-items: start; }
.frais-cycle { display: flex; flex-direction: column; gap: 24px; padding: 32px; background: var(--fond-page); border: 1px solid var(--bordure-claire); border-radius: 28px; }
.montants { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.montant { display: flex; flex-direction: column; gap: 4px; }
.montant__valeur { font-size: 40px; line-height: 50px; white-space: nowrap; }
.echeancier { display: flex; flex-direction: column; gap: 12px; }

/* Maternelle: one row of instalments */
.versements { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.versements li {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px;
  background: var(--fond-carte); border: 1px solid var(--bordure-claire); border-radius: 14px; text-align: center;
}
.versements span { font-size: 14px; line-height: 20px; color: var(--texte-secondaire); }
.versements strong { font-weight: 600; font-size: 16px; line-height: 24px; white-space: nowrap; }
.versements .versements__inscription { background: var(--cycle-accent); border-color: var(--cycle-accent); }
.versements__inscription span, .versements__inscription strong { color: var(--cycle-accent-texte); }

/* Primaire and secondaire: one row per class */
.cycle .tableau-frais { border-spacing: 6px; margin: -6px; width: calc(100% + 12px); min-width: 560px; }
.cycle .tableau-frais th, .cycle .tableau-frais td { border-radius: 12px; padding: 10px 4px; text-align: center; white-space: nowrap; }
.cycle .tableau-frais thead th { background: none; font-weight: 400; font-size: 14px; line-height: 20px; color: var(--texte-secondaire); }
.cycle .tableau-frais thead th:first-child { text-align: left; }
.cycle .tableau-frais tbody th, .cycle .tableau-frais td { background: var(--fond-carte); border: 1px solid var(--bordure-claire); }
.cycle .tableau-frais tbody th { text-align: left; padding-left: 6px; font-weight: 700; font-size: 16px; line-height: 24px; color: var(--marque-foret); }
.cycle .tableau-frais td { font-weight: 600; font-size: 14px; line-height: 24px; color: var(--texte-principal); }
.cycle--secondaire .tableau-frais td { font-size: 16px; }
.cycle .tableau-frais .total { background: var(--cycle-total); border-color: var(--cycle-total); font-weight: 700; color: var(--marque-foret); }

.frais-liens { display: flex; align-items: center; gap: 24px; }
.frais-liens .petit { max-width: 320px; }
.frais-liens .petit a { color: inherit; }

.pieces { display: flex; flex-direction: column; gap: 12px; padding: 28px; border-radius: 28px; background: var(--cycle-fond); }
.cycle--maternelle .pieces { gap: 14px; }
.pieces__groupe { margin-top: 0; font-weight: 700; font-size: 14px; line-height: 20px; color: var(--marque-prairie); }
.pieces ul { display: flex; flex-direction: column; gap: 12px; }
.pieces li { display: flex; align-items: flex-start; gap: 10px; color: var(--texte-principal); }
.coche { display: flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--cycle-accent); }
.cycle--maternelle .coche { width: 26px; height: 26px; }
.coche img { width: 13px; height: 13px; }
.cycle--maternelle .coche img { width: 14px; height: 14px; }
.horaires-inscription { display: flex; flex-direction: column; gap: 10px; padding: 28px; border-radius: 28px; }
.horaires-inscription h3 { display: flex; align-items: center; gap: 10px; }
.horaires-inscription h3 img { width: 22px; height: 22px; flex: none; }
.horaires-inscription p { color: var(--texte-principal); }
.dossier { display: flex; flex-direction: column; gap: 20px; }

/* ---------- Call to action ---------- */
.cta--cycle { padding: 64px 0; background: var(--cycle-accent); color: var(--cycle-accent-texte); }
.cta--cycle > .container { position: relative; z-index: 1; }
.cta--cycle .cta__texte { gap: 12px; max-width: 633px; }
.cta--cycle .titre, .cta--cycle .texte { color: var(--cycle-accent-texte); }
.cta__motif { left: calc(50% + 520px); top: -60px; width: 260px; height: 260px; }
.btn--foret { background: var(--marque-foret); color: var(--texte-inverse); }
.btn--foret:hover { background: var(--marque-prairie); }
.btn--blanc { background: var(--fond-carte); color: var(--marque-foret); }
.btn--blanc:hover { background: var(--fond-menthe); }

/* ---------- Other cycles (same card as the home page) ---------- */
.autres-titre { gap: 12px; margin-bottom: 40px; }
.carte-cycle { display: flex; flex-direction: column; overflow: hidden; }
.carte-cycle__bandeau { position: relative; overflow: hidden; display: flex; align-items: flex-end; height: 150px; padding: 18px 22px; }
.carte-cycle__bandeau--prairie { background: var(--marque-prairie); }
.carte-cycle__bandeau--ciel { background: var(--accent-ciel); }
.carte-cycle__bandeau--prairie .pastille { color: var(--marque-foret); }
.carte-cycle__bandeau--ciel .pastille { color: var(--accent-ciel); }
.carte-cycle__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.carte-cycle__motif { right: -14px; top: -14px; width: 120px; height: 120px; z-index: 1; }
.carte-cycle__motif--petit { right: -10px; top: -10px; width: 110px; height: 110px; }
.carte-cycle__bandeau .pastille { position: relative; z-index: 1; }
.carte-cycle__contenu { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 24px 26px 28px; }
.carte-cycle__frais { width: 100%; display: flex; flex-direction: column; gap: 6px; margin: 0; padding-top: 14px; border-top: 1px solid var(--bordure-claire); font-size: 15px; line-height: 20px; }
.carte-cycle__frais div { display: flex; gap: 14px; }
.carte-cycle__frais dt { flex: none; color: var(--texte-secondaire); }
.carte-cycle__frais dd { margin: 0; font-weight: 600; color: var(--texte-principal); }
.carte-cycle .lien-fleche { margin-top: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .cycle-bandeau__motif, .cta__motif { display: none; }
}
@media (max-width: 1000px) {
  .cycle-bandeau .bandeau__contenu, .cycle-bandeau .bandeau__contenu--composition,
  .cycle-intro, .programme, .frais-dossier { grid-template-columns: minmax(0, 1fr); }
  .cycle-intro { gap: 16px; }
  .programme { gap: 32px; }
  .composition, .cycle-photo { max-width: 540px; }
  .cycle-photo { height: 400px; }
  .composition .cycle-photo { height: 91.7%; }
}
@media (max-width: 720px) {
  .cycle-bandeau .bandeau__contenu { gap: 16px; }
  .cycle-bandeau .bandeau__texte { gap: 16px; }
  .cycle .titre-1 { font-size: 40px; line-height: 46px; }
  .cycle .titre-2 { font-size: 30px; line-height: 36px; }
  .cycle-bandeau .texte { font-size: 16px; line-height: 24px; }
  .selecteur-cycle a { padding: 10px 12px; }
  .reperes { gap: 12px; }
  .reperes li + li { padding-left: 0; border-left: 0; }
  .reperes__valeur { font-family: var(--font-texte); font-size: 18px; line-height: 26px; }
  .reperes__libelle { font-size: 12px; }
  .cycle-photo { height: 300px; }
  .composition .cycle-photo { border-radius: 24px; }
  .composition__forme { border-radius: 28px 28px 0 28px; }
  .composition__motif { width: 40px; height: 40px; }
  .cycle-intro { margin-bottom: 24px; }
  .niveau { padding: 22px; border-radius: 22px; }
  .niveau__pastille { width: 60px; height: 60px; font-size: 18px; }
  .programme__motif { width: 220px; height: 220px; left: -90px; }
  .domaines { gap: 12px; }
  .frais-titre, .autres-titre { margin-bottom: 24px; }
  .frais-cycle { padding: 20px; gap: 18px; border-radius: 24px; }
  .montants { gap: 16px; }
  .montant__valeur { font-size: 26px; line-height: 34px; }
  .versements { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .versements li { padding: 10px 4px; border-radius: 12px; }
  .versements strong { font-size: 14px; }
  .frais-liens { flex-direction: column; align-items: flex-start; gap: 8px; }
  .pieces, .horaires-inscription { padding: 20px; border-radius: 24px; }
  .cta--cycle { padding: 48px 0; }
  .carte-cycle__frais div { flex-direction: column; gap: 0; }
}
