/* Une seule feuille, sans dépendance : le site doit rester lisible sur un
   téléphone qui vient de scanner une carte, souvent en pleine rue. */

:root {
  --fond: #f7f7fb;
  --feuille: #ffffff;
  --encre: #1d2330;
  --encre-douce: #5b6478;
  --trait: #dfe3ec;
  --accent: #40527e;
  --accent-encre: #ffffff;
  --alerte: #b3261e;
  --reussite: #2e7d32;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #14161c;
    --feuille: #1c1f27;
    --encre: #edeff4;
    --encre-douce: #a3abbd;
    --trait: #2e3340;
    --accent: #8ea2d8;
    --accent-encre: #14161c;
    --alerte: #f2b8b5;
    --reussite: #86d18a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 24px 16px 48px;
  background: var(--fond);
  color: var(--encre);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.feuille {
  max-width: 44rem;
  margin: 0 auto;
  padding: 24px;
  background: var(--feuille);
  border: 1px solid var(--trait);
  border-radius: 16px;
}

h1 { margin: 0 0 4px; font-size: 1.6rem; line-height: 1.25; }
.sous-titre { margin: 0 0 20px; color: var(--encre-douce); }

.entete {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.aide { color: var(--encre-douce); font-size: .9rem; }
.erreur { color: var(--alerte); font-weight: 600; }
.succes { color: var(--reussite); font-weight: 600; }

label { display: block; margin: 16px 0 6px; font-weight: 600; }
label span { display: block; font-weight: 600; margin-bottom: 6px; }

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
  background: var(--fond);
  border: 1px solid var(--trait);
  border-radius: 10px;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

textarea { resize: vertical; }

button, .bouton {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 600;
  color: var(--accent-encre);
  background: var(--accent);
  border: none;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
}

button.discret {
  margin: 0;
  color: var(--accent);
  background: none;
  border: 1px solid var(--trait);
  font-weight: 500;
  padding: 8px 14px;
}

button.copier {
  margin: 0 0 0 8px;
  padding: 2px 10px;
  font-size: .8rem;
  font-weight: 500;
  width: auto;
}

fieldset {
  margin: 24px 0 0;
  padding: 12px 16px 16px;
  border: 1px solid var(--trait);
  border-radius: 12px;
}

legend { padding: 0 6px; font-weight: 600; }

.choix {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px 20px 4px 0;
  font-weight: 500;
}

.choix input { width: auto; }

.panneau { margin-top: 8px; }

.ligne-champ {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  padding: 10px 0;
  border-bottom: 1px solid var(--trait);
}

.ligne-champ label { flex: 1; margin: 0; }

.boutons-ligne { display: flex; gap: 4px; }

.boutons-ligne button {
  margin: 0;
  width: 2.2rem;
  padding: 8px 0;
  color: var(--encre-douce);
  background: none;
  border: 1px solid var(--trait);
  font-size: 1rem;
}

.fiche { margin: 24px 0 0; }
.fiche dt { color: var(--encre-douce); font-size: .85rem; }
.fiche dd {
  margin: 2px 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--trait);
  overflow-wrap: anywhere;
}

a { color: var(--accent); }

.pied {
  max-width: 44rem;
  margin: 16px auto 0;
  color: var(--encre-douce);
  font-size: .8rem;
  text-align: center;
}

/* Les codes fabriqués, à recopier ou à coller dans l'application. */
.codes {
  margin-top: 16px;
  padding: 14px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85rem;
  line-height: 1.7;
  background: var(--fond);
  border: 1px solid var(--trait);
  border-radius: 10px;
}

/* Le lien qui se comporte en bouton : page de bienvenue, page d'erreur. */
.bouton {
  display: inline-block;
  padding: 12px 20px;
  color: var(--accent-encre);
  background: var(--accent);
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
}

/* Un repli pour ce qu'on ne règle qu'une fois : l'adresse de secours. */
.repli {
  margin-top: 28px;
  padding: 12px 16px;
  border: 1px solid var(--trait);
  border-radius: 12px;
}

.repli summary {
  cursor: pointer;
  font-weight: 600;
}

.repli[open] summary { margin-bottom: 8px; }

/* Le fragment d'adresse cité dans une phrase, comme ?c= */
code {
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em;
  background: var(--fond);
  border: 1px solid var(--trait);
  border-radius: 5px;
}

/* Le choix de la carte en cours, quand le propriétaire en gère plusieurs. */
.bascule { margin: 0 0 16px; }
.bascule label { font-size: .9rem; }

.liste-cartes {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.liste-cartes li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--trait);
}

