/* Bail Simple — surfaces unies, typographie sans empattements et contrôles arrondis. */

:root {
  --ink: #293326;
  --muted: #626b5d;
  --line: #dde2d6;
  --line-strong: #aeb9a0;
  --paper: #ffffff;
  --wash: #f7f8f5;
  --surface: #ffffff;
  --surface-subtle: #fafbf8;
  --surface-muted: #eef1e9;
  --primary: #526735;
  --primary-dark: #354722;
  --primary-soft: #edf2e6;
  --mint: #34705c;
  --mint-soft: #e7f0eb;
  --clay: #526735;
  --clay-dark: #43582b;
  --clay-soft: #edf2e6;
  --amber: #8a651f;
  --amber-soft: #f7eed5;
  --red: #9f3440;
  --red-soft: #f9e8e8;
  --terracotta: #bc7458;
  --terracotta-dark: #884631;
  --terracotta-soft: #fbf2ee;
  --focus-halo: #52673530;
  --shadow: 0 18px 45px #2933260d;
  --shadow-soft: 0 8px 22px #2933260c;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --layout-max: 1220px;
  --content-max: 760px;
  --radius-control: 12px;
  --radius-panel: 18px;
  color: var(--ink);
  background: var(--wash);
  font-family: var(--font-sans);
}

html { color-scheme: light; }

body,
.portal-body,
.dashboard-body,
.home-body,
.signer-body {
  color: var(--ink);
  background-color: var(--wash);
  background-image: none;
  background-size: 48px 48px;
  font-family: var(--font-sans);
  line-height: 1.55;
}

::selection { color: var(--primary-dark); background: #e2ebd4; }

button,
input,
select,
textarea { font-family: inherit; }

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--clay);
  outline-offset: 3px;
}

input,
select,
textarea { accent-color: var(--primary); }

/* Marque et en-têtes */
.topbar,
.portal-header,
.home-header,
.login-header,
.signer-header {
  background: var(--paper);
  border-color: var(--line);
  box-shadow: none;
  backdrop-filter: none;
}

.topbar,
.portal-header { min-height: 72px; }

.brand { gap: 12px; }

.brand-mark,
.avatar,
.settings-avatar {
  color: var(--paper);
  background: var(--primary-dark);
  border: 1px solid var(--primary-dark);
  border-radius: 10px;
  box-shadow: none;
  letter-spacing: -.06em;
}

.brand-mark { position: relative; overflow: hidden; }
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid #fff4;
  pointer-events: none;
}

.brand strong { color: var(--ink); font-weight: 650; letter-spacing: -.025em; }
.brand small { color: var(--muted); }

.eyebrow,
.home-eyebrow,
.signer-eyebrow {
  color: var(--clay-dark);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .15em;
}

.save-state,
.local-badge,
.signer-security,
.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-subtle);
  box-shadow: none;
}

