/* ============================================================
   Mariage Christian & Mireille — Design System global
   Style : Magazine de luxe / Mariage haut de gamme
   Approche : Mobile-First (desktop en min-width)
   Règle : aucune icône, aucun emoji — texte et géométrie uniquement

   FICHIER UNIQUE : contient TOUS les styles de l'application.
   Sommaire :
     1. Variables, base, typographie, boutons
     2. Header partagé   (partials/header.html)
     3. Footer partagé   (partials/footer.html)
     4. Titres de page   (commun à toutes les pages)
     5. Page Accueil     (index.html)
     6. Page Invités     (invites.html)
     7. Page Plan        (plan.html)
     8. Page Admin       (admin.html)
     9. Cache des données (app.js)

   Version "lisibilité mobile" :
   - texte courant à 16px, textes secondaires à 14px minimum ;
   - petites capitales espacées (labels, menu, boutons) à 12px minimum ;
   - Cormorant en 500 (courant) / 600 (titres), plus de graisse 300 ;
   - Montserrat en 400 (petits textes) / 500-600 (boutons, éléments importants).
   ============================================================ */

/* ---------- Google Fonts (graisses utilisées uniquement) ---------- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500;1,600&family=Montserrat:wght@400;500;600&display=swap');

/* ---------- Variables ---------- */
:root {
  /* Palette */
  --blanc:      #FDFBF7;  /* Fond principal */
  --olive:      #6B705C;  /* Couleur principale */
  --sauge:      #A5A58D;  /* Textes secondaires / indications uniquement */
  --champagne:  #E3D5CA;  /* Accents, bordures */
  --texte:      #2B2D2A;  /* Texte principal (vert très foncé) */
  --terracotta: #A0522D;  /* Actions de suppression */

  /* Familles */
  --font-serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-sans:  'Montserrat', 'Helvetica Neue', Arial, sans-serif;

  /* Échelle de tailles (mobile) — utilisée par toutes les pages */
  --fs-micro:  0.75rem;   /* 12px : petites capitales espacées (labels, menu, boutons) */
  --fs-petit:  0.875rem;  /* 14px : textes secondaires ("- 4 prs", totaux, messages) */
  --fs-base:   1rem;      /* 16px : texte courant */
  --fs-nom:    1.25rem;   /* 20px : noms des invités (Cormorant, œil plus petit) */
  --fs-table:  1.5rem;    /* 24px : "TABLE 05" */
  --fs-h3:     1.5rem;
  --fs-h2:     2.25rem;   /* titres de pages */
  --fs-h1:     2.5rem;

  /* Graisses */
  --fw-serif:       500;  /* Cormorant : texte courant, noms */
  --fw-serif-titre: 600;  /* Cormorant : titres */
  --fw-sans:        400;  /* Montserrat : petits textes */
  --fw-sans-fort:   500;  /* Montserrat : labels, éléments importants */
  --fw-bouton:      600;  /* Montserrat : boutons */

  /* Espacement des lettres (réduit : les tailles ont augmenté) */
  --tracking-large: 0.2em;
  --tracking-moyen: 0.12em;

  /* Espacements */
  --espace-xs: 0.5rem;
  --espace-s:  1rem;
  --espace-m:  1.5rem;
  --espace-l:  2.5rem;
  --espace-xl: 4rem;

  /* Divers */
  --largeur-max: 1080px;
  --filet: 1px solid var(--champagne);
  --transition: 0.35s ease;
}

