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

:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #eff6ff;
  --green: #16a34a;
  --green-dark: #15803d;
  --orange: #ea580c;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius: 12px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
}

.container { max-width: 640px; margin: 0 auto; padding: 0 20px; }

/* Hero */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: white;
  padding: 56px 0 44px;
  text-align: center;
}
.badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero h1 { font-size: 44px; font-weight: 800; letter-spacing: -1.5px; margin-bottom: 14px; }
.hero-sub { font-size: 16px; opacity: 0.85; line-height: 1.75; }

/* Steps */
main { padding: 40px 0 80px; min-height: calc(100vh - 280px); }
.step { display: none; }
.step.active { display: block; }
.step > h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.step-desc { color: var(--gray-500); margin-bottom: 28px; font-size: 15px; }

/* Input SIREN */
.input-group { display: flex; gap: 10px; margin-bottom: 16px; }
.input-group input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 20px;
  font-family: 'Courier New', monospace;
  letter-spacing: 3px;
  outline: none;
  transition: border-color 0.15s;
  background: white;
}
.input-group input:focus { border-color: var(--blue); }
.input-group input::placeholder { letter-spacing: 1px; color: var(--gray-400); font-size: 16px; }

/* Boutons */
.btn-primary {
  background: var(--blue);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border: 2px solid var(--gray-200);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: block;
  margin: 24px auto 0;
  transition: border-color 0.15s;
}
.btn-secondary:hover { border-color: var(--gray-400); }

.btn-coover {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 22px;
  background: var(--green);
  color: white;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-coover:hover { background: var(--green-dark); }

/* Company card */
.company-card {
  background: white;
  border: 2px solid var(--blue);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 4px;
}
.company-name { font-size: 19px; font-weight: 700; margin-bottom: 5px; }
.company-meta { color: var(--gray-500); font-size: 14px; margin-bottom: 8px; }
.company-details { color: var(--gray-700); font-size: 13px; margin-bottom: 18px; }
.company-details a { color: var(--blue); text-decoration: none; }

/* Loading */
.loading { padding: 56px 0 40px; }
.loading-title { font-size: 16px; font-weight: 600; color: var(--gray-700); margin-bottom: 32px; text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Checklist */
.checklist { display: flex; flex-direction: column; gap: 20px; max-width: 380px; margin: 0 auto; }
.check-item {
  display: flex; align-items: center; gap: 14px;
  font-size: 15px; font-weight: 500;
  color: var(--gray-300);
  transition: color 0.4s ease;
}
.check-icon {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid currentColor;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  transition: border-color 0.4s ease;
}
.check-item.pending { color: var(--gray-300); }
.check-item.active { color: var(--blue); }
.check-item.active .check-icon {
  border-color: var(--blue);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}
.check-item.done { color: var(--green); }
.check-item.done .check-icon::before { content: '✓'; }
.check-item.done .check-icon { border-color: var(--green); }

/* Result header */
.result-header { margin-bottom: 24px; }
.result-header h2 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.result-company-name { color: var(--gray-500); font-size: 14px; }

/* Cards */
.card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}
.card h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-400);
  margin-bottom: 14px;
}
.card p { color: var(--gray-700); font-size: 15px; line-height: 1.7; }

/* Priorités */
.priority-item {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
}
.priority-item:last-child { border-bottom: none; padding-bottom: 0; }
.priority-item:first-child { padding-top: 0; }
.priority-item:has(.prio-check:checked) { background: var(--blue-light); margin: 0 -24px; padding-left: 24px; padding-right: 24px; border-radius: 8px; }

.prio-check {
  width: 17px; height: 17px;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}

.priority-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.priority-top strong { font-size: 15px; font-weight: 600; }

/* Barre devis */
.devis-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--gray-900);
  color: white;
  padding: 16px 0;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}
.devis-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.devis-count { font-size: 14px; font-weight: 500; opacity: 0.85; }
.btn-cooper {
  background: var(--blue);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-cooper:hover { background: var(--blue-dark); }
.btn-cooper:disabled { opacity: 0.6; cursor: not-allowed; }

.priority-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-urgent { background: #fee2e2; color: #991b1b; }
.badge-important { background: #fef3c7; color: #92400e; }
.badge-utile { background: var(--blue-light); color: #1e40af; }

.priority-raison { font-size: 14px; color: var(--gray-500); line-height: 1.6; margin-bottom: 10px; }
.priority-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}
.priority-cta:hover { text-decoration: underline; }

/* Badges AT/MP */
.atmp-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.atmp-élevé  { background: #fee2e2; color: #991b1b; }
.atmp-moyen  { background: #fef3c7; color: #92400e; }
.atmp-faible { background: #dcfce7; color: #166534; }

/* Fiche d'identité */
.identity-row {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
  align-items: baseline;
}
.identity-row:last-child { border-bottom: none; }
.identity-label {
  color: var(--gray-400);
  font-weight: 500;
  width: 120px;
  flex-shrink: 0;
  font-size: 13px;
}
.identity-value { color: var(--gray-700); }
.identity-value a { color: var(--blue); text-decoration: none; }
.identity-value a:hover { text-decoration: underline; }

/* CATNAT */
.catnat-row { align-items: flex-start; }
.catnat-count { font-weight: 600; color: var(--gray-700); display: block; margin-bottom: 4px; }
.catnat-types {
  list-style: disc;
  padding-left: 18px;
  margin: 0;
}
.catnat-types li { font-size: 13px; color: var(--gray-500); margin-bottom: 2px; }

/* Risques */
#result-risques { padding-left: 0; list-style: none; }
.risque-item {
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.6;
}
.risque-item:last-child { margin-bottom: 0; }
.risque-item span::before { content: '·'; margin-right: 8px; color: var(--gray-400); }

/* Prochaine étape */
.next-step-card { border-left: 4px solid var(--green); }

/* Hint sélection */
.select-hint {
  font-size: 13px;
  color: var(--gray-400);
  margin-bottom: 16px;
  margin-top: -4px;
}

/* Récapitulatif */
.recap-divider { border-top: 1px solid var(--gray-100); margin: 16px 0; }
.recap-coverage { padding: 14px 0; border-bottom: 1px solid var(--gray-100); }
.recap-coverage:last-child { border-bottom: none; padding-bottom: 0; }
.recap-coverage-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.recap-coverage-top strong { font-size: 15px; font-weight: 600; }
.recap-raison { font-size: 14px; color: var(--gray-500); line-height: 1.6; }
.recap-link-btn {
  display: block;
  padding: 11px 16px;
  margin-top: 10px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.recap-link-btn:hover { background: #dbeafe; }

/* Card merci */
.merci-card { text-align: center; padding: 28px 24px; }
.merci-text { font-size: 16px; font-weight: 600; color: var(--gray-700); margin-bottom: 8px; }
.merci-author { font-size: 14px; color: var(--gray-400); }
.merci-author a { color: var(--blue); text-decoration: none; font-weight: 500; }
.merci-author a:hover { text-decoration: underline; }

/* Erreur */
.error { color: #dc2626; font-size: 14px; margin-top: 8px; }
.hidden { display: none !important; }

/* Disclaimer */
.disclaimer { font-size: 12px; color: var(--gray-400); text-align: center; margin-top: 24px; line-height: 1.7; }

/* Footer */
footer { background: white; border-top: 1px solid var(--gray-200); padding: 20px 0; text-align: center; margin-top: 40px; }
footer p { font-size: 13px; color: var(--gray-500); }
footer a { color: var(--blue); text-decoration: none; }
footer a:hover { text-decoration: underline; }
