/* Data Transparency Index v1 — FR + MX */

.dti-hero {
  padding: 120px 0 48px;
  background: linear-gradient(165deg, #121820 0%, #1a2430 50%, #1e2a36 100%);
  position: relative;
  overflow: hidden;
}

.dti-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 40% at 80% 15%, rgba(184, 160, 122, 0.14) 0%, transparent 60%);
  pointer-events: none;
}

.dti-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.dti-badge {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(184, 160, 122, 0.15);
  border: 1px solid rgba(184, 160, 122, 0.35);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 20px;
}

.dti-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.5vw, 48px);
  font-weight: 400;
  color: #ffffff;
  line-height: 1.1;
  margin: 0 0 16px;
  max-width: 780px;
}

.dti-hero h1 .dti-h1-main {
  color: #ffffff;
  font-style: normal;
}

.dti-hero h1 em {
  font-style: italic;
  color: var(--gold);
}

.dti-lead {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.75;
  max-width: 720px;
  margin: 0 0 24px;
}

.dti-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.dti-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: -28px 0 40px;
  position: relative;
  z-index: 2;
}

@media (max-width: 768px) {
  .dti-kpi-strip { grid-template-columns: repeat(2, 1fr); margin-top: 20px; }
}

.dti-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
}

.dti-kpi-value {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 6px;
}

.dti-meta .dti-review-overdue,
.dti-updated .dti-review-overdue {
  color: #dc2626;
  font-weight: 700;
}

.dti-kpi-value#dti-market-avg {
  color: var(--gold);
}

.dti-answer {
  background: linear-gradient(135deg, rgba(184, 160, 122, 0.08) 0%, rgba(224, 120, 48, 0.05) 100%);
  border: 1px solid rgba(184, 160, 122, 0.25);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 40px;
}

.dti-answer-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gold);
  margin-bottom: 8px;
}

.dti-body h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  margin: 48px 0 12px;
}

.dti-body h2:first-child {
  margin-top: 0;
}

.dti-body p {
  color: var(--text-muted);
  line-height: 1.75;
  margin: 0 0 16px;
}

.dti-criteria-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 20px 0 32px;
}

@media (max-width: 640px) {
  .dti-criteria-grid { grid-template-columns: 1fr; }
}

.dti-criterion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}

.dti-criterion strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.dti-criterion span {
  font-size: 13px;
  color: var(--text-muted);
}

.dti-criterion .dti-weight {
  float: right;
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
}

