/* Espace client — charte Cater In Delight (application/DESIGN.md) : bleu nuit #1a2b3d, or #e5cb84.
   Cormorant Garamond (hébergée ici, pas de Google Fonts) pour les titres seulement ; texte et
   chiffres dans la police du système (lisible, chiffres droits). */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/static/cormorant-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --fond: #f3f5f8;
  --surface: #ffffff;
  --bordure: #e1e5ea;
  --texte: #1a2b3d;
  --texte-attenue: #4f5b68;
  --bouton-fond: #1a2b3d;
  --bouton-texte: #e5cb84;
  --lien: #86672a;
  --erreur: #b23a2d;
  --erreur-fond: #fbeceb;
  --police-texte: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --police-titre: "Cormorant Garamond", Georgia, serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0e1822;
    --surface: #172636;
    --bordure: #36506b;
    --texte: #ece8df;
    --texte-attenue: #a9b4c1;
    --bouton-fond: #e5cb84;
    --bouton-texte: #1a2b3d;
    --lien: #e5cb84;
    --erreur: #ec8d82;
    --erreur-fond: #3a2025;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police-texte);
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

.entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #1a2b3d;
  color: #ece8df;
}

.marque {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
  font-family: var(--police-titre);
  font-size: 1.35rem;
  font-variant-numeric: lining-nums;
}

.marque img { border-radius: 50%; }

.marque small {
  display: block;
  font-family: var(--police-texte);
  font-size: 0.8rem;
  color: #e5cb84;
  letter-spacing: 0.04em;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

main.etroit { max-width: 440px; }

h1, h2 {
  font-family: var(--police-titre);
  font-weight: 500;
  font-variant-numeric: lining-nums;
  margin: 0 0 0.5rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }

.attenue { color: var(--texte-attenue); }

.aide { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--texte-attenue); }

.carte {
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: 12px;
  padding: 1.5rem;
}

.grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

label {
  display: block;
  margin: 1rem 0 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
}

input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  font: inherit;
  color: var(--texte);
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: 8px;
}

input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--lien);
  outline-offset: 2px;
}

input.code {
  font-size: 1.6rem;
  letter-spacing: 0.4em;
  text-align: center;
}

button {
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--bouton-texte);
  background: var(--bouton-fond);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

button.bouton-secondaire {
  width: auto;
  margin: 0;
  padding: 0.45rem 0.9rem;
  color: #ece8df;
  background: transparent;
  border: 1px solid #4d6a88;
}

a { color: var(--lien); }

.lien-bas { margin: 1.25rem 0 0; text-align: center; }

.erreur {
  padding: 0.6rem 0.8rem;
  color: var(--erreur);
  background: var(--erreur-fond);
  border-radius: 8px;
}

/* Essais sur le PC seulement : code affiché sur la page (jamais en ligne). */
.essai {
  padding: 0.6rem 0.8rem;
  border: 1px dashed var(--lien);
  border-radius: 8px;
}

.essai strong { font-size: 1.3rem; letter-spacing: 0.15em; }

@media (max-width: 480px) {
  .marque small { display: none; }
  main { padding: 1.25rem 1rem; }
}

/* --- Lot 3 : événements et demandes --- */
:root {
  --ok: #1f7a52;
  --ok-fond: #e8f4ee;
  --info: #2d5f94;
  --info-fond: #eaf1f8;
  --attention: #a3570f;
  --attention-fond: #fbf0e4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ok: #86c9a4;
    --ok-fond: #1b3328;
    --info: #92b4d8;
    --info-fond: #1c2d40;
    --attention: #e9a467;
    --attention-fond: #3a2a1a;
  }
}

main.moyen { max-width: 720px; }

