/* ══════════════════════════════════════════════════════════════════════════
   WIZARD D'OFFRE — styles dédiés
   Chargé via <link> dans index.html après style.css
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Section offres (liste) ──────────────────────────────────────────────── */
.offres-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  color: var(--muted);
  text-align: center;
  gap: .5rem;
}
.offres-list-empty .offres-empty-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.offres-list-empty .offres-empty-title { font-size: .95rem; font-weight: 500; color: var(--text); }
.offres-list-empty .offres-empty-sub   { font-size: .82rem; }

/* ── Liste des offres enrichie ───────────────────────────────────────────── */
.wiz-offre-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .5rem 0;
}

.wiz-offre-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.wiz-offre-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 1px 4px rgba(196,30,107,.08);
}

.wiz-offre-card-main { flex: 1; min-width: 0; }
.wiz-offre-card-top  { display: flex; align-items: center; gap: .55rem; margin-bottom: .25rem; }

/* Actions */
.wiz-offre-actions {
  display: flex;
  gap: .4rem;
  flex-shrink: 0;
}

.wiz-offre-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: background .13s, border-color .13s, color .13s;
  color: var(--muted);
  flex-shrink: 0;
}
.wiz-offre-btn:hover { background: #f3f4f6; border-color: #9CA3AF; color: var(--text); }

.wiz-offre-btn-edit:hover    { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.wiz-offre-btn-preview       { color: #1565C0; border-color: #BBDEFB; background: #F0F7FF; }
.wiz-offre-btn-preview:hover { background: #BBDEFB; border-color: #1565C0; color: #0D47A1; }
.wiz-offre-btn-delete        { color: #EF4444; border-color: #FECACA; background: #FFF5F5; }
.wiz-offre-btn-delete:hover  { background: #FEE2E2; border-color: #EF4444; color: #B91C1C; }

/* ── Section wizard (layout pleine page) ─────────────────────────────────── */
#sec-offre-wizard {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-h));
  background: var(--bg);
}

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.wiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  gap: 1rem;
}
.wiz-topbar-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.wiz-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.wiz-draft-status {
  font-size: .72rem;
  color: var(--muted);
  min-height: 1em;
}
.wiz-cancel-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: .45rem .9rem;
  font-size: .83rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.wiz-cancel-btn:hover { background: #f5f5f5; }

/* ── Stepper ─────────────────────────────────────────────────────────────── */
.wiz-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem .75rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
  gap: 0;
  flex-wrap: wrap;
  row-gap: .5rem;
}
.wiz-step-pill {
  display: flex;
  align-items: center;
  gap: .45rem;
  cursor: default;
  opacity: .45;
  transition: opacity .2s;
}
.wiz-step-pill.current { opacity: 1; }
.wiz-step-pill.done    { opacity: .75; cursor: pointer; }
.wiz-step-pill.clickable { cursor: pointer; }
.wiz-step-pill.clickable:hover { opacity: 1; }
.wiz-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  background: var(--border);
  color: var(--muted);
  flex-shrink: 0;
  transition: background .2s, color .2s;
}
.wiz-step-pill.current .wiz-step-num {
  background: var(--primary);
  color: #fff;
}
.wiz-step-pill.done .wiz-step-num {
  background: var(--green);
  color: #fff;
}
.wiz-step-label {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}
.wiz-step-sep {
  width: 32px;
  height: 2px;
  background: var(--border);
  margin: 0 .25rem;
  flex-shrink: 0;
}

/* ── Body (scrollable content) ───────────────────────────────────────────── */
.wiz-body {
  flex: 1;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.wiz-step { display: flex; flex-direction: column; gap: 1rem; }

/* ── Footer navigation ───────────────────────────────────────────────────── */
.wiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.5rem;
  background: #fff;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  z-index: 30;
}
.wiz-step-counter {
  font-size: .82rem;
  color: var(--muted);
}
.wiz-footer .btn-primary:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ── Deal search (Step 1) ────────────────────────────────────────────────── */
.wiz-search-wrap { position: relative; margin-bottom: .75rem; }
.wiz-deal-results {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .75rem;
  max-height: 420px;
  overflow-y: auto;
}
.wiz-deal-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: #fff;
}
.wiz-deal-card:hover { border-color: var(--primary); background: var(--primary-light); }
.wiz-deal-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(196,30,107,.15);
}
.wiz-deal-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .3rem;
}
.wiz-deal-client { font-weight: 600; font-size: .9rem; }
.wiz-deal-local  { font-size: .82rem; color: var(--muted); margin-bottom: .2rem; }
.wiz-deal-meta   { font-size: .75rem; color: var(--muted); }
.wiz-type-badge {
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.wiz-deal-empty, .wiz-deal-loading, .wiz-deal-error {
  text-align: center;
  padding: 1.25rem;
  color: var(--muted);
  font-size: .85rem;
}
.wiz-deal-error { color: var(--red); }

.wiz-selected-deal { display: flex; flex-direction: column; gap: .5rem; }
.wiz-selected-deal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--text);
}
.wiz-unselect-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: .77rem;
  color: var(--muted);
  cursor: pointer;
}
.wiz-unselect-btn:hover { background: #f5f5f5; }

/* ── Forms (Step 2) ──────────────────────────────────────────────────────── */
.wiz-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 860px) {
  .wiz-two-col { grid-template-columns: 1fr; }
}
.wiz-card-section-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--primary);
  margin-bottom: .9rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.wiz-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: .65rem;
}
.wiz-field:last-child { margin-bottom: 0; }
.wiz-label {
  font-size: .73rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.wiz-input {
  padding: .45rem .7rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: .88rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s;
  width: 100%;
}
.wiz-input:focus { outline: none; border-color: var(--primary); }
.wiz-select {
  padding: .45rem .7rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: .88rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  width: 100%;
}
.wiz-select:focus { outline: none; border-color: var(--primary); }
.wiz-two-fields {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
}
.wiz-two-fields .wiz-field { flex: 1; margin-bottom: .65rem; }

/* ── Placeholders étapes 3 & 4 ───────────────────────────────────────────── */
.wiz-placeholder {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--muted);
}
.wiz-placeholder-icon  { font-size: 2rem; margin-bottom: .75rem; }
.wiz-placeholder-title { font-size: .95rem; font-weight: 500; color: var(--text); margin-bottom: .35rem; }
.wiz-placeholder-sub   { font-size: .82rem; }

