/* Espace propriétaire v2 — Immo Transac (29/09/2026). Mobile d'abord. */
:root {
  --creme: #F0E2C0; --creme-clair: #FAF4E4; --fond: #FBF8EF; --blanc: #ffffff;
  --or: #D4A844; --or-fonce: #A8842F; --marine: #0a1824; --texte: #243447; --doux: #5d6a82; --ligne: #E8DEC4;
  --vert: #0f8a5f; --vert-fond: #E4F5EC; --ambre: #B45309; --ambre-fond: #FBEDD3; --rouge: #B91C1C; --rouge-fond: #FBE3E3; --bleu: #1D4ED8; --bleu-fond: #E3EAFB;
  --rayon: 14px; --ombre: 0 6px 20px rgba(10, 24, 36, .08);
  --bas: calc(64px + env(safe-area-inset-bottom, 0px));
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 16px/1.55 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
[hidden] { display: none !important; }
h1, h2, h3, .serif { font-family: Georgia, "Times New Roman", serif; color: var(--marine); text-wrap: balance; }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; font-weight: 400; }
h2 { font-size: 20px; margin: 0 0 10px; font-weight: 700; }
h3 { font-size: 16px; margin: 0 0 6px; font-weight: 700; }
p { margin: 0 0 10px; }
a { color: var(--or-fonce); }
button, input, select, textarea { font: inherit; }
input, select, textarea { font-size: 16px; } /* < 16 px = zoom automatique sur iPhone */
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }

/* ---------- connexion */
.connexion { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(180deg, var(--creme) 0, var(--fond) 46%); }
.connexion-carte { width: 100%; max-width: 420px; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 20px; padding: 26px 22px; box-shadow: var(--ombre); }
.marque { text-align: center; margin-bottom: 18px; }
.marque-logo { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; background: var(--marine); color: var(--or); border: 2px solid var(--or); font-family: Georgia, serif; font-weight: 700; letter-spacing: 1px; }
.marque-nom { font-family: Georgia, serif; letter-spacing: 4px; text-transform: uppercase; font-size: 12px; color: #5C4815; font-weight: 700; }
.marque-sous { font-family: Georgia, serif; font-size: 22px; color: var(--marine); margin-top: 8px; }
form label { display: block; font-size: 13px; font-weight: 700; color: var(--doux); margin: 12px 0 5px; }
select { padding: 10px 12px; border: 1px solid var(--ligne); border-radius: 12px; background: var(--blanc); color: var(--marine); max-width: 100%; }
form input, form textarea, form select { width: 100%; min-width: 0; padding: 12px 14px; border: 1px solid var(--ligne); border-radius: 12px; background: var(--creme-clair); color: var(--marine); }
.form-erreur { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--rouge-fond); color: var(--rouge); font-size: 14px; font-weight: 600; }
.connexion-aide { margin: 16px 0 0; font-size: 13px; color: var(--doux); text-align: center; }

/* ---------- boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 700; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn-principal { background: var(--marine); color: var(--creme); width: 100%; margin-top: 18px; }
.btn-or { background: var(--or); color: var(--marine); }
.btn-clair { background: var(--blanc); color: var(--marine); border: 1px solid var(--or); }
.btn-discret { white-space: nowrap; background: transparent; color: var(--creme); border: 1px solid rgba(240, 226, 192, .45); padding: 8px 14px; min-height: 36px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: progress; }

/* ---------- structure */
.app { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); }
.entete { background: var(--marine); color: var(--creme); padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 3px solid var(--or); position: sticky; top: 0; z-index: 30; }
.entete-bien { min-width: 0; }
.entete-titre { font-family: Georgia, serif; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entete-sous { font-size: 12px; color: #cfd6e4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu { display: none; }
.contenu { min-width: 0; padding: 18px 16px calc(var(--bas) + 24px); max-width: 980px; width: 100%; margin: 0 auto; }
.contenu:focus { outline: none; }
.barre-bas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--blanc); border-top: 1px solid var(--ligne); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -4px 16px rgba(10, 24, 36, .06); }
.barre-bas button { background: none; border: 0; padding: 8px 2px 9px; min-height: 60px; display: grid; justify-items: center; gap: 2px; color: var(--doux); font-size: 11px; font-weight: 600; cursor: pointer; min-width: 0; }
.barre-bas button .ic { font-size: 20px; line-height: 1; }
.barre-bas button[aria-current="page"] { color: var(--marine); box-shadow: inset 0 3px 0 var(--or); }
.pastille-nb { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--or); color: var(--marine); font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }

