:root {
  --bleu: #1f4e79;
  --bleu-clair: #2e6da4;
  --fond: #f6f8fa;
  --texte: #2c3338;
  --gris: #6b7480;
  --blanc: #ffffff;
  --bord: #e1e6eb;
}

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

html { height: 100%; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--texte);
  background-color: var(--fond);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

/* ---------- Page d'accueil : photo en fond plein ecran ---------- */
body.accueil {
  background-image: linear-gradient(rgba(255,255,255,0.80), rgba(255,255,255,0.80)), url('helios-batiment.webp');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* ---------- En-tete ---------- */
header { background: var(--bleu); color: var(--blanc); }

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--blanc);
}

.logo span { font-weight: 300; opacity: 0.85; }

nav { display: flex; gap: 0.3rem; flex-wrap: wrap; }

nav a {
  color: var(--blanc);
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-size: 0.95rem;
  opacity: 0.9;
  transition: background 0.15s, opacity 0.15s;
}

nav a:hover { background: rgba(255,255,255,0.15); opacity: 1; }
nav a.actif { background: rgba(255,255,255,0.22); opacity: 1; font-weight: 600; }

/* Groupe de droite : navigation + identité du membre connecté */
.header-droite { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.user-chip {
  display: flex; align-items: center; gap: 0.8rem;
  padding-left: 1.1rem; border-left: 1px solid rgba(255,255,255,0.3);
  color: var(--blanc);
}
.user-chip .u-ligne { display: flex; flex-direction: column; line-height: 1.15; text-align: right; color: var(--blanc); text-decoration: none; }
.user-chip a.u-ligne:hover strong { text-decoration: underline; }
.user-chip .u-ligne strong { font-size: 0.92rem; font-weight: 600; }
.user-chip .u-ligne small { opacity: 0.8; font-size: 0.78rem; }
.user-chip .u-deco {
  color: var(--blanc); font-size: 0.84rem; text-decoration: none; opacity: 0.92;
  border: 1px solid rgba(255,255,255,0.4); padding: 0.3rem 0.7rem; border-radius: 6px; white-space: nowrap;
}
.user-chip .u-deco:hover { background: rgba(255,255,255,0.15); opacity: 1; }

/* ---------- Bandeau ---------- */
.hero {
  background: transparent;
  color: var(--texte);
  text-align: center;
  padding: 3rem 1.5rem 1.5rem;
}

.hero h1 { font-size: 2.1rem; font-weight: 700; margin-bottom: 0.6rem; color: var(--bleu); }
.hero p { font-size: 1.1rem; max-width: 620px; margin: 0 auto; color: var(--texte); }

/* ---------- Contenu ---------- */
main { max-width: 960px; margin: 0 auto; padding: 2.5rem 1.5rem 3.5rem; }

h2 { color: var(--bleu); font-size: 1.45rem; margin-bottom: 1rem; }
h3 { color: var(--bleu-clair); font-size: 1.1rem; margin-bottom: 0.4rem; }
p + p { margin-top: 0.8rem; }

.cartes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.2rem;
  margin-top: 1.8rem;
}

.carte {
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: 10px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--texte);
  transition: box-shadow 0.15s, transform 0.15s;
  display: block;
}

.carte:hover { box-shadow: 0 4px 14px rgba(31,78,121,0.12); transform: translateY(-2px); }
.carte .icone { font-size: 1.8rem; margin-bottom: 0.5rem; display: block; }
.carte p { font-size: 0.92rem; color: var(--gris); margin-top: 0.3rem; }

.encart {
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-left: 4px solid var(--bleu-clair);
  border-radius: 8px;
  padding: 1.3rem 1.5rem;
  margin-top: 1.5rem;
}