/* ---------- Reset léger ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;               /* respecte le réglage de taille du téléphone */
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Base ---------- */
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--blanc);
  color: var(--texte);
  font-family: var(--font-sans);
  font-weight: var(--fw-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

main {
  flex: 1;
  width: 100%;
}

p {
  color: var(--texte);
}

/* Champs de formulaire : même police, 16px pour éviter le zoom iOS */
input,
button,
select,
textarea {
  font-family: inherit;
  font-size: var(--fs-base);
}

/* ---------- Typographie ---------- */
h1, h2, h3, .serif {
  font-family: var(--font-serif);
  font-weight: var(--fw-serif-titre);
  line-height: 1.15;
  color: var(--texte);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

/* Petit label en capitales espacées (sur-titres, mentions) */
.label {
  font-family: var(--font-sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-sans-fort);
  text-transform: uppercase;
  letter-spacing: var(--tracking-large);
  color: var(--olive);
}

/* Italique serif (citations, esperluette, sous-titres) */
.italique {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: var(--fw-serif);
}

/* ---------- Éléments géométriques décoratifs ---------- */

/* Filet horizontal fin */
.filet {
  width: 60px;
  height: 1px;
  margin: var(--espace-m) auto;
  background-color: var(--champagne);
  border: 0;
}

/* Losange : carré pivoté */
.losange {
  display: inline-block;
  width: 7px;
  height: 7px;
  background-color: var(--champagne);
  transform: rotate(45deg);
  vertical-align: middle;
}

/* Séparateur : filet — losange — filet */
.separateur {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--espace-s);
  margin: var(--espace-m) auto;
}
.separateur::before,
.separateur::after {
  content: '';
  width: 40px;
  height: 1px;
  background-color: var(--champagne);
}

/* ---------- Conteneur ---------- */
.conteneur {
  width: 100%;
  max-width: var(--largeur-max);
  margin: 0 auto;
  padding: 0 var(--espace-m);
}

/* ---------- Boutons ---------- */
.btn {
  display: block;
  width: 100%;
  min-height: 52px;               /* zone tactile confortable */
  padding: 1rem var(--espace-m);
  font-family: var(--font-sans);
  font-size: 0.8125rem;           /* 13px en capitales espacées */
  font-weight: var(--fw-bouton);
  text-transform: uppercase;
  letter-spacing: var(--tracking-large);
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  border: 1px solid var(--olive);
  background-color: transparent;
  color: var(--olive);
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

.btn:hover,
.btn:focus-visible {
  background-color: var(--olive);
  color: var(--blanc);
  outline: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Variante pleine */
.btn--plein {
  background-color: var(--olive);
  color: var(--blanc);
}
.btn--plein:hover,
.btn--plein:focus-visible {
  background-color: var(--texte);
  border-color: var(--texte);
}

/* Variante suppression */
.btn--supprimer {
  border-color: var(--terracotta);
  color: var(--terracotta);
}
.btn--supprimer:hover,
.btn--supprimer:focus-visible {
  background-color: var(--terracotta);
  color: var(--blanc);
}

/* ============================================================
   2. HEADER PARTAGÉ  —  partials/header.html
   ============================================================ */
.entete {
  position: sticky;
  top: 0;
  z-index: 30;
  background-color: var(--blanc);
  border-bottom: var(--filet);
}

.entete__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 0.75rem 3rem;  /* 3rem de chaque côté : le titre reste centré malgré la flèche */
  text-align: center;
}

.entete__retour {
  position: absolute;
  left: var(--espace-s);
  top: 50%;
  transform: translateY(-50%);
  width: 44px;            /* zone tactile confortable */
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--olive);
  transition: color var(--transition);
}
.entete__retour:hover,
.entete__retour:focus-visible {
  color: var(--texte);
  outline: none;
}

.entete__titre {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: var(--fw-serif-titre);
  line-height: 1.2;
  color: var(--texte);
}

.entete__titre .italique { color: var(--olive); }

.entete__date {
  margin-top: 0.15rem;
  font-size: var(--fs-micro);
  font-weight: var(--fw-sans-fort);
  text-transform: uppercase;
  letter-spacing: var(--tracking-large);
  color: var(--sauge);
}

@media (min-width: 768px) {
  .entete__titre { font-size: 2rem; }
  .entete__retour { left: var(--espace-m); }
}

/* ============================================================
   3. FOOTER PARTAGÉ  —  partials/footer.html
   ============================================================ */
.footer {
  margin-top: var(--espace-xl);
  padding: var(--espace-m) 0;
  border-top: var(--filet);
  text-align: center;
  background-color: var(--blanc);
}

/* Menu : ACCUEIL • INVITÉS • PLAN DE SALLE */
.footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 0.75rem;
  list-style: none;
  margin-bottom: var(--espace-s);
}

.footer__nav li {
  display: flex;
  align-items: center;
}

.footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;               /* cible tactile recommandée */
  padding: 0 0.25rem;
  font-size: var(--fs-micro);
  font-weight: var(--fw-sans-fort);
  text-transform: uppercase;
  letter-spacing: var(--tracking-moyen);
  color: var(--sauge);
  transition: color var(--transition);
}

