@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Archivo:wght@400;500;600&display=swap');

:root{
  --bg: #ECEEE4;
  --bg-panel: #F5F6EF;
  --ink: #2B3A38;
  --ink-soft: #5B6B67;
  --line: #D7D9C9;
  --shutter: #4F6D7A;
  --shutter-soft: #DCE4E3;
  --driftwood: #C9B79C;
  --dune: #8E9B7C;
  --dune-soft: #E4E8DB;
  --ochre: #B8763F;
  --ochre-soft: #F2E2D0;
  --rust: #B15C4A;
  --rust-soft: #F0DAD3;
  --radius: 3px;
}

*{ box-sizing: border-box; }

body{
  margin:0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Archivo', sans-serif;
  -webkit-font-smoothing: antialiased;
}

a{ color: inherit; }

.wrap{
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 28px 80px;
}
.wrap.narrow{ max-width: 480px; padding-top: 60px; }

/* Header / nav shared across pages */
header.site{
  padding: 32px 0 22px;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  border-bottom: 1px solid var(--line);
  margin-bottom: 36px;
  flex-wrap: wrap;
  gap: 16px;
}
.brand{ display:flex; align-items:center; gap:14px; text-decoration:none; }
.wave{ width:38px; height:21px; flex-shrink:0; }
.brand h1{
  font-family:'Fraunces', serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 24px;
  margin:0;
  letter-spacing: 0.2px;
}
.brand .tag{
  display:block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
  font-style: italic;
}
nav.main{ display:flex; gap:24px; font-size:14.5px; align-items:center; }
nav.main a{ color: var(--ink-soft); text-decoration:none; padding-bottom:4px; }
nav.main a.active{ color: var(--ink); border-bottom: 2px solid var(--shutter); }

h1,h2,h3{ font-family:'Fraunces', serif; font-weight:500; margin:0; }

.panel{
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 8px;
  margin-bottom: 24px;
}
.panel h3{ font-size: 17px; margin: 0 0 14px; }