.menu { display: flex; align-items: center; gap: 1rem; }
.menu a { color: #ece8df; text-decoration: none; }
.menu a:hover { color: #e5cb84; }

.titre-page {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.bloc { margin-top: 1.5rem; }

a.bouton, .actions button {
  display: inline-block;
  width: auto;
  margin: 0;
  padding: 0.65rem 1.1rem;
  font-weight: 600;
  color: var(--bouton-texte);
  background: var(--bouton-fond);
  border: 1px solid var(--bouton-fond);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}

a.bouton-contour, button.bouton-contour {
  color: var(--texte);
  background: transparent;
  border: 1px solid var(--bordure);
}

button.bouton-discret {
  width: auto;
  margin: 0;
  padding: 0.35rem 0.7rem;
  font-weight: 500;
  color: var(--lien);
  background: transparent;
  border: 1px solid var(--bordure);
}

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.ligne {
  display: grid;
  grid-template-columns: 230px 1fr auto;  /* largeur fixe : colonnes alignées d'une ligne à l'autre */
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  margin-top: 0.5rem;
  color: var(--texte);
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: 10px;
  text-decoration: none;
}

.ligne:hover { border-color: var(--lien); }
.ligne-date, .ligne-titre { display: flex; flex-direction: column; }

.pastille {
  padding: 0.2rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 999px;
  color: var(--info);
  background: var(--info-fond);
}

.pastille.statut_realise, .pastille.statut_paye { color: var(--ok); background: var(--ok-fond); }
.pastille.statut_facture, .pastille.statut_en_cours { color: var(--attention); background: var(--attention-fond); }
.pastille.statut_annule { color: var(--texte-attenue); background: var(--fond); }

.succes, .info, .avertissement {
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
}

.succes { color: var(--ok); background: var(--ok-fond); }
.info { color: var(--info); background: var(--info-fond); }
.avertissement { color: var(--attention); background: var(--attention-fond); }

.demande {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--bordure);
}

.demande:first-of-type { border-top: 0; }

.details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.25rem;
  margin: 1rem 0;
}

.details dt { font-weight: 600; color: var(--texte-attenue); }
.details dd { margin: 0; }
.texte-libre { white-space: pre-line; }

.deux-colonnes, .trois-colonnes { display: grid; gap: 0 1rem; }
.deux-colonnes { grid-template-columns: 1fr 1fr; }
.trois-colonnes { grid-template-columns: 1.4fr 1fr 1fr; }

textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  font: inherit;
  color: var(--texte);
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: 8px;
  resize: vertical;
}

table.estimation { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
table.estimation td { padding: 0.5rem 0; border-bottom: 1px solid var(--bordure); vertical-align: top; }
table.estimation .nombre { text-align: right; white-space: nowrap; padding-left: 1rem; }
table.estimation tr.total td { font-weight: 700; }

@media (max-width: 640px) {
  .ligne { grid-template-columns: 1fr auto; }
  .ligne-date { grid-column: 1 / -1; }
  .trois-colonnes, .deux-colonnes { grid-template-columns: 1fr; }
  .details { grid-template-columns: 1fr; }
  .details dd { margin-bottom: 0.5rem; }
  .menu { gap: 0.6rem; font-size: 0.9rem; }
}

/* En-tête sur téléphone : le menu passe sous le logo (sinon la page défilait sur le côté). */
.entete { flex-wrap: wrap; }
.marque span { white-space: nowrap; }

@media (max-width: 640px) {
  .entete { padding: 0.6rem 1rem; }
  .marque { font-size: 1.15rem; }
  .marque img { width: 32px; height: 32px; }
  .menu { width: 100%; justify-content: space-between; }
  .menu button.bouton-secondaire { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
}

/* --- Lot 4 : factures --- */
.pastille.facture_a_payer { color: var(--info); background: var(--info-fond); }
.pastille.facture_en_retard { color: var(--erreur); background: var(--erreur-fond); }
.pastille.facture_payee { color: var(--ok); background: var(--ok-fond); }

.paiement {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 1.5rem;
}

.qr { max-width: 230px; }
.qr svg { display: block; max-width: 100%; border-radius: 8px; }  /* taille propre du SVG (segno, scale=5) */
.copiable { user-select: all; font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .paiement { grid-template-columns: 1fr; }
  .qr { margin: 0 auto; }
}

/* --- Lot 5 : bouton FR / NL --- */
.langues { display: flex; gap: 0.15rem; }
.langues button {
  width: auto;
  margin: 0;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #a9b4c1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
}
.langues button.active { color: #e5cb84; border-color: #4d6a88; }
.langues button:hover { color: #ece8df; }

/* Menu sur téléphone : passe à la ligne si les mots sont longs (néerlandais) au lieu de déborder. */
@media (max-width: 640px) {
  .menu { flex-wrap: wrap; justify-content: flex-start; gap: 0.5rem 0.9rem; }
  .menu .langues { margin-left: auto; }
}

/* Lignes d'événement / de facture dans une carte étroite (accueil sur deux colonnes) : elles se
   règlent sur la largeur de leur carte, pas sur celle de l'écran. Date au-dessus, puis nom et
   pastille ; rien ne sort jamais de la carte. */
.carte, .bloc { container-type: inline-size; }
.ligne > * { min-width: 0; }
.ligne-titre, .ligne-date { overflow-wrap: anywhere; }

@container (max-width: 620px) {
  .ligne { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0.35rem; }
  .ligne-date { grid-column: 1 / -1; }
}
