/* Espace-Client — coffre-fort documentaire (charte Vol. 11).
 * Bleu dominant (sérieux documentaire) + accents turquoise (actions).
 */
:root {
  --brand: #0B0BE2;
  --secondary: #3A5FCD;
  --success: #1BA97B;
  --accent: #00D4AA;
  --text: #0f172a;
  --muted: #797D87;
  --surface: #ffffff;
  --surface-alt: #f5f7fb;
  --border: #e5e9f2;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(15, 23, 42, .06);
  --shadow-lg: 0 18px 40px rgba(11, 11, 226, .14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: var(--surface-alt);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--secondary); }

/* ---------- Login ---------- */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-form-side { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.login-hero {
  background: linear-gradient(135deg, var(--brand), var(--secondary));
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center;
}
.login-hero h2 { font-size: 2rem; margin: 12px 0; line-height: 1.2; }
.login-card { width: min(100%, 380px); }
.brand-mark { font-weight: 700; font-size: 1.1rem; }
.brand-mark b { color: var(--brand); }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 14px 28px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow);
}
.topbar .brand { font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; }
.topbar .brand b { color: var(--brand); }
.topbar nav { display: flex; gap: 6px; align-items: center; }
.topbar nav button {
  background: transparent; border: 0; cursor: pointer;
  padding: 8px 14px; border-radius: 999px; font-weight: 600; color: var(--muted);
}
.topbar nav button:hover { background: var(--surface-alt); color: var(--text); }
.topbar nav button.active { background: var(--brand); color: #fff; }

.container { max-width: 1180px; margin: 0 auto; padding: 28px 24px 60px; }

/* ---------- Composants ---------- */
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 700; color: var(--secondary); }
h1 { font-size: 1.7rem; margin: 4px 0 6px; letter-spacing: -.02em; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 12px; color: var(--text); }
p.lead { color: var(--muted); margin: 0 0 24px; max-width: 70ch; }

.btn { background: var(--brand); color: #fff; border: 0; padding: 10px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; transition: background .15s; }
.btn:hover { background: var(--secondary); }
.btn.secondary { background: var(--surface); color: var(--brand); border: 1px solid var(--brand); }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: #00b894; }
.btn.good { background: var(--success); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--surface-alt); }
.btn.small { padding: 7px 12px; font-size: .85rem; }
.btn.full { width: 100%; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--surface-alt); color: var(--muted); border: 1px solid var(--border); }
.badge.warn { background: rgba(217,119,6,.14); color: var(--warning); border-color: rgba(217,119,6,.3); }
.badge.ok { background: rgba(27,169,123,.12); color: var(--success); border-color: rgba(27,169,123,.3); }

.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty b { display: block; font-size: 1.1rem; margin-bottom: 6px; color: var(--text); }

/* ---------- Bannière hors-ligne ---------- */
.offline-banner { position: sticky; top: 0; z-index: 60; padding: 9px 24px; font-size: .9rem; font-weight: 500; text-align: center; color: #fff; }
.offline-banner.offline { background: var(--danger); }
.offline-banner.syncing { background: var(--warning); }

/* ---------- Demo box login ---------- */
.demo-box { margin-top: 8px; padding: 10px; background: linear-gradient(135deg, rgba(11,11,226,.08), rgba(0,212,170,.08)); border: 1px dashed var(--brand); border-radius: 10px; text-align: center; }
.demo-box small { display: block; color: var(--muted); font-size: .78rem; }
.demo-box b { display: block; font-size: 1.6rem; letter-spacing: .3em; color: var(--brand); font-family: "Courier New", monospace; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--text); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 1000; max-width: 90vw; }
.toast.ok { background: var(--success); }
.toast.error { background: var(--danger); }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: grid; place-items: center; z-index: 999; padding: 24px; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 26px; width: min(100%, 460px); box-shadow: var(--shadow-lg); }
.modal h2 { margin-top: 0; }

