:root {
  --fond: #ffffff;
  --fond-doux: #f4f6fa;
  --surface: #ffffff;
  --texte: #1d2330;
  --texte-doux: #586174;
  --bordure: #dfe3ea;
  --accent: #2f5bd3;
  --accent-fonce: #2448ad;
  --sur-accent: #ffffff;
  --erreur: #b42318;
  --succes: #1f7a3a;
  --ombre: 0 10px 30px rgb(20 30 60 / 10%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #11151d;
    --fond-doux: #171c26;
    --surface: #1b2130;
    --texte: #e8ebf2;
    --texte-doux: #a3abbd;
    --bordure: #2c3446;
    --accent: #7c9cff;
    --accent-fonce: #9db5ff;
    --sur-accent: #0d1220;
    --erreur: #ff8a7a;
    --succes: #6fd38f;
    --ombre: 0 10px 30px rgb(0 0 0 / 40%);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

/* author display rules (.formulaire is flex) would otherwise beat the hidden attribute */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

a {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin: 2rem 0 1rem;
}

h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
}

.conteneur {
  width: min(1100px, 100% - 32px);
  margin-inline: auto;
}

.conteneur.large {
  width: min(1440px, 100% - 32px);
}

.conteneur.etroit {
  width: min(720px, 100% - 32px);
}

.bloc {
  padding-block: 3.5rem;
}

.bloc > h2:first-child {
  margin-top: 0;
}

.fond-doux {
  background: var(--fond-doux);
}

.centre {
  text-align: center;
}

.discret {
  color: var(--texte-doux);
  font-size: 0.9rem;
}

/* --- buttons --- */
.bouton {
  display: inline-block;
  padding: 0.75rem 1.4rem;
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: var(--sur-accent);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.bouton:hover,
.bouton:focus-visible {
  background: var(--accent-fonce);
  border-color: var(--accent-fonce);
}

.bouton.secondaire {
  background: transparent;
  color: var(--accent);
}

.bouton.petit {
  padding: 0.4rem 0.9rem;
  font-size: 0.95rem;
}

.bouton:disabled {
  opacity: 0.6;
  cursor: default;
}

/* --- header / footer --- */
.entete {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--fond) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bordure);
}

.entete-contenu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.marque {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--texte);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.entete nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.entete nav a:not(.bouton) {
  color: var(--texte-doux);
  text-decoration: none;
  font-size: 0.95rem;
}

.entete nav a:not(.bouton):hover {
  color: var(--texte);
}

@media (max-width: 760px) {
  .entete nav a:not(.bouton) {
    display: none;
  }
}

.pied {
  border-top: 1px solid var(--bordure);
  background: var(--fond-doux);
  padding-block: 2rem;
}

.pied nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin: 0.5rem 0 1rem;
}

.pied a {
  color: var(--texte-doux);
}

/* --- hero --- */
.hero {
  padding-top: 4rem;
  background: linear-gradient(180deg, var(--fond-doux), var(--fond) 70%);
}

.hero-contenu {
  max-width: 820px;
  text-align: center;
}

.accroche {
  font-size: 1.2rem;
  color: var(--texte-doux);
}

.actions-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin: 2rem 0 2.5rem;
}

.entete-page {
  max-width: 860px;
}

.surtitre {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- screenshots --- */
.capture {
  margin: 1.5rem auto;
}

.capture img {
  display: block;
  margin-inline: auto;
  border: 1px solid var(--bordure);
  border-radius: 12px;
  box-shadow: var(--ombre);
  background: #fff;
}

@media (max-width: 700px) {
  .hero .capture img {
    max-width: 300px;
    border-radius: 24px;
  }
}

.capture.etroite {
  max-width: 520px;
}

.capture.telephone {
  max-width: 300px;
}

.capture.telephone img {
  border-radius: 24px;
}

figcaption {
  margin-top: 0.8rem;
  text-align: center;
  color: var(--texte-doux);
  font-size: 0.95rem;
}

/* --- cards, lists --- */
.cartes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

.carte {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border: 1px solid var(--bordure);
  border-radius: 14px;
  background: var(--surface);
  color: var(--texte);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.carte:hover,
.carte:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.carte h3 {
  margin-top: 0;
}

.carte p {
  flex: 1;
  color: var(--texte-doux);
}

.carte .lien {
  color: var(--accent);
  font-weight: 600;
}

.deux-colonnes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem 3rem;
  align-items: start;
}

.deux-colonnes h2 {
  margin-top: 0;
}

.liste-fonctions,
.liste-simple {
  padding-left: 1.2rem;
}

.liste-fonctions li,
.liste-simple li {
  margin-bottom: 0.7rem;
}

.pastilles-annees {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0;
  list-style: none;
}

.pastilles-annees li {
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  background: var(--fond-doux);
  border: 1px solid var(--bordure);
  font-weight: 600;
}

details {
  border-bottom: 1px solid var(--bordure);
  padding: 0.9rem 0;
}

summary {
  cursor: pointer;
  font-weight: 600;
}

details p {
  margin: 0.6rem 0 0;
  color: var(--texte-doux);
}

.texte h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
}