/* ── Récap (Step 5) ──────────────────────────────────────────────────────── */
.wiz-recap-cards { display: flex; flex-direction: column; gap: 1rem; }
.wiz-recap-card  {}
.wiz-recap-body  { padding: .75rem 1.1rem; display: flex; flex-direction: column; gap: .3rem; }
.wiz-recap-row   { display: flex; align-items: baseline; gap: .5rem; font-size: .85rem; }
.wiz-recap-label { color: var(--muted); font-size: .8rem; min-width: 120px; flex-shrink: 0; }
.wiz-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  padding: 1rem 0 .5rem;
}
.wiz-actions .btn-primary { font-size: .95rem; padding: .65rem 1.5rem; }
.wiz-actions .btn-ghost   { font-size: .88rem; }
.wiz-actions .btn-ghost[disabled] { opacity: .45; cursor: not-allowed; }

/* ── Step title (utilisé dans étape 1) ───────────────────────────────────── */
.wiz-step-section-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: .5rem;
}

/* ══════════════════════════════════════════════════════════════════════════
   PHASE B — Étape 3 : Conditions financières
   ══════════════════════════════════════════════════════════════════════════ */

.wiz-required { color: var(--primary); font-weight: 700; font-style: normal; }
.wiz-opt      { color: var(--muted);   font-weight: 400; text-transform: none; font-size: .7rem; }

.wiz-field-error {
  font-size: .75rem;
  color: var(--red);
  min-height: 1em;
  margin-top: 2px;
}

.wiz-fin-loyer-preview {
  font-size: .8rem;
  color: var(--primary);
  font-weight: 600;
  margin-top: 3px;
  min-height: 1.1em;
}

/* ══════════════════════════════════════════════════════════════════════════
   PHASE B — Étape 4 : Conditions suspensives
   ══════════════════════════════════════════════════════════════════════════ */

.wiz-cond-group { margin-bottom: .5rem; }

.wiz-cond-details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.wiz-cond-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 1rem;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: .88rem;
  list-style: none;
  gap: .75rem;
}
.wiz-cond-summary::-webkit-details-marker { display: none; }
.wiz-cond-summary::before {
  content: '▶';
  font-size: .65rem;
  color: var(--muted);
  transition: transform .18s;
  flex-shrink: 0;
}
details[open] > .wiz-cond-summary::before { transform: rotate(90deg); }

.wiz-cond-cat-name  { flex: 1; color: var(--text); }
.wiz-cond-cat-count { font-size: .73rem; font-weight: 600; color: var(--primary); white-space: nowrap; }

.wiz-cond-items { border-top: 1px solid var(--border); }

.wiz-cond-item {
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.wiz-cond-item:last-child   { border-bottom: none; }
.wiz-cond-item.checked      { background: var(--primary-light); }

.wiz-cond-header            { display: flex; align-items: flex-start; }
.wiz-cond-checkbox-label    { display: flex; align-items: flex-start; gap: .55rem; cursor: pointer; width: 100%; }
.wiz-cond-cb                { margin-top: 2px; flex-shrink: 0; width: 15px; height: 15px; cursor: pointer; }
.wiz-cond-title             { font-size: .88rem; color: var(--text); line-height: 1.4; }

.wiz-cond-body {
  margin-top: .6rem;
  padding-top: .55rem;
  border-top: 1px dashed var(--border);
}

/* Radio modes */
.wiz-cond-modes         { display: flex; gap: 1.5rem; margin-bottom: .6rem; flex-wrap: wrap; }
.wiz-cond-mode-label    { display: flex; align-items: center; gap: .35rem; font-size: .82rem; cursor: pointer; }

/* Variable grid */
.wiz-cond-var-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .4rem .75rem;
  margin-bottom: .4rem;
}

/* Custom textarea */
.wiz-cond-textarea {
  width: 100%;
  resize: vertical;
  min-height: 80px;
  margin-bottom: .4rem;
  font-size: .83rem;
  line-height: 1.5;
  box-sizing: border-box;
}

/* Texte final preview */
.wiz-cond-text-final {
  background: #f7f7f8;
  border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
  padding: .45rem .75rem;
  font-size: .81rem;
  line-height: 1.55;
  margin-top: .45rem;
}
.wiz-cond-text-label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: .2rem;
}
.wiz-cond-text-final em { font-style: italic; color: var(--text); }
