/* ============================================================
   Gestion de Bénévoles — charte visuelle UPProcess
   Palette bleu clair, navy, dégradés bleus, Poppins.
   ============================================================ */
:root {
  --blue-light: #8fc1ea;
  --blue: #5a9fd6;
  --blue-deep: #3d7fb8;
  --blue-darker: #2f6699;

  --bg: #e9f2fb;
  --bg-soft: #f4f9fe;
  --bg-hero-1: #dcebfa;
  --bg-hero-2: #c7e0f6;

  --navy: #1e3a5f;
  --text: #3f5168;
  --muted: #7e91a8;
  --white: #ffffff;

  --ok: #1a8a4a;
  --ok-soft: #e6f7ee;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --warn: #b9770a;
  --warn-soft: #fdf3e1;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 40px -18px rgba(45, 102, 153, 0.45);
  --shadow-soft: 0 10px 30px -12px rgba(45, 102, 153, 0.30);
  --max-width: 1140px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: var(--blue-deep); }
a:hover { color: var(--blue); }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.page { padding: 110px 0 80px; }
.page-narrow { max-width: 720px; }

h1, h2, h3 { color: var(--navy); line-height: 1.25; font-weight: 600; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h2 { font-size: 1.4rem; margin: 30px 0 14px; }
h3 { font-size: 1.15rem; }
.subtitle { color: var(--muted); font-size: 1.05rem; margin: 6px 0 26px; }
.accent {
  background: linear-gradient(95deg, var(--blue), var(--blue-deep));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: #DAEAF7; padding: 12px 0;
  box-shadow: 0 4px 20px -10px rgba(45, 102, 153, 0.35);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; position: relative; }

/* Bouton hamburger (mobile uniquement) */
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px; z-index: 101;
}
.nav-toggle span { width: 26px; height: 2.5px; background: var(--navy); border-radius: 2px; transition: var(--transition); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Sous-navigation admin : défilement horizontal au pouce sur mobile */
.subnav {
  display: flex; align-items: center; gap: 8px; margin-bottom: 18px;
  flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 6px; scrollbar-width: thin;
}
.subnav::-webkit-scrollbar { height: 4px; }
.subnav::-webkit-scrollbar-thumb { background: rgba(143,193,234,.5); border-radius: 4px; }
.subnav .btn { flex: 0 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--navy); line-height: 0; }
.brand-logo { height: 46px; width: auto; display: block; }
.brand-sep {
  font-weight: 600; font-size: 1.02rem; line-height: 1; color: var(--navy);
  padding-left: 12px; border-left: 2px solid rgba(45, 102, 153, 0.28); letter-spacing: 0.2px;
}
/* (ancien .logo-dot conservé pour compat, plus utilisé) */
.brand .logo-dot {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue-light), var(--blue-deep));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.1rem;
}
.brand b { font-weight: 300; }
@media (max-width: 520px) {
  .brand-logo { height: 38px; }
  .brand-sep { font-size: 0.92rem; padding-left: 9px; }
}
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav-link { color: var(--navy); font-weight: 500; font-size: 0.95rem; position: relative; }
.nav-link:hover { color: var(--blue-deep); }
.nav-link.active { color: var(--blue-deep); }
.nav .spacer { flex: 1; }
.badge-dot {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; background: var(--danger); color: #fff;
  border-radius: 999px; font-size: 0.68rem; font-weight: 700; margin-left: 4px;
  box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.55); animation: badge-pulse 1.8s infinite;
  position: relative; top: -1px;
}
@keyframes badge-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(192, 57, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0); }
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 24px; border-radius: 50px; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; border: 2px solid transparent; transition: var(--transition);
  font-family: inherit; color: var(--blue-deep); background: var(--bg);
}
.btn-primary { background: linear-gradient(120deg, var(--blue), var(--blue-deep)); color: #fff; box-shadow: var(--shadow-soft); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: #fff; }
.btn-ghost { background: transparent; color: var(--blue-deep); border-color: var(--blue-light); }
.btn-ghost:hover { background: var(--white); border-color: var(--blue); transform: translateY(-3px); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(192,57,43,.35); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 7px 16px; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* ---------- Cartes ---------- */
.card {
  background: var(--white); border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow-soft); border: 1px solid rgba(143, 193, 234, 0.25);
}
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
/* Variante centrée (landing) : 3 cartes symétriques, pas de colonne vide */
.grid.features-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); max-width: 900px; margin-left: auto; margin-right: auto; }

.org-card { display: block; transition: var(--transition); cursor: pointer; }
.org-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.org-card h3 { margin-bottom: 6px; }

.stat { text-align: center; }
.stat .num { font-size: 2rem; font-weight: 700; color: var(--blue-deep); line-height: 1; }
.stat .lbl { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }

/* ---------- Avatar / logo d'organisation ---------- */
.org-avatar {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0; overflow: hidden;
  background: linear-gradient(135deg, var(--blue-light), var(--blue-deep));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700;
}
.org-avatar img { width: 100%; height: 100%; object-fit: cover; }
.org-avatar.lg { width: 96px; height: 96px; border-radius: 20px; font-size: 2.6rem; }
.org-avatar.sm { width: 38px; height: 38px; border-radius: 11px; font-size: 1.1rem; }

