/* ── FORMULAIRE ── */
.form-widget {
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
  margin-bottom: 20px;
}
.form-header {
  background: linear-gradient(135deg, var(--blue) 0%, #2563eb 100%);
  padding: 22px 26px;
  color: #fff;
}
.form-header h2 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 5px;
}
.form-header p {
  font-size: 0.85rem;
  opacity: 0.85;
  margin: 0;
  line-height: 1.5;
}
.form-body {
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

/* Pills de sélection */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  padding: 7px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 50px;
  background: var(--gray-50);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.17s;
  user-select: none;
}
.pill:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}
.pill.selected {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
  font-weight: 700;
}

/* Slider budget */
.slider-wrap {
  position: relative;
}
.slider-val {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-top: 6px;
}
.slider-current {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--blue);
  text-align: center;
  margin-bottom: 6px;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
  height: 4px;
  cursor: pointer;
}

/* Priorités checkboxes */
.priorities-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.prio-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.17s;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-700);
}
.prio-item:hover {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
}
.prio-item.selected {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
}
.prio-item .pico {
  font-size: 1rem;
}

.generate-btn {
  width: 100%;
  padding: 13px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.97rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.generate-btn:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}
.generate-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ── RÉSULTATS ── */
.results-widget {
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
  display: none;
}
.results-widget.show {
  display: block;
  animation: fadeSlide 0.3s ease;
}
@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.results-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.results-header h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--gray-900);
  margin: 0;
}
.results-count {
  font-size: 0.78rem;
  color: var(--gray-400);
  font-weight: 600;
}
.reset-btn {
  padding: 6px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 7px;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.17s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.reset-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

/* Carte quartier résultat */
.quartier-result {
  border-bottom: 1px solid var(--gray-100);
  padding: 18px 22px;
  transition: background 0.15s;
}
.quartier-result:last-child {
  border-bottom: none;
}
.quartier-result:hover {
  background: var(--gray-50);
}

.q-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.q-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.q-rank.gold {
  background: #f59e0b;
}
.q-rank.silver {
  background: #9ca3af;
}
.q-rank.bronze {
  background: #b45309;
}

.q-info {
  flex: 1;
}
.q-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 2px;
}
.q-city {
  font-size: 0.75rem;
  color: var(--gray-400);
  font-weight: 600;
}
.q-score-badge {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 50px;
  background: var(--green-light);
  color: var(--green);
  flex-shrink: 0;
}

.q-loyer {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.q-loyer span {
  font-weight: 400;
  color: var(--gray-400);
}

/* Mini scores bars */
.score-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}
.score-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.score-lbl {
  font-size: 0.72rem;
  color: var(--gray-500, #6b7280);
  width: 100px;
  flex-shrink: 0;
}
.score-track {
  flex: 1;
  height: 5px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}
.score-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.score-fill.blue {
  background: var(--blue);
}
.score-fill.green {
  background: var(--green);
}
.score-fill.orange {
  background: var(--orange);
}

/* Tags profils */
.q-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.q-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 50px;
  background: var(--gray-100);
  color: var(--gray-600);
}
.q-tag.green {
  background: var(--green-light);
  color: var(--green);
}
.q-tag.blue {
  background: var(--blue-light);
  color: var(--blue);
}
.q-tag.orange {
  background: #fffbeb;
  color: #92400e;
}
.q-tag.red {
  background: #fef2f2;
  color: var(--red);
}

/* Lien article */
.q-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  margin-top: 8px;
}
.q-link:hover {
  text-decoration: underline;
}

/* État vide */
.no-results {
  padding: 40px 22px;
  text-align: center;
  display: none;
}
.no-results.show {
  display: block;
}
.no-results p {
  font-size: 0.9rem;
  color: var(--gray-400);
}

/* ── SIDEBAR ── */
.sidebar-card {
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.sidebar-card h3 {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 11px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.sidebar-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-card ul li {
  font-size: 0.81rem;
  color: var(--gray-600);
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  gap: 7px;
  align-items: flex-start;
  line-height: 1.4;
}
.sidebar-card ul li:last-child {
  border-bottom: none;
}
.sidebar-card ul li::before {
  content: "•";
  color: var(--blue);
  font-weight: 800;
  flex-shrink: 0;
}
.alert-card {
  border-color: #fde68a;
  background: #fffbeb;
}
.alert-card h3 {
  color: #92400e;
}
.alert-card ul li::before {
  color: var(--orange);
}
.alert-card ul li {
  color: #78350f;
}
.cta-card {
  background: linear-gradient(135deg, var(--blue) 0%, #2563eb 100%);
  border: none;
  color: #fff;
}
.cta-card h3 {
  color: #fff;
}
.cta-card p {
  font-size: 0.81rem;
  opacity: 0.88;
  line-height: 1.55;
  margin-bottom: 13px;
}
.cta-card a {
  display: block;
  background: #fff;
  color: var(--blue);
  text-align: center;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 0.83rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s;
}
.cta-card a:hover {
  background: var(--gray-100);
}

/* ── ARTICLE ── */
.article-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.article-section h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gray-900);
  margin: 48px 0 14px;
  padding-top: 40px;
  border-top: 2px solid var(--gray-100);
}
.article-section h2:first-child {
  border-top: none;
  padding-top: 0;
}
.article-section p {
  font-size: 0.96rem;
  color: var(--gray-600);
  line-height: 1.8;
  margin-bottom: 14px;
}
.article-section ul {
  margin: 0 0 14px 22px;
}
.article-section li {
  font-size: 0.96rem;
  color: var(--gray-600);
  line-height: 1.75;
  margin-bottom: 6px;
}
.article-section strong {
  color: var(--gray-800);
}
.callout {
  border-left: 4px solid var(--blue);
  border-radius: 0 8px 8px 0;
  padding: 13px 17px;
  margin: 18px 0;
  background: var(--blue-light);
}
.callout p {
  color: var(--gray-700) !important;
  margin: 0 !important;
  font-size: 0.88rem !important;
}
.callout.warning {
  background: #fffbeb;
  border-color: var(--orange);
}
.callout.success {
  background: var(--green-light);
  border-color: var(--green);
}
/* ── RELATED ── */
.related {
  margin-top: 50px;
  padding-top: 34px;
  border-top: 2px solid var(--gray-200);
}
.related h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--gray-900);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 13px;
}
.related-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  display: block;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}
.related-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.related-thumb {
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 9px;
  background: var(--gray-100);
}
.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.related-card h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.35;
}

/* ── MOBILE ── */
@media (max-width: 720px) {
  .priorities-grid {
    grid-template-columns: 1fr;
  }
}