/* Charte JPS Immo : mêmes jetons que jps-immo.fr (crème, encre, or). */
:root {
  --encre: #141210;
  --encre-douce: #2b2822;
  --creme: #f7f3ea;
  --creme-fonce: #e7e0d1;
  --creme-clair: #f2ede2;
  --blanc: #ffffff;
  --or: #dfa91c;
  --or-profond: #866212;
  --or-pale: #fbf3dc;
  --texte: #141210;
  --texte-muet: #665f52;
  --filet: rgba(20, 18, 15, 0.1);
  --filet-moyen: rgba(20, 18, 15, 0.2);
  --erreur: #9b3b2e;
  --erreur-fond: #f6e8e5;
  --succes: #2f6b3a;
  --succes-fond: #e8efe6;
  --ombre: 0 1px 2px rgba(20, 18, 15, 0.04), 0 6px 18px rgba(20, 18, 15, 0.06);
  --rayon: 16px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Segoe UI Variable Text', 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--creme);
  color: var(--texte);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}

h1,
h2,
h3,
p,
blockquote,
fieldset,
ol,
ul {
  margin: 0;
  padding: 0;
}

fieldset {
  border: none;
  min-width: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  touch-action: manipulation;
}

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

/* ---------- Page ---------- */

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.page.centre {
  min-height: 100vh;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-bottom: 32px;
}

.entete {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

.entete-titres {
  flex: 1;
  min-width: 0;
}

.entete h1 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.retour {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blanc);
  border: 1px solid var(--filet);
  display: grid;
  place-items: center;
  font-size: 28px;
  line-height: 1;
  padding-bottom: 4px;
  flex-shrink: 0;
}

.doux {
  color: var(--texte-muet);
}

.petit {
  font-size: 14px;
}

.centre {
  text-align: center;
}

.section-titre {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--texte-muet);
  margin-bottom: 8px;
}

section > .carte + .carte,
section > .carte-reco + .carte-reco {
  margin-top: 10px;
}

/* ---------- Marque ---------- */

.marque {
  display: flex;
  align-items: center;
  gap: 10px;
}

.marque.grande {
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.marque-logo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--encre);
  color: var(--or);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
}

.marque.grande .marque-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  font-size: 34px;
}

.marque-texte {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.marque-texte strong {
  font-family: var(--serif);
  font-size: 19px;
}

.marque-texte span {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--or-profond);
}

.marque.grande .marque-texte {
  align-items: center;
}

/* ---------- Cartes ---------- */

.carte {
  display: block;
  background: var(--blanc);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 16px;
}

.carte-ligne {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.carte-reco strong {
  font-size: 18px;
}

.carte-reco .doux {
  margin-top: 2px;
}

.carte-apporteur,
.profil {
  display: flex;
  gap: 14px;
  align-items: center;
}

.carte-apporteur.bloque {
  opacity: 0.6;
}

.carte.vide {
  text-align: center;
  padding: 32px 20px;
}

.grand-emoji {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 12px;
}

.carte.vide h2 {
  font-family: var(--serif);
  font-size: 22px;
  margin-bottom: 8px;
}

.carte.vide .bouton {
  margin-top: 16px;
}

.vide-liste {
  padding: 32px 0;
}

.avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--or-pale);
  color: var(--or-profond);
  font-weight: 600;
  flex-shrink: 0;
}

.message {
  margin: 10px 0;
  padding: 10px 14px;
  border-left: 3px solid var(--or);
  background: var(--creme-clair);
  border-radius: 0 10px 10px 0;
  font-style: italic;
}

.lien {
  text-decoration: underline;
  text-decoration-color: var(--or);
  text-underline-offset: 3px;
}

.lien.discret {
  display: block;
  margin-top: 10px;
  color: var(--texte-muet);
  font-size: 14px;
  text-align: left;
}

.lien.discret.danger {
  color: var(--erreur);
}

.lien-tel {
  font-size: 20px;
  font-weight: 600;
}

.lien-personnel {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
  background: var(--creme-clair);
  padding: 10px 12px;
  border-radius: 10px;
  margin: 10px 0;
  user-select: all;
}

.commentaires {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- Pastilles d'étape ---------- */

.pastille {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--creme-fonce);
  color: var(--encre-douce);
}

.pastille.etape-recue {
  background: var(--or);
  color: var(--encre);
}

.pastille.etape-cours {
  background: var(--or-pale);
  color: var(--or-profond);
}

.pastille.etape-avancee {
  background: var(--encre);
  color: var(--or);
}

.pastille.etape-finie {
  background: var(--succes-fond);
  color: var(--succes);
}

.pastille.etape-sans-suite {
  background: var(--creme-fonce);
  color: var(--texte-muet);
}

/* ---------- Chronologie ---------- */

.chronologie {
  list-style: none;
  position: relative;
}

.chronologie li {
  display: flex;
  gap: 14px;
  padding-bottom: 18px;
  position: relative;
  color: var(--texte-muet);
}

.chronologie li:last-child {
  padding-bottom: 0;
}

.chronologie li::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 20px;
  bottom: -2px;
  width: 2px;
  background: var(--filet);
}

.chronologie li:last-child::before {
  display: none;
}