.encart.note { border-left-color: #c9a227; }

/* ---------- Actualites ---------- */
.actu {
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: 10px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.2rem;
}

.actu .date {
  font-size: 0.85rem;
  color: var(--gris);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Boutons ---------- */
.bouton {
  display: inline-block;
  background: var(--bleu-clair);
  color: var(--blanc);
  text-decoration: none;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  margin-top: 1rem;
  transition: background 0.15s;
}

.bouton:hover { background: var(--bleu); }
.bouton.whatsapp { background: #25d366; }
.bouton.whatsapp:hover { background: #1ebe5a; }

/* ---------- Pied de page ---------- */
footer {
  background: var(--bleu);
  color: rgba(255,255,255,0.75);
  text-align: center;
  padding: 1.4rem 1.5rem;
  font-size: 0.88rem;
}

footer a { color: rgba(255,255,255,0.9); }

/* ---------- Page fichiers (iframe) ---------- */
body.page-fichiers { display: flex; flex-direction: column; min-height: 100vh; }
.cadre-fichiers { flex: 1; display: flex; }
.cadre-fichiers iframe { flex: 1; width: 100%; border: none; min-height: 75vh; }
.barre-fichiers { text-align: center; padding: 0.6rem 1rem; background: var(--fond); border-top: 1px solid var(--bord); }
.barre-fichiers a { color: var(--bleu-clair); text-decoration: none; font-size: 0.9rem; }
.barre-fichiers a:hover { text-decoration: underline; }

/* ================= Espace membres ================= */
.sous-titre { color: var(--gris); margin: -0.4rem 0 1.4rem; }
.sous-titre a, .aide a { color: var(--bleu-clair); }

/* Boutons (fonctionnent aussi sur <button>) */
.bouton { border: none; cursor: pointer; font-family: inherit; }
.bouton.petit { padding: 0.45rem 1rem; font-size: 0.9rem; margin-top: 0; }
.bouton.gris { background: #eef0f3; color: var(--texte); }
.bouton.gris:hover { background: #e2e6ea; }
.bouton[disabled] { opacity: 0.5; cursor: default; }
.aide { font-size: 0.85rem; color: var(--gris); margin-top: 0.9rem; text-align: center; }
.nav-deco { opacity: 0.8; }

/* Formulaires */
.carte-auth { background: var(--blanc); border: 1px solid var(--bord); border-radius: 12px; padding: 1.8rem; max-width: 460px; margin-top: 1rem; box-shadow: 0 4px 18px rgba(31,78,121,0.08); }
form label { display: block; font-size: 0.85rem; color: var(--gris); margin: 0.8rem 0 0.25rem; }
form input[type=text], form input[type=email], form input[type=password], form input[type=date], form select, form textarea {
  padding: 0.6rem 0.75rem; border: 1px solid var(--bord); border-radius: 8px; font-size: 0.95rem; font-family: inherit; background: #fff; color: var(--texte);
}
.carte-auth input, .carte-auth select, .form-membre input, .form-membre select,
.actu form input, .actu form select, .actu form textarea { width: 100%; }
form textarea { width: 100%; min-height: 120px; resize: vertical; }
.deux-cols { display: flex; gap: 0.7rem; }
.deux-cols > div { flex: 1; }
.roles { display: flex; gap: 0.6rem; margin-top: 0.4rem; }
.role-case { flex: 1; border: 1px solid var(--bord); border-radius: 8px; padding: 0.7rem; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; color: var(--texte); margin: 0; }
.role-case input { width: auto; accent-color: var(--bleu-clair); }
.indice { font-size: 0.82rem; color: var(--gris); margin-top: 0.4rem; }

/* Barre utilisateur */
.barre-user { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; background: var(--blanc); border: 1px solid var(--bord); border-radius: 10px; padding: 0.8rem 1.1rem; margin-bottom: 1.2rem; }
.barre-user .infos { font-size: 0.95rem; }
.barre-user .infos small { display: block; color: var(--gris); font-size: 0.82rem; }
.badges { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.35rem; }
.badge { font-size: 0.76rem; padding: 0.2rem 0.6rem; border-radius: 20px; background: #eef4fb; color: var(--bleu); border: 1px solid #cfe0f1; display: inline-block; }
.badge.adm { background: #fbf4e0; color: #8a6d00; border-color: #ecdca6; }

/* Fil d'Ariane + barre d'actions */
.fil { font-size: 0.9rem; color: var(--gris); margin-bottom: 0.9rem; }
.fil .sep { margin: 0 0.4rem; opacity: 0.5; }
.fil a { color: var(--bleu-clair); text-decoration: none; }
.fil a:hover { text-decoration: underline; }
.barre-actions { display: flex; justify-content: flex-end; margin-bottom: 0.7rem; }

/* Liste fichiers / dossiers */
.liste { background: var(--blanc); border: 1px solid var(--bord); border-radius: 10px; overflow: hidden; }
.ligne { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem 1.1rem; border-top: 1px solid var(--bord); text-decoration: none; color: var(--texte); }
.ligne:first-child { border-top: none; }
.ligne.dossier { cursor: pointer; }
.ligne.dossier:hover { background: #f3f7fb; }
.ico { font-size: 1.3rem; width: 1.6rem; text-align: center; }
.ligne .nom { flex: 1; font-size: 0.96rem; }
.ligne .nom small { display: block; color: var(--gris); font-size: 0.78rem; }
.ligne .nom small.desc { font-style: italic; font-size: 0.82rem; margin-top: 0.1rem; }
.dl { color: var(--bleu-clair); text-decoration: none; font-size: 0.85rem; border: 1px solid #cfe0f1; padding: 0.3rem 0.7rem; border-radius: 6px; cursor: pointer; background: #fff; font-family: inherit; }
.dl:hover { background: #eef4fb; }
.dl.sup { color: #a3242e; border-color: #f0c2c6; }
.dl.sup:hover { background: #fcebec; }
.vide { padding: 1.2rem; color: var(--gris); font-size: 0.9rem; text-align: center; }

/* Panneaux admin */
.panneau { background: var(--blanc); border: 1px solid var(--bord); border-radius: 10px; padding: 1.2rem 1.3rem; margin-bottom: 1.2rem; }
.panneau.adm { border-left: 4px solid #c9a227; }
.item { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0; border-top: 1px solid var(--bord); flex-wrap: wrap; }
.item:first-of-type { border-top: none; }
.item .acts { display: flex; gap: 0.4rem; }
.ajout-membre { display: flex; gap: 0.5rem; margin-top: 0.9rem; flex-wrap: wrap; align-items: center; }
.ajout-membre select { flex: 1; min-width: 180px; }

/* Actualites : titre, contenu, actions */
.actu h3 { color: var(--bleu); margin: 0.2rem 0 0.5rem; }
.actu p { font-size: 0.95rem; }
.actu .actions { display: flex; gap: 0.4rem; margin-top: 0.9rem; align-items: center; }

@media (max-width: 600px) {
  .hero h1 { font-size: 1.6rem; }
  .header-inner { justify-content: center; }
  .header-droite { justify-content: center; }
  .user-chip { padding-left: 0; border-left: none; }
  .deux-cols { flex-direction: column; gap: 0; }
}
