/* ── PROFIL SELECTOR ── */
.profile-selector {
  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;
}
.profile-header {
  background: linear-gradient(135deg, var(--blue) 0%, #2563eb 100%);
  padding: 22px 26px;
  color: #fff;
}
.profile-header h2 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 5px;
}
.profile-header p {
  font-size: 0.85rem;
  opacity: 0.85;
  margin: 0;
  line-height: 1.5;
}
.profile-body {
  padding: 22px 26px;
}
.profile-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.profile-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  background: var(--gray-50);
  cursor: pointer;
  transition: all 0.18s;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-700);
  text-align: center;
  line-height: 1.3;
}
.profile-btn .emoji {
  font-size: 1.6rem;
}
.profile-btn:hover {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
}
.profile-btn.selected {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 700;
}
.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.5;
  cursor: not-allowed;
  transform: none;
}

/* ── CHECKLIST WIDGET ── */
.checklist-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;
}
.checklist-widget.show {
  display: block;
  animation: fadeSlide 0.3s ease;
}
@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.checklist-top {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--gray-50);
}
.checklist-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.checklist-profile-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  background: var(--blue-light);
  color: var(--blue);
}
.checklist-count {
  font-size: 0.8rem;
  color: var(--gray-400);
  font-weight: 600;
}
.checklist-actions {
  display: flex;
  gap: 8px;
}
.action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  border: 1.5px solid var(--gray-200);
  background: #fff;
  color: var(--gray-700);
  text-decoration: none;
}
.action-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}
.action-btn.pdf {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.action-btn.pdf:hover {
  background: var(--blue-dark);
}

/* Progress checklist */
.checklist-progress {
  padding: 14px 24px;
  border-bottom: 1px solid var(--gray-200);
  background: #fff;
}
.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-500, #6b7280);
  margin-bottom: 7px;
}
.progress-track {
  height: 5px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue) 0%, var(--green) 100%);
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}

/* Categories */
.checklist-body {
  padding: 8px 0;
}
.cat-section {
  margin-bottom: 2px;
}
.cat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.cat-header:hover {
  background: var(--gray-50);
}
.cat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.cat-icon.blue {
  background: var(--blue-light);
}
.cat-icon.green {
  background: var(--green-light);
}
.cat-icon.orange {
  background: #fffbeb;
}
.cat-icon.red {
  background: #fef2f2;
}
.cat-icon.purple {
  background: #f5f3ff;
}
.cat-title {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gray-900);
}
.cat-count {
  font-size: 0.75rem;
  color: var(--gray-400);
  font-weight: 600;
  margin-right: 6px;
}
.cat-chevron {
  color: var(--gray-400);
  font-size: 0.75rem;
  transition: transform 0.2s;
}
.cat-section.open .cat-chevron {
  transform: rotate(180deg);
}

/* Doc items */
.cat-items {
  display: none;
  padding: 0 24px 12px 66px;
  border-bottom: 1px solid var(--gray-100);
}
.cat-section.open .cat-items {
  display: block;
}
.doc-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
}
.doc-item:last-child {
  border-bottom: none;
}
.doc-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: 5px;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  background: #fff;
}
.doc-item.checked .doc-checkbox {
  background: var(--green);
  border-color: var(--green);
}
.doc-item.checked .doc-checkbox::after {
  content: "✓";
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}
.doc-item.checked .doc-name {
  text-decoration: line-through;
  color: var(--gray-400);
}
.doc-content {
  flex: 1;
}
.doc-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 2px;
  transition: color 0.18s;
}
.doc-desc {
  font-size: 0.78rem;
  color: var(--gray-500, #6b7280);
  line-height: 1.45;
}
.doc-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 50px;
  flex-shrink: 0;
  margin-top: 2px;
  align-self: flex-start;
}
.tag-obligatoire {
  background: #fef2f2;
  color: var(--red);
}
.tag-recommande {
  background: #fffbeb;
  color: #92400e;
}
.tag-logement {
  background: var(--blue-light);
  color: var(--blue);
}

/* Résultat complet */
.checklist-done {
  margin: 16px 24px;
  background: var(--green-light);
  border: 1px solid #86efac;
  border-radius: 10px;
  padding: 16px 18px;
  display: none;
  animation: fadeSlide 0.3s ease;
}
.checklist-done.show {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.checklist-done svg {
  flex-shrink: 0;
  margin-top: 2px;
}
.checklist-done h4 {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 4px;
}
.checklist-done p {
  font-size: 0.82rem;
  color: var(--gray-700);
  margin: 0;
}

/* ── SIDEBAR ── */
.tool-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.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);
}

/* ── SECTION 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;
}

/* ── PRINT ── */
@media print {
  nav,
  .tool-sidebar,
  .profile-selector,
  .article-section,
  footer,
  .breadcrumb,
  .tool-hero,
  .checklist-actions,
  .checklist-progress,
  .checklist-done,
  .cat-chevron {
    display: none !important;
  }
  .tool-layout {
    display: block !important;
  }
  .checklist-widget {
    display: block !important;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  .cat-items {
    display: block !important;
  }
  body {
    font-size: 12px;
  }
  .doc-item.checked .doc-name {
    text-decoration: none;
    color: #111;
  }
}