/* ConciergerieFlow — mise en page : back-office, pages publiques, installateur. */

/* ---------- Marque ---------- */
.brand { display: flex; align-items: center; gap: var(--space-3); color: var(--text); text-decoration: none; min-width: 0; }
.brand-mark {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent);
  font: 600 1rem/1 var(--font-serif);
}
.brand-mark-lg { width: 56px; height: 56px; border-radius: 14px; font-size: 1.375rem; }
/* Logo : hauteur fixe, largeur libre (carré ≈ 40 × 40, horizontal jusqu'à 180 px) ; marges déjà rognées à l'envoi. */
.brand-logo { display: block; flex: none; height: 40px; width: auto; max-width: 180px; object-fit: contain; }
.brand-logo-lg { height: 80px; max-width: min(280px, 100%); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-app { font-size: var(--text-sm); color: var(--muted); }
/* Mobile : le nom passe sur trois lignes (14 px, minimum de l'interface) au lieu d'être tronqué ;
   la mention du logiciel s'efface. Tient dans la barre de 64 px. */
@media (max-width: 599px) {
  .topbar { gap: var(--space-2); padding: 0 var(--space-2); }
  .brand { gap: var(--space-2); }
  .brand-logo { height: 32px; max-width: 96px; }
  .brand-app { display: none; }
  .brand-name {
    white-space: normal; overflow-wrap: anywhere; font-size: var(--text-sm); line-height: 1.15;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3;
  }
  /* Le nom prend toute la place libre ; « Mon compte » reste dans le menu. */
  .brand { flex: 1 1 auto; }
  .topbar .topbar-spacer, .topbar .user-chip { display: none; }
}

/* ---------- Back-office ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--space-3);
  height: var(--topbar-height); padding: 0 var(--space-4);
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar-spacer { flex: 1; }
.user-menu { display: flex; align-items: center; gap: var(--space-1); }
.user-chip {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--control-height); padding: var(--space-1) var(--space-3);
  border-radius: var(--radius); color: var(--text); text-decoration: none;
}
.user-chip:hover, .user-chip[aria-current="page"] { background: var(--surface-2); }
.avatar {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: var(--text-sm); font-weight: 600;
}
.user-meta { display: none; flex-direction: column; line-height: 1.25; }
.user-name { font-weight: 600; font-size: 0.9375rem; }
.user-role { font-size: var(--text-sm); color: var(--muted); }
@media (min-width: 720px) { .user-meta { display: flex; } }

.shell { display: block; }
.sidenav {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: var(--space-4) var(--space-3) var(--space-8);
  overflow-y: auto;
}
.nav-group {
  margin: var(--space-5) var(--space-3) var(--space-2);
  font-size: var(--text-sm); font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.nav-group:first-child { margin-top: var(--space-1); }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav li + li { margin-top: 2px; }
.sidenav a {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--control-height); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius); color: var(--text); text-decoration: none;
}
.sidenav a:hover { background: var(--surface-2); }
.sidenav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* Mobile et tablette : menu latéral escamotable */
@media (max-width: 1023px) {
  .sidenav {
    position: fixed; z-index: 25; top: var(--topbar-height); bottom: 0; left: 0;
    width: min(var(--sidenav-width), 86vw);
    transform: translateX(-100%);
    /* Fermé : invisible aussi pour le clavier et les lecteurs d'écran (visibility après la glissade). */
    visibility: hidden;
    transition: transform var(--duration) var(--ease), visibility 0s linear var(--duration);
    box-shadow: var(--shadow);
  }
  body.nav-open .sidenav { transform: translateX(0); visibility: visible; transition-delay: 0s; }
  body.nav-open .shell::before {
    content: ""; position: fixed; inset: var(--topbar-height) 0 0 0; z-index: 20; background: var(--overlay);
  }
}
@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .shell { display: grid; grid-template-columns: var(--sidenav-width) minmax(0, 1fr); }
  .sidenav { position: sticky; top: var(--topbar-height); height: calc(100vh - var(--topbar-height)); }
}

.main { padding: var(--space-6) var(--space-4) var(--space-10); min-width: 0; outline: none; }
.main > * { max-width: var(--content-max); margin-left: auto; margin-right: auto; }
@media (min-width: 720px) { .main { padding: var(--space-8) var(--space-8) var(--space-12); } }
.page-header { margin-bottom: var(--space-6); }
.page-lede { color: var(--muted); margin: var(--space-2) 0 0; max-width: 70ch; }
.app-footer { display: flex; gap: var(--space-2); margin-top: var(--space-12); color: var(--muted); font-size: var(--text-sm); }

/* ---------- Pages publiques (connexion, erreurs, maintenance) ---------- */
body.public { min-height: 100vh; display: grid; place-items: center; padding: var(--space-8) var(--space-4); }
.public-main { width: min(440px, 100%); }
.public-brand { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); margin-bottom: var(--space-6); text-align: center; }
.public-name { font-family: var(--font-serif); font-size: var(--text-xl); margin: 0; }
.public-card { padding: var(--space-8) var(--space-6); }
.public-card .display-title { font-size: var(--text-2xl); }
.powered { text-align: center; color: var(--muted); font-size: var(--text-sm); margin-top: var(--space-6); }
.powered a { color: inherit; }
.powered a:hover { color: var(--text); }

/* ---------- Installateur ---------- */
body.install { padding: var(--space-8) var(--space-4) var(--space-12); }
.install-main { max-width: 880px; margin: 0 auto; }
.install-header { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-6); }
.install-kicker { margin: 0; font-size: var(--text-sm); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.install-product { margin: 0; font-weight: 600; }
/* Étapes : une seule ligne ; en dessous de 760 px, seul le libellé de l'étape en cours reste affiché. */
.stepper { list-style: none; display: flex; flex-wrap: nowrap; gap: var(--space-2); margin: 0 0 var(--space-6); padding: 0; min-width: 0; }
.stepper-item + .stepper-item { margin-top: 0; }
.stepper-label { white-space: nowrap; }
@media (max-width: 759px) {
  .stepper { gap: var(--space-1); }
  .stepper-item:not(.is-current) { padding: var(--space-1); }
  .stepper-item:not(.is-current) .stepper-label {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}
.stepper-item {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-3) var(--space-1) var(--space-1);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  color: var(--muted); font-size: var(--text-sm); margin: 0;
}
.stepper-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); font-weight: 600; }
.stepper-num .icon { width: 16px; height: 16px; }
.stepper-item.is-current { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.stepper-item.is-current .stepper-num { background: var(--accent); color: var(--on-accent); }
.stepper-item.is-done { color: var(--success); }
.stepper-item.is-done .stepper-num { background: var(--success-bg); }
.install-card { padding: var(--space-8); }
@media (max-width: 600px) { .install-card { padding: var(--space-5) var(--space-4); } }
