/* Feuille de l'application Vivre aux Vignes (décision 131).
   Elle complète avenir.css, la feuille de la plateforme, servie telle quelle :
   palette, boutons et avis viennent de là. Celle-ci porte les composants de
   l'habitat, repris des maquettes validées le 31 octobre 2026. Aucun script. */

body.vignes { background: var(--color-bg); min-height: 100dvh; display: flex; flex-direction: column; }
body.vignes .habitat-corps { max-width: 34rem; width: 100%; margin: 0 auto; }
.habitat-bandeau p { margin: 0; }
.vignes-essai {
  margin: 0;
  padding: 0.3rem 0.9rem;
  background: var(--color-accent);
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

/* ── Le bandeau de l'écran de l'habitat ─────────────────────────────────── */
.habitat-bandeau {
  background: var(--color-header-bg);
  color: var(--color-white);
  padding: 0.6rem 0.9rem;
}
.habitat-bandeau-lieu { color: var(--color-header-text); font-weight: 700; font-size: 0.95rem; }
.habitat-bandeau-poste { font-size: 0.85rem; opacity: 0.92; }
.habitat-corps { padding: 0.9rem; flex: 1; overflow: hidden; display: flex; flex-direction: column; gap: 0.8rem; }
.habitat-pied { padding: 0.6rem 0.9rem; border-top: 1px solid var(--color-border); font-size: 0.9rem; display: flex; justify-content: space-between; }
.habitat-pied a { color: var(--color-primary-2); text-decoration: underline; }

/* ── Les tuiles des habitants ───────────────────────────────────────────────
   Une classe à elles : « tuile » reste réservée à l'accueil. */
.habitants { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
.habitant {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 56px;
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
  background: var(--color-primary-2);
  color: var(--color-white);
  border: 2px solid var(--color-primary-2);
  touch-action: manipulation;
}
.habitant-nom { font-weight: 700; font-size: 0.9rem; line-height: 1.15; }
.habitant-logement { font-size: 0.78rem; opacity: 0.85; }
.habitant-marque {
  align-self: flex-start;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--color-accent);
  color: var(--color-primary);
}
.habitant--absent { background: var(--color-white); color: var(--color-text-muted); border-color: var(--color-border); }
.habitant--absent .habitant-marque { background: var(--color-kiosque-sans-doux); color: var(--color-kiosque-sans); }
.habitant--encours { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }

/* La nuit : fond sombre, rien qui éblouisse à la sortie de la chambre. */
.habitat--nuit { background: #0f172a; }
.habitat--nuit .habitat-bandeau { background: #0b1222; }
.habitat--nuit .habitant { background: #1e293b; border-color: #334155; color: #e2e8f0; }
.habitat--nuit .habitant--absent { background: #0f172a; color: #64748b; border-color: #1e293b; }
.habitat--nuit .habitat-pied { border-color: #1e293b; color: #94a3b8; }
.habitat--nuit .habitat-pied a { color: #cbd5e1; }
.habitat--nuit .vv-texte { color: #cbd5e1; }

/* ── L'intervention en cours ──────────────────────────────────────────────── */
.intervention { display: flex; flex-direction: column; gap: 1rem; flex: 1; }
.intervention-etat { font-size: 0.9rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.intervention-chez { font-size: 1.6rem; font-weight: 700; color: var(--color-primary); line-height: 1.2; }
.intervention-depuis { font-size: 1.15rem; }
.intervention-fin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 9rem;
  border-radius: 18px;
  background: var(--color-accent);
  color: var(--color-primary);
  font-size: 2.6rem;
  font-weight: 800;
  border: 0;
}
.intervention-secours { display: flex; flex-direction: column; gap: 0.5rem; margin-top: auto; }
.intervention-secours .bouton { align-self: stretch; text-align: center; }
.habitat--nuit .intervention-chez { color: #f8fafc; }
.habitat--nuit .intervention-etat, .habitat--nuit .intervention-depuis { color: #cbd5e1; }

.vv-heure { font-size: 2.2rem; font-weight: 800; color: var(--color-primary); }
.vv-texte { font-size: 0.95rem; }
.vv-petit { font-size: 0.8rem; color: var(--color-text-muted); }
.vv-plein { align-self: stretch; text-align: center; padding: 0.9rem; font-size: 1.05rem; }

/* ── La prise de poste ────────────────────────────────────────────────────── */
.poste-liste { display: flex; flex-direction: column; gap: 0.45rem; }
.poste-nom {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 2px solid var(--color-border);
  background: var(--color-white);
  font-weight: 600;
}
.poste-nom--choisi { border-color: var(--color-primary-2); background: var(--color-accent-soft); }
.poste-code {
  display: flex;
  gap: 0.45rem;
  justify-content: center;
  font-size: 1.6rem;
  letter-spacing: 0.3rem;
  padding: 0.6rem;
  border: 2px solid var(--color-primary-2);
  border-radius: 10px;
  background: var(--color-white);
}

/* ── Le bandeau d'une intervention à vérifier ─────────────────────────────── */
.a-verifier {
  border-left: 5px solid var(--color-danger);
  background: var(--color-danger-doux);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  font-size: 0.9rem;
  color: var(--color-text);
}
.a-verifier strong { color: var(--color-danger-fort); }
.a-verifier-gestes { display: flex; gap: 0.5rem; margin-top: 0.6rem; flex-wrap: wrap; }
.habitat--nuit .a-verifier { background: #3b1a17; color: #fde2e0; }
.habitat--nuit .a-verifier strong { color: #fca5a5; }

/* ── La relève (étage 2) ───────────────────────────────────────────────────── */
.releve-tete { display: flex; flex-direction: column; }
.releve-nom { font-size: 1.25rem; font-weight: 700; color: var(--color-primary); }
.releve-bloc { background: var(--color-white); border: 1px solid var(--color-border); border-radius: 10px; padding: 0.7rem 0.8rem; }
.releve-bloc-titre { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); margin-bottom: 0.4rem; font-weight: 700; }
.releve-consigne { border-left: 5px solid var(--color-accent); background: var(--color-exergue); }
.releve-ligne { padding: 0.45rem 0; border-top: 1px solid var(--color-border); font-size: 0.9rem; }
.releve-ligne:first-of-type { border-top: 0; }
.releve-meta { font-size: 0.75rem; color: var(--color-text-muted); }
.nature {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  margin-right: 0.3rem;
  background: var(--color-kiosque-sans-doux);
  color: var(--color-kiosque-sans);
}
.nature--afaire { background: var(--color-accent-soft); color: #92400e; }
.nature--demande { background: #dbeafe; color: #1e3a8a; }
.nature--consigne { background: var(--color-primary-2); color: var(--color-accent); }
.choix-nature { display: grid; grid-template-columns: 1fr; gap: 0.45rem; }
.choix-nature span {
  display: block;
  padding: 0.7rem 0.8rem;
  border: 2px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-white);
  font-weight: 600;
}
.choix-nature span.choisi { border-color: var(--color-primary-2); background: var(--color-accent-soft); }
.zone-texte {
  min-height: 6rem;
  border: 2px solid var(--color-primary-2);
  border-radius: 10px;
  background: var(--color-white);
  padding: 0.6rem;
  font-size: 0.95rem;
}
.zone-texte--vide { color: var(--color-text-muted); }
.rappel-sante {
  font-size: 0.82rem;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  background: var(--color-exergue);
  border: 1px solid var(--color-exergue-bord);
}
.rappel-sante--fort { background: var(--color-danger-doux); border-color: var(--color-danger); }
.gestes { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.gestes .bouton { flex: 1; text-align: center; }
.sante-tiers {
  border: 2px dashed var(--color-primary-2);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  background: var(--color-white);
  font-size: 0.88rem;
}

/* ── L'écran du service (poste de travail) ─────────────────────────────────── */
.service-corps { padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: 1rem; }
.service-titre { font-size: 1.2rem; font-weight: 700; color: var(--color-primary); }
.service-bloc { background: var(--color-white); border: 1px solid var(--color-border); border-radius: 10px; padding: 0.9rem 1rem; }
.service-bloc h3 { font-size: 0.95rem; margin-bottom: 0.6rem; color: var(--color-primary-2); }
.service-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.service-table th { text-align: left; color: var(--color-text-muted); font-weight: 600; border-bottom: 1px solid var(--color-border); padding: 0.35rem 0.4rem; }
.service-table td { border-bottom: 1px solid var(--color-border); padding: 0.4rem; vertical-align: top; }
.service-table .bouton { padding: 0.3rem 0.6rem; font-size: 0.8rem; white-space: nowrap; display: inline-block; }
.etat { font-size: 0.75rem; font-weight: 700; padding: 0.05rem 0.45rem; border-radius: 999px; }
.etat--ok { background: var(--color-kiosque-oui-doux); color: var(--color-kiosque-oui); }
.etat--verifier { background: var(--color-danger-doux); color: var(--color-danger-fort); }
.etat--cours { background: var(--color-accent-soft); color: #92400e; }
.service-bandeau { background: var(--color-header-bg); color: var(--color-header-text); padding: 0.6rem 1.2rem; font-weight: 700; }

/* ── L'espace des proches (étage 3) ────────────────────────────────────────── */
.proche-bloc { background: var(--color-white); border: 1px solid var(--color-border); border-radius: 10px; padding: 0.7rem 0.8rem; }
.proche-bloc h3 { font-size: 0.95rem; color: var(--color-primary-2); margin-bottom: 0.4rem; }
.proche-ligne { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.4rem 0; border-top: 1px solid var(--color-border); font-size: 0.88rem; }
.proche-ligne:first-of-type { border-top: 0; }
.champ { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }
.champ span.saisie { border: 2px solid var(--color-border); border-radius: 8px; padding: 0.55rem; background: var(--color-white); min-height: 2.6rem; }

/* Un bouton posé dans un paragraphe garde sa place sous le texte qui le précède. */
.service-bloc p > .bouton, .sante-tiers p > .bouton { display: inline-block; margin-top: 0.5rem; }
.proche-ligne { align-items: flex-start; }
.etat { white-space: nowrap; }


/* Le logo dans le bandeau, à la hauteur de celui de la plateforme sur téléphone. */
.habitat-bandeau--marque { display: flex; align-items: center; gap: 0.65rem; }
.habitat-marque { height: 30px; width: auto; display: block; flex-shrink: 0; }
.habitat-bandeau-textes { min-width: 0; }

/* ── Les formulaires et les tuiles boutons (étage 1) ──────────────────────── */
.vignes-titre { font-size: 1.35rem; color: var(--color-primary); }
.vignes-formulaire { display: flex; flex-direction: column; gap: 0.8rem; }
.vignes-formulaire input:not([type=hidden]) {
  width: 100%;
  padding: 0.75rem;
  font-size: 1.15rem;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-white);
}
.vignes-formulaire input:focus { border-color: var(--color-primary-2); outline: none; }
.vignes-qr { background: var(--color-white); padding: 0.6rem; border-radius: 10px; align-self: center; width: 220px; }
.vignes-qr--grand { width: min(80vw, 360px); }
.vignes-qr svg { width: 100%; height: auto; display: block; }
.tuile-formulaire { margin: 0; display: contents; }
button.habitant { font: inherit; text-align: left; width: 100%; cursor: pointer; }
form > .intervention-fin { cursor: pointer; }
.habitat-pied { margin-top: auto; align-items: center; }
.habitat-pied .bouton { padding: 0.4rem 0.6rem; }
.a-verifier-gestes form { margin: 0; }
.habitat--nuit .vignes-titre, .habitat--nuit .vv-texte { color: #e2e8f0; }
.habitat--nuit .habitat-corps { background: #0f172a; }