.cta{
  display:inline-flex;
  align-items:center;
  gap:10px;
  background: var(--shutter);
  color: #fff;
  border:none;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-family:'Archivo', sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration:none;
}
.cta:hover{ background: #435D68; }

.btn-ghost{
  border:1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  padding: 9px 14px;
  border-radius: var(--radius);
  cursor:pointer;
  font-family:'Archivo', sans-serif;
  text-decoration:none;
  display:inline-block;
}
.btn-wa{
  border:none;
  background: var(--dune);
  color: #fff;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: var(--radius);
  cursor:pointer;
  font-family:'Archivo', sans-serif;
  font-weight:500;
}

.status-tag{
  display:inline-block;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 8px;
}
.status-tag.pending{ background: var(--ochre-soft); color: var(--ochre); }
.status-tag.confirmed{ background: var(--dune-soft); color: #4B5A3D; }
.status-tag.declined{ background: var(--rust-soft); color: var(--rust); }

footer.site{
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
}

.field{ margin-bottom: 14px; }
.field label{ display:block; font-size:13px; color: var(--ink-soft); margin-bottom:5px; }
.field input, .field textarea, .field select{
  width:100%;
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  font-family:'Archivo', sans-serif;
  font-size: 14px;
  background: #fff;
}

/* Modal (used on index) */
.overlay{
  display:none;
  position:fixed; inset:0;
  background: rgba(43,58,56,0.4);
  align-items:center;
  justify-content:center;
  padding: 20px;
  z-index: 10;
}
.overlay.open{ display:flex; }
.modal{
  background: var(--bg-panel);
  border-radius: 4px;
  max-width: 420px;
  width:100%;
  padding: 28px;
}
.modal h3{ font-size:20px; margin: 0 0 4px; }
.modal p.sub{ color: var(--ink-soft); font-size:13.5px; margin: 0 0 20px; }
.modal-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:18px; }

/* =========================================================
   RESPONSIVE — smartphone / tablette
   ========================================================= */

/* Empêche le zoom auto d'iOS sur les champs (< 16px déclenche le zoom) */
@media (max-width: 700px){
  .field input, .field textarea, .field select{ font-size: 16px; }
}

/* --- Bouton menu (masqué sur grand écran) --- */
.nav-toggle{
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.nav-toggle span{
  display: block;
  width: 18px; height: 1.5px;
  background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle.open span:nth-child(1){ transform: translateY(5.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2){ opacity: 0; }
.nav-toggle.open span:nth-child(3){ transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 760px){
  .wrap{ padding: 0 18px 60px; }

  header.site{
    padding: 20px 0 16px;
    margin-bottom: 26px;
    align-items: center;
    position: relative;
  }
  .brand h1{ font-size: 20px; }
  .brand .tag{ font-size: 12px; }
  .wave{ width: 32px; height: 18px; }

  .nav-toggle{ display: flex; }

  nav.main{
    display: none;
    flex-direction: column;
    gap: 0;
    width: 100%;
    order: 3;
    margin-top: 14px;
    border-top: 1px solid var(--line);
  }
  nav.main.open{ display: flex; }
  nav.main a{
    padding: 14px 2px;          /* cible tactile confortable */
    border-bottom: 1px solid var(--line);
    font-size: 15.5px;
  }
  nav.main a.active{
    border-bottom: 1px solid var(--line);
    color: var(--shutter);
    font-weight: 500;
  }

  /* Boutons pleine largeur, plus faciles à viser au doigt */
  .cta{ width: 100%; justify-content: center; padding: 14px 20px; }
  .btn-ghost, .btn-wa{ padding: 11px 14px; }

  .panel{ padding: 18px 16px 6px; }

  h2{ font-size: 20px !important; }

  .modal{ padding: 22px 18px; }
  .modal-actions{ flex-direction: column-reverse; }
  .modal-actions .btn-ghost,
  .modal-actions .cta{ width: 100%; text-align: center; justify-content: center; }
}

/* =========================================================
   ESPACE FAMILLE — membres, administration
   ========================================================= */

/* --- Tableau des membres --- */
.members{ }
.member-row{
  display:flex; align-items:center; gap: 14px;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.member-row:first-of-type{ border-top:none; }
.member-avatar{
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--shutter-soft); color: var(--shutter);
  display:flex; align-items:center; justify-content:center;
  font-size: 13px; font-weight: 600; flex-shrink:0;
}
.member-main{ flex:1; min-width:0; }
.member-main .m-name{ font-weight:500; font-size: 15px; }
.member-main .m-sub{ color: var(--ink-soft); font-size: 13px; margin-top:2px; }
.role-tag{
  font-size: 12px; padding: 3px 10px; border-radius: 10px; flex-shrink:0;
  background: var(--dune-soft); color: #4B5A3D;
}
.role-tag.admin{ background: var(--shutter-soft); color: var(--shutter); font-weight:500; }
.member-actions{ display:flex; gap: 6px; flex-shrink:0; }
.icon-btn{
  border:1px solid var(--line); background: transparent; color: var(--ink-soft);
  font-family:'Archivo', sans-serif; font-size: 12.5px;
  padding: 6px 10px; border-radius: var(--radius); cursor:pointer;
}
.icon-btn:hover{ color: var(--ink); border-color: var(--ink-soft); }
.icon-btn.danger{ color: var(--rust); border-color: var(--rust-soft); }
.icon-btn.danger:hover{ border-color: var(--rust); }

@media (max-width: 700px){
  .member-row{ flex-wrap: wrap; }
  .member-main{ flex-basis: calc(100% - 110px); }
  .member-actions{ flex-basis: 100%; margin-top: 4px; }
  .member-actions button{ flex:1; }
}

/* --- Formulaire sur deux colonnes --- */
.form-2col{ display:grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-2col .full{ grid-column: 1 / -1; }
@media (max-width: 620px){ .form-2col{ grid-template-columns: 1fr; } }

/* --- Titre de section --- */
.section-head{
  display:flex; align-items:baseline; justify-content:space-between;
  gap: 12px; margin: 40px 0 16px; flex-wrap: wrap;
}
.section-head h2{ font-size: 22px; }
.section-head .hint{ color: var(--ink-soft); font-size: 13px; }

/* --- Sélecteur de rôle de la maquette --- */
.demo-switch{
  margin-top: 14px; display:flex; align-items:center; gap: 8px;
  font-size: 12px; color: var(--ink-soft); flex-wrap: wrap;
}
.demo-switch button{
  border:1px solid var(--line); background: transparent; color: var(--ink-soft);
  font-family:'Archivo', sans-serif; font-size: 12px;
  padding: 4px 10px; border-radius: 10px; cursor:pointer;
}
.demo-switch button.on{ background: var(--shutter); color:#fff; border-color: var(--shutter); }

/* --- Messages d'erreur et de confirmation --- */
.msg{ display:none; font-size: 13.5px; padding: 11px 14px; border-radius: var(--radius);
      margin-bottom: 16px; line-height: 1.5; }
.msg.erreur{ display:block; background: var(--rust-soft); color: var(--rust); }
.msg.succes{ display:block; background: var(--dune-soft); color: #4B5A3D; }
.msg.info  { display:block; background: var(--shutter-soft); color: var(--shutter); }
.m-name .moi{ color: var(--ink-soft); font-weight: 400; font-size: 13px; }
.actions-sejour{ margin-top: 10px; display:flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 760px){ .actions-sejour{ justify-content: flex-start; } }

/* --- Bouton de déconnexion --- */
.btn-off{
  order: 3;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--ink-soft);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0;
  transition: color .18s ease, border-color .18s ease;
}
.btn-off svg{ width: 17px; height: 17px; }
.btn-off:hover{ color: var(--rust); border-color: var(--rust); }

@media (max-width: 760px){
  header.site{ position: relative; padding-right: 96px; }
  .btn-off{ position: absolute; top: 18px; right: 52px; width: 40px; height: 40px; }
  .nav-toggle{ position: absolute; top: 18px; right: 0; }
}
.aide{ font-size: 12.5px; color: var(--ink-soft); margin: 6px 0 0; line-height: 1.5; }