/* ---------- Pills ---------- */
.pill {
  display: inline-block; padding: 4px 13px; border-radius: 50px;
  font-size: 0.76rem; font-weight: 600; background: var(--bg); color: var(--blue-deep);
}
.pill.violet { background: #ece7ff; color: #6a4ad6; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.muted { background: var(--bg); color: var(--muted); }

/* ---------- Formulaires ---------- */
label { display: block; font-weight: 500; margin: 16px 0 6px; font-size: 0.9rem; color: var(--navy); }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=time], input[type=color], select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid #cdddee; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.95rem; color: var(--navy); background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(90, 159, 214, 0.2);
}
textarea { resize: vertical; min-height: 110px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 150px; }
.hint { color: var(--muted); font-size: 0.82rem; margin-top: 5px; }

.auth-wrap { max-width: 440px; margin: 130px auto 60px; }

/* ---------- Flash ---------- */
.flash { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 12px; font-weight: 500; }
.flash.success { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--danger-soft); color: var(--danger); }
.flash.info { background: #e7effb; color: var(--blue-darker); }

/* ---------- Listes ---------- */
.list { display: flex; flex-direction: column; gap: 12px; }
.list-item {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--white);
  border: 1px solid rgba(143, 193, 234, 0.25); border-radius: var(--radius-sm); box-shadow: var(--shadow-soft);
}
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; color: var(--navy); }
.list-item .meta { color: var(--muted); font-size: 0.85rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 12px; border-bottom: 1px solid rgba(143, 193, 234, 0.3); }
th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
tbody tr:hover { background: var(--bg-soft); }

.code-box {
  font-family: Consolas, "Cascadia Code", monospace; font-size: 1.5rem; font-weight: 700;
  letter-spacing: 4px; color: var(--blue-deep); background: var(--bg-soft);
  border: 2px dashed var(--blue-light); border-radius: var(--radius-sm); padding: 12px 22px; display: inline-block;
}

.muted { color: var(--muted); }
.center { text-align: center; }
.mt { margin-top: 18px; } .mb { margin-bottom: 18px; }
.flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.empty { color: var(--muted); text-align: center; padding: 46px 20px; }

