/* =============================================================================
 * ZIC — « Publie ton bien » (biens immobiliers) : STYLES DU CŒUR PARTAGÉ,
 * préfixe mre-.
 *
 * Fichier identique octet pour octet dans les deux dépôts (tests d'identité) :
 *   zic_admin_python         zic_admin/static/css/realty-listing-form.css
 *   zic_landing_page_python  zic_landing/static/css/realty-listing-form.css
 * Formulaire (partiel _realty_listing_form.html, piloté par
 * realty-listing-form.js), en-tête, bandeaux, écrans d'état, toast et
 * dialogue. Règles propres à un hôte : admin-multishop-add-product-realty.css
 * (page) et landing-multishop-realty.css (fenêtre de la popup).
 *
 * Visuel : template_html_claude/JSX/zic-workspace-realtywizard.jsx — cartes
 * blanches rayon 18, champs pilules de 50 px, tuiles de type grises #E9ECEF,
 * 9 cases photo en 3 groupes (badge « Principale »), offre Vente / Location en
 * pilules, contact téléphone / WhatsApp, « Annuler » ardoise et « Publier
 * gratuitement » rouge de 56 px, carte de conseils collante.
 * Accent ARDOISE (décision D5, phase 2) : sélection #3E5468 (texte blanc
 * 7,9:1), #5B7083 pour les bordures, icônes et focus (5,1:1) ; bordure de
 * champ #7C8B99 (3,5:1), champs en 16 px sous 768 px (zoom iOS).
 *
 * Paliers :
 * - .mre-layout = conteneur de requêtes « mre » : 2 colonnes dès 824 px de
 *   largeur RÉELLE du conteneur, sinon 1 colonne et conseils repliables en
 *   tête de formulaire ;
 * - .mre-card = conteneur « mrecard » : tuiles, cases photo, rangées ;
 * - < 768 px : barre d'actions collante (zone sûre iOS), champs en 16 px.
 * Réglages laissés à l'hôte (variables à repli) : --mre-sticky-top (haut de
 * la carte de conseils collante ; défaut : barre du cadre admin + 16 px) et
 * --mre-bleed (débord latéral de la barre d'actions mobile ; défaut 16 px).
 * Thème clair seulement. Jetons --mre-* sur .mre-root. Aucun sélecteur hors
 * du préfixe mre- (les variables --aw-* du cadre admin ne servent que de
 * valeurs, avec repli).
 * ============================================================================= */