.footer__nav a:hover,
.footer__nav a:focus-visible {
  color: var(--olive);
  outline: none;
}

/* Page en cours (aria-current ajouté par le serveur) : Olive et gras */
.footer__nav a[aria-current="page"] {
  color: var(--olive);
  font-weight: var(--fw-bouton);
}

/* Point séparateur géométrique entre les liens (pas de caractère) */
.footer__nav li + li::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 0.75rem;
  border-radius: 50%;
  background-color: var(--sauge);
}

/* Ligne "Salle — Contact — Conçu par" */
.footer__mentions {
  font-size: var(--fs-micro);
  font-weight: var(--fw-sans);
  line-height: 1.9;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sauge);
}

/* ============================================================
   4. TITRES DE PAGE (sur-titre + titre, commun à toutes les pages)
   ============================================================ */
.titre-page {
  text-align: center;
  margin-bottom: var(--espace-m);
}

.titre-page h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-serif-titre);
  color: var(--olive);
  margin-top: 0.25rem;
}

/* ---------- Utilitaires ---------- */
.centre  { text-align: center; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Tablette / Desktop ---------- */
@media (min-width: 768px) {
  :root {
    --fs-h1: 4rem;
    --fs-h2: 2.75rem;
  }

  .btn {
    display: inline-block;
    width: auto;
    min-width: 260px;
  }
}

/* ============================================================
   5. PAGE ACCUEIL  —  index.html
   ============================================================ */
/* ---------- Hero ---------- */
.hero {
  padding: var(--espace-l) 0 var(--espace-m);
  text-align: center;
}

.hero__surtitre {
  margin-bottom: var(--espace-m);
}

.hero__noms {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 3.25rem;
  color: var(--texte);
}

.hero__esperluette {
  font-size: 2.25rem;
  color: var(--olive);
}

.hero__date {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.5em;
  color: var(--olive);
  /* compense l'espacement de la dernière lettre pour un centrage parfait */
  padding-left: 0.5em;
}

/* Image placeholder : cadre fin + liseré intérieur décalé */
/* Masquée sur téléphone, affichée à partir de 768px (voir media query) */
.hero__visuel {
  display: none;
  position: relative;
  margin: var(--espace-l) auto 0;
  max-width: 420px;
  aspect-ratio: 4 / 5;
  padding: 10px;
  border: var(--filet);
}

.hero__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;              /* remplit le cadre 4:5 sans déformer */
  object-position: center 30%;    /* ajuste le cadrage : 30% = un peu au-dessus du centre */
  background-color: var(--champagne); /* visible le temps du chargement */
}

/* ---------- Actions ---------- */
.actions {
  display: grid;
  gap: var(--espace-s);
  margin-top: var(--espace-l);
  text-align: center;
}

.actions__intro {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.375rem;
  color: var(--sauge);
  margin-bottom: var(--espace-xs);
}

@media (min-width: 768px) {
  .hero__noms {
    flex-direction: row;
    justify-content: center;
    gap: var(--espace-m);
  }
  .hero__esperluette { font-size: 3.5rem; }

  /* Photo visible uniquement sur tablette / desktop */
  .hero__visuel { display: block; }

  .actions {
    grid-template-columns: auto auto;
    justify-content: center;
  }
  .actions__intro { grid-column: 1 / -1; }
}

/* ============================================================
   6. PAGE INVITÉS  —  invites.html
   ============================================================ */
/* ---------- CONTENU ---------- */
.page-invites {
  max-width: 560px;       /* largeur de lecture confortable sur grand écran */
  padding-top: var(--espace-m);
}

/* ---------- RECHERCHE ---------- */
.recherche {
  margin-bottom: var(--espace-m);
}

#search-input {
  width: 100%;
  padding: 0.9rem 1rem;
  font-family: var(--font-sans);
  font-size: 16px;        /* 16px minimum : évite le zoom automatique sur iOS */
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--texte);
  background-color: #FFFFFF;
  border: 1px solid var(--olive);
  border-radius: 4px;
  -webkit-appearance: none;
  appearance: none;
  transition: box-shadow var(--transition);
}

#search-input::placeholder {
  color: var(--sauge);
  opacity: 1;
}

#search-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(107, 112, 92, 0.12);
}