/* ---------- Segmented (type d'activité) ---------- */
.seg { display: flex; border: 1px solid #cdddee; border-radius: var(--radius-sm); overflow: hidden; }
.seg label { flex: 1; margin: 0; text-align: center; padding: 12px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg input { display: none; }
.seg label:has(input:checked) { background: linear-gradient(120deg, var(--blue), var(--blue-deep)); color: #fff; }

/* ---------- Contrôles de présence ---------- */
.att-controls { display: flex; gap: 6px; }
.att-controls label { margin: 0; }
.att-controls input { display: none; }
.att-controls span {
  padding: 6px 13px; border-radius: 50px; border: 1px solid #cdddee; cursor: pointer;
  font-size: 0.8rem; font-weight: 600; color: var(--muted); display: inline-block;
}
.att-controls label:has(input:checked) span.s-present { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.att-controls label:has(input:checked) span.s-absent { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.att-controls label:has(input:checked) span.s-inscrit { background: #ece7ff; color: #6a4ad6; border-color: #6a4ad6; }
.att-controls label:has(input:checked) span.s-none { background: var(--bg); color: var(--navy); border-color: var(--muted); }

/* ---------- Pastilles de session (admin) ---------- */
.sess-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px;
  border-radius: 50px; background: var(--bg); border: 1px solid rgba(143,193,234,.35); font-size: .82rem; font-weight: 600; }
.sess-chip a { color: var(--blue-deep); }
.sess-chip.canceled { background: var(--danger-soft); border-color: rgba(192,57,43,.3); }
.sess-chip.canceled a { color: var(--danger); }
.sess-x { border: none; background: transparent; cursor: pointer; color: var(--muted); font-weight: 700;
  font-size: .9rem; padding: 2px 6px; border-radius: 50px; line-height: 1; }
.sess-x:hover { background: rgba(192,57,43,.12); color: var(--danger); }

/* ---------- Guide email ---------- */
.mail-guide { background: var(--bg-soft); border: 1px solid rgba(143,193,234,.4);
  border-left: 4px solid var(--blue-deep); border-radius: var(--radius-sm);
  padding: 14px 18px; margin-top: 10px; }
.mail-guide-title { font-weight: 700; margin-bottom: 6px; }
.mail-guide ol { margin: 0; padding-left: 20px; }
.mail-guide li { margin: 5px 0; font-size: 0.9rem; line-height: 1.6; }

/* ---------- Galerie photos ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.gallery-item { background: var(--white); border: 1px solid rgba(143,193,234,.25); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-soft); }
.gallery-item img { width: 100%; height: 140px; object-fit: cover; display: block; cursor: zoom-in; }
.gallery-cap { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; font-size: 0.82rem; color: var(--navy); }
.gallery-cap span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* liens ressources (bénévole) */
.res-links { display: flex; flex-wrap: wrap; gap: 10px; }
.res-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 50px;
  background: var(--white); border: 1px solid rgba(143,193,234,.35); box-shadow: var(--shadow-soft); font-weight: 600; color: var(--navy); }
.res-chip:hover { transform: translateY(-2px); color: var(--blue-deep); text-decoration: none; }

/* ---------- Indicateur de places ---------- */
.places { max-width: 320px; }
.places-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.places-count { font-weight: 700; color: var(--navy); font-size: .9rem; }
.places-bar { height: 8px; border-radius: 50px; background: #e3eef8; overflow: hidden; }
.places-bar span { display: block; height: 100%; border-radius: 50px;
  background: linear-gradient(90deg, var(--blue), var(--blue-deep)); transition: width .3s; }

/* ---------- Réponses live (bénévole) ---------- */
.resp-row { display: flex; gap: 10px; flex-wrap: wrap; }
.resp-row form { flex: 1; min-width: 130px; }
.resp-btn {
  width: 100%; padding: 11px 14px; border-radius: 50px; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 0.9rem;
  border: 2px solid #cdddee; background: #fff; color: var(--muted); transition: var(--transition);
}
.resp-btn:hover { transform: translateY(-2px); }
.resp-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; background: var(--bg); }
.resp-btn.r-yes.active { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.resp-btn.r-maybe.active { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.resp-btn.r-no.active { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

/* dépliant "qui a répondu" */
.who { margin-top: 8px; }
.who summary {
  cursor: pointer; color: var(--blue-deep); font-weight: 600; font-size: 0.85rem;
  list-style: none; display: inline-flex; align-items: center; gap: 6px; width: fit-content;
}
.who summary::before { content: "▸"; transition: transform .2s; }
.who[open] summary::before { transform: rotate(90deg); }
.who-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.who-list > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.who-name {
  display: inline-block; padding: 3px 11px; border-radius: 50px;
  background: var(--bg); color: var(--navy); font-size: 0.82rem; font-weight: 500;
}

/* badges réponse (admin) */
.resp-tag { display:inline-block; padding:3px 11px; border-radius:50px; font-size:0.78rem; font-weight:600; }
.resp-tag.yes { background: var(--ok-soft); color: var(--ok); }
.resp-tag.maybe { background: var(--warn-soft); color: var(--warn); }
.resp-tag.no { background: var(--danger-soft); color: var(--danger); }
.resp-tag.none { background: var(--bg); color: var(--muted); }

/* ---------- Disponibilités ---------- */
.avail-grid { display: grid; grid-template-columns: 130px repeat(3, 1fr); gap: 8px; align-items: center; }
.avail-grid .head { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-align: center; }
.avail-grid .day { font-weight: 600; color: var(--navy); font-size: 0.9rem; }
.avail-cell label { margin: 0; }
.avail-cell input { display: none; }
.avail-cell label > span {
  display: flex; align-items: center; justify-content: center; padding: 12px;
  border: 1px solid #cdddee; border-radius: var(--radius-sm); cursor: pointer; color: var(--muted);
}
.avail-cell label:has(input:checked) > span { background: var(--blue-deep); color: #fff; border-color: var(--blue-deep); }

/* ---------- Footer ---------- */
.site-footer { background: #14263d; color: #b9c8dc; padding: 40px 0 36px; text-align: center; margin-top: 50px; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.footer-logo-img { height: 58px; width: auto; border-radius: 10px; display: block; }
.footer-tagline { color: #8ea4bf; font-style: italic; font-weight: 300; font-size: 0.95rem; }
.footer-copy { font-size: 0.85rem; margin-top: 8px; color: #7e91a8; }
.footer-copy a { color: var(--blue-light); }
.footer-copy a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  /* Le menu devient un panneau déroulant sous l'en-tête */
  .nav {
    position: absolute; top: calc(100% + 12px); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #DAEAF7; border-radius: 14px; padding: 6px;
    box-shadow: var(--shadow); border: 1px solid rgba(45,102,153,.15);
    display: none; z-index: 100;
  }
  .nav.open { display: flex; }
  .nav .nav-link {
    width: 100%; padding: 14px 16px; border-radius: 10px;
    border-bottom: 1px solid rgba(45,102,153,.08);
  }
  .nav .nav-link:last-child { border-bottom: none; }
  .nav .nav-link:hover, .nav .nav-link.active { background: rgba(255,255,255,.55); }
  .nav .nav-logout { width: 100%; }
  .nav .nav-logout .nav-link { display: block; }
  .nav .btn { width: 100%; margin-top: 6px; }
  .nav .label-hide { display: none; }
  .avail-grid { grid-template-columns: 90px repeat(3, 1fr); }
  /* Évite le zoom automatique iOS au focus (police < 16px) */
  input[type=text], input[type=email], input[type=password], input[type=date],
  input[type=time], input[type=color], select, textarea { font-size: 16px; }
}
