/* ============================================================
   ATELIER MAGENTA — styles
   Palette et réglages généraux tout en haut : c'est le plus simple
   endroit à modifier pour changer les couleurs du site.
   ============================================================ */

:root {
  --magenta: #C2255C;
  --magenta-dark: #99184A;
  --magenta-light: #FF5DA2;
  --sun: #FFB703;
  --sky: #4CC9F0;
  --green: #2E9E6B;
  --red: #C0392B;
  --cream: #FFF8F0;
  --paper: #FFFFFF;
  --ink: #2B2130;
  --ink-soft: #5C4E5F;
  --border: #F1DDE4;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(194, 37, 92, 0.10);
  --max-width: 1120px;
  --bottom-nav-h: 64px;
  font-size: 17px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.3rem; margin-bottom: 0.4em; }

p { margin: 0 0 1em; }

a { color: var(--magenta-dark); }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--magenta);
  color: white;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  border-radius: 999px;
  padding: 0.7em 1.5em;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--magenta);
  color: white;
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: var(--magenta-dark); }
.btn-primary:disabled {
  background: var(--border);
  color: var(--ink-soft);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.btn-ghost {
  background: transparent;
  border-color: var(--magenta);
  color: var(--magenta-dark);
}
.btn-ghost:hover { background: rgba(194,37,92,0.06); }
.btn-lg { padding: 0.85em 2em; font-size: 1.05rem; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,248,240,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 14px;
  padding-bottom: 14px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: Georgia, serif;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--ink);
}
.logo-mark { font-size: 1.5rem; }
.logo strong { color: var(--magenta); }
.logo-img { height: 92px; width: auto; display: block; }

.site-nav {
  display: none;
  align-items: center;
  gap: 28px;
}
.site-nav a:not(.btn) {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
}
.site-nav a:not(.btn):hover { color: var(--magenta); }
.btn-nav { padding: 0.55em 1.3em; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 16px; overflow: hidden; }
.hero-inner { max-width: 640px; margin: 0 auto; text-align: center; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--magenta);
  margin-bottom: 0.6em;
}
.highlight { color: var(--magenta); }
.lead { font-size: 1.1rem; color: var(--ink-soft); max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 1.6em; }
.hero-intro { margin-top: 20px; text-align: left; }
.hero-intro h2 {
  text-align: center;
  color: var(--magenta-dark);
  font-family: 'Fredoka', 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  font-size: 2.4rem;
}
.hero-intro p { color: var(--ink-soft); }

/* ---------- Sections génériques ---------- */
.section { padding: 32px 0 72px; }
.section.alt { background: var(--paper); }
.section-head { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.section-head .eyebrow { text-align: center; }
.section-lead { color: var(--ink-soft); }

/* ---------- À propos ---------- */
.apropos-inner {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: center;
}
.apropos-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--magenta-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  flex-shrink: 0;
}
.apropos-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 58%;
  transform: scale(1.4);
}