.compteur {
  margin-top: 0.6rem;
  text-align: center;
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-moyen);
  color: var(--sauge);
  min-height: 1em;
}

/* ---------- CARTES (une carte = une table) ---------- */
.carte {
  background-color: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 2px 14px rgba(43, 45, 42, 0.06);
  margin-bottom: 15px;
  padding: 1.1rem 1.25rem 1.2rem;
}

.carte__entete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--espace-s);
  padding-bottom: 0.6rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--champagne);
}

.carte__table {
  font-family: var(--font-serif);
  font-size: var(--fs-table);
  font-weight: var(--fw-serif-titre);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--olive);
  line-height: 1;
}

.carte__total {
  flex-shrink: 0;
  font-size: var(--fs-petit);
  letter-spacing: 0.1em;
  color: var(--sauge);
}

/* En-tête cliquable : lien vers plan.html?table=XX */
a.carte__entete {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--transition);
}

.carte__titre {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.7rem;
}

/* Indication discrète "Voir le plan →" */
.carte__lien {
  font-family: var(--font-sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-sans-fort);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  white-space: nowrap;
  color: var(--sauge);
  transition: color var(--transition);
}

.carte__fleche {
  display: inline-block;
  margin-left: 0.2em;
  letter-spacing: 0;
  transition: transform var(--transition);
}

a.carte__entete:hover,
a.carte__entete:focus-visible {
  outline: none;
  border-bottom-color: var(--sauge);
}
a.carte__entete:hover .carte__lien,
a.carte__entete:focus-visible .carte__lien { color: var(--olive); }
a.carte__entete:hover .carte__fleche,
a.carte__entete:focus-visible .carte__fleche { transform: translateX(3px); }

.carte__liste {
  list-style: none;
  display: grid;
  gap: 0.55rem;           /* de l'espace, pas de traits */
}

.invite {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--espace-s);
}

.invite__nom {
  font-family: var(--font-serif);
  font-size: var(--fs-nom);
  font-weight: var(--fw-serif);
  line-height: 1.3;
  color: var(--texte);
}

.invite__nb {
  flex-shrink: 0;
  font-size: var(--fs-petit);
  letter-spacing: 0.08em;
  color: var(--sauge);
}

/* Surlignage discret du texte recherché */
mark {
  background-color: var(--champagne);
  color: inherit;
  padding: 0 1px;
}

/* ---------- ÉTATS (chargement, vide, erreur) ---------- */
.etat {
  padding: var(--espace-l) var(--espace-s);
  text-align: center;
}

.etat__titre {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.375rem;
  color: var(--olive);
  margin-bottom: 0.4rem;
}

.etat__texte {
  font-size: var(--fs-petit);
  color: var(--sauge);
}

@media (min-width: 768px) {
  .carte { padding: 1.4rem 1.6rem; }
}

/* ============================================================
   7. PAGE PLAN  —  plan.html
   ============================================================ */
/* ---------- TITRE ---------- */
.page-plan {
  max-width: 1040px;
  padding-top: var(--espace-m);
}

/* ---------- LE PLAN ---------- */
/*
  Système de coordonnées
  ----------------------
  Le plan est décrit dans le JavaScript en "unités plan" : un rectangle
  de 1192 x 820 unités, calqué sur le plan papier de la salle.
  --u vaut la taille réelle d'une unité à l'écran (100cqw / largeur du plan),
  ce qui permet d'écrire les positions, tailles et polices en unités :
  le dessin s'adapte donc à n'importe quelle largeur d'écran.

  Deux orientations
  -----------------
  - Paysage (≥ 700px)  : identique au plan papier.
  - Portrait (< 700px) : le plan pivote d'un quart de tour (sens horaire)
    pour occuper toute la hauteur du téléphone. Les textes restent
    horizontaux, seules les positions sont recalculées.
*/
.plan-zone {
  position: relative;            /* repère du tooltip */
}

/*
  Cadrage : seule la partie droite de la salle est affichée
  (à partir des tables 26 / 27 / 36 / 37). Tout ce qui dépasse
  à gauche du cadrage est coupé par overflow: hidden.
  Largeur visible : 1002 unités (voir CADRAGE dans le JavaScript).
*/
.plan {
  position: relative;
  width: 100%;
  aspect-ratio: 1002 / 820;
  container-type: inline-size;
  overflow: hidden;
  --u: calc(100cqw / 1002);
}

