
/* styles.css – thème clair + responsive, header sticky, grid + flex */
:root{
  --bg: #f7f8fa;
  --card-bg: #fff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --primary: #0a6cff;
  --primary-600: #0959d1;
  --border: #e5e7eb;
  --accent: #f0f7ff;
  --shadow: 0 6px 20px rgba(0,0,0,.08);
  --radius: 12px;
  --maxw: 1100px;
}

/* Dark mode auto */
@media (prefers-color-scheme: dark){
  :root{
    --bg: #101317;
    --card-bg: #151a20;
    --text: #e6e8eb;
    --muted: #9aa3ad;
    --border: #2a3038;
    --accent: #0b2a55;
    --shadow: 0 6px 24px rgba(0,0,0,.35);
  }
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--text); background: var(--bg); line-height: 1.5;
}

/* style menu et header */
header{
  position: sticky; top: 0; z-index: 50;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.nav{ max-width: var(--maxw); margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 24px; }
.brand{ display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
/*.brand .logo{ width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, var(--primary), #5ea0ff); display: inline-block; }*/
.brand .logo{width: 32px; height: 32px; object-fit: contain; border-radius: 6px; }

.menu{ display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.menu a{ color: var(--text); text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 8px; }
.menu a:hover, .menu a[aria-current="page"]{ background: var(--accent); color: var(--primary); }

/* style page principale */
main{ max-width: var(--maxw); margin: 24px auto 60px; padding: 0 20px; display: flex; flex-direction: column; gap: 24px; }
.page-title{ display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px; }
.page-title h1{ margin: 0; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); }
.page-title p{ margin: 4px 0 0;  }

/* style formulaire introduction des données*/
.layout{ display: grid; grid-template-columns: 1fr minmax(260px, 320px); gap: 24px; }
@media (max-width: 900px){ .layout{ grid-template-columns: 1fr; } }

/* Cadre explicatif blanc */
.card{ background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card h2{ margin: 0 0 12px; font-size: 1.2rem; }

/* Grid pour la sélection des modules de calcul */
.form-grid{ display: grid; grid-template-columns: repeat(2, minmax(240px, 1fr)); gap: 14px; }
@media (max-width: 700px){ .form-grid{ grid-template-columns: 1fr; } }
label{ font-weight: 600; font-size: .95rem; }

/* field pour les formulaires */
.field{ display: flex; flex-direction: column; gap: 6px; }
input[type="date"], input[type="number"], select{ width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font-size: .95rem; }
@media (prefers-color-scheme: dark){ input[type="date"], input[type="number"], select{ background: #0e1216; color: var(--text); } }

/* On crée une variante horizontale pour field input sur la même ligne (page mortalité)*/
.field.inline {
  display: flex ;
  flex-direction: row;            /* Aligne sur la même ligne */
  align-items: center;            /* Centre verticalement le texte et le champ */
  justify-content: space-evenly; /* Optionnel : pousse le select à droite */
}
/* On empêche le select de prendre toute la place dans cette variante */
.field.inline select {
  width: auto;             /* Annule le width 100% */
  min-width: 200px;        /* Optionnel : définit une largeur minimale */
}

/*Force l'affichage sur une ligne */
.row{ display: flex; gap: 10px; align-items: center; justify-content: space-evenly; }

/* Empêche l'input de prendre toute la place et limite sa largeur */
.row input {
  width: auto; /* Laisse l'input s'adapter à son contenu */
  max-width: 80px;
}

.actions{ display: flex; gap: 12px; justify-content: center; margin-top: 10px; }

/* style bouton */
button{ appearance: none; border: none; border-radius: 10px; padding: 10px 16px; font-weight: 700; color: #fff; background: var(--primary); cursor: pointer; }
button:hover{ background: var(--primary-600); }

.results{ background: #fafcff; border: 1px dashed #cfe0ff; padding: 12px; border-radius: 10px; }
@media (prefers-color-scheme: dark){ .results{ background: #0e1520; border-color: #284a86; } }

/* style grisé clair pour commentaires */
.muted{ color: var(--muted); }

/* style base de page
footer{ max-width: var(--maxw); margin: 30px auto; padding: 0 20px 30px; color: var(--muted); }

/* Utilitaire pour cartes cliquables sur la page hub */
.card.link{ text-decoration: none; color: inherit; transition: transform .08s ease, box-shadow .08s ease; }
.card.link:hover{ transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.12); }

/* Lien primaire cohérent pour pages du site */
.link-primary-center{
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;  
  display: block;
  text-align: center;
  margin: 12px auto;

}
.link-primary-center:hover{
  text-decoration: underline;
}

/* Style pour l'encodage dynamique du nombre d'enfants */
.children-container {
  grid-column: 1 / -1; /* occupe toute la ligne */
}

.child-fieldset {
  border: 1px solid #ddd;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 6px;
}

.child-fieldset legend {
  font-weight: 600;
  padding: 0 6px;
}

/*Style table */
.table-wrapper{
  display: flex;
  justify-content: center;
  margin: 20px auto;
}

.table{
  border-collapse: collapse;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  width: 100%;
  max-width: 700px;
}

.table th,
.table td{
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table th{
  background: var(--accent);
  color: var(--primary);
  font-weight: 700;
}

.table tr:last-child td{
  border-bottom: none;
}

@media (prefers-color-scheme: dark){
  .table th{
    background: var(--accent);
  }
}
/*style pour le formulaire de contact */
textarea{
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .95rem;
  resize: vertical;
  background: #fff;
}

@media (prefers-color-scheme: dark){
  textarea{
    background: #0e1216;
    color: var(--text);
  }
}

button:disabled{
  opacity: 0.6;
  cursor: not-allowed;
}

/* style pour la page d'accueil */
/* ===== Section Auteur ===== */

.author-content {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.author-photo {
  width: 160px;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.author-text p {
  margin-top: 0;
}

/* Responsive : photo au-dessus du texte sur petit écran */
@media (max-width: 700px) {
  .author-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .author-photo {
    width: 180px;
  }
}
