:root {
  --primaire: #7a1f2b;
  --primaire-fonce: #5c1620;
  --secondaire: #f4c95d;
  --texte: #26201d;
  --fond: #faf7f2;
  --carte: #ffffff;
  --bordure: #e7ddd0;
  --succes: #2f7d4f;
  --attente: #b8860b;
  --danger: #a3323b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--fond);
  color: var(--texte);
  line-height: 1.5;
}

a { color: var(--primaire); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.site-header {
  background: var(--primaire);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.site-header a { color: #fff; }
.site-header .brand { font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.site-header nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-header nav a.btn-connexion {
  background: var(--secondaire);
  color: var(--primaire-fonce);
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
}
.site-header nav a.btn-connexion:hover { text-decoration: none; opacity: .9; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }

.hero {
  background: linear-gradient(135deg, var(--primaire), var(--primaire-fonce));
  color: #fff;
  padding: 48px 20px;
  text-align: center;
}
.hero h1 { margin: 0 0 10px; font-size: 2rem; }
.hero p { max-width: 640px; margin: 0 auto; opacity: .92; }

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 40px 0 16px;
}
.section-title h2 { margin: 0; font-size: 1.4rem; border-left: 5px solid var(--secondaire); padding-left: 10px; }
.section-title a { font-size: .9rem; }

.grille-eglises {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.carte-eglise, .carte-evenement {
  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.carte-eglise .photo, .carte-evenement .photo {
  height: 130px;
  background: var(--bordure) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: var(--primaire);
  font-weight: 700;
  font-size: 1.1rem;
}
.carte-eglise .corps, .carte-evenement .corps { padding: 14px 16px; }
.carte-eglise h3, .carte-evenement h3 { margin: 0 0 6px; font-size: 1.05rem; }
.carte-eglise .commune, .carte-evenement .meta { color: #6b6058; font-size: .88rem; }
.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--secondaire);
  color: var(--primaire-fonce);
}

.liste-evenements { display: flex; flex-direction: column; gap: 12px; }
.ligne-evenement {
  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.ligne-evenement .date-bloc {
  background: var(--fond);
  border: 1px solid var(--bordure);
  border-radius: 6px;
  padding: 6px 10px;
  text-align: center;
  min-width: 64px;
  font-weight: 700;
  color: var(--primaire);
}

.vide { color: #8a7f75; font-style: italic; padding: 20px 0; }

.site-footer {
  text-align: center;
  padding: 24px;
  color: #8a7f75;
  font-size: .85rem;
}

/* --- Formulaires --- */
.form-carte {
  max-width: 380px;
  margin: 40px auto;
  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: 10px;
  padding: 28px;
}
.form-carte h1 { margin-top: 0; font-size: 1.3rem; }
.form-champ { margin-bottom: 16px; }
.form-champ label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .9rem; }
.form-champ input, .form-champ select, .form-champ textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--bordure);
  border-radius: 6px;
  font-size: .95rem;
}
.btn {
  display: inline-block;
  background: var(--primaire);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: .95rem;
}
.btn:hover { background: var(--primaire-fonce); text-decoration: none; }
.btn-secondaire { background: var(--secondaire); color: var(--primaire-fonce); }
.alerte {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: .9rem;
}
.alerte-erreur { background: #fbe4e4; color: var(--danger); border: 1px solid #f2c4c4; }
.alerte-succes { background: #e6f4ec; color: var(--succes); border: 1px solid #c3e6d1; }

/* --- Espace de gestion --- */
.gestion-layout { display: flex; min-height: 100vh; }
.gestion-sidebar {
  width: 240px;
  background: var(--primaire-fonce);
  color: #fff;
  padding: 20px 0;
  flex-shrink: 0;
}
.gestion-sidebar .brand { padding: 0 20px 20px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 12px; }
.gestion-sidebar a {
  display: block;
  color: #f1e6dd;
  padding: 10px 20px;
  font-size: .92rem;
}
.gestion-sidebar a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.gestion-sidebar .a-venir { opacity: .55; }
.gestion-sidebar .a-venir .badge { margin-left: 6px; background: rgba(255,255,255,.2); color: #fff; }
.gestion-main { flex: 1; padding: 28px 32px; }
.gestion-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.cartes-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.carte-module {
  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: 10px;
  padding: 18px;
}
.carte-module h3 { margin: 0 0 6px; font-size: 1rem; }
.carte-module p { margin: 0; font-size: .85rem; color: #6b6058; }

table.tableau-simple { width: 100%; border-collapse: collapse; background: var(--carte); }
table.tableau-simple th, table.tableau-simple td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--bordure);
  font-size: .9rem;
}
table.tableau-simple th { background: var(--fond); }

@media (max-width: 720px) {
  .gestion-layout { flex-direction: column; }
  .gestion-sidebar { width: 100%; }
}