/* Base commune : chaque élément est centré sur (--x, --y) */
.el {
  position: absolute;
  left:   calc(var(--x) * var(--u));
  top:    calc(var(--y) * var(--u));
  width:  calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Textes techniques (Montserrat, majuscules espacées) */
.el__texte {
  font-family: var(--font-sans);
  font-size: clamp(8px, calc(var(--u) * 13), 12px);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--sauge);
}
.texte-vertical-paysage .el__texte {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

/* ---------- Murs et zones ---------- */
.salle {
  background-color: #FFFFFF;
  border: 1.5px solid var(--olive);
}

.terrasse {
  background-color: #F9F5F1;      /* champagne très clair */
  border: 1px solid var(--sauge);
  border-top: 0;
}

.perron {
  background-color: #F9F5F1;
  border: 1px solid var(--sauge);
  border-top: 0;
}

/* Traits fins : séparations de zones et allée centrale */
.trait {
  min-width: 1px;
  min-height: 1px;
  background-color: var(--champagne);
}
.allee { background-color: var(--sauge); opacity: 0.55; }

/* Ouverture de porte dans le mur du bas */
.porte {
  min-width: 3px;
  min-height: 3px;
  background-color: #FFFFFF;
}

/* ---------- Mobilier ---------- */
.honneur {
  background-color: #F7F1EC;
  border: 1px solid var(--olive);
}
.honneur .el__texte { color: var(--olive); font-weight: 500; }

.parents {
  background-color: #F7F1EC;
  border: 1px solid var(--olive);
}
.parents .el__texte { color: var(--olive); }

.piste {
  border: 1px dashed var(--sauge);
}

.mobilier {
  border: 1px solid var(--sauge);
  background-color: #FFFFFF;
}

/* ---------- Tables d'invités ---------- */
.table {
  border-radius: 50%;
  background-color: #FFFFFF;
  border: 1px solid var(--olive);
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--transition), box-shadow var(--transition);
}

/* Numéros de table : Montserrat (sans-serif), plus simple et plus lisible
   en petite taille que la Serif. Chiffres de largeur égale pour un bon centrage. */
.table__numero {
  font-family: var(--font-sans);
  font-size: clamp(10px, calc(var(--u) * 21), 20px);
  font-weight: 500;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0;
  line-height: 1;
  color: var(--olive);
  pointer-events: none;
}

/* Survol / focus : la bordure s'épaissit (sans décaler le cercle) */
.table:hover,
.table:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--olive), 0 0 0 3px rgba(107, 112, 92, 0.12);
}

/* Table ouverte */
.table.est-active { background-color: var(--olive); }
.table.est-active .table__numero { color: var(--blanc); }

/* ---------- MODE PORTRAIT (téléphone) ---------- */
@media (max-width: 699px) {
  /* Le plan gagne un peu de largeur sur les bords de l'écran */
  .plan-zone { margin: 0 calc(var(--espace-m) * -0.5); }

  .plan {
    aspect-ratio: 820 / 1002;
    --u: calc(100cqw / 820);
  }

  /* Positions pivotées (calculées par le JavaScript) */
  .el {
    left:   calc(var(--px) * var(--u));
    top:    calc(var(--py) * var(--u));
    width:  calc(var(--pw) * var(--u));
    height: calc(var(--ph) * var(--u));
  }

  .texte-vertical-paysage .el__texte { writing-mode: horizontal-tb; transform: none; }
  .texte-vertical-portrait .el__texte {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
  }

  /* Après rotation, le côté "haut" de la terrasse et du perron passe à droite */
  .terrasse,
  .perron { border-top: 1px solid var(--sauge); border-right: 0; }
}

/* ---------- LÉGENDE ---------- */
.legende {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1.25rem;
  margin-top: var(--espace-s);
  list-style: none;
}

.legende li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--sauge);
}

.legende__forme { display: inline-block; flex-shrink: 0; }
.legende__forme--table   { width: 9px;  height: 9px; border: 1px solid var(--olive); border-radius: 50%; }
.legende__forme--honneur { width: 14px; height: 8px; border: 1px solid var(--olive); background-color: #F7F1EC; }
.legende__forme--piste   { width: 14px; height: 8px; border: 1px dashed var(--sauge); }

.aide {
  margin-top: var(--espace-m);
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--sauge);
}