/* Boutons : une hiérarchie stable et des proportions communes */
.button,
.portal-primary,
.portal-secondary,
.home-body a.home-button,
.signer-primary,
.signer-secondary,
.back-button,
.login-home-link,
.text-button,
.modal-jump {
  min-height: 46px;
  border-radius: var(--radius-control);
  box-shadow: none;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.button.primary,
.portal-primary,
.home-body a.home-button,
.signer-primary {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.button.primary:hover:not(:disabled),
.portal-primary:hover:not(:disabled),
.home-body a.home-button:hover,
.signer-primary:hover:not(:disabled) {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  box-shadow: none;
  filter: none;
  transform: translateY(-1px);
}

.button.ghost,
.portal-secondary,
.signer-secondary,
.back-button,
.login-home-link {
  color: var(--primary-dark);
  border: 1px solid var(--line-strong);
  background: var(--paper);
}

.button.ghost:hover:not(:disabled),
.portal-secondary:hover:not(:disabled),
.signer-secondary:hover:not(:disabled),
.back-button:hover,
.login-home-link:hover {
  color: var(--primary-dark);
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: none;
}

.button.soft { color: var(--clay-dark); border-color: #bccbaa; background: var(--clay-soft); }
.button.soft:hover:not(:disabled) { color: #fff; border-color: var(--clay); background: var(--clay); }
.button.danger,
.text-button.danger { color: var(--red); border-color: #d8a8ad; background: var(--paper); }

.button:disabled,
.portal-primary:disabled,
.signer-primary:disabled,
.signer-secondary:disabled {
  color: #737b80;
  border-color: var(--line);
  background: #edf0f4;
  opacity: 1;
  box-shadow: none;
}

/* Champs */
.field label,
.portal-field label,
.profile-field label,
.micro-label { color: var(--ink); font-size: 13px; font-weight: 600; }

.field input,
.field select,
.field textarea,
.portal-field input,
.profile-field input,
.profile-field select,
.profile-field textarea,
.signer-access input {
  min-height: 48px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--paper);
  box-shadow: inset 0 -1px 0 #29332606;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.portal-field input:hover,
.profile-field input:hover { border-color: #8d9397; }

.field input:focus,
.field select:focus,
.field textarea:focus,
.portal-field input:focus,
.profile-field input:focus,
.signer-access input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--focus-halo);
}

.field input[aria-invalid="true"],
.portal-field input[aria-invalid="true"] { border-color: var(--red); background: var(--red-soft); }
.field-error,
.form-message[data-state="error"] { color: var(--red); }
.correction-return { margin: 0 0 16px; }
.correction-return .button { max-width: 100%; white-space: normal; text-align: left; }
.signer-owner-hint { align-self: end; margin: 0 0 12px; }
.energy-cost-pair {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
  align-items: start;
}
.energy-cost-hint, .energy-year { grid-column: 1 / -1; }
.energy-cost-hint { margin: 0; }
.energy-cost-pair > .field label { display: flex; min-height: 2.8em; align-items: flex-end; }
.hint,
.profile-hint,
.optional { color: var(--muted); }

/* Accueil */
.home-body { background-color: var(--paper); background-size: 64px 64px; }

.home-header {
  max-width: none;
  min-height: 78px;
  padding-inline: max(28px, calc((100vw - var(--layout-max)) / 2));
}

.home-header nav { gap: 28px; }
.home-header nav > a:not(.home-button):not(.home-login-link) { color: var(--muted); border-bottom: 1px solid transparent; }
.home-header nav > a:not(.home-button):not(.home-login-link):hover { color: var(--ink); border-color: var(--clay); filter: none; }

.home-hero {
  max-width: var(--layout-max);
  min-height: min(690px, calc(100vh - 78px));
  grid-template-columns: minmax(0, .92fr) minmax(400px, .82fr);
  gap: clamp(48px, 8vw, 112px);
  align-items: center;
  padding: clamp(72px, 9vw, 118px) 0;
}

.hero-text { position: relative; }
.hero-text::before {
  content: "BAIL SIMPLE / 01";
  position: absolute;
  top: 0;
  right: 0;
  color: var(--line-strong);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .18em;
  writing-mode: vertical-rl;
}

.hero-text h1 {
  max-width: 650px;
  margin: 24px 0 28px;
  color: var(--primary-dark);
  font-family: var(--font-display);
  font-size: clamp(52px, 6vw, 82px);
  font-weight: 500;
  line-height: .97;
  letter-spacing: -.055em;
}

.hero-text h1 em { color: var(--clay); font-style: italic; font-weight: 500; }
.hero-text > p { max-width: 510px; color: var(--muted); font-size: 18px; line-height: 1.65; }
.home-actions { gap: 24px; margin-top: 34px; }
.home-link { color: var(--primary-dark); text-decoration: underline; text-decoration-color: #52673570; text-underline-offset: 6px; }
.hero-notes { color: var(--muted); }
.hero-notes span::first-letter { color: var(--clay); }

.hero-service {
  position: relative;
  padding: 10px 0 10px 38px;
  border: 0;
  border-left: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
}

.hero-service::before {
  content: "CHOISIR UN DOCUMENT";
  position: absolute;
  top: 10px;
  left: -10px;
  padding: 3px 7px;
  color: var(--clay-dark);
  background: var(--paper);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .14em;
  transform: translateX(-100%);
}

.hero-service h2 {
  margin: 0 0 24px;
  color: var(--primary-dark);
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -.025em;
}

.home-body .hero-service > .service-link {
  min-height: 104px;
  margin: 0;
  padding: 22px 10px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
}

.home-body .hero-service > .service-link:last-of-type { border-bottom: 1px solid var(--line); }
.home-body .hero-service > .service-link:hover { border-color: var(--clay); background: #f2f5ec; box-shadow: none; transform: none; }
.service-icon { color: var(--primary); border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.service-inspection .service-icon { color: var(--clay-dark); border-color: #bccbaa; background: var(--clay-soft); }
.hero-service strong { font-size: 17px; }
.hero-service small { color: var(--muted); }

.home-services,
.home-pricing {
  max-width: var(--layout-max);
  padding-block: clamp(70px, 9vw, 112px);
  border-top: 1px solid var(--line);
}

.home-body h2 {
  color: var(--primary-dark);
  font-family: var(--font-display);
  font-size: clamp(36px, 4.4vw, 58px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -.045em;
}

.benefits { gap: 42px; }
.benefits article { min-height: 210px; padding: 20px 0 0; border-top: 2px solid var(--primary-dark); }
.benefits article:nth-child(2) { border-color: var(--clay); }
.benefits article:nth-child(3) { border-color: var(--mint); }
.benefits h3 { font-family: var(--font-display); font-size: 25px; font-weight: 600; }
.benefits p { max-width: 310px; color: var(--muted); }

.pricing-heading { align-items: start; }
.pricing-grid { gap: 0; border-top: 1px solid var(--line-strong); }
.offer {
  min-height: 310px;
  padding: 28px 24px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: color-mix(in srgb, var(--paper) 93%, transparent);
}
.offer:first-child { border-left: 1px solid var(--line); }
.offer h3 { font-family: var(--font-display); font-size: 25px; font-weight: 600; }
.offer-price { color: var(--primary-dark); font-family: var(--font-display); font-weight: 600; }
.offer li::before { color: var(--clay); }
.offer > a { color: var(--primary-dark); text-decoration-color: var(--clay); }
.offer:hover { background: #f2f5ec; }
.offer.complete {
  min-height: 0;
  color: #fff;
  border: 0;
  border-top: 7px solid var(--clay);
  background: var(--primary-dark);
}
.complete .offer-price,
.complete h3 { color: #fff; }
.offer.complete > a {
  color: #fff;
  border-color: #aebc9a;
  background: rgba(255, 255, 255, .06);
  text-decoration-color: currentColor;
}
.offer.complete > a:hover {
  color: var(--primary-dark);
  border-color: #fff;
  background: #fff;
}
.offer.complete > a:focus-visible {
  color: #fff;
  outline-color: #fff;
}
.home-start { border-color: var(--line); }
.home-footer { color: #d6d7d6; background: var(--primary-dark); border: 0; }
.home-footer strong { color: #fff; }

/* Connexion et inscription */
.login-body { background-color: var(--wash); }
.login-header {
  min-height: 78px;
  padding-inline: max(26px, calc((100vw - 1120px) / 2));
}
.login-main {
  min-height: calc(100vh - 78px);
  padding: clamp(48px, 8vw, 96px) 24px;
  place-items: start center;
  background: transparent;
}
.login-card,
.register-card {
  width: min(480px, 100%);
  padding: clamp(30px, 5vw, 48px);
  border: 1px solid var(--line);
  border-top: 6px solid var(--clay);
  border-radius: 0;
  background: var(--paper);
  box-shadow: 18px 18px 0 #e5eaf1;
}
.login-heading { margin-bottom: 30px; text-align: left; }
.login-symbol {
  width: 44px;
  height: 44px;
  margin: 0 0 24px;
  color: var(--clay-dark);
  border: 1px solid #bccbaa;
  border-radius: 10px;
  background: var(--clay-soft);
}
.login-heading h1 {
  color: var(--primary-dark);
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 550;
  letter-spacing: -.04em;
}
.login-intro { color: var(--muted); }
.password-wrap { overflow: visible; }
.password-wrap input { padding-right: 96px; }
.password-toggle {
  right: 7px;
  min-height: 44px;
  padding: 0 10px;
  color: var(--primary-dark);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
}
.password-toggle:hover { color: #fff; border-color: var(--primary); background: var(--primary); }
.register-link { color: var(--muted); }
.register-link a { color: var(--primary-dark); text-decoration-color: var(--clay); }
.local-notice { border-color: var(--line); background: transparent; }
.notice-symbol { color: var(--primary); border: 1px solid var(--line); border-radius: 10px; background: var(--primary-soft); }
.password-feedback,
.legal-acceptance { border-radius: var(--radius-control); background: var(--surface-subtle); }

/* Tableau de bord et compte */
.portal-header {
  padding-inline: max(28px, calc((100vw - var(--layout-max)) / 2));
}
.portal-navigation { align-self: stretch; gap: 0; }
.portal-navigation a {
  min-width: 150px;
  min-height: 100%;
  padding: 0 24px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 0;
  border-inline-start: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.portal-navigation a:last-child { border-inline-end: 1px solid var(--line); }
.portal-navigation a:hover { color: var(--primary-dark); border-color: var(--line); background: var(--surface-subtle); }
.portal-navigation a[aria-current] { color: var(--primary-dark); border-color: var(--line); background: var(--primary-soft); box-shadow: inset 0 -3px 0 var(--clay); }
.portal-navigation a[aria-current]:hover { color: var(--primary-dark); background: var(--primary-soft); }
.account-trigger { border-radius: var(--radius-control); border-color: var(--line); background: var(--paper); }
.account-trigger:hover { border-color: var(--primary); background: var(--primary-soft); }
.account-dropdown { border-color: var(--line); border-radius: var(--radius-control); box-shadow: var(--shadow); }
.dashboard-shell { max-width: var(--layout-max); padding-block: 52px 80px; }
.welcome-row { align-items: end; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.welcome-row h1,
.profile-view h1,
.simple-view h1,
.detail-heading h1 {
  color: var(--primary-dark);
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 50px);
  font-weight: 550;
  letter-spacing: -.04em;
}
.quick-actions { gap: 0; border: 1px solid var(--line-strong); }
.quick-card {
  min-height: 132px;
  padding: 24px 28px;
  border: 0;
  border-radius: 0;
  background: var(--paper);
}
.quick-card + .quick-card { border-left: 1px solid var(--line-strong); }
.quick-card::before { content: "01"; color: var(--clay); font-size: 10px; font-weight: 650; letter-spacing: .12em; }
.quick-card.parking-action::before { content: "02"; }
.quick-card.inspection-action::before { content: "03"; }
.quick-card:hover { color: var(--ink); border-color: var(--line); background: #f2f5ec; transform: none; }
.quick-icon { display: none; }
.quick-card strong { color: var(--primary-dark); font-family: var(--font-display); font-size: 25px; font-weight: 600; }
.quick-card em { color: var(--muted); }
.quick-card b { color: var(--clay); }
.section-heading { align-items: end; padding-top: 12px; border-top: 2px solid var(--primary-dark); }
.section-heading h2 { color: var(--primary-dark); font-family: var(--font-display); font-size: 27px; font-weight: 600; }
.empty-drafts,
.empty-properties { border-style: dashed; border-radius: var(--radius-control); background: color-mix(in srgb, var(--paper) 82%, transparent); }
.draft-card,
.property-card,
.document-card,
.settings-card,
.profile-editor-card,
.account-disclosure,
.registry-card,
.remote-request-card {
  border-color: var(--line);
  border-radius: var(--radius-panel);
  background: var(--paper);
  box-shadow: none;
}
.draft-card:hover,
.property-card:hover,
.document-card:hover { border-color: var(--primary); box-shadow: none; transform: none; }
.property-visual,
.document-kind-icon,
.account-menu-symbol,
.registry-card-icon { color: var(--clay-dark); border-color: #bccbaa; border-radius: 10px; background: var(--clay-soft); }
.profile-identity { border-left-width: 1px; }
.account-disclosure {
  transition: background-color .16s ease, border-color .16s ease;
}
.account-disclosure > summary { min-height: 84px; }
.account-disclosure > summary.profile-editor-heading:hover { background: transparent; }
.account-disclosure:not([open]):has(> summary:hover) {
  border-color: #bccbaa;
  background: #f2f5ec;
}
.account-disclosure > summary:hover h2 { color: var(--primary-dark); }
.account-disclosure-icon { color: var(--primary-dark); border-radius: 10px; background: var(--primary-soft); }
.account-disclosure-icon::before {
  display: block;
  width: 100%;
  line-height: 1;
  text-align: center;
  transform: translateY(-1px);
}
.back-button { width: max-content; }

/* Assistants bail et état des lieux */
.app-shell,
.inspection-shell {
  max-width: 1280px;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  background: var(--paper);
  border-inline: 1px solid var(--line);
}
.sidebar,
.inspection-sidebar {
  top: 72px;
  padding: 34px 20px;
  border-right: 1px solid var(--line);
  background: var(--surface-subtle);
}
.dossier-card {
  padding: 0 8px 22px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}
.dossier-card::after { content: none; }
.dossier-card .eyebrow { color: var(--clay-dark); }
.dossier-card .status-pill { width: max-content; color: var(--primary-dark); background: var(--primary-soft); }
#step-nav,
#inspection-nav { gap: 2px; margin-top: 16px; }
.nav-step,
.inspection-nav-button {
  min-height: 54px;
  padding: 10px 9px;
  color: var(--muted);
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  background: transparent;
}
.nav-step span:first-child,
.inspection-nav-button span:first-child { border-radius: 8px; border-color: var(--line-strong); background: var(--paper); }
.nav-step:hover,
.inspection-nav-button:hover { color: var(--ink); border-left-color: var(--line-strong); background: #f1f4eb; }
.nav-step.active,
.inspection-nav-button.active { color: var(--primary-dark); border-left-color: var(--clay); background: #edf2e6; }
.nav-step.active span:first-child,
.inspection-nav-button.active span:first-child { color: #fff; border-color: var(--primary); background: var(--primary); }
.nav-step.done,
.inspection-nav-button.done { color: var(--primary-dark); background: transparent; }
.nav-step.done span:first-child,
.inspection-nav-button.done span:first-child { color: #fff; border-color: #2f805c; background: #2f805c; box-shadow: none; }
.privacy-note { color: var(--muted); }
.workspace,
.inspection-workspace { padding: 42px clamp(28px, 5vw, 64px) 24px; border: 0; background: var(--paper); }
.workspace-header { max-width: var(--content-max); padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.workspace-header h1,
.inspection-heading h1 {
  color: var(--primary-dark);
  font-family: var(--font-display);
  font-size: clamp(36px, 4.4vw, 52px);
  font-weight: 550;
  line-height: 1.04;
  letter-spacing: -.04em;
}
.workspace-header p { color: var(--muted); font-size: 15px; }
.progress-block { max-width: var(--content-max); margin-block: 18px 26px; }
.progress-track { height: 3px; border-radius: 0; background: var(--line); }
.progress-track span { border-radius: 0; background: var(--clay); }
.substep-nav { max-width: var(--content-max); gap: 0; border: 1px solid var(--line); }
.substep-button { border: 0; border-right: 1px solid var(--line); border-radius: 0; background: var(--paper); }
.substep-button:last-child { border-right: 0; }
.substep-button:hover { border-color: var(--line); background: var(--surface-subtle); }
.substep-button.active { color: var(--primary-dark); border-color: var(--line); background: var(--primary-soft); box-shadow: inset 0 -3px 0 var(--clay); }
.substep-button.active span { color: #fff; background: var(--primary); }
.step-content,
.inspection-content { max-width: var(--content-max); }
.form-section,
.situation-panel,
.composition-question,
.composition-preview,
.inspection-section,
.review-section {
  padding: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.step-content > :first-child,
.inspection-content > .inspection-section:first-child { border-top: 0; }
.form-section h2,
.situation-panel h2,
.composition-question h2,
.inspection-section h2 { color: var(--primary-dark); font-family: var(--font-display); font-size: 25px; font-weight: 600; }
.stage-lead,
.selection-help,
.info-box,
.mission-card,
.visit-intro,
.phase-banner,
.owner-prefill,
.room-head,
.remote-signing-intro {
  border: 1px solid var(--line);
  border-left: 4px solid var(--clay);
  border-radius: 0;
  background: var(--surface-subtle);
  box-shadow: none;
}
.stage-lead > span,
.prefill-icon { color: #fff; border-radius: 8px; background: var(--primary); box-shadow: none; }
.choice-card {
  min-height: 108px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--paper);
  box-shadow: none;
}
.choice-card:hover { border-color: var(--primary); background: var(--surface-subtle); box-shadow: none; transform: none; }
.choice-card:not(:has(.choice-icon)) {
  grid-template-columns: minmax(0, 1fr);
  row-gap: 6px;
}
.choice-card:not(:has(.choice-icon)) > :is(strong, small) {
  grid-column: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.choice-card.selected { color: var(--primary-dark); border: 2px solid var(--primary); background: var(--primary-soft); box-shadow: inset 5px 0 0 var(--clay); }
.choice-icon { color: var(--primary); border: 1px solid var(--line); border-radius: 10px; background: var(--surface-subtle); }
.choice-card.selected .choice-icon { color: #fff; border-color: var(--primary); background: var(--primary); }
.lease-choice-surface .choice-card { min-height: 88px; }
.lease-choice-surface .choice-card small { font-weight: 650; }
.segment span,
.binary-control button,
.counter-control,
.condition-option,
.simple-choice {
  border-color: var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--paper);
}
.segment input:checked + span,
.binary-control button.active,
.binary-control button[aria-pressed="true"],
.condition-option.active,
.simple-choice.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 -3px 0 var(--clay);
}
.segment input:checked + span:hover,
.binary-control button.active:hover,
.binary-control button[aria-pressed="true"]:hover,
.condition-option.active:hover,
.simple-choice.active:hover { color: #fff; border-color: var(--primary-dark); background: var(--primary-dark); }
.toggle { background: #bbb9b4; }
.toggle:checked,
.toggle-row input.toggle:checked { background: var(--primary); }
.toggle-row input.toggle {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 46px;
  min-width: 46px;
  max-width: 46px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 1px solid #969992;
  border-radius: 999px;
  background: #bbb9b4;
  box-shadow: inset 0 0 0 1px rgba(41, 51, 38, .04);
  flex: 0 0 46px;
}
.toggle-row input.toggle::after {
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
}
.toggle-row input.toggle:checked {
  border-color: var(--primary);
  background: var(--primary);
}
.toggle-row input.toggle:checked::after { transform: translateX(20px); }
.toggle-row input.toggle:hover { border-color: var(--primary); }
.toggle-row input.toggle:focus {
  border-color: var(--primary);
  background: #bbb9b4;
  box-shadow: 0 0 0 4px var(--focus-halo);
}
.toggle-row input.toggle:checked:focus { background: var(--primary); }
.optional-section,
.plain-help,
.meter-family-card,
.account-disclosure { border-color: var(--line); border-radius: var(--radius-control); background: var(--paper); }
.optional-section > summary::before { color: var(--clay-dark); border-radius: 8px; background: var(--clay-soft); }
.optional-section[open] > summary { background: var(--surface-subtle); }
.repeat-item,
.review-card,
.item-phase,
.history-item,
.signer-row { border-color: var(--line); border-radius: var(--radius-control); background: var(--surface-subtle); }
.wizard-footer {
  background: var(--paper);
  backdrop-filter: none;
  max-width: var(--content-max);
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.summary-panel,
.inspection-summary {
  grid-column: 2;
  padding: 0 clamp(28px, 5vw, 64px) 38px;
  border: 0;
  background: var(--paper);
}
/* Keep account recovery beside the form, rather than in the next sidebar grid cell. */
.app-shell > .product-toolbox[aria-label="Sauvegarde du compte"],
.inspection-shell > .product-toolbox[aria-label="Sauvegarde du compte"] {
  grid-column: 2;
  width: min(var(--content-max), calc(100% - clamp(56px, 10vw, 128px)));
  margin: 0 auto 38px;
  box-sizing: border-box;
}
.document-disclosure { max-width: var(--content-max); border-color: var(--line); }
.document-disclosure > summary { color: var(--primary-dark); }
.document-disclosure > summary::marker { color: var(--clay); }
.total-card { border-radius: var(--radius-control); background: var(--primary-soft); box-shadow: none; color: var(--primary-dark); grid-template-columns: minmax(0, 1fr); gap: 6px; }
.total-card :is(span, small) { color: var(--muted); }
.total-card strong { grid-row: auto; overflow-wrap: anywhere; }
.preview-access-gate { font-family: Inter, sans-serif; font-size: 13px; line-height: 1.5; }
.preview-access-gate p { margin: 12px 0; }
.dashboard-shortcuts { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.home-signing-overview { margin: 28px 0; }
.home-signing-overview .section-heading { flex-wrap: wrap; gap: 12px; }
.home-signing-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; margin: 12px 0; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.home-signing-card > div { min-width: 0; overflow-wrap: anywhere; }
.home-signing-card small { display: block; margin-top: 6px; color: var(--muted); }
.home-signing-card .button { flex-shrink: 0; }
@media (max-width: 600px) {
  .home-signing-card { align-items: stretch; flex-direction: column; }
  .dashboard-shortcuts .button { flex: 1 1 150px; }
}
[data-dashboard-superfluous] { display: none !important; }
.modal-card { border: 1px solid var(--line); border-top: 6px solid var(--clay); border-radius: 0; box-shadow: 20px 20px 0 #29332620; }
dialog::backdrop { background: #35472299; }

/* État des lieux */
.inspection-heading .dossier-new-button { color: var(--primary-dark); border-color: var(--line-strong); border-radius: var(--radius-control); background: var(--paper); }
.phase-banner { border-left-color: var(--mint); }
.composition-flow { gap: 0; }
.composition-question { min-height: 112px; }
.composition-question-number { color: var(--clay-dark); border: 1px solid #bccbaa; border-radius: 10px; background: var(--clay-soft); }
.composition-preview { margin-top: 24px; border-top: 5px solid var(--primary); }
.composition-preview-list > * { border-color: var(--line); border-radius: var(--radius-control); background: var(--surface-subtle); }
.room-nav,
.item-nav { gap: 6px; }
.room-nav-button,
.item-nav-button { border-color: var(--line); border-radius: var(--radius-control); background: var(--paper); }
.room-nav-button.active,
.item-nav-button.active { color: var(--primary-dark); border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 4px 0 0 var(--clay); }
.room-nav-button.done,
.item-nav-button.done { border-color: #a9c8b9; background: var(--mint-soft); }
.inspection-item,
.room-card,
.meter-card,
.access-card,
.party-card { border-color: var(--line); border-radius: var(--radius-panel); background: var(--paper); box-shadow: none; }
.condition-button[aria-pressed="true"],
.state-button[aria-pressed="true"] { color: #fff; border-color: var(--primary); background: var(--primary); }
.condition-button[aria-pressed="true"]:hover,
.state-button[aria-pressed="true"]:hover { color: #fff; background: var(--primary-dark); }

/* Parcours de signature */
.signer-header { border-bottom: 1px solid var(--line); }
.signer-shell { max-width: 1220px; }
.signer-intro { padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.signer-intro h1,
.signer-state h1 {
  color: var(--primary-dark);
  font-family: var(--font-display);
  font-weight: 550;
  letter-spacing: -.04em;
}
.signer-person { border-color: var(--line); border-radius: var(--radius-control); background: var(--surface-subtle); }
.signer-steps { gap: 0; border: 1px solid var(--line); }
.signer-steps li { border: 0; border-right: 1px solid var(--line); border-radius: 0; background: var(--paper); }
.signer-steps li:last-child { border-right: 0; }
.signer-steps li.active { color: var(--primary-dark); background: var(--primary-soft); box-shadow: inset 0 -3px 0 var(--clay); }
.signer-steps li.done { color: var(--mint); background: var(--mint-soft); }
.signer-card,
.mark-panel,
.signer-state { border-color: var(--line); border-radius: var(--radius-panel); background: var(--paper); box-shadow: none; }
.signer-card-heading > div > span { color: #fff; border-radius: 8px; background: var(--primary); }
.mark-panel canvas { border-color: var(--line-strong); border-radius: var(--radius-control); background: #fff; }
.page-list-panel,
.pdf-stage { border-color: var(--line); border-radius: var(--radius-control); background: var(--surface-muted); }
.page-list button { border-radius: var(--radius-control); }
.page-list button[aria-current="page"] { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 4px 0 0 var(--clay); }
.page-initials-zone,
.page-signature-zone { border-color: var(--clay); background: #fffaf6e8; }
.consent-check { border-color: #a9c8b9; border-left: 4px solid var(--mint); border-radius: 0; background: var(--mint-soft); }

@media (max-width: 1260px) {
  .home-header,
  .home-hero,
  .home-services,
  .home-pricing { margin-inline: 28px; }
  .home-header { padding-inline: 0; }
}

@media (max-width: 1000px) {
  .home-hero { grid-template-columns: minmax(0, 1fr) minmax(340px, .82fr); gap: 42px; }
  .hero-text h1 { font-size: 58px; }
  .hero-service { padding-left: 26px; }
  .hero-service::before { display: none; }
  .app-shell,
  .inspection-shell { grid-template-columns: 190px minmax(0, 1fr); }
}

@media (max-width: 780px) {
  body,
  .portal-body,
  .dashboard-body,
  .home-body,
  .signer-body { background-size: 36px 36px; }
  .topbar,
  .portal-header { padding: 14px 18px; }
  .top-actions { gap: 6px; }
  .top-actions .button { min-height: 44px; }
  .app-shell,
  .inspection-shell { display: block; border: 0; }
  .sidebar,
  .inspection-sidebar { padding: 10px 14px 14px; border: 0; border-bottom: 1px solid var(--line); }
  .dossier-card,
  .privacy-note { display: none; }
  #step-nav,
  #inspection-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 0; }
  .nav-step,
  .nav-step.active,
  .inspection-nav-button,
  .inspection-nav-button.active {
    min-height: 78px;
    padding: 8px 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
  }
  .nav-step.active,
  .inspection-nav-button.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 -3px 0 var(--clay); }
  .workspace,
  .inspection-workspace { padding: 28px 18px 20px; }
  .summary-panel,
  .inspection-summary { padding: 0 18px 28px; }
  .app-shell > .product-toolbox[aria-label="Sauvegarde du compte"],
  .inspection-shell > .product-toolbox[aria-label="Sauvegarde du compte"] {
    width: calc(100% - 36px);
    margin-bottom: 28px;
  }
  .wizard-footer { margin: 26px -18px -20px; padding: 14px 18px max(14px, env(safe-area-inset-bottom)); background: var(--paper); }
  .portal-navigation { order: 3; width: 100%; min-height: 54px; }
  .portal-navigation a { min-width: 0; padding-inline: 14px; }
  .dashboard-shell { padding: 30px 18px 52px; }
  .quick-actions { grid-template-columns: 1fr; }
  .quick-card + .quick-card { border-left: 0; border-top: 1px solid var(--line-strong); }
  .home-hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-service { max-width: none; }
  .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .offer:nth-child(odd) { border-left: 1px solid var(--line); }
  .login-card,
  .register-card { box-shadow: 10px 10px 0 #e5eaf1; }
  .signer-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .home-header,
  .home-hero,
  .home-services,
  .home-pricing { margin-inline: 20px; }
  .home-header { align-items: flex-start; }
  .home-header nav { gap: 12px; }
  .home-header nav a:nth-child(2) { display: none; }
  .home-hero { padding-block: 54px 66px; }
  .hero-text::before { display: none; }
  .hero-text h1 { font-size: clamp(46px, 14vw, 62px); }
  .hero-text > p { font-size: 16px; }
  .home-actions { align-items: stretch; flex-direction: column; }
  .home-actions .home-button { width: 100%; }
  .hero-service { padding-left: 18px; }
  .hero-service h2 { font-size: 28px; }
  .benefits { grid-template-columns: 1fr; }
  .benefits article { min-height: 0; }
  .pricing-grid { grid-template-columns: 1fr; }
  .offer,
  .offer:nth-child(odd) { min-height: 0; border-left: 1px solid var(--line); }
  .login-main { padding: 28px 14px 48px; }
  .login-card,
  .register-card { padding: 28px 22px; box-shadow: 7px 7px 0 #e5eaf1; }
  .login-heading h1 { font-size: 38px; }
  .quick-card { grid-template-columns: auto minmax(0, 1fr) auto; padding: 20px; }
  .quick-card strong { font-size: 22px; }
  .workspace-header h1,
  .inspection-heading h1 { font-size: 40px; }
  .card-grid { grid-template-columns: 1fr; }
  .choice-card { min-height: 96px; }
  .substep-nav { grid-template-columns: repeat(var(--substep-count), 100px); overflow-x: auto; }
  .form-section,
  .situation-panel,
  .composition-question { padding-block: 20px; }
  .signer-steps strong { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Surfaces et composants communs : proportions compactes, contours explicites. */
:root { --control-radius: 12px; --card-radius: 18px; }
.login-body {
  --login-ink: var(--ink);
  --login-muted: var(--muted);
  --login-green: var(--primary);
  --login-green-dark: var(--primary-dark);
  --login-sage: var(--primary-soft);
  --login-cream: var(--wash);
  --login-line: var(--line-strong);
  font-family: var(--font-sans);
}
.login-header .brand-mark { background: var(--primary); }
.login-card .login-submit, .login-card .portal-primary { border: 1px solid var(--primary-dark); border-radius: 12px; }
body { font-size: 16px; }
h1, h2, h3, .brand strong { font-family: var(--font-sans); letter-spacing: -.025em; }
h1, h2 { font-weight: 650; line-height: 1.2; }
strong, b { font-weight: 650; }
.brand-mark { border-radius: 13px; background: var(--primary); border-color: var(--primary); }
.brand-mark::after, .hero-text::before, .hero-service::before { content: none; }
.eyebrow, .home-eyebrow, .signer-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }
.field label, .portal-field label, .profile-field label, .micro-label { font-size: 14px; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.field-label-row > label { min-width: 0; }
.field-help { position: relative; flex: none; }
.field-help > summary { display: grid; width: 44px; height: 44px; place-items: center; list-style: none; cursor: pointer; }
.field-help > summary::-webkit-details-marker { display: none; }
.field-help > summary span { display: grid; width: 26px; height: 26px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--primary-dark); background: var(--paper); font-size: 15px; font-weight: 700; }
.field-help > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
.field-help > p { position: absolute; z-index: 25; top: calc(100% + 4px); right: 0; width: min(340px, calc(100vw - 54px)); margin: 0; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper); box-shadow: 0 12px 28px rgba(27, 38, 20, .14); color: var(--ink); font-size: 13px; line-height: 1.55; }
.irl-custom { display: grid; gap: 7px; margin-top: 14px; }
.irl-custom[hidden] { display: none; }
.focused-grid > .irl-choice-field,
.focused-grid > .toggle-row:has([data-path="finance.revisionEnabled"]) { grid-column: 1 / -1; }
.button, .portal-primary, .portal-secondary, .signer-primary, .signer-secondary,
.home-body a.home-button, .text-button, .icon-button, .modal-jump {
  border-width: 1px; border-style: solid; border-radius: 12px; min-height: 44px; font-weight: 600;
}
.button:not(.primary):not(.soft):not(.danger), .text-button:not(.danger), .icon-button {
  border-color: var(--line-strong); background: var(--paper); color: var(--ink);
}
.button.primary, .portal-primary, .home-body a.home-button, .signer-primary { border-color: var(--primary-dark); }
.button:hover:not(:disabled), .portal-primary:hover:not(:disabled), .home-body a.home-button:hover { transform: none; }
.button.soft { border-color: #b7c7a2; }
.button:disabled { color: #737b80; border-color: var(--line); background: #edf0f4; }
.offer-details > summary,
.offer > a { min-height: 44px; display: flex; align-items: center; }
.home-hero { gap: 64px; min-height: 580px; padding-block: 76px; }
.hero-text h1 { font-size: clamp(38px, 4.5vw, 60px); font-weight: 650; line-height: 1.1; letter-spacing: -.035em; }
.hero-text h1 em { color: var(--primary); font-style: normal; font-weight: inherit; }
.home-body h2 { font-size: clamp(28px, 3vw, 38px); font-weight: 650; line-height: 1.2; letter-spacing: -.025em; }
.hero-service { padding: 26px; border: 1px solid var(--line); border-radius: 22px; background: var(--wash); }
.home-body .hero-service h2 { font-size: 24px; margin-bottom: 20px; }
.home-body .hero-service > .service-link { margin: 10px 0 0; padding: 18px; min-height: 96px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--paper); }
.home-body .hero-service > .service-link:last-of-type { border-bottom-color: var(--line-strong); }
.home-body .hero-service > .service-link:hover { border-color: var(--primary); background: var(--primary-soft); }
.benefits article { border-top: 1px solid var(--line); }
.benefits h3 { font-size: 21px; }
.pricing-grid { gap: 16px; border: 0; }
.offer, .offer:first-child, .offer:nth-child(2n+1) { border: 1px solid var(--line); border-radius: 18px; }
.offer.complete { border: 1px solid var(--primary-dark); border-radius: 18px; }
.login-card, .register-card { border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 12px 40px #2933260a; }
.login-heading h1 { font-size: 34px; font-weight: 650; }
.password-toggle { border-radius: 8px; }
.portal-navigation { align-self: center; gap: 8px; }
.portal-navigation a, .portal-navigation a:last-child { min-height: 44px; padding: 10px 22px; border: 1px solid var(--line-strong); border-radius: 12px; background: white; }
.portal-navigation a[aria-current], .portal-navigation a[aria-current]:hover { border-color: var(--primary); background: var(--primary-soft); box-shadow: none; }
.welcome-row { border: 0; padding-bottom: 0; }
.welcome-row h1, .profile-view h1, .simple-view h1, .detail-heading h1 { font-size: clamp(28px, 3vw, 36px); font-weight: 650; }
.quick-actions { gap: 16px; border: 0; }
.quick-card, .quick-card + .quick-card { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 16px; min-height: 148px; padding: 22px; border: 1px solid var(--line-strong); border-radius: 18px; align-items: center; }
.quick-card::before, .quick-card.parking-action::before, .quick-card.inspection-action::before { content: none; }
.quick-icon { display: grid; place-items: center; width: 44px; height: 44px; font-size: 22px; border: 1px solid #c8d3b9; border-radius: 12px; color: var(--primary); background: var(--primary-soft); }
.quick-card strong { font-size: 20px; font-weight: 650; line-height: 1.35; }
.quick-card em { font-size: 14px; line-height: 1.5; }
.quick-card b { align-self: center; }
.quick-card:hover,
.quick-card:focus-visible {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  box-shadow: 0 10px 24px #29332624;
}
.quick-card:hover strong,
.quick-card:focus-visible strong,
.quick-card:hover em,
.quick-card:focus-visible em,
.quick-card:hover b,
.quick-card:focus-visible b { color: #fff; }
.quick-card:hover .quick-icon,
.quick-card:focus-visible .quick-icon {
  color: #fff;
  border-color: #ffffff66;
  background: #ffffff1f;
}
.section-heading { border-top: 1px solid var(--line); padding-top: 24px; }
.section-heading h2 { font-size: 23px; }
.sidebar, .inspection-sidebar { background: var(--wash); }
#step-nav, #inspection-nav { gap: 8px; grid-auto-rows: 1fr; }
.nav-step, .inspection-nav-button { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); font-size: 14px; }
.nav-step.active, .inspection-nav-button.active { border: 1px solid var(--primary); background: var(--primary-soft); box-shadow: none; }
.nav-step.active:hover, .inspection-nav-button.active:hover { background: var(--primary-soft); border-color: var(--primary); }
.workspace-header h1, .inspection-heading h1, .signer-intro h1, .signer-state h1 { font-size: clamp(28px, 3.2vw, 38px); line-height: 1.2; font-weight: 650; }
#substep-nav { width: min(100%, 900px); max-width: 900px; gap: 6px; border: 0; }
.substep-button, .substep-button:last-child { border: 1px solid var(--line-strong); border-radius: 10px; }
.substep-button.active { border-color: var(--primary); box-shadow: none; }
.substep-button span:last-child { font-size: 13px; }
.app-shell .workspace-header h1 { margin-top: 0; }
.stage-lead, .selection-help, .info-box, .mission-card, .visit-intro, .phase-banner, .owner-prefill, .room-head, .remote-signing-intro { border: 1px solid var(--line); border-radius: 14px; }
.choice-card.selected, .segment input:checked + span, .binary-control button[aria-pressed="true"], .room-nav-button.active, .item-nav-button.active { box-shadow: none; }
.room-nav-button, .item-nav-button, .condition-button, .state-button { border-width: 1px; border-style: solid; border-radius: 10px; }
.modal-card { border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 20px 60px #29332620; }
.consent-check { border: 1px solid #a9c8b9; border-radius: 12px; }
.signer-steps { gap: 8px; border: 0; }
.signer-steps li, .signer-steps li:last-child { border: 1px solid var(--line); border-radius: 12px; }
.signer-steps li.active { border-color: var(--primary); box-shadow: none; }
@media (max-width: 780px) {
  .portal-navigation { align-self: stretch; min-height: 44px; }
  .portal-navigation a { flex: 1; }
  .quick-card, .quick-card + .quick-card { min-height: 112px; border: 1px solid var(--line-strong); }
  .nav-step, .nav-step.active, .inspection-nav-button, .inspection-nav-button.active { border-radius: 10px; }
  .hero-service { padding: 20px; }
  .home-hero { gap: 32px; min-height: 0; padding-block: 48px; }
  .login-card, .register-card { box-shadow: 0 8px 28px #29332608; }
}
@media (max-width: 1000px) {
  .quick-actions { grid-template-columns: 1fr; }
  .quick-card, .quick-card + .quick-card { min-height: 104px; align-items: center; }
  .home-hero { grid-template-columns: 1fr; gap: 32px; min-height: 0; padding-block: 48px; }
  .home-header { flex-wrap: wrap; gap: 18px; padding-block: 18px; }
  .home-header nav { flex-wrap: wrap; gap: 18px; }
  .hero-service { padding: 24px; }
}
@media (max-width: 560px) {
  .hero-text h1 { font-size: 40px; }
  .hero-service h2 { font-size: 23px; }
  .workspace-header h1, .inspection-heading h1 { font-size: 30px; }
  .quick-card strong { font-size: 19px; }
}

@media (max-width: 1260px) {
  .home-header, .home-hero, .home-services, .home-pricing { width: calc(100% - 56px); }
}
@media (max-width: 560px) {
  .home-header, .home-hero, .home-services, .home-pricing { width: calc(100% - 40px); }
  .home-header nav { width: 100%; justify-content: space-between; gap: 12px; }
}

/* Accès unifié de la vitrine vers la connexion. */
.home-header .home-login-link {
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper);
  font-weight: 650;
}
.home-header .home-login-link:hover {
  color: var(--primary-dark);
  border-color: var(--primary);
  background: var(--primary-soft);
  filter: none;
}
@media (max-width: 650px) {
  .home-header nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
  .home-header nav > a:not(.home-login-link):not(.home-button) { display: none; }
  .home-header .home-login-link,
  .home-header nav > .home-button {
    width: 100%;
    min-width: 0;
    padding-inline: 12px;
  }
}

/* Un iPhone en paysage conserve le rail latéral au-delà de 780 px. La barre
   d'actions doit néanmoins prolonger son fond jusqu'aux bords du workspace. */
@media (min-width: 781px) and (max-width: 900px) and (max-height: 520px) {
  .home-header,
  .login-header {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    box-sizing: border-box;
    background: var(--paper);
  }

  .wizard-footer {
    width: auto;
    max-width: none;
    margin-left: calc(-1 * clamp(28px, 5vw, 64px));
    margin-right: calc(-1 * clamp(28px, 5vw, 64px));
    padding-left: clamp(28px, 5vw, 64px);
    padding-right: clamp(28px, 5vw, 64px);
    box-sizing: border-box;
    background: var(--paper);
    box-shadow: 0 -8px 20px rgba(41, 51, 38, .08);
  }
}

@media (max-width: 480px) {
  .topbar {
    position: relative;
    top: auto;
  }
}

/* Continuité des surfaces sur iPhone : les zones sûres et les barres collantes
   doivent prolonger leur fond sans laisser transparaître le contenu dessous. */
@media (max-width: 780px) {
  html {
    min-height: 100%;
    background: var(--wash);
  }

  body,
  .portal-body,
  .dashboard-body,
  .home-body,
  .login-body,
  .signer-body {
    min-height: 100svh;
    min-height: 100dvh;
  }

  .topbar,
  .portal-header,
  .home-header,
  .login-header,
  .signer-header {
    box-sizing: border-box;
    background: var(--paper);
    backdrop-filter: none;
  }

  .home-header,
  .login-header {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .home-header {
    padding-top: max(18px, env(safe-area-inset-top));
  }

  .login-header {
    min-height: calc(76px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
  }

  .home-body {
    display: flex;
    min-width: 0;
    flex-direction: column;
  }

  .home-body > main { flex: 1 0 auto; }

  .home-footer {
    box-sizing: border-box;
    width: 100%;
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: calc(25px + env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
    background: var(--primary-dark);
  }

  .login-main {
    box-sizing: border-box;
    width: 100%;
    min-height: calc(100svh - 76px - env(safe-area-inset-top));
    min-height: calc(100dvh - 76px - env(safe-area-inset-top));
    padding-right: max(14px, env(safe-area-inset-right));
    padding-bottom: calc(48px + env(safe-area-inset-bottom));
    padding-left: max(14px, env(safe-area-inset-left));
    background: var(--wash);
  }

  .app-shell,
  .inspection-shell,
  .parking-shell {
    width: 100%;
    min-height: calc(100svh - 72px - env(safe-area-inset-top));
    min-height: calc(100dvh - 72px - env(safe-area-inset-top));
    background: var(--paper);
  }

  .topbar,
  .wizard-footer {
    background: var(--paper);
    backdrop-filter: none;
  }

  .wizard-footer {
    width: auto;
    margin-left: calc(-1 * max(18px, env(safe-area-inset-left)));
    margin-right: calc(-1 * max(18px, env(safe-area-inset-right)));
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
    box-sizing: border-box;
    box-shadow: 0 -8px 20px rgba(41, 51, 38, .08);
  }

  .workspace,
  .inspection-workspace,
  .summary-panel,
  .inspection-summary {
    background: var(--paper);
  }
}

/* Alignement du haut de l’état des lieux et continuité du rail latéral. */
@media (min-width: 781px) {
  .inspection-shell {
    background: linear-gradient(
      to right,
      var(--wash) 0,
      var(--wash) 219px,
      var(--line) 219px,
      var(--line) 220px,
      var(--paper) 220px
    );
  }

  .inspection-heading,
  .phase-banner {
    margin-left: -20px;
    margin-right: 20px;
  }
}

/* Dernières retouches communes : hiérarchie plus calme et retours proches de l'action. */
:is(.home-body, .portal-body, .journey-page, .payment-body) .eyebrow {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .08em;
}

:is(.field, .profile-field, .portal-field) > label,
.field-label-row > label { font-size: 14px; line-height: 1.4; font-weight: 650; }
:is(.field, .profile-field, .portal-field) > .hint { margin-top: 5px; font-size: 13px; line-height: 1.45; }

.button.soft:hover:not(:disabled),
.button.ghost:hover:not(:disabled) {
  color: var(--primary-dark);
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: none;
}
.button.primary:focus-visible,
.button.soft:focus-visible,
.button.ghost:focus-visible { outline: 3px solid var(--primary-dark); outline-offset: 3px; }
.button:disabled { cursor: not-allowed; }

.workspace,
.inspection-workspace { padding-top: 30px; }
.workspace-header,
.inspection-heading { padding-bottom: 14px; margin-bottom: 14px; }
.progress-block { margin-block: 10px 16px; }
.parking-shell .workspace-header h1,
.parking-shell .form-section h2 { line-height: 1.2; }

.wizard-footer > .footer-save-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}
.footer-save-state::before { content: ""; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.footer-save-state[data-state="saving"]::before { background: var(--amber); }
.footer-save-state[data-state="warning"]::before,
.footer-save-state[data-state="offline"]::before { background: var(--terracotta); }
.footer-save-state[data-state="error"] { color: var(--red); font-weight: 650; }
.footer-save-state[data-state="error"]::before { background: var(--red); }

.field-error { display: block; margin-top: 7px; padding-left: 9px; border-left: 2px solid var(--terracotta); font-size: 13px; line-height: 1.45; }
.field-help-inline { grid-column: 1 / -1; margin-top: -4px; }
.field-help-inline > summary { min-height: 44px; display: flex; align-items: center; width: fit-content; color: var(--primary-dark); cursor: pointer; font-size: 13px; font-weight: 650; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.field-help-inline > p { margin: 0 0 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }

@media (max-width: 780px) {
  .workspace,
  .inspection-workspace { padding-top: 18px; }
  .workspace-header,
  .inspection-heading { padding-bottom: 12px; margin-bottom: 12px; }
  .wizard-footer > .footer-save-state {
    grid-column: 1 / -1;
    order: -1;
    justify-content: flex-start;
    min-height: 16px;
    text-align: left;
  }
  .journey-lease .lease-mobile-save-state { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .portal-primary,
  .portal-secondary { transition: none; }
}

/* Warm accent only where an active step or a follow-up needs attention. */
.substep-button.active {
  border-color: var(--terracotta);
  background: var(--terracotta-soft);
}
.substep-button.active span:first-child {
  background: var(--terracotta-dark);
}
.phase-banner-progress b {
  background: var(--terracotta);
}
#my-files > .account-warning {
  border-left: 3px solid var(--terracotta);
}
#my-files .account-warning > p { margin: 0; font-size: 14px; line-height: 1.6; }
#my-files .account-warning-details { margin-top: 8px; }
#my-files .account-warning-details > summary { display: list-item; cursor: pointer; padding: 10px 0; min-height: 44px; font-size: 14px; font-weight: 600; line-height: 1.6; }
#my-files .account-warning-details > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
#my-files .account-warning-details > p { font-size: 14px; line-height: 1.6; }
.warning-box.validation-warning .validation-list button {
  border-color: var(--terracotta);
  background: var(--terracotta-soft);
  color: var(--terracotta-dark);
}
.warning-box.validation-warning .validation-list button:hover {
  background: #f5e3db;
}

.offer-unit .offer-price small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
}

.pricing-grid-single {
  display: block;
  max-width: 720px;
}
.pricing-grid-single .offer {
  min-height: 0;
}

.dashboard-body .is-empty .document-totals { display: none; }
.dashboard-body .document-center:has(.remote-requests-section.is-empty):has(.properties-section.is-empty) {
  padding-block: 20px;
}
.dashboard-body .document-center > .is-empty {
  padding-top: 16px;
  margin-bottom: 16px;
}

.production-cost {
  max-width: var(--content-max, 860px);
  margin: 10px 0 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 360px) {
  .register-card .password-wrap input::placeholder { font-size: 13px; letter-spacing: -.01em; }
}

@media (min-width: 781px) and (max-width: 1000px) {
  .inspection-shell {
    background: linear-gradient(
      to right,
      var(--wash) 0,
      var(--wash) 189px,
      var(--line) 189px,
      var(--line) 190px,
      var(--paper) 190px
    );
  }
}

@media (min-width: 781px) and (max-width: 820px) {
  .inspection-shell { background: var(--paper); }
  .inspection-heading,
  .phase-banner { margin-inline: 0; }
}

/* Tableau de bord : brouillons compacts, avec des actions faciles à distinguer. */
.dashboard-body .draft-grid { gap: 12px; }
.dashboard-body .draft-card { padding: 16px; }
.dashboard-body .draft-card h3 { margin: 10px 0 4px; }
.dashboard-body .draft-card > p { min-height: 0; margin-bottom: 9px; }
.dashboard-body .draft-progress { margin: 6px 0 7px; }
.dashboard-body .draft-updated { font-size: 11px; }
.dashboard-body .draft-actions {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 12px;
  margin-top: 12px;
}
.dashboard-body .draft-actions .button {
  width: auto;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 14px;
  white-space: normal;
}
@media (max-width: 480px) {
  .dashboard-body .draft-actions { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .dashboard-body .draft-actions .button.danger {
    justify-self: start;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
}

/* Rail du bail : moins de séparateurs, une seule mise en avant utile. */
@media (min-width: 781px) {
  .app-shell { border-inline: 0; }
  .app-shell .sidebar { border-right: 0; }
  .app-shell .dossier-card {
    margin-bottom: 10px;
    padding-bottom: 12px;
    border-bottom: 0;
  }
  .app-shell .dossier-card .status-pill { border: 0; }
  .app-shell #step-nav { gap: 3px; margin-top: 6px; }
  .app-shell .nav-step {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, .72);
  }
  .app-shell .nav-step span:first-child {
    color: var(--primary-dark);
    border-color: #c8d3b9;
    background: var(--primary-soft);
    font-weight: 750;
  }
  .app-shell .nav-step:hover {
    border-color: var(--line-strong);
    background: #f1f4eb;
  }
  .app-shell .nav-step.active,
  .app-shell .nav-step.active:hover {
    border-color: #b7c7a2;
    background: var(--primary-soft);
  }
  .app-shell .nav-step.active span:first-child,
  .app-shell .nav-step.active:hover span:first-child,
  .app-shell .nav-step.done span:first-child,
  .app-shell .nav-step.done:hover span:first-child {
    color: #fff;
    border-color: #2f805c;
    background: #2f805c;
  }
  .app-shell .privacy-note {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 0;
  }
}

.lease-question-navigation { margin-block:18px; }
.lease-question-navigation > summary { cursor:pointer; min-height:44px; padding-block:12px; color:var(--primary-dark); font-size:14px; }
.lease-question-navigation[open] #substep-nav { margin-top:12px; }
#progress-percent:empty { display:none; }

.journey-page .account-copy small { font-size:11px; }
.lease-question-navigation > summary { list-style:none; }
.lease-question-navigation > summary::before { content:'＋'; margin-right:.6em; }
.lease-question-navigation[open] > summary::before { content:'−'; }
@media (min-width: 781px) { .lease-question-navigation > summary { display:none; } }
/* Start date recalled on the duration screen. */
.term-start-recap { border:1px solid var(--line); border-radius:12px; padding:14px 16px; }
.term-start-recap > p { margin:4px 0 0; color:var(--muted, inherit); font-size:14px; }
.term-start-recap .term-start-edit { margin-top:10px; }
.term-start-recap .term-start-edit > summary { cursor:pointer; min-height:44px; display:flex; align-items:center; color:var(--primary-dark); font-weight:600; }
.term-start-recap .term-start-edit .form-grid { margin-top:8px; }
/* Destructive reset stays out of the main action bar; phones keep it hidden as before. */
@media (max-width: 780px) { .journey-lease .lease-reset { display:none; } }

/* Emil review: frequent navigation is immediate; press feedback is pointer-only. */
.step-content, .focused-step { animation:none; }
.progress-track span, .inspection-progress-track span, .visit-progress-bar span { transition:none; }
:is(.button,.portal-primary,.portal-secondary,.home-button,.back-button,.text-button,.icon-button,.quick-card) {
  transition-property:color,background-color,border-color,transform;
  transition-duration:140ms;
  transition-timing-function:cubic-bezier(.23,1,.32,1);
}
:is(.button,.portal-primary,.portal-secondary,.home-button,.back-button,.text-button,.icon-button,.quick-card):focus-visible,
.toggle:focus-visible::after { transition:none; }
@media (prefers-reduced-motion:no-preference) {
  :is(.button,.portal-primary,.portal-secondary,.home-button,.back-button,.text-button,.icon-button):active:not(:disabled):not(:focus-visible):not([aria-disabled="true"]) { transform:scale(.98); }
  .quick-card:active:not(:focus-visible) { transform:scale(.99); }
}
@media (prefers-reduced-motion:reduce) {
  :is(.button,.portal-primary,.portal-secondary,.home-button,.back-button,.text-button,.icon-button,.quick-card):active { transform:none; }
}

/* Respiration des écrans : l'espace sépare les groupes, les cadres restent aux contrôles. */
.dashboard-body .document-center {
  padding: 0;
  border: 0;
  background: transparent;
}
.dashboard-body .document-center > :is(.properties-section, .remote-requests-section, .stored-documents-section, .is-empty) {
  margin-block: 0 36px;
  padding: 0;
  border: 0;
}
.dashboard-body .section-heading {
  padding-top: 0;
  border-top: 0;
}
.dashboard-body :is(.welcome-row, .detail-heading) { border-bottom: 0; }
.dashboard-body .document-totals > span {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-variant-numeric: tabular-nums;
}
.dashboard-body :is(.empty-drafts, .empty-properties, .empty-column),
.dashboard-body .is-empty :is(.empty-drafts, .empty-properties) {
  padding: 4px 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.dashboard-body :is(.empty-drafts, .empty-properties) p { margin: 0; max-width: none; }
.dashboard-body :is(.property-card, .profile-identity, .registry-card) { border: 0; box-shadow: none; }
.dashboard-body .property-visual,
.dashboard-body .property-visual.visual-1,
.dashboard-body .property-visual.visual-2 { background: transparent; }
.dashboard-body .property-visual span { border: 0; background: var(--primary-soft); }
.dashboard-body .property-copy h3 { margin-top: 0; text-wrap: pretty; }
.dashboard-body .property-copy button,
.dashboard-body .document-card > a { border-top: 0; }
.dashboard-body .property-copy button { margin-top: 8px; }
.dashboard-body .property-grid:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.dashboard-body .account-disclosure { border: 0; }
.dashboard-body .account-disclosure[open] > summary { border-bottom: 0; }
.dashboard-body .account-disclosure-icon,
.dashboard-body .registry-card-icon { border: 0; }
.dashboard-body .folder-disclosure { border: 0; background: transparent; }
.dashboard-body .library-group { border-bottom: 0; }
/* The question and its fields already form one group; avoid a second rule around them. */
:is(.workspace-header, .inspection-heading) { border-bottom: 0; }
:is(.focused-step, .inspection-content) > :is(.form-section, .substep-surface, .inspection-section),
.form-section .form-section { border-top: 0; }
:is(.preparation-help, .document-disclosure, .local-notice) { border: 0; }
.dashboard-body .document-totals[hidden] { display: none; }

/* Location documents: consistent rows rather than touching inline buttons. */
.dashboard-body #location-view .folder-document-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 24px;
}
.dashboard-body #location-view .folder-document-actions > .button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  height: 100%;
  margin: 0;
  text-align: center;
  white-space: normal;
}
.dashboard-body #location-view .folder-related-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 24px;
}
.dashboard-body #location-view .folder-related-actions > .button { margin: 0; }
@media (max-width: 900px) {
  .dashboard-body #location-view .folder-document-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .dashboard-body #location-view .folder-document-actions { grid-template-columns: minmax(0, 1fr); }
  .dashboard-body #location-view .folder-related-actions > .button { width: 100%; }
}

/* Separate independent actions, including when they wrap onto a second line. */
.button-row,
.topbar .top-actions { gap: 12px; }
.dashboard-body #invoices > p:has(> .button),
.dashboard-body #property-folder-list > p:has(> .button) {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
}
.dashboard-body #invoices > p > .button,
.dashboard-body #property-folder-list > p > .button { margin: 0; white-space: normal; }
#charges-preview > .button {
  display: flex;
  width: fit-content;
  max-width: 100%;
  white-space: normal;
  margin: 12px 0;
}
@media (max-width: 520px) {
  .dashboard-body #invoices > p > .button,
  .dashboard-body #property-folder-list > p > .button,
  #charges-preview > .button { width: 100%; }
}