/* ---------- Coffre-fort layout ---------- */
.vault-layout { display: grid; grid-template-columns: 260px 1fr; gap: 22px; }
.vault-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; height: fit-content; box-shadow: var(--shadow); }
.cat-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: 1px solid transparent; text-align: left;
  padding: 10px 12px; border-radius: 10px; cursor: pointer; margin-bottom: 4px; font-weight: 500;
}
.cat-btn:hover { background: var(--surface-alt); }
.cat-btn.active { background: rgba(11,11,226,.08); border-color: rgba(11,11,226,.2); color: var(--brand); }
.cat-icon { font-size: 1.2rem; }
.cat-label { flex: 1; }
.cat-count { background: var(--surface-alt); padding: 1px 9px; border-radius: 999px; font-size: .78rem; color: var(--muted); font-weight: 600; }
.cat-btn.active .cat-count { background: var(--brand); color: #fff; }
.maintenance-btn { color: var(--warning); border-top: 1px solid var(--border); margin-top: 10px; padding-top: 14px; border-radius: 0 0 10px 10px; }

.vault-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.vault-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.vault-head h2 { margin: 0; }

/* ---------- Table documents ---------- */
.vault-table { width: 100%; border-collapse: collapse; }
.vault-table th { text-align: left; padding: 10px 8px; border-bottom: 2px solid var(--border); font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.vault-table td { padding: 12px 8px; border-bottom: 1px solid var(--border); font-size: .9rem; vertical-align: middle; }
.vault-table tr.unread { background: rgba(217,119,6,.04); }
.vault-table tr.unread td:nth-child(2) b::before { content: "● "; color: var(--warning); }
.vault-table tr:hover { background: var(--surface-alt); }

/* ---------- Notif item ---------- */
.notif-item { background: var(--surface-alt); border-radius: 10px; padding: 12px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.notif-item b { color: var(--text); }
.notif-item small { color: var(--muted); }
.notif-item .btn { align-self: flex-start; margin-top: 4px; }

@media (max-width: 720px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .vault-layout { grid-template-columns: 1fr; }
}

/* ===== Mes identifiants de connexion (e-mail + téléphone vérifiés) ===== */
.identity-panel h3 { margin: 0 0 6px; }
.identity-panel .muted, .identity-panel .id-label { color: var(--muted); }
.identity-box { margin-top: 18px; }
.id-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.id-label { min-width: 110px; font-weight: 600; }
.id-value { flex: 1; min-width: 180px; }
.id-form { margin-top: 12px; }
.id-form > label { display: block; font-weight: 600; margin-bottom: 6px; }
.id-inputs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.id-inputs input, .id-inputs select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.id-inputs input { flex: 1; min-width: 180px; }

/* Bannières publicitaires défilantes (identiques à Immocilia) */
.banner-carousel { position: relative; height: clamp(140px, 22vw, 260px); border-radius: 14px; overflow: hidden; background: #0b0b2a; margin-bottom: 16px; box-shadow: 0 10px 30px rgba(8,17,31,.12); }
.banner-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s; pointer-events: none; }
.banner-slide.active { opacity: 1; pointer-events: auto; }
.banner-slide a { display: block; width: 100%; height: 100%; color: inherit; }
.banner-slide img, .banner-slide video { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-text { display: grid; place-items: center; height: 100%; color: #fff; font-size: 1.5rem; font-weight: 800; padding: 20px; text-align: center; background: linear-gradient(135deg, #0B0BE2, #1BA97B); }
.banner-label { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: .72rem; padding: 3px 8px; border-radius: 999px; }
.banner-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.banner-dots button { width: 9px; height: 9px; border-radius: 50%; border: 0; background: rgba(255,255,255,.5); cursor: pointer; padding: 0; }
.banner-dots button.active { background: #fff; width: 22px; border-radius: 6px; }

/* Messages vocaux (demande d'intervention) */
.voice-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.voice-level { width: 70px; height: 8px; border-radius: 4px; background: rgba(0,0,0,.1); overflow: hidden; }
.voice-level span { display: block; height: 100%; width: 0; background: #1BA97B; transition: width .08s; }
.btn.recording { background: #E53935 !important; color: #fff !important; border-color: #E53935 !important; }
.voice-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(11,11,226,.06); border-radius: 10px; padding: 4px 8px; }
.voice-chip audio, .voice-row audio { height: 34px; max-width: 240px; }
.voice-chip button, .voice-del { border: 0; background: rgba(0,0,0,.08); border-radius: 8px; cursor: pointer; padding: 4px 7px; }
.voice-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.voice-removed { display: block; opacity: .7; font-style: italic; }
.request-item { border: 1px solid var(--border, #e5e9f2); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.request-item p { margin: 6px 0; }
.request-item small { color: var(--muted, #797D87); margin-left: 6px; }


/* ---------- Annonces à la une ---------- */
.une-strip { margin: 0 0 22px; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, #FFF8E6, #FFFDF6); border: 1px solid #F5D98A; }
.une-strip h3 { margin: 0 0 12px; color: #8A5A00; }
.une-strip h3 small { color: #9b8650; font-weight: 500; }
.une-list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 240px); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.une-card { display: grid; gap: 3px; padding: 0 0 12px; border-radius: 14px; background: #fff; border: 1px solid #F5D98A; text-decoration: none; color: inherit; overflow: hidden; }
.une-card:hover { box-shadow: 0 8px 22px rgba(245, 196, 81, .3); }
.une-card b, .une-card small, .une-card .une-price { padding: 0 12px; }
.une-photo { display: block; aspect-ratio: 4 / 3; background: #eef1f8 center / cover no-repeat; margin-bottom: 8px; }
.une-price { font-weight: 800; color: #8A5A00; }