.mre-root {
  --mre-accent: #5b7083;
  --mre-accent-strong: #3e5468;
  --mre-accent-dk: #2f4253;
  --mre-accent-soft: #eef2f6;
  --mre-ink: #3e5468;
  --mre-ink-dk: #2f4253;
  --mre-tile: #e9ecef;
  --mre-tile-hover: #dde2e7;
  --mre-tile-text: #2f4253;
  --mre-cta: #e11d48;
  --mre-cta-dk: #be123c;
  --mre-error: #dc2626;
  --mre-error-dk: #991b1b;
  --mre-error-soft: #fef2f2;
  --mre-line: #7c8b99;
  --mre-line-hover: #5f6e7c;
  --mre-line-faint: #d5dbe2;
  --mre-line-soft: var(--aw-border, rgba(31, 19, 64, 0.08));
  --mre-text: var(--aw-text, #1f1340);
  --mre-muted: #6b6383;
  --mre-surface: var(--aw-surface, #ffffff);
  --mre-page: var(--aw-bg, #f4f3fb);
  --mre-wa: #25d366;
  --mre-field-h: 50px;
  --mre-radius-card: 18px;
  --mre-display: "Space Grotesk", "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --mre-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mre-shadow: 0 2px 8px rgba(31, 19, 64, 0.06);
  --mre-ring: 0 0 0 3px rgba(91, 112, 131, 0.25);
  --mre-ring-error: 0 0 0 3px rgba(220, 38, 38, 0.16);

  font-family: var(--mre-body);
  color: var(--mre-text);
  padding-bottom: 8px;
}

.mre-root [hidden] { display: none !important; }

.mre-root *,
.mre-root *::before,
.mre-root *::after { box-sizing: border-box; }

/* Texte réservé aux lecteurs d'écran. */
.mre-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ============================================================ */
/* En-tête, bandeaux                                             */
/* ============================================================ */

.mre-head { margin: 0 0 18px; }

.mre-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin: -8px 0 2px -10px;
  padding: 0 12px 0 6px;
  border-radius: 999px;
  color: var(--mre-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mre-back svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mre-back:hover { color: var(--mre-text); background: rgba(31, 19, 64, 0.05); }

.mre-back:focus-visible { outline: 2px solid var(--mre-accent); outline-offset: 2px; }

.mre-title {
  margin: 0;
  font-family: var(--mre-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.4px;
  color: var(--mre-text);
}

.mre-subtitle {
  max-width: 62ch;
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--mre-muted);
}

@media (min-width: 768px) {
  .mre-title { font-size: 26px; letter-spacing: -0.6px; }
  .mre-subtitle { font-size: 15px; }
}

.mre-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
}

.mre-alert--closed { background: #f1f5f9; border-color: #cbd5e1; color: #334155; }

.mre-alert--draft { background: #fffbeb; border-color: #fcd34d; color: #78350f; }

.mre-alert-ic {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mre-alert-text { margin: 0; }

/* ============================================================ */
/* Mise en page : colonne formulaire + conseils                  */
/* ============================================================ */

/* Conteneur de requêtes : jamais sur .mre-root (le confinement en ferait le
   bloc conteneur du toast `position: fixed`) — toast et dialogue restent
   hors de .mre-layout. Aucun descendant fixe ici. */
.mre-layout { container: mre / inline-size; }

.mre-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.mre-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.mre-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  margin: 0;
}

.mre-aside { display: none; min-width: 0; }

.mre-note { margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: var(--mre-muted); }

@container mre (min-width: 824px) {
  .mre-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 24px;
  }
  .mre-aside {
    display: block;
    position: sticky;
    top: var(--mre-sticky-top, calc(var(--aw-topbar-h, 64px) + 16px));
  }
  .mre-tips-m { display: none; }
}

/* ============================================================ */
/* Conseils : carte collante (large) / repliable (étroit)        */
/* ============================================================ */

.mre-tips {
  padding: 20px 22px 22px;
  border: 1px solid var(--mre-line-soft);
  border-radius: var(--mre-radius-card);
  background: var(--mre-surface);
  box-shadow: var(--mre-shadow);
}

.mre-tips-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--mre-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  color: var(--mre-text);
}

.mre-tips-ic {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 6px;
  border-radius: 50%;
  background: var(--mre-accent-soft);
  fill: none;
  stroke: var(--mre-accent-strong);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mre-tips-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  line-height: 1.5;
  color: var(--mre-text);
}

.mre-tips-list li { position: relative; padding-left: 20px; }

.mre-tips-list li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mre-accent);
}

.mre-tips-m {
  border: 1px solid var(--mre-line-soft);
  border-radius: 16px;
  background: var(--mre-surface);
  box-shadow: var(--mre-shadow);
}

.mre-tips-sum {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 14px;
  border-radius: 16px;
  list-style: none;
  cursor: pointer;
  font-family: var(--mre-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--mre-text);
  -webkit-tap-highlight-color: transparent;
}

.mre-tips-sum::-webkit-details-marker { display: none; }

.mre-tips-sum:focus-visible { outline: 2px solid var(--mre-accent); outline-offset: 2px; }

.mre-tips-sum .mre-tips-ic { flex-basis: 30px; width: 30px; height: 30px; padding: 5px; }

.mre-tips-sum-text { flex: 1 1 auto; min-width: 0; }

.mre-tips-chev {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--mre-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.mre-tips-m[open] .mre-tips-chev { transform: rotate(180deg); }

.mre-tips-m .mre-tips-list { margin: 0; padding: 2px 16px 16px; }

/* ============================================================ */
/* Cartes                                                        */
/* ============================================================ */

.mre-card {
  container: mrecard / inline-size;
  position: relative;
  min-width: 0;
  padding: 18px 16px 20px;
  border: 1px solid var(--mre-line-soft);
  border-radius: 16px;
  background: var(--mre-surface);
  box-shadow: var(--mre-shadow);
}

@media (min-width: 768px) {
  .mre-card { padding: 22px; border-radius: var(--mre-radius-card); }
}

.mre-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.mre-card-title {
  margin: 0;
  font-family: var(--mre-display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.2px;
  color: var(--mre-text);
}

@media (min-width: 768px) {
  .mre-card-title { font-size: 20px; }
}

.mre-req { margin-left: 2px; color: var(--mre-cta); font-weight: 700; }

.mre-card-sub {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--mre-muted);
}

.mre-count-pill {
  flex: 0 0 auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--mre-ink);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mre-block { margin-top: 22px; }

.mre-block-sm { margin-top: 14px; }

/* ============================================================ */
/* Libellés, groupes, aides, erreurs                             */
/* ============================================================ */

.mre-label {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: normal;
  text-transform: none;
  color: var(--mre-text);
}

.mre-label--sub { font-size: 13.5px; }

.mre-opt { font-weight: 400; color: var(--mre-muted); }

/* Marge haute laissée à .mre-block / .mre-block-sm (déclarées plus haut). */
.mre-fieldset { min-width: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding: 0; border: 0; }

/* Légende rendue comme un bloc ordinaire (marges fiables partout). */
.mre-fieldset > legend { float: left; width: 100%; }

.mre-fieldset > legend + * { clear: left; }

/* Légende réservée aux lecteurs d'écran (unité) : reste 1 × 1 px. */
.mre-fieldset > legend.mre-sr { float: none; width: 1px; }

.mre-field { min-width: 0; }

.mre-help {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--mre-muted);
}

.mre-help a { color: var(--mre-accent-strong); font-weight: 600; }

.mre-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 6px 0 0;
  padding-left: 14px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--mre-error);
}