/* ---------- TOOLTIP (infobulle) ---------- */
.tooltip {
  display: none;                       /* caché par défaut */
  position: absolute;
  z-index: 20;
  width: max-content;
  min-width: 170px;
  max-width: 250px;
  padding: 0.9rem 1.1rem 1rem;
  background-color: #FFFFFF;
  border-radius: 8px;
  box-shadow:
    0 10px 30px rgba(43, 45, 42, 0.14),
    0 2px 6px rgba(43, 45, 42, 0.06);
  text-align: left;
}

.tooltip.est-visible {
  display: block;
  animation: apparition 0.28s ease-out;
}
.tooltip.en-dessous.est-visible { animation-name: apparition-bas; }

@keyframes apparition {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes apparition-bas {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Petite pointe (carré pivoté) qui désigne la table */
.tooltip::after {
  content: '';
  position: absolute;
  left: var(--pointe-x, 50%);
  bottom: -5px;
  width: 10px;
  height: 10px;
  background-color: #FFFFFF;
  transform: translateX(-50%) rotate(45deg);
  box-shadow: 3px 3px 6px rgba(43, 45, 42, 0.05);
}
.tooltip.en-dessous::after {
  bottom: auto;
  top: -5px;
  box-shadow: -2px -2px 4px rgba(43, 45, 42, 0.04);
}

.tooltip__entete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.45rem;
  margin-bottom: 0.55rem;
  border-bottom: 1px solid var(--champagne);
}

.tooltip__titre {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: var(--fw-serif-titre);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--olive);
}

.tooltip__total {
  flex-shrink: 0;
  font-size: var(--fs-petit);
  letter-spacing: 0.08em;
  color: var(--sauge);
}

.tooltip__liste { list-style: none; display: grid; gap: 0.3rem; }

.tooltip__ligne {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.tooltip__nom {
  font-family: var(--font-serif);
  font-size: var(--fs-nom);
  font-weight: var(--fw-serif);
  line-height: 1.3;
}

.tooltip__nb {
  flex-shrink: 0;
  font-size: var(--fs-petit);
  letter-spacing: 0.06em;
  color: var(--sauge);
}

.tooltip__vide {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.125rem;
  color: var(--sauge);
}

/* ============================================================
   8. PAGE ADMIN  —  admin.html
   ============================================================ */
.page-admin {
  max-width: 560px;
  padding-top: var(--espace-l);
}

/* ---------- CHAMPS (communs) ---------- */
.champ {
  width: 100%;
  padding: 0.9rem 1rem;
  font-family: var(--font-sans);
  font-size: 16px;                  /* 16px : pas de zoom automatique sur iOS */
  font-weight: 400;
  color: var(--texte);
  background-color: #FFFFFF;
  border: 1px solid var(--champagne);
  border-radius: 4px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.champ::placeholder { color: var(--sauge); opacity: 1; }

.champ:focus {
  outline: none;
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(107, 112, 92, 0.1);
}

/* Retire les flèches des champs numériques */
.champ[type="number"]::-webkit-outer-spin-button,
.champ[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.champ[type="number"] { -moz-appearance: textfield; }

/* Message de retour (erreur ou succès) */
.message {
  min-height: 1.2em;
  margin-top: 0.75rem;
  text-align: center;
  font-size: var(--fs-petit);
  letter-spacing: 0.08em;
  color: var(--sauge);
}
.message--erreur { color: var(--terracotta); }
.message--succes { color: var(--olive); }

/* ---------- CONNEXION ---------- */
#login-section {
  max-width: 340px;
  margin: 0 auto;
  text-align: center;
}

#login-section .intro {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--sauge);
  margin-bottom: var(--espace-m);
}

#login-section form {
  display: grid;
  gap: 0.75rem;
}

#login-section .champ { border-color: var(--olive); text-align: center; }

#login-section .btn { width: 100%; min-width: 0; }

/* ---------- DASHBOARD ---------- */
.resume {
  text-align: center;
  font-size: var(--fs-petit);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-large);
  color: var(--olive);
  margin-bottom: var(--espace-l);
}

.resume__point {
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 0.75rem;
  border-radius: 50%;
  background-color: var(--sauge);
  vertical-align: middle;
}