.feuille { position: fixed; inset: 0; z-index: 60; }
.feuille-fond { position: absolute; inset: 0; background: rgba(10, 24, 36, .45); }
.feuille-corps { position: absolute; left: 0; right: 0; bottom: 0; background: var(--blanc); border-radius: 20px 20px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
.feuille-poignee { width: 44px; height: 5px; border-radius: 3px; background: var(--ligne); margin: 0 auto 10px; }
.feuille-liens { display: grid; gap: 6px; }
.feuille-liens button { text-align: left; background: var(--creme-clair); border: 1px solid var(--ligne); border-radius: 12px; padding: 14px; font-weight: 700; color: var(--marine); cursor: pointer; min-height: 48px; }

@media (min-width: 900px) {
  .app { grid-template-columns: 250px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .entete { grid-column: 1 / -1; }
  .menu { display: grid; align-content: start; gap: 4px; padding: 18px 12px; border-right: 1px solid var(--ligne); background: var(--blanc); position: sticky; top: 62px; height: calc(100dvh - 62px); overflow: auto; }
  .menu button { text-align: left; background: none; border: 0; border-radius: 10px; padding: 11px 12px; font-weight: 600; color: var(--texte); cursor: pointer; display: flex; gap: 10px; align-items: center; }
  .menu button[aria-current="page"] { background: var(--creme-clair); color: var(--marine); box-shadow: inset 3px 0 0 var(--or); }
  .barre-bas { display: none; }
  .contenu { padding: 26px 28px 40px; }
}

/* ---------- composants */
.carte { background: var(--blanc); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 16px; min-width: 0; }
.carte + .carte { margin-top: 12px; }
.pile { display: grid; gap: 12px; min-width: 0; }
.grille { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.compteur { background: var(--blanc); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 14px; min-width: 0; text-align: left; cursor: pointer; }
.compteur .n { font-family: Georgia, serif; font-size: 30px; color: var(--marine); line-height: 1; font-variant-numeric: tabular-nums; }
.compteur .l { font-size: 12.5px; color: var(--doux); margin-top: 6px; }
.sur-titre { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--or-fonce); font-weight: 800; margin-bottom: 6px; }
.doux { color: var(--doux); }
.petit { font-size: 13px; }
.ligne-info { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--ligne); font-size: 14.5px; }
.ligne-info:last-child { border-bottom: 0; }
.ligne-info dt { color: var(--doux); font-size: 13px; margin: 0; }
.ligne-info dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
dl { margin: 0; }
.etat { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; line-height: 1.7; white-space: nowrap; }
/* Libellés longs (« Éligible à l'assurance loyers impayés », « Dossier accepté, visite à organiser ») :
   le badge passe à la ligne au lieu de pousser la page hors de l'écran. */
.ligne-info dd .etat, .bloc .etat { white-space: normal; border-radius: 12px; line-height: 1.35; padding: 4px 10px; }
.entete-carte > .etat { white-space: normal; border-radius: 12px; line-height: 1.35; padding: 4px 10px; max-width: 100%; }
.etat.vert { background: var(--vert-fond); color: var(--vert); }
.etat.ambre { background: var(--ambre-fond); color: var(--ambre); }
.etat.rouge { background: var(--rouge-fond); color: var(--rouge); }
.etat.bleu { background: var(--bleu-fond); color: var(--bleu); }
.etat.neutre { background: var(--creme); color: #5C4815; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { background: var(--creme); color: #5C4815; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; }
.puce.moins { background: var(--rouge-fond); color: #9f1d1d; }
.puce.plus { background: var(--vert-fond); color: var(--vert); }
.jauge { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.jauge-piste { height: 8px; background: var(--creme); border-radius: 6px; overflow: hidden; }
.jauge-plein { height: 100%; background: var(--or); border-radius: 6px; }
.jauge-val { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--marine); font-size: 14px; }
.bloc { background: var(--creme-clair); border: 1px solid var(--ligne); border-radius: 12px; padding: 12px; margin-top: 10px; min-width: 0; }
.bloc.vert { background: var(--vert-fond); border-color: #bfe6d1; }
.citation { border-left: 4px solid var(--or); padding: 8px 12px; background: var(--blanc); border-radius: 6px; font-style: italic; margin-top: 8px; }
.onglets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; background: var(--creme); padding: 5px; border-radius: 14px; margin-bottom: 14px; }
.onglets button { border: 0; background: transparent; border-radius: 10px; padding: 9px 4px; font-weight: 700; color: #5C4815; cursor: pointer; min-width: 0; font-size: 13.5px; line-height: 1.25; }
.onglets button[aria-selected="true"] { background: var(--blanc); color: var(--marine); box-shadow: 0 2px 8px rgba(10, 24, 36, .08); }
.onglets .nb { display: block; font-family: Georgia, serif; font-size: 20px; }
.entete-carte { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.vide { text-align: center; padding: 30px 16px; color: var(--doux); }
.vide .ic { font-size: 34px; }
.alerte { padding: 12px 14px; border-radius: 12px; background: var(--rouge-fond); color: var(--rouge); font-weight: 600; }
.squelette { border-radius: var(--rayon); height: 92px; background: linear-gradient(90deg, var(--creme-clair) 25%, var(--creme) 37%, var(--creme-clair) 63%); background-size: 400% 100%; animation: brille 1.3s ease infinite; }
@keyframes brille { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .squelette { animation: none; } }

.frise { position: relative; margin: 0; padding: 0 0 0 26px; list-style: none; }
.frise::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--ligne); }
.frise li { position: relative; padding: 0 0 16px; min-width: 0; }
.frise li::before { content: ""; position: absolute; left: -22px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--blanc); border: 3px solid var(--ligne); }
.frise li.fait::before { border-color: var(--vert); background: var(--vert); }
.frise li.cours::before { border-color: var(--or); background: var(--or); }
.frise strong { font-size: 15px; }
.frise .quand { font-size: 12px; color: var(--doux); }

.conseiller { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; }
.conseiller img, .conseiller .avatar { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--or); object-fit: cover; background: var(--marine); color: var(--creme); display: grid; place-items: center; font-family: Georgia, serif; font-weight: 700; }
.photo-bien { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; display: block; background: var(--creme); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--creme); }