.mre-error-ic {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Rangée du gabarit (row) : champ ≤ 420 px, aide à droite quand la carte est
   large ; empilés sinon (aide sous le champ). */
.mre-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mre-row-field { min-width: 0; }

.mre-row-help { margin: 0; }

@container mrecard (min-width: 620px) {
  .mre-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px 18px;
  }
  .mre-row-field { flex: 1 1 300px; max-width: 420px; }
  /* Libellé (20 + 8 px) puis milieu du champ de 50 px. */
  .mre-row-help { flex: 1 1 200px; padding-top: 43px; }
}

/* Deux champs côte à côte (pièces / salles de bain, pays / ville). */
.mre-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  max-width: 640px;
}

@container mrecard (min-width: 420px) {
  .mre-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
}

.mre-under {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.mre-under .mre-error { flex: 1 1 auto; min-width: 0; }

/* ============================================================ */
/* Champs pilules (50 px, bordure 1 px)                          */
/* ============================================================ */

.mre-input,
.mre-textarea {
  display: block;
  width: 100%;
  height: var(--mre-field-h);
  margin: 0;
  padding: 0 18px;
  border: 1px solid var(--mre-line);
  border-radius: 999px;
  background: var(--mre-surface);
  color: var(--mre-text);
  font: inherit;
  font-size: 15px;
  line-height: 1.3;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mre-textarea {
  height: auto;
  min-height: 160px;
  padding: 16px 18px;
  border-radius: 22px;
  line-height: 1.5;
  resize: vertical;
}

.mre-input::placeholder,
.mre-textarea::placeholder,
.mre-affix-input::placeholder { color: var(--mre-muted); opacity: 1; }

.mre-input:hover,
.mre-textarea:hover { border-color: var(--mre-line-hover); }

/* Anneau ardoise ; contour transparent = visible en mode contraste forcé. */
.mre-input:focus,
.mre-textarea:focus {
  border-color: var(--mre-accent);
  box-shadow: var(--mre-ring);
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.mre-input[aria-invalid="true"],
.mre-textarea[aria-invalid="true"] { border-color: var(--mre-error); }

.mre-input[aria-invalid="true"]:focus,
.mre-textarea[aria-invalid="true"]:focus { box-shadow: var(--mre-ring-error); }

.mre-select-wrap { position: relative; display: block; }

.mre-select {
  padding-right: 44px;
  overflow: hidden;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mre-select-chev {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 12px;
  height: 7px;
  margin-top: -3px;
  fill: var(--mre-text);
  pointer-events: none;
}

/* Pilule à éléments (prix + devise, indicatif + numéro) : l'anneau suit le
   focus du champ interne. */
.mre-affix {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: var(--mre-field-h);
  padding: 0 18px;
  border: 1px solid var(--mre-line);
  border-radius: 999px;
  background: var(--mre-surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mre-affix:hover { border-color: var(--mre-line-hover); }

.mre-affix:focus-within {
  border-color: var(--mre-accent);
  box-shadow: var(--mre-ring);
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.mre-affix.is-invalid { border-color: var(--mre-error); }

.mre-affix.is-invalid:focus-within { box-shadow: var(--mre-ring-error); }

.mre-affix-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--mre-text);
  font: inherit;
  font-size: 15px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.mre-affix-suffix {
  flex: 0 0 auto;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--mre-text);
  white-space: nowrap;
}

/* ============================================================ */
/* Photos : 9 cases en 3 groupes (case 0 = photo principale)     */
/* ============================================================ */

.mre-file { display: none; }

.mre-photos { position: relative; margin-top: 16px; }

.mre-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mre-slot-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 104px));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Groupes côte à côte (cases de 88 px) : 2 + 1 dès 584 px, 3 dès 888 px. */
@container mrecard (min-width: 440px) {
  .mre-slots { flex-direction: row; flex-wrap: wrap; gap: 12px 24px; }
  .mre-slot-group { grid-template-columns: repeat(3, 88px); }
}

.mre-slot {
  position: relative;
  min-width: 0;
  aspect-ratio: 1 / 1;
}

.mre-slot-add,
.mre-slot-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 2px solid var(--mre-line-faint);
  border-radius: 14px;
  background: var(--mre-surface);
  color: #b7c0ca;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.mre-slot-empty { cursor: pointer; }

.mre-slot-add,
.mre-slot.is-active .mre-slot-empty {
  border-color: var(--mre-ink);
  color: var(--mre-ink);
}

.mre-slot-add {
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mre-slot-add:focus-visible { outline: 2px solid var(--mre-accent); outline-offset: 3px; }

.mre-photos.is-invalid .mre-slot-add { border-color: var(--mre-error); color: var(--mre-error); }

.mre-slot-cam { position: relative; display: inline-flex; }

.mre-slot-cam svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mre-slot-plus {
  position: absolute;
  top: -8px;
  left: -9px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.mre-slot-badge {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  z-index: 2;
  padding: 3px 4px;
  border-radius: 999px;
  background: var(--mre-ink);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.mre-slot-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: #eef1f4;
  object-fit: cover;
}

.mre-slot.is-filled::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(31, 19, 64, 0.1);
  pointer-events: none;
}

.mre-slot.is-error::after { box-shadow: inset 0 0 0 2px var(--mre-error); }

/* Boutons ★ / × : 30 px visibles, cible de 44 px (::after). */
.mre-slot-btn {
  position: absolute;
  top: 5px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.62);
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.mre-slot-btn::after { content: ""; position: absolute; inset: -7px; }

.mre-slot-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mre-slot-btn--main { left: 5px; }

.mre-slot-btn--main svg { fill: currentColor; stroke: none; }

.mre-slot-btn--remove { right: 5px; }

.mre-slot-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 1px;
  box-shadow: 0 0 0 4px var(--mre-accent);
}

/* Envoi en cours / échec : voile sur la vignette. */
.mre-slot-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.45);
  color: #ffffff;
}

.mre-slot-veil--error { background: rgba(127, 29, 29, 0.6); }

.mre-slot-progress {
  display: block;
  width: 64%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  overflow: hidden;
}

.mre-slot-bar {
  display: block;
  width: 4%;
  height: 100%;
  border-radius: inherit;
  background: #ffffff;
  transition: width 0.2s ease;
}

.mre-slot-alert {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mre-slot-retry {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: var(--mre-error);
  cursor: pointer;
}

.mre-slot-retry::after { content: ""; position: absolute; inset: -4px; }

.mre-slot-retry svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mre-slot-retry:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--mre-accent);
}