.dti-table-wrap {
  overflow-x: auto;
  margin: 20px 0 32px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.dti-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.dti-table th,
.dti-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.dti-table th {
  background: var(--surface-alt, #f8f6f2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

.dti-table tr:last-child td {
  border-bottom: none;
}

.dti-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
}

.dti-score.excellent { background: rgba(16, 185, 129, 0.15); color: #059669; }
.dti-score.bon { background: rgba(20, 184, 166, 0.15); color: #0d9488; }
.dti-score.moyen { background: rgba(200, 134, 10, 0.15); color: #b45309; }
.dti-score.faible { background: rgba(239, 68, 68, 0.12); color: #dc2626; }

.dti-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.dti-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), #e07830);
}

.dti-highlights {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  padding-left: 18px;
}

.dti-highlights li {
  margin-bottom: 4px;
}

.dti-download {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
}

.dti-download a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.dti-download a:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.dti-cta {
  text-align: center;
  padding: 40px 24px;
  margin-top: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1a2430 0%, #243040 100%);
  color: var(--ivory);
}

.dti-cta h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 8px;
}

.dti-cta p {
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 20px;
}

.dti-loading {
  color: var(--text-muted);
  font-style: italic;
}

.dti-updated {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ── Baromètre v2 ── */
.dti-barometer {
  margin: 0 0 40px;
}

.dti-barometer-card {
  background: linear-gradient(165deg, #121820 0%, #1a2430 50%, #1e2a36 100%);
  border: 1px solid rgba(184, 160, 122, 0.25);
  border-radius: 16px;
  padding: 28px 24px 20px;
  text-align: center;
}

.dti-barometer-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ivory);
  margin-bottom: 16px;
}

.dti-gauge-wrap {
  position: relative;
  max-width: 320px;
  margin: 0 auto;
}

.dti-gauge {
  width: 100%;
  height: auto;
  display: block;
}

.dti-gauge-needle {
  transform-origin: 100px 100px;
  transition: transform 1.2s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.dti-gauge-label {
  font-size: 10px;
  fill: rgba(255, 255, 255, 0.45);
}

.dti-gauge-center {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  text-align: center;
}

.dti-gauge-score {
  font-family: var(--font-display);
  font-size: 42px;
  color: var(--gold);
  line-height: 1;
}

.dti-gauge-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 4px;
}

.dti-barometer-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 24px;
  margin-top: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.dti-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dti-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dti-legend-needle {
  background: #fff;
}

.dti-legend-own {
  background: var(--gold);
}

.dti-barometer-tiers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.dti-tier-chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.dti-tier-chip.faible { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.dti-tier-chip.moyen { background: rgba(200, 134, 10, 0.15); color: #b45309; }
.dti-tier-chip.bon { background: rgba(20, 184, 166, 0.15); color: #0d9488; }
.dti-tier-chip.excellent { background: rgba(16, 185, 129, 0.15); color: #059669; }

/* ── Critères v2 ── */
.dti-criterion {
  position: relative;
}

.dti-criterion-desc {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.dti-criterion-checklist {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-muted);
}

.dti-criterion-checklist li {
  margin-bottom: 3px;
}

.dti-criterion-alert {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.dti-criterion-alert.high {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.dti-criterion-alert.medium {
  background: rgba(200, 134, 10, 0.15);
  color: #b45309;
}

.dti-criterion:has(.dti-criterion-alert) {
  padding-left: 40px;
}

/* ── Matrice heatmap ── */
.dti-matrix-wrap {
  margin: 20px 0 32px;
}

.dti-matrix-table th,
.dti-matrix-table td {
  text-align: center;
  vertical-align: middle;
}

.dti-matrix-sticky,
.dti-matrix-row-label {
  text-align: left !important;
  position: sticky;
  left: 0;
  background: var(--surface-alt, #f8f6f2);
  z-index: 1;
  min-width: 160px;
}

.dti-matrix-row-label {
  background: var(--surface);
}

.dti-matrix-col {
  min-width: 90px;
}

.dti-matrix-provider {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.dti-matrix-total {
  margin-bottom: 6px;
}

.dti-bar-sm {
  height: 4px;
  margin-top: 0;
}

.dti-matrix-crit-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.dti-matrix-crit-weight {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.dti-matrix-cell {
  font-size: 13px;
  font-weight: 600;
}

.dti-matrix-val {
  font-size: 15px;
}

.dti-matrix-max {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.dti-matrix-cell.heat-excellent { background: rgba(16, 185, 129, 0.18); color: #059669; }
.dti-matrix-cell.heat-bon { background: rgba(20, 184, 166, 0.14); color: #0d9488; }
.dti-matrix-cell.heat-moyen { background: rgba(200, 134, 10, 0.12); color: #b45309; }
.dti-matrix-cell.heat-faible { background: rgba(239, 68, 68, 0.1); color: #dc2626; }

/* ── Points critiques ── */
.dti-critical {
  margin: 48px 0 32px;
}

.dti-critical-intro {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.dti-critical-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 768px) {
  .dti-critical-grid { grid-template-columns: 1fr; }
}

.dti-critical-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px 16px 22px;
  border-left: 4px solid var(--border);
}

.dti-critical-card.high {
  border-left-color: #dc2626;
}

.dti-critical-card.medium {
  border-left-color: #b45309;
}

.dti-critical-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.dti-critical-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 999px;
}

.dti-critical-badge.high {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.dti-critical-badge.medium {
  background: rgba(200, 134, 10, 0.12);
  color: #b45309;
}

.dti-critical-count {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.dti-critical-card h3 {
  font-size: 15px;
  margin: 0 0 8px;
}

.dti-critical-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 8px;
  line-height: 1.6;
}

.dti-critical-affected a,
.dti-critical-crit {
  font-size: 12px;
}

/* ── Mini-barres revendeurs ── */
.dti-mini-bars {
  display: flex;
  gap: 2px;
  margin: 8px 0 4px;
}

.dti-mini-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.dti-mini-bar-fill {
  height: 100%;
  border-radius: 2px;
}

.dti-mini-bar-fill.heat-excellent { background: #059669; }
.dti-mini-bar-fill.heat-bon { background: #0d9488; }
.dti-mini-bar-fill.heat-moyen { background: #b45309; }
.dti-mini-bar-fill.heat-faible { background: #dc2626; }

.dti-bar-total {
  margin-top: 6px;
}

/* ── Détail revendeur ── */
.dti-provider-details {
  font-size: 13px;
}

.dti-provider-details summary {
  cursor: pointer;
  color: var(--gold);
  font-weight: 600;
  user-select: none;
}

.dti-detail-scores {
  list-style: none;
  margin: 10px 0;
  padding: 0;
}

.dti-detail-scores li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.dti-detail-scores li span {
  color: var(--text-muted);
}

/* Header search — aligné sur index.html (accueil) */
.hsearch-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-right: 8px;
}

.hsearch-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  pointer-events: none;
}

#hsearch-input {
  width: 200px;
  padding: 6px 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}

#hsearch-input:focus {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.hsearch-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: 90vw;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  max-height: 60vh;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  z-index: 1000;
  color: #111;
}

.hsearch-close {
  display: none;
  position: absolute;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}

.hsearch-trigger-mobile {
  display: none;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 6px;
  opacity: 0.85;
  align-items: center;
  justify-content: center;
}

.hsearch-trigger-mobile:hover { opacity: 1; }

@media (max-width: 767px) {
  .hsearch-wrap { display: none; }
  .hsearch-trigger-mobile { display: inline-flex; }

  body.hsearch-active { overflow: hidden; }

  body.hsearch-active .hsearch-wrap {
    display: flex !important;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    z-index: 9999;
    flex-direction: column;
    padding: 20px 16px;
    margin: 0;
  }

  body.hsearch-active .hsearch-icon {
    top: 36px;
    left: 28px;
    opacity: 0.5;
    color: #111;
    width: 18px;
    height: 18px;
  }

  body.hsearch-active #hsearch-input {
    width: 100%;
    height: 48px;
    padding: 10px 50px 10px 44px;
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
    color: #111;
    font-size: 16px;
    border-radius: 12px;
  }

  body.hsearch-active .hsearch-close {
    display: block;
    top: 28px;
    right: 20px;
    color: #111;
    font-size: 32px;
    opacity: 0.7;
  }

  body.hsearch-active .hsearch-close:hover { opacity: 1; }

  body.hsearch-active .hsearch-results {
    position: static;
    margin-top: 16px;
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 100px);
    border: none;
    box-shadow: none;
    background: transparent;
  }
}