.table-defile { overflow-x: auto; border: 1px solid var(--ligne); border-radius: 12px; background: var(--blanc); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--ligne); vertical-align: top; }
th { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--or-fonce); background: var(--creme-clair); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

.fil { display: grid; gap: 8px; }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 15px; overflow-wrap: anywhere; }
.msg.moi { justify-self: end; background: var(--marine); color: var(--creme); border-bottom-right-radius: 4px; }
.msg.agence { justify-self: start; background: var(--blanc); border: 1px solid var(--ligne); border-bottom-left-radius: 4px; }
.msg .quand { display: block; font-size: 11px; opacity: .7; margin-top: 4px; }
.choix { display: grid; gap: 8px; }
.choix label { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--ligne); border-radius: 12px; background: var(--blanc); cursor: pointer; margin: 0; font-weight: 400; color: var(--texte); font-size: 15px; }
.choix input { width: 20px; height: 20px; padding: 0; margin-top: 2px; accent-color: var(--or-fonce); }
.choix label:has(input:checked) { border-color: var(--or); background: var(--creme-clair); }

.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--bas) + 10px); z-index: 80; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: var(--marine); color: var(--creme); padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: var(--ombre); max-width: 100%; }
.toast.erreur { background: var(--rouge); color: #fff; }
@media (min-width: 900px) { .toasts { bottom: 20px; } }