/* --- sign-up form --- */
.inscription {
  padding-block: 3.5rem;
  background: var(--fond-doux);
  border-top: 1px solid var(--bordure);
}

.inscription h2 {
  margin-top: 0;
}

.formulaire {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.formulaire label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.formulaire .ligne {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.formulaire input,
.formulaire select,
.formulaire textarea {
  font: inherit;
  font-weight: 400;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  background: var(--surface);
  color: var(--texte);
}

.formulaire input:focus-visible,
.formulaire select:focus-visible,
.formulaire textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.formulaire label.case {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 400;
}

.formulaire label.case input {
  margin-top: 0.3rem;
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
}

.facultatif {
  color: var(--texte-doux);
  font-weight: 400;
}

.piege {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.erreur {
  margin: 0;
  color: var(--erreur);
  font-weight: 600;
}

.confirmation {
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  border-radius: 10px;
  border: 1px solid var(--succes);
  color: var(--succes);
  font-weight: 600;
}

.formulaire button {
  align-self: flex-start;
}

/* --- week numbers --- */
.semaine-en-cours {
  padding: 0.8rem 1.1rem;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: var(--fond-doux);
}

.calendriers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem 3rem;
  align-items: start;
}

.calendriers h2 {
  margin-top: 0;
}

table.semaines {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

table.semaines caption {
  text-align: left;
  color: var(--texte-doux);
  margin-bottom: 0.5rem;
}

table.semaines th,
table.semaines td {
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid var(--bordure);
  text-align: left;
}

table.semaines tbody th {
  width: 5.5rem;
  font-weight: 600;
}

table.semaines tr.courante {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  scroll-margin-top: 90px;
}

@media print {
  .entete,
  .pied,
  .inscription,
  .sans-impression,
  .surtitre,
  .accroche {
    display: none !important;
  }

  body {
    font-size: 10pt;
    background: #fff;
    color: #000;
  }

  .bloc {
    padding-block: 0;
  }

  .calendriers {
    display: block;
  }

  .calendriers > div {
    break-before: page;
  }

  .calendriers > div:first-child {
    break-before: auto;
  }

  /* one year per A4 page */
  table.semaines {
    font-size: 8.5pt;
    line-height: 1.15;
  }

  table.semaines th,
  table.semaines td {
    padding: 0 0.4rem;
  }
}

/* --- Excel template preview: same colors as STATUTS_MODELE (build.py) --- */
.apercu-tableur {
  overflow-x: auto;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  box-shadow: var(--ombre);
  background: #fff;
  color: #1d2330;
}

.apercu-tableur table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.apercu-tableur th {
  background: #2f5bd3;
  color: #fff;
  text-align: left;
}

.apercu-tableur th,
.apercu-tableur td {
  padding: 0.35rem 0.7rem;
  border-bottom: 1px solid #dfe3ea;
  white-space: nowrap;
}

.apercu-tableur .statut-modele-1 {
  background: #93c5fd;
}

.apercu-tableur .statut-modele-2 {
  background: #fde68a;
}

.apercu-tableur .statut-modele-3 {
  background: #86efac;
}

.apercu-tableur .statut-modele-4 {
  background: #fca5a5;
}

.apercu-tableur .statut-modele-5 {
  background: #e5e7eb;
}
