/* =========================================================================
   PROSPECTEUR IA — reprend la palette "Atelier" du portfolio pour la
   coherence de marque personnelle (deja verifiee WCAG AA).
   ========================================================================= */

@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Work+Sans:wght@400;500;600;700&display=swap");

:root {
  --sable: #fbf2e7;
  --sable-2: #ffffff;
  --encre: #33302c;
  --encre-soft: #6b6259;
  --line: rgba(51, 48, 44, 0.14);
  --line-soft: rgba(51, 48, 44, 0.07);

  --miel: #e8a33d;
  --miel-dim: #885c19;
  --miel-glow: rgba(232, 163, 61, 0.2);

  --sauge: #6e8f7c;
  --sauge-dim: #4d6857;
  --sauge-glow: rgba(110, 143, 124, 0.16);

  --rose: #f4dcd2;
  --coral: #a24b3b;
  --coral-glow: rgba(216, 101, 79, 0.14);

  --font-display: "Fredoka", sans-serif;
  --font-body: "Work Sans", sans-serif;
  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--sable); color: var(--encre);
  font-family: var(--font-body); font-size: 15px; line-height: 1.55;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0 0 .4em; }
p { margin: 0 0 .8em; color: var(--encre-soft); }
button, input, textarea, select { font-family: inherit; font-size: inherit; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--sable-2);
}
.topbar h1 { font-size: 1.3rem; display: flex; align-items: center; gap: 8px; }
.topbar h1 .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--miel); }
.tabs { display: flex; gap: 8px; }
.tab {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  cursor: pointer; font-weight: 500; color: var(--encre-soft); transition: all .15s var(--ease);
}
.tab.active { background: var(--encre); color: #fff; border-color: var(--encre); }
.tab:hover:not(.active) { border-color: var(--encre); color: var(--encre); }

main { padding: 24px 0 60px; }
.view { display: none; }
.view.active { display: block; }

/* ===== Formulaire ajout prospect ===== */
.add-form {
  background: var(--sable-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.add-form .full { grid-column: 1 / -1; }
.field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 5px; }
.field input, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--sable); font-family: var(--font-body);
}
.field textarea { min-height: 70px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--sauge); box-shadow: 0 0 0 3px var(--sauge-glow); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-weight: 600; padding: 10px 18px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform .15s var(--ease); text-decoration: none; font-size: .92rem;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--miel); color: #3a2405; }
.btn-outline { background: transparent; color: var(--encre); border-color: var(--line); }
.btn-outline:hover { border-color: var(--encre); }
.btn-danger { background: transparent; color: var(--coral); border-color: var(--coral-glow); }
.btn-sm { padding: 7px 13px; font-size: .82rem; }

/* ===== Pipeline (kanban) ===== */
.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; align-items: start; }
.column { background: rgba(255,255,255,.5); border-radius: var(--radius); padding: 12px; min-height: 120px; }
.column-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 10px; }
.column-head h3 { font-size: .88rem; margin: 0; }
.column-count {
  font-size: .74rem; background: var(--line-soft); padding: 2px 8px; border-radius: 999px; color: var(--encre-soft);
}
.card {
  background: var(--sable-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  margin-bottom: 10px; cursor: pointer; transition: box-shadow .15s var(--ease);
}
.card:hover { box-shadow: 0 8px 18px rgba(51,48,44,.08); }
.card h4 { font-family: var(--font-body); font-size: .92rem; font-weight: 600; margin: 0 0 4px; }
.card .meta { font-size: .74rem; color: var(--encre-soft); }
.card .badge-ia { font-size: .68rem; background: var(--sauge-glow); color: var(--sauge-dim); padding: 2px 7px; border-radius: 999px; margin-top: 6px; display: inline-block; }

/* ===== Modal detail prospect ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(51,48,44,.4); backdrop-filter: blur(2px);
  display: none; align-items: flex-start; justify-content: center; padding: 30px 16px; z-index: 100; overflow-y: auto;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--sable-2); border-radius: var(--radius); padding: 26px; max-width: 640px; width: 100%;
  box-shadow: 0 30px 70px rgba(51,48,44,.25);
}
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--encre-soft); line-height: 1; }
.stage-select { padding: 8px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--sable); font-weight: 500; }
.section-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.section-block h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--encre-soft); margin-bottom: 8px; }
.msg-box {
  background: var(--sable); border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px;
  white-space: pre-wrap; font-size: .92rem; margin-bottom: 8px;
}
.relance-item { display: flex; gap: 10px; margin-bottom: 8px; align-items: flex-start; }
.relance-item .delai { font-weight: 600; font-size: .8rem; color: var(--miel-dim); min-width: 44px; padding-top: 10px; }
.relance-item .msg-box { flex: 1; margin-bottom: 0; }
.copy-btn { font-size: .76rem; padding: 5px 10px; margin-top: 6px; }
.notes-field textarea { width: 100%; min-height: 70px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--sable); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--encre-soft); }

/* ===== Vue Reponses ===== */
.reply-view { max-width: 720px; }
.reply-result { margin-top: 18px; }

/* ===== Login gate ===== */
.login-gate {
  position: fixed; inset: 0; background: var(--sable); display: flex; align-items: center; justify-content: center; z-index: 200;
}
.login-card { background: var(--sable-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; width: 100%; max-width: 360px; box-shadow: 0 24px 60px rgba(51,48,44,.15); }
.login-card h2 { margin-bottom: 6px; }
.login-error { color: var(--coral); font-size: .85rem; margin-top: 8px; display: none; }

.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(0,0,0,.15); border-top-color: var(--encre); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .pipeline { grid-template-columns: 1fr; }
  .add-form { grid-template-columns: 1fr; }
}
:focus-visible { outline: 2px solid var(--miel); outline-offset: 2px; }
