/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.ha-tnd-wrap {
  font-family: inherit;
  max-width: 820px;
  margin: 0 auto;
  color: inherit;
}

/* ── Loader ──────────────────────────────────────────────────────────────── */
.ha-loader {
  width: 40px; height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: #7f6ed4;
  border-radius: 50%;
  animation: ha-spin .8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes ha-spin { to { transform: rotate(360deg); } }
#ha-loading, #ha-computing { text-align: center; padding: 60px 20px; }

/* ── Intro ───────────────────────────────────────────────────────────────── */
.ha-intro-inner {
  margin: 0 auto;
  padding: 32px 20px;
}
.ha-intro-inner h2 {
  font-size: 1.6rem;
  margin-bottom: 4px;
}
.ha-subtitle {
  color: #7f6ed4;
  font-size: 1.05rem;
  margin-bottom: 24px;
}
.ha-intro-body p { margin-bottom: 12px; line-height: 1.65; }
.ha-disclaimer {
  background: #fdf6e3;
  border-left: 3px solid #e6813c;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: .9rem;
}

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.ha-btn {
  display: inline-block;
  padding: 12px 28px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity .2s;
}
.ha-btn:hover { opacity: .85; }
.ha-btn-primary  { background: #7f6ed4; color: #fff; }
.ha-btn-secondary{ background: #f0eefc; color: #7f6ed4; }
.ha-btn-success  { background: #3c9e8e; color: #fff; }

/* ── Progression ─────────────────────────────────────────────────────────── */
.ha-progress-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding: 0 4px;
}
.ha-progress-bar {
  flex: 1;
  height: 8px;
  background: #e8e5f8;
  border-radius: 4px;
  overflow: hidden;
}
.ha-progress-fill {
  height: 100%;
  background: #7f6ed4;
  border-radius: 4px;
  transition: width .4s ease;
}
.ha-progress-label {
  font-size: .85rem;
  color: #888;
  white-space: nowrap;
}

/* ── Bloc ────────────────────────────────────────────────────────────────── */
.ha-block-header {
  margin-bottom: 24px;
}
.ha-block-badge {
  display: none;
  background: #7f6ed4;
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
  letter-spacing: .04em;
}
.ha-block-title {
  font-size: 1.25rem;
  margin: 0 0 8px;
}
.ha-block-desc {
  color: #666;
  font-size: .95rem;
  line-height: 1.55;
  margin: 0;
}

/* ── Légende échelle ─────────────────────────────────────────────────────── */
.ha-scale-legend {
  background: #f7f6fd;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: .85rem;
}
.ha-legend-labels {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ha-legend-item {
  background: #ede9fa;
  padding: 3px 10px;
  border-radius: 12px;
  color: #5a4d9e;
}
.ha-legend-range {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ha-legend-nums { color: #aaa; font-size: .8rem; }

/* ── Questions ───────────────────────────────────────────────────────────── */
.ha-question {
  background: #fff;
  border: 1.5px solid #eee;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.ha-question.ha-answered { border-color: #c5bef0; }
.ha-question.ha-unanswered {
  border-color: #e6813c;
  box-shadow: 0 0 0 3px rgba(230,129,60,.15);
}
.ha-q-label {
  font-size: .97rem;
  line-height: 1.55;
  margin-bottom: 14px;
}
.ha-q-num {
  font-weight: 600;
  color: #7f6ed4;
  margin-right: 4px;
}

/* Grille options (likert 4/5/raads) */
.ha-opts-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ha-opt-col {
  flex: 1;
  min-width: 100px;
  border: 1.5px solid #e0ddf8;
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  font-size: .82rem;
  line-height: 1.3;
}
.ha-opt-col input { display: none; }
.ha-opt-col:hover { background: #f5f3fd; border-color: #a99de0; }
.ha-opt-col.ha-selected {
  background: #7f6ed4;
  border-color: #7f6ed4;
  color: #fff;
}

/* Likert 7 */
.ha-opts-likert7 {
  display: flex;
  gap: 6px;
  align-items: center;
}
.ha-opt-radio {
  flex: 1;
  text-align: center;
  cursor: pointer;
}
.ha-opt-radio input { display: none; }
.ha-opt-val {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid #c5bef0;
  margin: 0 auto;
  font-size: .9rem;
  font-weight: 600;
  transition: all .15s;
}
.ha-opt-radio:hover .ha-opt-val { background: #f0eeff; }
.ha-opt-radio.ha-selected .ha-opt-val {
  background: #7f6ed4;
  border-color: #7f6ed4;
  color: #fff;
}

/* Binaire */
.ha-opts-binary { display: flex; gap: 12px; }
.ha-opt-binary {
  flex: 1;
  text-align: center;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  font-size: .95rem;
  transition: all .15s;
}
.ha-opt-binary input { display: none; }
.ha-opt-binary:hover { background: #f5f3fd; }
.ha-opt-binary.ha-selected {
  background: #7f6ed4;
  border-color: #7f6ed4;
  color: #fff;
}

/* ── Navigation ──────────────────────────────────────────────────────────── */
.ha-nav {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #f0eeff;
}
.ha-validation-msg {
  color: #e6813c;
  font-size: .9rem;
  margin-top: 8px;
}

/* ── Résultats ───────────────────────────────────────────────────────────── */
.ha-results-wrap { padding: 16px 0; }
.ha-results-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
}
.ha-profile-card {
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 28px;
  border-left: 5px solid #7f6ed4;
  background: #f8f6ff;
}
.ha-profile-card h3 { margin: 0 0 10px; font-size: 1.1rem; }
.ha-profile-card p  { margin: 0; line-height: 1.65; color: #444; }

.ha-profile-tsa     { border-color: #7f6ed4; background: #f8f6ff; }
.ha-profile-tdah    { border-color: #e6813c; background: #fff8f3; }
.ha-profile-double_profil { border-color: #3c9e8e; background: #f3fdfb; }
.ha-profile-tsa_masking   { border-color: #9e3c7a; background: #fdf3f8; }
.ha-profile-low_moderate  { border-color: #aaa; background: #fafafa; }

.ha-bars-section { margin-bottom: 28px; }
.ha-bars-section h4 { margin-bottom: 14px; font-size: 1rem; }
.ha-res-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.ha-res-bar-label { width: 220px; font-size: .88rem; color: #555; flex-shrink: 0; }
.ha-res-bar-track {
  flex: 1;
  height: 12px;
  background: #eee;
  border-radius: 6px;
  overflow: hidden;
}
.ha-res-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 1s ease;
}
.ha-res-bar-score { width: 42px; text-align: right; font-size: .88rem; color: #666; }

.ha-disclaimer-result {
  background: #fdf6e3;
  border-left: 3px solid #e6813c;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: .88rem;
  margin-bottom: 24px;
}
.ha-next-steps h4 { margin-bottom: 10px; }
.ha-next-steps ul { padding-left: 20px; line-height: 1.8; }
.ha-link { color: #7f6ed4; text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .ha-opts-grid { flex-direction: column; }
  .ha-opt-col { min-width: unset; flex: unset; text-align: left; }
  .ha-res-bar-label { width: 130px; font-size: .8rem; }
  .ha-opts-likert7 { gap: 3px; }
  .ha-opt-val { width: 30px; height: 30px; font-size: .8rem; }
}

/* ── Écran identité ──────────────────────────────────────────────────────── */
.ha-identity-inner {
  max-width: 500px;
  margin: 0 auto;
  padding: 32px 20px;
}
.ha-identity-inner h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}
.ha-identity-intro {
  color: #666;
  font-size: .95rem;
  line-height: 1.6;
  margin-bottom: 28px;
}
.ha-field-group {
  margin-bottom: 18px;
}
.ha-field-group label {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #444;
}
.ha-field-group input,
.ha-field-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  transition: border-color .2s;
  box-sizing: border-box;
}
.ha-field-group input:focus,
.ha-field-group select:focus {
  outline: none;
  border-color: #7f6ed4;
}
.ha-identity-note {
  font-size: .82rem;
  color: #999;
  margin: 20px 0 24px;
  line-height: 1.5;
}
.ha-identity-actions {
  display: flex;
  gap: 12px;
}