.chronologie .point {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--filet-moyen);
  background: var(--blanc);
  flex-shrink: 0;
  margin-top: 2px;
}

.chronologie li.atteinte,
.chronologie li.courante {
  color: var(--texte);
}

.chronologie li.atteinte .point {
  background: var(--encre);
  border-color: var(--encre);
}

.chronologie li.courante .point {
  background: var(--or);
  border-color: var(--or);
  box-shadow: 0 0 0 4px var(--or-pale);
}

.chronologie li.sans-suite .point {
  background: var(--texte-muet);
  border-color: var(--texte-muet);
  box-shadow: none;
}

.chronologie .date {
  font-size: 13px;
  color: var(--texte-muet);
}

/* ---------- Formulaires ---------- */

.formulaire {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.formulaire h2 {
  font-family: var(--serif);
  font-size: 24px;
}

.champ {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.champ-etiquette {
  font-size: 14px;
  font-weight: 600;
  color: var(--encre-douce);
}

.champ-aide {
  font-size: 13px;
  color: var(--texte-muet);
}

.champ-erreur {
  font-size: 14px;
  color: var(--erreur);
}

input:not([type='checkbox']):not([type='radio']),
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--filet-moyen);
  border-radius: 12px;
  background: var(--blanc);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--or);
  box-shadow: 0 0 0 3px var(--or-pale);
}

.en-erreur input,
.en-erreur textarea {
  border-color: var(--erreur);
}

.case {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15px;
}

.case input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--encre);
  flex-shrink: 0;
}

.choix {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choix-option {
  padding: 9px 14px;
  border: 1px solid var(--filet-moyen);
  border-radius: 999px;
  font-size: 15px;
  cursor: pointer;
}

.choix-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.choix-option.actif {
  background: var(--encre);
  color: var(--creme-clair);
  border-color: var(--encre);
}

.choix-option:focus-within {
  box-shadow: 0 0 0 3px var(--or-pale);
}

/* ---------- Boutons ---------- */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--encre);
  color: var(--creme-clair);
  font-weight: 600;
  text-align: center;
  width: 100%;
}

.bouton:disabled {
  opacity: 0.55;
  cursor: default;
}

.bouton.secondaire {
  background: var(--blanc);
  color: var(--encre);
  border: 1px solid var(--filet-moyen);
}

.bouton.danger {
  background: var(--erreur);
  color: #fff;
}

.bouton.flottant {
  position: fixed;
  right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  width: auto;
  background: var(--or);
  color: var(--encre);
  box-shadow: 0 8px 24px rgba(20, 18, 15, 0.25);
  z-index: 5;
}

.boutons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.boutons .bouton {
  flex: 1;
}

.actions textarea {
  margin-top: 4px;
}

/* ---------- Bandeaux ---------- */

.bandeau {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 15px;
}

.bandeau.erreur {
  background: var(--erreur-fond);
  color: var(--erreur);
}

.bandeau.succes {
  background: var(--succes-fond);
  color: var(--succes);
}

.bandeau.info {
  background: var(--or-pale);
  color: var(--or-profond);
}

.chargement {
  padding: 32px 0;
}

/* ---------- Accueil public ---------- */

.presentation h1 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 12px;
}

.presentation p {
  margin-bottom: 16px;
}

.etapes-presentation {
  list-style: none;
  counter-reset: etape;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.etapes-presentation li {
  counter-increment: etape;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.etapes-presentation li::before {
  content: counter(etape);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--or);
  color: var(--encre);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.bienvenue h1 {
  font-family: var(--serif);
  font-size: 26px;
  margin-bottom: 8px;
}

.bienvenue .bouton {
  margin-top: 16px;
}

/* ---------- Tableau de bord ---------- */

.compteurs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.compteur {
  background: var(--blanc);
  border-radius: 14px;
  box-shadow: var(--ombre);
  padding: 12px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.compteur strong {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1;
}

.compteur span {
  font-size: 12px;
  color: var(--texte-muet);
  margin-top: 4px;
}

.compteur.accent {
  background: var(--or);
}

.compteur.accent span {
  color: var(--encre-douce);
}

.filtres {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filtre {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--filet-moyen);
  background: var(--blanc);
  font-size: 15px;
  white-space: nowrap;
}

.filtre.actif {
  background: var(--encre);
  color: var(--creme-clair);
  border-color: var(--encre);
}

/* ---------- Barre d'onglets ---------- */

.onglets {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  background: var(--blanc);
  border-top: 1px solid var(--filet);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 10;
}

.onglets a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  color: var(--texte-muet);
  min-width: 80px;
  padding: 4px 8px;
  border-radius: 12px;
}

.onglets a.actif {
  color: var(--encre);
  font-weight: 600;
}

.onglet-icone {
  font-size: 22px;
  line-height: 1;
}

.onglets a.actif .onglet-icone {
  filter: drop-shadow(0 0 6px var(--or));
}

@media (min-width: 600px) {
  .onglets {
    left: 50%;
    right: auto;
    width: 560px;
    transform: translateX(-50%);
    border-radius: 18px 18px 0 0;
    border: 1px solid var(--filet);
    border-bottom: none;
  }
}

/* ---------- Notifications ---------- */

.carte > .bouton {
  margin-top: 12px;
}
