/* ===========================================================
   RH AI — Prospection (formulaire + résultats)
   Palette et briques de base reprises de pitch/script_client.html
   =========================================================== */

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

:root {
  --red:       #b91c1c;
  --red-light: #ef4444;
  --dark:      #0f172a;
  --gray:      #64748b;
  --surface:   #ffffff;
  --bg:        #f8fafc;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--dark);
}

a { color: inherit; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ── Cards & fields (repris de pitch/script_client.html) ── */
.card {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 24px;
}

.field-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 8px;
  display: block;
}
.field-input, .field-textarea, .field-select {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: .92rem;
  color: var(--dark);
  background: #fff;
  transition: border-color .25s, box-shadow .25s;
}
.field-input:focus, .field-textarea:focus, .field-select:focus {
  outline: none;
  border-color: var(--red-light);
  box-shadow: 0 0 0 4px rgba(239,68,68,.1);
}
.field-textarea { resize: vertical; min-height: 110px; }
.field-hint { font-size: .78rem; color: var(--gray); margin-top: 6px; }

.script-quote {
  border-left: 3px solid var(--red-light);
  padding: 6px 0 6px 16px;
  color: #475569;
  font-style: italic;
  line-height: 1.7;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 28px;
  border-radius: 100px;
  background: var(--red);
  color: #fff;
  font-weight: 600;
  font-size: .92rem;
  border: none;
  cursor: pointer;
  transition: background .25s, transform .2s, box-shadow .25s;
  box-shadow: 0 8px 24px rgba(185,28,28,.22);
  white-space: nowrap;
}
.btn-primary:hover:not(:disabled) {
  background: #991b1b;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(185,28,28,.3);
}
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 100px;
  background: #fff;
  color: var(--gray);
  font-weight: 600;
  font-size: .92rem;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.btn-secondary:hover:not(:disabled) { border-color: var(--red-light); color: var(--red); }
.btn-secondary:disabled { opacity: .4; cursor: not-allowed; }

.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  flex-shrink: 0;
  background: #cbd5e1;
  transition: background .25s, box-shadow .25s, transform .2s;
}

#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  left: 24px;
  z-index: 300;
  margin: 0 auto;
  max-width: 420px;
  padding: 14px 20px;
  border-radius: 14px;
  background: var(--dark);
  color: #fff;
  font-size: .88rem;
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(0,0,0,.25);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s ease, opacity .3s ease;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.error { background: #991b1b; }

/* ── Page shell (formulaire + résultats) ── */
.page-header {
  padding: 20px 6% 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
}
.page-header h1 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.page-header .subtitle { font-size: .8rem; color: var(--gray); margin-top: 2px; }
.page-header .nav-link {
  font-size: .85rem;
  font-weight: 600;
  color: var(--red);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.page-header .nav-link:hover { text-decoration: underline; }

.page-body {
  padding: 28px 6% 60px;
  max-width: 900px;
  margin: 0 auto;
}

/* ── Wizard (form.html) ── */
.wizard-progress {
  height: 4px;
  background: #eef2f7;
  border-radius: 4px;
  overflow: hidden;
}
.wizard-progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--red), var(--red-light));
  transition: width .25s ease;
}

.wizard-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 24px;
  flex-wrap: wrap;
}
.wizard-dots button.step-dot {
  border: none;
  cursor: default;
}
.wizard-dots button.step-dot.clickable { cursor: pointer; }
.wizard-dots button.step-dot.active {
  background: var(--red);
  box-shadow: 0 4px 14px rgba(185,28,28,.35);
  transform: scale(1.1);
}
.wizard-dots button.step-dot.done { background: var(--red-light); }
.wizard-dots .dot-sep { flex: 1; height: 2px; background: #eef2f7; min-width: 12px; }

.wizard-card { max-width: 640px; margin: 0 auto; }

.wizard-step-label {
  display: inline-block;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--red);
  background: #fef2f2;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 12px;
}

.wizard-question {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 14px;
}

.wizard-key-question {
  border: 2px solid #fecaca;
  background: #fffbfb;
  border-radius: 24px;
}
.wizard-key-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
  background: var(--red);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 12px;
}

.advice-banner {
  border-left: 3px solid var(--red-light);
  background: #fef2f2;
  color: #9f1239;
  font-size: .85rem;
  line-height: 1.6;
  padding: 12px 16px;
  border-radius: 0 14px 14px 0;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}
.wizard-nav .btn-primary, .wizard-nav .btn-secondary { flex: 0 0 auto; }

.recap-list { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 4px; }
.recap-item { background: #f8fafc; border-radius: 14px; padding: 12px 16px; }
.recap-item .recap-q { font-size: .74rem; font-weight: 700; color: var(--gray); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .03em; }
.recap-item .recap-a { font-size: .88rem; color: var(--dark); white-space: pre-wrap; }
.recap-item .recap-a:empty::before { content: "—"; color: #cbd5e1; }

.confirm-screen { text-align: center; padding: 40px 0; }
.confirm-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}

@media (max-width: 480px) {
  .wizard-nav { flex-direction: column-reverse; }
  .wizard-nav .btn-primary, .wizard-nav .btn-secondary { width: 100%; }
}

/* ── Results page ── */
.results-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.results-toolbar .field-input { max-width: 320px; }
.results-count { font-size: .82rem; color: var(--gray); white-space: nowrap; }

.results-grid { display: flex; flex-direction: column; gap: 10px; }

.results-head-row, .results-row {
  display: grid;
  grid-template-columns: 100px 1.3fr 1.3fr 1fr 2fr 40px;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
}
.results-head-row {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--gray);
}
.results-row {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.results-row:hover { border-color: var(--red-light); background: #fffafa; }
.results-row .rr-date { font-size: .78rem; color: var(--gray); }
.results-row .rr-entreprise { font-weight: 700; font-size: .9rem; }
.results-row .rr-contact { font-size: .85rem; color: #475569; }
.results-row .rr-contact .rr-fonction { color: var(--gray); font-size: .78rem; }
.results-row .rr-commercial { font-size: .82rem; color: var(--gray); }
.results-row .rr-apercu { font-size: .82rem; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results-row .rr-chevron { color: #cbd5e1; text-align: right; }

.results-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray);
  font-size: .92rem;
}

@media (max-width: 768px) {
  .results-head-row { display: none; }
  .results-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 16px 18px;
  }
  .results-row .rr-chevron { display: none; }
  .results-row .rr-date { order: -1; }
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 400;
}
.modal-panel {
  background: #fff;
  border-radius: 24px;
  max-width: 640px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  position: relative;
}
.modal-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: var(--gray);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: #e2e8f0; color: var(--dark); }

.modal-id-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin: 16px 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
}
.modal-id-grid .idf-label { font-size: .72rem; color: var(--gray); text-transform: uppercase; letter-spacing: .03em; }
.modal-id-grid .idf-value { font-size: .9rem; font-weight: 600; }
.modal-id-grid .idf-value:empty::before { content: "—"; color: #cbd5e1; font-weight: 400; }

.modal-qa { display: flex; flex-direction: column; gap: 18px; margin-bottom: 18px; }
.modal-qa .qa-question { font-size: .84rem; font-weight: 700; margin-bottom: 6px; }

.modal-footer { font-size: .78rem; color: var(--gray); border-top: 1px solid #f1f5f9; padding-top: 14px; }

@media (max-width: 640px) {
  .modal-id-grid { grid-template-columns: 1fr; }
  .modal-panel { padding: 22px; border-radius: 18px; }
}