/* ---------- Planning : filtre de catégorie ---------- */
.planning-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: -16px 0 32px;
}
.filter-btn {
  border: 1.5px solid var(--border);
  background: var(--paper);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.5em 1.2em;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.filter-btn:hover { border-color: var(--magenta-light); }
.filter-btn.is-active {
  background: var(--magenta);
  border-color: var(--magenta);
  color: white;
}

/* ---------- Planning : accordéon de créneaux ---------- */
.creneaux {
  display: grid;
  gap: 14px;
}
.creneaux-groupe-titre {
  margin: 20px 0 -4px;
  font-size: 1.1rem;
  color: var(--magenta-dark);
}
.creneaux-groupe-titre:first-child { margin-top: 0; }
.creneaux-groupe-intro { margin: 16px 0 28px; color: var(--ink-soft); }
.creneaux-groupe-intro p { margin: 0 0 14px; }
.creneaux-groupe-intro p:last-child { margin-bottom: 0; }
.creneau {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.creneau summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.creneau summary::-webkit-details-marker { display: none; }
.creneau summary:focus-visible { outline: 3px solid var(--sky); outline-offset: -3px; }

.creneau-summary {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1.4fr 0.8fr;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.creneau-summary:not(:has(.creneau-age)) { grid-template-columns: 1.1fr 1.3fr 1.4fr; }
.creneau-col { font-weight: 600; }
.creneau-jour { color: var(--magenta-dark); }
.creneau-age { color: var(--ink-soft); font-weight: 500; }

.creneau-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.creneau-chevron {
  transition: transform 0.2s ease;
  color: var(--ink-soft);
}
.creneau[open] .creneau-chevron { transform: rotate(180deg); }

.creneau-panel {
  padding: 0 20px 22px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.creneau-prochaine-date {
  display: inline-block;
  background: #FFE3EE;
  color: var(--magenta-dark);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.creneau-desc { color: var(--ink-soft); }
.creneau-lieu { color: var(--ink-soft); font-size: 0.88rem; margin: 4px 0 0; }
.creneau-tarif { font-weight: 600; margin-bottom: 16px; }

.places-detail {
  margin-bottom: 18px;
  display: grid;
  gap: 12px;
}
/* Sur la fiche, les places ne sont visibles que via la pop-up "Voir les places
   disponibles" (bouton dans .creneau-actions) — le bloc reste dans le DOM (mis à
   jour par mettreAJourAffichagePlaces/Stages, cloné dans la pop-up) mais masqué
   ici. Sélecteur scopé pour ne pas masquer le clone une fois dans #placesModalContenu. */
.creneau-panel .places-detail,
.stage-item .places-detail {
  display: none;
}
.places-trimestre-label {
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.places-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 8px;
}
.places-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 999px;
  width: 0%;
  transition: width 0.3s ease, background 0.3s ease;
}
.places-bar-fill.is-low { background: var(--sun); }
.places-bar-fill.is-full { background: var(--red); }
.places-text { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }

.btn-preinscrire { width: 100%; border: none; }
.creneau-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.creneau-actions .btn { flex: 1 1 160px; width: auto; text-align: center; }

/* ---------- Stages vacances (imbriqués dans le créneau "Stage vacances") ---------- */
.stages-liste {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}
.stage-item {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}
.stage-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.stage-item-nom { margin: 0; font-weight: 700; }
.stage-item-tarif { margin: 0; font-weight: 700; color: var(--magenta-dark); white-space: nowrap; }

/* ---------- Formulaire pré-inscription ---------- */
.form-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: grid;
  gap: 18px;
}
.form-card[hidden] { display: none; }
.form-row { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  min-width: 0;
}
.form-grid-2.form-grid-2--simple { grid-template-columns: 1fr; }
label { font-weight: 600; font-size: 0.92rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="password"], input[type="number"], select, textarea {
  font: inherit;
  padding: 0.65em 0.8em;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--ink);
  width: 100%;
  min-width: 0;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--magenta);
}
.form-row.field-highlight select,
.form-row.field-highlight input {
  border-color: var(--magenta);
  box-shadow: 0 0 0 3px rgba(194,37,92,0.12);
}
.form-checkbox { flex-direction: row; align-items: flex-start; gap: 10px; }
.form-checkbox input { margin-top: 4px; }
.form-checkbox label { font-weight: 400; font-size: 0.88rem; }

.tarif-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.tarif-checks[hidden] { display: none; }
.tarif-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
}
.tarif-check input[type="checkbox"] { margin: 0; flex-shrink: 0; }
.tarif-check-dates { display: block; font-weight: 400; font-size: 0.78rem; color: var(--ink-soft); }
.tarif-check-prix { margin-left: auto; font-weight: 700; color: var(--magenta-dark); white-space: nowrap; }
.tarif-stage-info { margin: 0 0 10px; font-size: 0.9rem; color: var(--ink-soft); font-style: italic; }
.tarif-total {
  margin: 0;
  text-align: right;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.tarif-total strong { color: var(--ink); font-size: 1.1rem; }
.btn-submit { width: 100%; border: none; }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.form-status {
  margin: 0;
  min-height: 1.4em;
  font-weight: 600;
  text-align: center;
}
.form-status.success { color: #1B7A43; }
.form-status.error { color: #B3261E; }

/* ---------- Pied de page ---------- */
.site-footer {
  background: var(--ink);
  color: #EADFE6;
  padding: 48px 0 20px;
  margin-top: 40px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 24px;
}
.footer-logo { margin: 0 0 14px; }
.footer-logo-img {
  height: 36px;
  background: var(--cream);
  padding: 8px 14px;
  border-radius: 10px;
}
.footer-title { font-weight: 700; color: white; margin-bottom: 10px; }
.site-footer a, .link-btn {
  color: #EADFE6;
  text-decoration: none;
  background: none;
  border: none;
  font: inherit;
  padding: 0;
  cursor: pointer;
}
.site-footer a:hover, .link-btn:hover { text-decoration: underline; }
.footer-copy {
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 18px;
  margin: 0 auto;
  max-width: var(--max-width);
}
.admin-link { opacity: 0.7; font-size: inherit; }
.admin-link:hover { opacity: 1; }

/* ---------- Navigation (barre du bas, téléphone et ordinateur) ---------- */
.bottom-nav {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  height: var(--bottom-nav-h);
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: var(--paper);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(43,33,48,0.08);
  max-width: 480px;
  margin: 0 auto;
  border-radius: 999px 999px 0 0;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
body { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0)); }
.bottom-nav a, .bottom-nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.64rem;
  font-weight: 600;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  white-space: nowrap;
}
.bottom-nav a span, .bottom-nav button span { font-size: 1.15rem; }
.bottom-nav a.is-active { color: var(--magenta); }
.bottom-nav a.bottom-nav-cta span, .bottom-nav button.bottom-nav-cta span {
  background: var(--magenta);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}
.bottom-nav a.bottom-nav-cta.is-active span,
.bottom-nav a.bottom-nav-cta,
.bottom-nav button.bottom-nav-cta { color: var(--ink-soft); }

/* Survol à la souris (ordinateur) : évite l'effet collant sur écrans tactiles */
@media (hover: hover) and (pointer: fine) {
  .bottom-nav a:not(.bottom-nav-cta):hover,
  .bottom-nav button:not(.bottom-nav-cta):hover { color: var(--magenta); cursor: pointer; }
  .bottom-nav a.bottom-nav-cta:hover span,
  .bottom-nav button.bottom-nav-cta:hover span { background: var(--magenta-dark); }
}

/* Écrans larges (ordinateur) : barre un peu plus grande et plus confortable */
@media (min-width: 721px) {
  :root { --bottom-nav-h: 76px; }
  .bottom-nav { max-width: 620px; gap: 4px; padding: 0 8px; }
  .bottom-nav a, .bottom-nav button { font-size: 0.72rem; gap: 4px; cursor: pointer; }
  .bottom-nav a span, .bottom-nav button span { font-size: 1.3rem; }
  .bottom-nav a.bottom-nav-cta span, .bottom-nav button.bottom-nav-cta span { width: 38px; height: 38px; font-size: 1.1rem; }
}

/* ---------- Modales (présentation, pré-inscription, liste d'attente) ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(43, 33, 48, 0.55);
  padding: 24px;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
.modal-overlay.is-open { display: flex; }
body.modal-open { overflow: hidden; }
.modal-box {
  position: relative;
  background: var(--cream);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(43, 33, 48, 0.3);
  margin: auto;
}
.modal-box.modal-box-lg { max-width: 640px; }
.modal-box .form-card { padding: 0; background: transparent; }
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: var(--border);
  color: var(--ink);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.modal-close:hover { background: var(--magenta-light); color: white; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .apropos-inner { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
}

@media (max-width: 720px) {
  .bottom-nav { border-radius: 0; border-left: none; border-right: none; }

  .form-grid-2 { grid-template-columns: 1fr; }

  .creneau-summary { grid-template-columns: 1fr; gap: 2px; }
  .creneau-col { font-size: 0.92rem; }
  .creneau-age { font-size: 0.82rem; }
  .creneau summary { align-items: flex-start; }
  .creneau-right { flex-direction: column-reverse; align-items: flex-end; gap: 6px; }
}