/* Dépôt de fichiers : toute la carte Photos est une cible. */
.mre-drop {
  position: absolute;
  inset: -8px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed var(--mre-accent);
  border-radius: 16px;
  background: rgba(238, 242, 246, 0.94);
  color: var(--mre-accent-strong);
  font-size: 15px;
  font-weight: 700;
  pointer-events: none;
}

.mre-drop svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================================ */
/* Type de bien : tuiles (la radio couvre sa tuile)              */
/* ============================================================ */

.mre-kinds-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 680px;
}

@container mrecard (min-width: 280px) {
  .mre-kinds-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@container mrecard (min-width: 460px) {
  .mre-kinds-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
}

@container mrecard (min-width: 580px) {
  .mre-kinds-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.mre-kind-item { position: relative; min-width: 0; }

/* Radio réelle, invisible mais focalisable (flèches, Tab, lecteurs d'écran).
   Elle COUVRE sa tuile : au focus, toute la tuile défile dans la vue (jamais
   sous la barre collante mobile, WCAG 2.4.11). Les clics vont au label. */
.mre-kind-radio,
.mre-seg-radio,
.mre-unit-radio {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.mre-kind {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  min-height: 92px;
  padding: 12px 4px;
  border-radius: 14px;
  background: var(--mre-tile);
  color: var(--mre-tile-text);
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.mre-kind-ic {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--mre-ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mre-kind-label {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  -webkit-hyphens: auto;
  hyphens: auto;
  overflow-wrap: break-word;
}

.mre-kind-radio:checked + .mre-kind {
  background: var(--mre-accent-strong);
  color: #ffffff;
  box-shadow: 0 8px 18px -12px rgba(62, 84, 104, 0.9);
}

.mre-kind-radio:checked + .mre-kind .mre-kind-ic { stroke: #ffffff; }

.mre-kind-radio:focus-visible + .mre-kind,
.mre-seg-radio:focus-visible + .mre-seg,
.mre-unit-radio:focus-visible + .mre-unit {
  outline: 2px solid var(--mre-accent);
  outline-offset: 2px;
}

@container mrecard (min-width: 460px) {
  .mre-kind { min-height: 108px; }
  .mre-kind-ic { width: 34px; height: 34px; }
  .mre-kind-label { font-size: 13px; }
}

@container mrecard (min-width: 580px) {
  .mre-kind { min-height: 120px; gap: 10px; padding: 14px 6px; }
  .mre-kind-ic { width: 38px; height: 38px; }
  .mre-kind-label { font-size: 14px; }
}

/* ============================================================ */
/* Offre et période : pilules de 50 px                           */
/* ============================================================ */

.mre-segs { display: flex; flex-wrap: wrap; gap: 12px; }

.mre-seg-item { position: relative; display: inline-flex; }

/* Largeur minimale commune : le gras de la sélection ne décale rien. */
.mre-seg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  height: var(--mre-field-h);
  padding: 0 24px;
  border: 1px solid var(--mre-line);
  border-radius: 999px;
  background: var(--mre-surface);
  color: var(--mre-text);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mre-seg-radio:checked + .mre-seg {
  background: var(--mre-accent-strong);
  border-color: var(--mre-accent-strong);
  color: #ffffff;
  font-weight: 800;
}

/* ============================================================ */
/* Surface + unité (cercle « m² » ; m² / ha pour les terrains)   */
/* ============================================================ */

.mre-surface-row {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
}

.mre-surface-input { flex: 1 1 auto; min-width: 0; }

.mre-unit-static,
.mre-unit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  border: 1px solid var(--mre-line);
  border-radius: 50%;
  background: var(--mre-surface);
  font-size: 14px;
  font-weight: 700;
}

.mre-unit-static { color: var(--mre-muted); }

.mre-units { display: flex; flex: 0 0 auto; gap: 8px; }

.mre-unit-item { position: relative; display: inline-flex; }

.mre-unit {
  color: var(--mre-text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mre-unit-radio:checked + .mre-unit {
  background: var(--mre-accent-strong);
  border-color: var(--mre-accent-strong);
  color: #ffffff;
}

/* ============================================================ */
/* Titre proposé, devise, contact                                */
/* ============================================================ */

.mre-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: 0 0 -6px 4px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--mre-accent-strong);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.mre-link svg { width: 16px; height: 16px; fill: currentColor; }

.mre-link:focus-visible { outline: 2px solid var(--mre-accent); outline-offset: 2px; }

/* Choix de la devise (composant partagé .zsc, monté par le JS) : couleurs de
   la page par ses variables. */
.mre-currency {
  --zsc-purple: var(--mre-accent-strong);
  --zsc-text: var(--mre-text);
  --zsc-muted: var(--mre-muted);
  --zsc-border: var(--mre-line);
  max-width: 640px;
}

.mre-currency-hint { margin-top: 10px; }

.mre-contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
  margin-top: 18px;
}

.mre-phone { gap: 10px; padding: 0 16px; }

.mre-phone-ic {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--mre-cta);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mre-wa-ic { flex: 0 0 22px; width: 22px; height: 22px; fill: var(--mre-wa); }

/* Indicatif : affichage « 🇨🇮 +225 » + vrai <select> transparent par-dessus
   (focalisable, liste native du système). */
.mre-dial {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding-right: 10px;
  border-right: 1px solid var(--mre-line-faint);
}

.mre-dial-display {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--mre-text);
  white-space: nowrap;
}

.mre-dial-chev { width: 9px; height: 6px; fill: var(--mre-muted); }

.mre-dial-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}

.mre-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  min-height: 44px;
  padding-right: 6px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--mre-text);
  cursor: pointer;
}

.mre-check-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.mre-check-box {
  display: inline-flex;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--mre-line);
  border-radius: 6px;
  background: var(--mre-surface);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.mre-check-box svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.mre-check-input:checked + .mre-check-box {
  background: var(--mre-accent-strong);
  border-color: var(--mre-accent-strong);
}

.mre-check-input:checked + .mre-check-box svg { opacity: 1; }

.mre-check-input:focus-visible + .mre-check-box { outline: 2px solid var(--mre-accent); outline-offset: 2px; }

/* ============================================================ */
/* Description : compteur sous le champ                          */
/* ============================================================ */

.mre-count {
  flex: 0 0 auto;
  margin: 6px 4px 0 auto;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--mre-tile-text);
  font-variant-numeric: tabular-nums;
}