.liste-cartes form { margin: 0; }
.liste-cartes .sous-titre { margin: 0; }

/* Historique des cartes, page de fabrication. */
.defilement { overflow-x: auto; margin: .5rem 0 1.5rem; }
.historique { width: 100%; border-collapse: collapse; font-size: .9rem; }
.historique th, .historique td {
  text-align: left; padding: .45rem .6rem;
  border-bottom: 1px solid var(--trait); white-space: nowrap;
}
.historique th { color: var(--encre-douce); font-weight: 600; }
.historique td:first-child, .historique th:first-child { text-align: right; }

/* La case « Hôtel » de l'historique : une case, pas un champ pleine largeur. */
.historique .case-hotel { width: auto; margin: 0; padding: 0; transform: scale(1.3); cursor: pointer; }

/* Suppression d'une carte depuis l'historique. */
.en-ligne { display: inline; margin: 0; }
.historique .croix {
  background: none; border: 0; padding: 0 .3rem; margin: 0; width: auto;
  color: var(--alerte); font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.confirmation {
  border: 1px solid var(--alerte); border-radius: 8px;
  padding: .8rem 1rem; margin: 1rem 0;
}
.confirmation .en-ligne { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
button.danger { background: var(--alerte); color: var(--feuille); }

/* Le bouton Accueil, en haut de chaque page. */
.retour-accueil { max-width: 44rem; margin: 1rem auto .75rem; padding: 0 24px; }
.bouton-accueil {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-weight: 600;
  color: var(--accent);
  background: var(--feuille);
  border: 1px solid var(--trait);
  border-radius: 10px;
  text-decoration: none;
}
.bouton-accueil:hover { border-color: var(--accent); }
.bouton-accueil:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Onglet Lien : cinq adresses, un point à droite de chacune pour l'activer. */
.etiquette { font-weight: 600; margin: 16px 0 4px; }
.liens { display: grid; gap: 8px; margin-top: 10px; }
.lien-ligne {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}
.lien-ligne label { margin: 0; font-weight: 500; white-space: nowrap; }
.lien-ligne input[type="radio"] {
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.lien-ligne:has(input[type="radio"]:checked) input:not([type="radio"]) { border-color: var(--accent); }

/* Onglet Contact : trois fiches en volets, l'ouverte est l'active. */
.fiche {
  border: 1px solid var(--trait);
  border-radius: 12px;
  padding: 0 16px;
  margin-top: 12px;
}
.fiche[open] { border-color: var(--accent); padding-bottom: 16px; }
.fiche summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  font-weight: 600;
  cursor: pointer;
}
.fiche-nom { font-weight: 400; color: var(--encre-douce); }
.fiche-actif { color: var(--accent); font-size: .9rem; white-space: nowrap; }

/* --- La page hôtel (inc/page-hotel.php) --------------------------------- */

.tuiles { display: grid; gap: 12px; margin: 24px 0; }
.tuile {
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--trait);
  border-radius: 14px;
  background: var(--feuille);
  color: var(--encre);
  text-decoration: none;
}
.tuile:hover, .tuile:focus-visible { border-color: var(--accent); }
.tuile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tuile svg {
  grid-row: span 2;
  width: 44px; height: 44px; padding: 9px;
  border-radius: 50%;
  background: var(--accent); color: var(--accent-encre);
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.tuile-titre { font-weight: 600; font-size: 1.1rem; }
.tuile-aide { color: var(--encre-douce); font-size: .9rem; }

.retour-hotel { margin: 0 0 12px; }
.retour-hotel a { text-decoration: none; }

.liste-hotel { margin: 0 0 16px; padding-left: 1.2rem; }
.liste-hotel li { margin: 2px 0; }

.plan {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-top: 16px;
  border: 1px solid var(--trait);
  border-radius: 12px;
}

.avis-google {
  margin: 28px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--trait);
  text-align: center;
}
.avis-google a { font-weight: 600; text-decoration: none; }

/* Le choix de la langue, avant la page hôtel. */
.drapeaux { display: grid; gap: 12px; margin: 24px 0 8px; }
.drapeau {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--trait);
  border-radius: 14px;
  background: var(--feuille);
  color: var(--encre);
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
}
.drapeau:hover, .drapeau:focus-visible { border-color: var(--accent); }
.drapeau:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.drapeau-image {
  flex: none;
  width: 60px;
  height: 40px;
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--trait);
}
.changer-langue { margin: 0; text-align: center; color: var(--encre-douce); font-size: .9rem; }
.changer-langue a, .changer-langue strong { margin: 0 4px; }
