/* ── Variables & reset ─────────────────────────────────────────────────── */
:root {
  --primary:   #28c8b4;
  --dark:      #28786e;
  --gradient:  linear-gradient(135deg, #28786e 0%, #28c8b4 100%);
  --accent:    #f97316;
  --bg:        #f0fdfc;
  --surface:   #ffffff;
  --text:      #1e3a38;
  --muted:     #5a8a83;
  --border:    #b2dfdb;
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(40,120,110,.1);
  --container: 1100px;
  --danger:    #d64545;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .55s ease, transform .55s ease; }
.reveal.est-visible { opacity: 1; transform: translateY(0); }

h1, h2, h3 { font-family: 'Space Grotesk', 'Segoe UI', sans-serif; line-height: 1.2; font-weight: 700; color: var(--dark); letter-spacing: -.01em; }
a { color: var(--dark); text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 2.5rem 0; }

/* ── Nav ──────────────────────────────────────────────────────────────── */
.nav {
  background: var(--gradient); padding: .8rem 0; position: sticky; top: 0; z-index: 40;
  transition: box-shadow .25s ease, padding .25s ease;
}
.nav-scrolled { padding: .55rem 0; box-shadow: 0 8px 28px rgba(0,0,0,.2); }
.nav-admin { background: var(--dark); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
.nav-brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 700; font-size: 1.15rem; font-family: 'Space Grotesk', 'Segoe UI', sans-serif; }
.nav-brand:hover { color: #fff; opacity: .9; }
.nav-logo { height: 34px; width: auto; }
.nav-admin-liens { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.nav-admin-liens a { color: #fff; opacity: .9; font-size: .92rem; }
.nav-admin-liens a:hover { opacity: 1; text-decoration: underline; }

/* ── Hero (bannière d'en-tête avec image en flou) ────────────────────── */
.hero {
  position: relative; overflow: hidden; color: #fff; isolation: isolate;
  display: flex; align-items: center; min-height: min(68vh, 560px);
}
.hero-bg {
  position: absolute; inset: -30px;
  background-size: cover; background-position: center;
  filter: blur(26px) brightness(.55) saturate(1.3);
  transform: scale(1.12);
  z-index: -2;
  animation: hero-bg-respire 16s ease-in-out infinite;
}
@keyframes hero-bg-respire { 0%, 100% { transform: scale(1.12); } 50% { transform: scale(1.18); } }
.hero-bg-defaut {
  background:
    radial-gradient(circle at 18% 28%, #28c8b4 0%, transparent 58%),
    radial-gradient(circle at 82% 75%, #f97316 0%, transparent 45%),
    radial-gradient(circle at 60% 10%, #28786e 0%, transparent 60%),
    #0f2e2a;
}
.hero-overlay {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(160deg, rgba(10,36,33,.82) 0%, rgba(40,120,110,.6) 55%, rgba(40,200,180,.4) 100%);
}
.hero-grain {
  position: absolute; inset: 0; z-index: -1; opacity: .5; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 3px 3px;
}
.hero-shape {
  position: absolute; border-radius: 50%; filter: blur(55px); opacity: .5; z-index: -1; pointer-events: none;
  animation: hero-flotte 13s ease-in-out infinite;
}
.hero-shape-1 { width: 280px; height: 280px; background: var(--accent); top: -80px; right: 8%; }
.hero-shape-2 { width: 220px; height: 220px; background: var(--primary); bottom: -80px; left: 4%; animation-delay: -4s; animation-duration: 15s; }
.hero-shape-3 { width: 160px; height: 160px; background: #fff; top: 40%; left: 48%; opacity: .25; animation-delay: -8s; animation-duration: 10s; }
@keyframes hero-flotte {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(18px, -24px) scale(1.06); }
  66%      { transform: translate(-14px, 12px) scale(.96); }
}

.hero-content { position: relative; z-index: 1; padding: 3rem 0; animation: hero-apparait .7s cubic-bezier(.22,1,.36,1) both; width: 100%; }
@keyframes hero-apparait { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.hero-badges { display: flex; gap: .7rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.hero-tag, .hero-stat {
  display: inline-flex; align-items: center; gap: .35rem; background: rgba(255,255,255,.14);
  backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.28); padding: .35rem .95rem;
  border-radius: 999px; font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; font-weight: 600;
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
}
.hero-stat { text-transform: none; letter-spacing: 0; background: rgba(249,115,22,.22); border-color: rgba(249,115,22,.35); }
.hero-content h1 {
  font-size: clamp(2rem, 4.6vw, 3.1rem); color: #fff; margin-bottom: .7rem; letter-spacing: -.01em;
}
.hero-content p { color: rgba(255,255,255,.88); max-width: 560px; margin-bottom: 1.6rem; font-size: 1.02rem; }
.btn-hero {
  background: #fff; color: var(--dark); box-shadow: 0 10px 28px rgba(0,0,0,.28);
  transition: transform .2s cubic-bezier(.22,1,.36,1), box-shadow .2s ease;
}
.btn-hero:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 16px 36px rgba(0,0,0,.34); color: var(--dark); }

.hero-scroll-cue {
  position: absolute; bottom: 1.3rem; left: 50%; transform: translateX(-50%); z-index: 1;
  color: rgba(255,255,255,.75); font-size: 1.5rem; line-height: 1; animation: hero-rebondit 2s ease-in-out infinite;
}
@keyframes hero-rebondit { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 9px); } }

.hero-detail { min-height: auto; padding: 0; }
.hero-detail .hero-content { padding: 2.6rem 0 2.4rem; }
.hero-pills { list-style: none; display: flex; gap: 1.1rem; flex-wrap: wrap; margin-top: .6rem; font-size: .92rem; color: rgba(255,255,255,.92); }
.retour-clair { color: #fff; opacity: .85; }
.retour-clair:hover { color: #fff; opacity: 1; text-decoration: underline; }

@media (max-width: 600px) { .hero-shape-3 { display: none; } .hero { min-height: min(58vh, 460px); } }

/* ── Flash messages ───────────────────────────────────────────────────── */
.flash-zone { margin: 1rem 0; }
.flash { padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: .6rem; font-size: .92rem; }
.flash-success { background: #dcf5ef; color: var(--dark); border: 1px solid var(--primary); }
.flash-error { background: #fde8e8; color: #a23030; border: 1px solid var(--danger); }
.flash-info { background: #fff4e5; color: #9a5b12; border: 1px solid var(--accent); }

/* ── Titres de page ───────────────────────────────────────────────────── */
.page-title { font-size: 1.9rem; margin-bottom: .3rem; }
.page-sub { color: var(--muted); margin-bottom: 1.5rem; }
.section-title-sm { font-size: 1.2rem; margin: 1.8rem 0 .8rem; }
.vide { color: var(--muted); padding: 1rem 0; }

/* ── Cartes événements (accueil) ──────────────────────────────────────── */
.grille-evenements { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.carte-evenement {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); color: var(--text); display: flex; flex-direction: column;
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s ease;
}
.carte-evenement:hover {
  transform: translateY(-7px); color: var(--text);
  box-shadow: 0 20px 44px rgba(40,120,110,.22), 0 0 0 1px rgba(40,200,180,.18);
}
.carte-photo {
  height: 150px; background: var(--gradient); background-size: cover; background-position: center;
  transition: transform .5s cubic-bezier(.22,1,.36,1);
}
.carte-evenement:hover .carte-photo { transform: scale(1.09); }
.carte-photo-vide { background: var(--gradient); }
.carte-corps { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .3rem; }
.badge-date { color: var(--muted); font-size: .82rem; text-transform: capitalize; }
.carte-corps h2 { font-size: 1.1rem; }
.carte-lieu, .carte-horaire { font-size: .88rem; color: var(--muted); }

.liste-passee { list-style: none; padding: 0; }
.liste-passee li { padding: .35rem 0; border-bottom: 1px solid var(--border); }

/* ── Pastilles de statut ──────────────────────────────────────────────── */
.pastille { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .6rem .2rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; margin-top: .3rem; font-family: 'Space Grotesk', 'Segoe UI', sans-serif; }
.pastille-ouverte { background: #dcf5ef; color: var(--dark); }
.pastille-ouverte::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); flex-shrink: 0;
  animation: pastille-pulse 1.8s ease-in-out infinite;
}
@keyframes pastille-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(40,200,180,.55); }
  50%      { box-shadow: 0 0 0 4px rgba(40,200,180,0); }
}
.pastille-attente { background: #fff4e5; color: #9a5b12; }
.pastille-fermee { background: #f1f1f1; color: #777; }

/* ── Détail événement ─────────────────────────────────────────────────── */
.retour { display: inline-block; margin-bottom: 1rem; font-size: .9rem; }
.detail-grille { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: start; }
.detail-cloture { color: var(--muted); margin-bottom: 1rem; font-size: .92rem; }
.detail-description { white-space: normal; }
.detail-inscription { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); position: sticky; top: 1rem; }
.alerte-attente { background: #fff4e5; color: #9a5b12; padding: .6rem .8rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .88rem; }

@media (max-width: 820px) { .detail-grille { grid-template-columns: 1fr; } .detail-inscription { position: static; } }

/* ── Formulaires ──────────────────────────────────────────────────────── */
.champ { margin-bottom: 1rem; }
.champ label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .9rem; }
.champ input[type=text], .champ input[type=email], .champ input[type=password],
.champ input[type=date], .champ input[type=time], .champ input[type=number],
.champ input[type=datetime-local], .champ select, .champ textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .95rem; font-family: inherit; background: #fff; color: var(--text);
}
.champ select[multiple] { height: auto; }
.ligne-champs { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.ligne-champs .champ { flex: 1; min-width: 160px; }
.champ-bouton { display: flex; }

.choix-agenda { display: flex; flex-direction: column; gap: .6rem; margin-top: .8rem; }
.choix-agenda .btn { text-decoration: none; }

.choix-public { display: flex; gap: 1rem; flex-wrap: wrap; }
.choix-public-item { font-weight: 400; display: flex; align-items: center; gap: .35rem; }
.cases-public { display: flex; flex-direction: column; gap: .5rem; }
.case-public { font-weight: 400; display: flex; align-items: center; gap: .5rem; }

.photo-actuelle { display: flex; align-items: center; gap: 1rem; margin-bottom: .6rem; }
.photo-actuelle img { height: 70px; width: 100px; object-fit: cover; border-radius: var(--radius-sm); }
.photo-actuelle label { font-weight: 400; font-size: .85rem; display: flex; align-items: center; gap: .4rem; }

.btn { display: inline-block; padding: .6rem 1.2rem; border-radius: var(--radius-sm); border: none;
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif; font-weight: 600; font-size: .9rem; cursor: pointer; text-align: center;
  transition: transform .18s cubic-bezier(.22,1,.36,1), box-shadow .18s ease, opacity .18s ease; }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 4px 14px rgba(40,120,110,.3); }
.btn-primary:hover { opacity: 1; color: #fff; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(40,120,110,.4); }
.btn-secondaire { background: #fff; color: var(--dark); border: 1px solid var(--border); }
.btn-secondaire:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(40,120,110,.15); }
.btn-full { width: 100%; }

.form-admin { max-width: 640px; }
.actions-form { display: flex; gap: .8rem; margin-top: 1.5rem; }
.form-fantome { display: none; }

/* ── Login admin ──────────────────────────────────────────────────────── */
.page-login { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--gradient); }
.carte-login { background: #fff; border-radius: var(--radius); padding: 2.2rem; width: 100%; max-width: 380px; box-shadow: var(--shadow); }
.login-logo { height: 44px; margin: 0 auto 1rem; }
.carte-login h1 { font-size: 1.3rem; text-align: center; margin-bottom: 1.2rem; }

/* ── Admin : tableaux ─────────────────────────────────────────────────── */
.admin-entete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: .8rem; }
.table-admin { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.table-admin th, .table-admin td { padding: .6rem .8rem; border-bottom: 1px solid var(--border); text-align: left; font-size: .9rem; vertical-align: middle; }
.table-admin th { background: var(--bg); color: var(--dark); }
.ligne-archivee { opacity: .55; }
.actions-cell { display: flex; gap: .7rem; flex-wrap: wrap; }
.inline-form { display: inline; }
.lien-bouton { background: none; border: none; padding: 0; color: var(--dark); text-decoration: underline; cursor: pointer; font-size: .85rem; font-family: inherit; }
.lien-bouton:hover { color: var(--primary); }
.lien-danger { color: var(--danger); }
.lien-danger:hover { color: #a23030; }
.input-inline { padding: .35rem .5rem; font-size: .88rem; }
.input-court { width: 80px; }

.bloc-ajout { background: var(--surface); border-radius: var(--radius); padding: 1.2rem 1.4rem; box-shadow: var(--shadow); margin-bottom: 1.8rem; }

/* ── Footer ───────────────────────────────────────────────────────────── */
.footer { padding: 1.5rem 0; color: var(--muted); font-size: .85rem; text-align: center; }