/* ---------- FORMULAIRE ---------- */
.formulaire {
  background-color: #FFFFFF;
  border: 1px solid var(--champagne);
  padding: var(--espace-m) var(--espace-s);
  margin-bottom: var(--espace-xl);
}

.formulaire__titre {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: var(--fw-serif-titre);
  text-align: center;
  margin-bottom: var(--espace-s);
}

.formulaire form {
  display: grid;
  gap: 0.75rem;
}

.formulaire__ligne {
  display: flex;
  gap: 0.75rem;
}
.formulaire__ligne .champ { flex: 1; min-width: 0; }

.formulaire .btn { width: 100%; min-width: 0; margin-top: 0.25rem; }

/* Lien texte "Annuler" (visible seulement en mode modification) */
.lien-annuler {
  justify-self: center;
  padding: 0.4rem;
  font-family: var(--font-sans);
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-moyen);
  color: var(--sauge);
  background: none;
  border: 0;
  cursor: pointer;
}
.lien-annuler[hidden] { display: none; }

/* Mode modification : liseré olive pour bien le signaler */
.formulaire.en-modification { border-color: var(--olive); }

/* ---------- LISTE (sans boîtes) ---------- */
.groupe { margin-bottom: var(--espace-l); }

.groupe__titre {
  font-family: var(--font-serif);
  font-size: var(--fs-table);
  font-weight: var(--fw-serif-titre);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--olive);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--champagne);
}

.groupe__titre span {
  font-family: var(--font-sans);
  font-size: var(--fs-petit);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: none;
  color: var(--sauge);
}

.ligne {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--espace-s);
  padding: 0.45rem 0;
}

/* Ligne en cours de modification */
.ligne.est-editee .ligne__nom { color: var(--olive); }

.ligne__infos { min-width: 0; }

.ligne__nom {
  font-family: var(--font-serif);
  font-size: var(--fs-nom);
  font-weight: var(--fw-serif);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.ligne__nb {
  font-size: var(--fs-petit);
  letter-spacing: 0.08em;
  color: var(--sauge);
  white-space: nowrap;
}

.ligne__actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.9rem;
}

/* Actions en texte seul */
.action {
  padding: 0.35rem 0;              /* zone tactile verticale confortable */
  font-family: var(--font-sans);
  font-size: var(--fs-micro);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  transition: border-color var(--transition);
}
.action:hover,
.action:focus-visible { outline: none; border-bottom-color: currentColor; }
.action:disabled { opacity: 0.4; cursor: default; }

.action--modifier  { color: var(--sauge); }
.action--supprimer { color: var(--terracotta); }

/* Deuxième étape de la suppression : "CONFIRMER ?" */
.action--supprimer.a-confirmer { border-bottom-color: var(--terracotta); }

.vide {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--sauge);
  padding: var(--espace-m) 0;
}

.deconnexion {
  display: block;
  margin: var(--espace-l) auto 0;
}

#gestion-section[hidden],
#login-section[hidden] { display: none; }

@media (min-width: 768px) {
  .formulaire { padding: var(--espace-l); }
}

/* ============================================================
   9. CACHE DES DONNÉES  —  app.js
   ============================================================ */

/* Barre "Liste mise à jour à 09:04 — Actualiser" (invites, plan) */
.actualisation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.9rem;
  margin-top: var(--espace-l);
  text-align: center;
  font-size: var(--fs-petit);
  color: var(--sauge);
}

.actualisation__bouton {
  min-height: 44px;                 /* cible tactile */
  padding: 0 0.25rem;
  font-family: var(--font-sans);
  font-size: var(--fs-micro);
  font-weight: var(--fw-sans-fort);
  text-transform: uppercase;
  letter-spacing: var(--tracking-moyen);
  color: var(--sauge);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--champagne);
  text-underline-offset: 5px;
  transition: color var(--transition);
}

.actualisation__bouton:hover,
.actualisation__bouton:focus-visible {
  color: var(--olive);
  outline: none;
}

.actualisation__bouton:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Accueil : message discret si la liste n'a pas pu être préchargée */
.message-connexion {
  max-width: 300px;
  margin: var(--espace-xs) auto 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.0625rem;
  font-weight: var(--fw-serif);
  line-height: 1.4;
  color: var(--olive);
}

.message-connexion[hidden] { display: none; }

@media (min-width: 768px) {
  .message-connexion { grid-column: 1 / -1; }
}