.mre-count.is-near { color: #b45309; }

.mre-count.is-full { color: var(--mre-error); }

/* ============================================================ */
/* Récapitulatif des erreurs                                     */
/* ============================================================ */

.mre-summary {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #fecaca;
  border-radius: 14px;
  background: var(--mre-error-soft);
  color: var(--mre-error-dk);
}

.mre-summary-ic {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  fill: none;
  stroke: var(--mre-error);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mre-summary-body { min-width: 0; }

.mre-summary-text { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.45; }

.mre-summary-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.mre-summary-list a {
  display: inline-block;
  padding: 3px 0;
  border-radius: 4px;
  color: var(--mre-error-dk);
  font-size: 13.5px;
  line-height: 1.45;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mre-summary-list a:focus-visible { outline: 2px solid var(--mre-error); outline-offset: 2px; }

/* ============================================================ */
/* Boutons                                                       */
/* ============================================================ */

.mre-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 16px;
  margin-top: 4px;
}

.mre-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 56px;
  margin: 0;
  padding: 0 32px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.mre-btn:focus-visible { outline: 2px solid var(--mre-accent); outline-offset: 3px; }

.mre-btn-ic {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mre-btn--cancel { background: var(--mre-ink); color: #ffffff; }

.mre-btn--cta {
  padding: 0 40px;
  background: var(--mre-cta);
  color: #ffffff;
  box-shadow: 0 12px 24px -14px rgba(225, 29, 72, 0.75);
}

.mre-btn--teal { background: var(--mre-accent-strong); color: #ffffff; }

.mre-btn--ghost {
  background: var(--mre-surface);
  color: var(--mre-text);
  box-shadow: inset 0 0 0 1px rgba(31, 19, 64, 0.16);
}

.mre-btn--sm {
  height: 50px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
}

/* Occupé : aria-disabled (jamais disabled — le focus resterait perdu). */
.mre-btn[aria-disabled="true"] { cursor: progress; opacity: 0.8; }

.mre-spinner {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: mre-spin 0.8s linear infinite;
}

@keyframes mre-spin { to { transform: rotate(360deg); } }

/* Survol : pointeurs fins seulement (pas d'état collé au toucher). */
@media (hover: hover) {
  .mre-kind:hover { background: var(--mre-tile-hover); }
  .mre-kind-radio:checked + .mre-kind:hover { background: var(--mre-accent-dk); }
  .mre-seg:hover,
  .mre-unit:hover { border-color: var(--mre-line-hover); }
  .mre-seg-radio:checked + .mre-seg:hover,
  .mre-unit-radio:checked + .mre-unit:hover { background: var(--mre-accent-dk); }
  .mre-slot-add:hover,
  .mre-slot.is-active .mre-slot-empty:hover {
    border-color: var(--mre-accent-strong);
    background: var(--mre-accent-soft);
    color: var(--mre-accent-strong);
  }
  .mre-slot-btn:hover { background: rgba(15, 23, 42, 0.85); }
  .mre-slot-btn--remove:hover { background: var(--mre-cta); }
  .mre-link:hover { background: var(--mre-accent-soft); color: var(--mre-accent-dk); }
  .mre-btn--cancel:not([aria-disabled="true"]):hover { background: var(--mre-ink-dk); }
  .mre-btn--cta:not([aria-disabled="true"]):hover { background: var(--mre-cta-dk); }
  .mre-btn--teal:not([aria-disabled="true"]):hover { background: var(--mre-accent-dk); }
  .mre-btn--ghost:not([aria-disabled="true"]):hover { background: #f6f5fa; }
}

.mre-btn:not([aria-disabled="true"]):active { transform: scale(0.985); }

/* ============================================================ */
/* Écrans d'état : annonce enregistrée, annonce introuvable      */
/* ============================================================ */

.mre-state {
  max-width: 560px;
  margin: 40px auto;
  padding: 0 4px;
  text-align: center;
}

.mre-state-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--mre-accent);
}

.mre-state-ic svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mre-state-ic--muted { background: var(--mre-tile); }

.mre-state-ic--muted svg { stroke: var(--mre-ink); stroke-width: 1.8; }

.mre-state-title {
  margin: 18px 0 0;
  font-family: var(--mre-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.25;
  color: var(--mre-text);
}

.mre-state-title:focus { outline: none; }

.mre-state-text {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--mre-muted);
  overflow-wrap: anywhere;
}

.mre-state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

/* ============================================================ */
/* Toast et dialogue (hors de .mre-layout)                       */
/* ============================================================ */

/* Région live toujours présente (annonces fiables), visible quand .is-in.
   Au-dessus du bouton de messagerie (26 + 58 + 14 px, comme les toasts du
   cadre) : centré, il le chevaucherait de 768 à 1100 px environ. */
.mre-toast {
  position: fixed;
  bottom: calc(98px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 300;
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 12px;
  background: #1e293b;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.28);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.mre-toast:empty { padding: 0; box-shadow: none; }

.mre-toast.is-in { opacity: 1; transform: translate(-50%, 0); }

.mre-toast--err { background: #b91c1c; }

.mre-toast--ok { background: var(--mre-accent-strong); }

.mre-dialog {
  width: min(420px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: 24px;
  border: 0;
  border-radius: 18px;
  background: var(--mre-surface);
  color: var(--mre-text);
  box-shadow: 0 24px 60px -20px rgba(31, 19, 64, 0.45);
}

.mre-dialog::backdrop { background: rgba(15, 10, 35, 0.5); }

.mre-dialog-title {
  margin: 0;
  font-family: var(--mre-display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.3;
}

.mre-dialog-text {
  margin: 8px 0 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--mre-muted);
}

.mre-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* Étroit : boutons empilés pleine largeur, action principale en haut (écrans
   d'état : ordre du DOM ; dialogue : « Continuer la saisie », 2ᵉ du DOM pour
   rester à droite en ligne). */
@media (max-width: 479px) {
  .mre-state-actions { flex-direction: column; }
  .mre-dialog-actions { flex-direction: column-reverse; }
  .mre-state-actions .mre-btn,
  .mre-dialog-actions .mre-btn { width: 100%; }
}

/* ============================================================ */
/* Mobile (< 768 px)                                             */
/* ============================================================ */

@media (max-width: 767px) {
  /* 16 px : iOS ne zoome pas au focus. */
  .mre-input,
  .mre-textarea,
  .mre-affix-input { font-size: 16px; }

  /* Le champ focalisé s'arrête AU-DESSUS de la barre collante (WCAG 2.4.11). */
  .mre-form :is(input, select, textarea, button, a) {
    scroll-margin-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  /* « Annuler » + « Publier » à portée de pouce : 12 + 56 + 12 px. */
  .mre-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    flex-wrap: nowrap;
    gap: 10px;
    margin: 0 calc(-1 * var(--mre-bleed, 16px));
    padding: 12px var(--mre-bleed, 16px) max(12px, env(safe-area-inset-bottom));
    background: linear-gradient(to bottom, rgba(244, 243, 251, 0), var(--mre-page) 24%);
  }

  .mre-btn--cancel { flex: 0 0 auto; padding: 0 22px; }

  .mre-btn--cta { flex: 1 1 auto; min-width: 0; padding: 0 18px; }

  /* Toast au-dessus de la barre et du bouton de messagerie soulevé. */
  .mre-toast {
    right: 16px;
    bottom: calc(156px + env(safe-area-inset-bottom, 0px));
    left: 16px;
    max-width: none;
    transform: translateY(8px);
  }

  .mre-toast.is-in { transform: none; }
}

/* Étroit : « Annuler » devient un rond (le libellé reste lu). */
@media (max-width: 439px) {
  .mre-btn--cancel { width: 56px; padding: 0; }
  .mre-btn--cancel .mre-btn-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .mre-btn--cancel .mre-btn-ic { width: 20px; height: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .mre-root *,
  .mre-root *::before,
  .mre-root *::after { transition: none !important; }
  .mre-spinner { animation-duration: 1.6s; }
  .mre-btn:not([aria-disabled="true"]):active { transform: none; }
}
