:root {
  --bg: #0a0c10;
  --bg-elevated: #12151c;
  --bg-card: #181c25;
  --fg: #e8eaed;
  --fg-muted: #8b919e;
  --accent: #00e676;
  --accent-dim: rgba(0, 230, 118, 0.12);
  --vis: #42a5f5;
  --stab: #ab47bc;
  --comp: #ff7043;
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; font-weight: 700; }

/* NAV */
.nav { padding: 20px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 10px; }
.logo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; box-shadow: 0 0 12px var(--accent); }
.logo-text { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em; }

/* HERO */
.hero { max-width: 1100px; margin: 0 auto; padding: 80px 24px 40px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); letter-spacing: -0.03em; margin-bottom: 20px; }
.accent { color: var(--accent); }
.hero-sub { color: var(--fg-muted); font-size: 1.05rem; max-width: 480px; line-height: 1.7; }

/* HERO CARD */
.hero-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--vis), var(--stab), var(--comp));
}
.card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.card-dot { width: 8px; height: 8px; border-radius: 50%; }
.card-dot.green { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.card-title { font-family: var(--font-display); font-size: 0.95rem; font-weight: 500; color: var(--fg-muted); }

.score-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.score-label { font-size: 0.82rem; color: var(--fg-muted); width: 100px; flex-shrink: 0; }
.score-bar { flex: 1; height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 4px; background: var(--accent); transition: width 1s ease; }
.score-fill.vis { background: var(--vis); }
.score-fill.stab { background: var(--stab); }
.score-fill.comp { background: var(--comp); }
.score-val { font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; width: 30px; text-align: right; }

.card-summary { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.06); }
.card-badge { padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 500; }
.card-badge.low-risk { background: var(--accent-dim); color: var(--accent); }
.card-score-total { font-size: 0.85rem; color: var(--fg-muted); }
.card-score-total strong { color: var(--fg); font-family: var(--font-display); font-size: 1.1rem; }

/* DATA STRIP */
.hero-data-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 60px;
  padding: 16px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: var(--fg-muted);
  font-size: 0.85rem;
  font-weight: 500;
  flex-wrap: wrap;
}
.hero-data-strip .sep { color: rgba(255,255,255,0.15); }

/* SCORES SECTION */
.scores { padding: 100px 24px; }
.scores-inner { max-width: 1100px; margin: 0 auto; }
.scores-header { margin-bottom: 60px; }
.scores-header h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); letter-spacing: -0.03em; margin-bottom: 16px; }
.scores-header p { color: var(--fg-muted); max-width: 560px; font-size: 1.02rem; }
.scores-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.score-card {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color 0.2s;
}
.score-card:hover { border-color: rgba(255,255,255,0.14); }
.score-icon { font-size: 1.6rem; margin-bottom: 16px; }
.score-card h3 { font-size: 1.1rem; margin-bottom: 10px; letter-spacing: -0.01em; }
.score-card p { color: var(--fg-muted); font-size: 0.88rem; line-height: 1.65; margin-bottom: 16px; }
.score-weight { display: inline-block; padding: 4px 10px; background: var(--accent-dim); color: var(--accent); border-radius: 6px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; }

/* HOW SECTION */
.how { padding: 100px 24px; background: var(--bg-elevated); }
.how-inner { max-width: 1100px; margin: 0 auto; }
.how-header { margin-bottom: 60px; }
.how-header h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); letter-spacing: -0.03em; }
.how-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.step { position: relative; }
.step-num {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  color: rgba(255,255,255,0.04);
  line-height: 1;
  margin-bottom: 16px;
}
.step-content h3 { font-size: 1.05rem; margin-bottom: 8px; }
.step-content p { color: var(--fg-muted); font-size: 0.88rem; line-height: 1.65; }

/* CLOSING */
.closing { padding: 100px 24px; text-align: center; position: relative; }
.closing::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,230,118,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.closing-inner { max-width: 700px; margin: 0 auto; position: relative; }
.closing h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); letter-spacing: -0.03em; margin-bottom: 20px; }
.closing p { color: var(--fg-muted); font-size: 1.02rem; margin-bottom: 50px; line-height: 1.7; }
.closing-stats { display: flex; justify-content: center; gap: 60px; }
.stat { text-align: center; }
.stat-num { display: block; font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; }
.stat-label { display: block; font-size: 0.8rem; color: var(--fg-muted); margin-top: 6px; max-width: 160px; }

/* FOOTER */
.footer { padding: 40px 24px; border-top: 1px solid rgba(255,255,255,0.06); }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-tagline { color: var(--fg-muted); font-size: 0.82rem; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 50px 20px 30px; }
  .scores-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .how-steps { grid-template-columns: 1fr 1fr; gap: 24px; }
  .closing-stats { flex-direction: column; gap: 30px; align-items: center; }
  .footer-inner { flex-direction: column; gap: 10px; text-align: center; }
}
@media (max-width: 480px) {
  .scores-grid { grid-template-columns: 1fr; }
  .how-steps { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .hero-data-strip { gap: 10px; font-size: 0.78rem; }
}

/* ─── UTILITIES ──────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── SEARCH BAR ─────────────────────────────────────────────────────────── */
:root {
  --warning: #f59e0b;
  --danger: #ef4444;
}

.search-wrap {
  position: relative;
  margin-top: 36px;
  max-width: 540px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 6px 8px 6px 16px;
  gap: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.12);
}

.search-icon { color: var(--fg-muted); display: flex; align-items: center; flex-shrink: 0; }

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 8px 0;
  min-width: 0;
}
.search-input::placeholder { color: var(--fg-muted); }

.search-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--accent);
  color: #0a0c10;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.search-btn:hover { background: #00ff8a; transform: translateY(-1px); }
.search-btn:active { transform: translateY(0); }

/* Autocomplete dropdown */
.autocomplete-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  list-style: none;
  z-index: 100;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.autocomplete-list.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.1s;
}
.autocomplete-item:hover,
.autocomplete-item.highlighted {
  background: rgba(255,255,255,0.05);
}
.ac-icon { color: var(--fg-muted); flex-shrink: 0; }
.ac-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ac-main { font-size: 0.9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-secondary { font-size: 0.78rem; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Search error */
.search-error {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.85rem;
}

/* ─── LOADING SECTION ────────────────────────────────────────────────────── */
.loading-section {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-inner {
  text-align: center;
  max-width: 400px;
  padding: 40px 24px;
}

.loading-spinner {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 32px;
}
.spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.06);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
.spinner-core {
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,230,118,0.25), transparent);
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-title {
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  color: var(--fg);
}

.loading-steps { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.loading-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--fg-muted);
  transition: color 0.3s;
}
.loading-step.step-active { color: var(--fg); }
.loading-step.step-done { color: var(--accent); }

.step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
  transition: background 0.3s;
}
.step-active .step-dot {
  background: var(--fg);
  box-shadow: 0 0 8px rgba(255,255,255,0.3);
}
.step-done .step-dot {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(0,230,118,0.4);
}

/* ─── ANALYSIS SECTION ───────────────────────────────────────────────────── */
.analysis-section { padding: 40px 24px 80px; }
.analysis-inner { max-width: 1100px; margin: 0 auto; }

.new-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--fg-muted);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 0.83rem;
  cursor: pointer;
  margin-bottom: 36px;
  transition: border-color 0.2s, color 0.2s;
}
.new-search-btn:hover { border-color: rgba(255,255,255,0.25); color: var(--fg); }

/* Commerce header */
.commerce-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.commerce-meta { flex: 1; min-width: 0; }
.commerce-nom { font-size: clamp(1.6rem, 3.5vw, 2.4rem); letter-spacing: -0.03em; margin-bottom: 10px; }
.commerce-details { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.commerce-adresse { font-size: 0.88rem; color: var(--fg-muted); }
.commerce-cat-pill {
  padding: 3px 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--fg-muted);
  font-weight: 500;
}
.commerce-rating { font-size: 0.88rem; }
.stars { letter-spacing: 2px; }
.star.full { color: #f59e0b; }
.star.half { color: #f59e0b; opacity: 0.6; }
.star.empty { color: rgba(255,255,255,0.15); }
.rating-num { font-family: var(--font-display); font-weight: 600; margin-left: 4px; }
.rating-count { color: var(--fg-muted); font-size: 0.8rem; }
.no-rating { color: var(--fg-muted); font-size: 0.82rem; }

/* Global score ring */
.commerce-global { display: flex; flex-direction: column; align-items: center; gap: 12px; flex-shrink: 0; }
.global-score-ring { position: relative; width: 120px; height: 120px; }
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { stroke: rgba(255,255,255,0.06); }
.ring-fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.ring-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-val { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1; }
.ring-label { font-size: 0.72rem; color: var(--fg-muted); }

/* Risk badge */
.risk-badge { padding: 5px 14px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.risk-low { background: var(--accent-dim); color: var(--accent); }
.risk-medium { background: rgba(245,158,11,0.12); color: #f59e0b; }
.risk-high { background: rgba(239,68,68,0.12); color: #ef4444; }

/* 4 score result cards */
.scores-result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.score-result-card {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 22px 20px;
  transition: border-color 0.2s;
}
.score-result-card:hover { border-color: rgba(255,255,255,0.14); }
.src-header { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.src-icon { font-size: 1.1rem; }
.src-title { font-family: var(--font-display); font-size: 0.9rem; font-weight: 600; flex: 1; }
.src-weight { font-size: 0.72rem; color: var(--fg-muted); padding: 2px 7px; background: rgba(255,255,255,0.05); border-radius: 4px; }

.src-gauge { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.gauge-track { flex: 1; height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.gauge-fill {
  height: 100%;
  border-radius: 4px;
  width: var(--gauge-val, 0%);
  background: var(--gauge-color, var(--accent));
  transition: width 0.8s ease;
}
.gauge-val { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; width: 32px; text-align: right; flex-shrink: 0; }
.src-desc { font-size: 0.78rem; color: var(--fg-muted); line-height: 1.6; }

/* Bottom row: data points + rapport */
.analysis-bottom {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 20px;
}
.data-points-card,
.rapport-card {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 24px;
}
.card-section-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}
.data-points-list { display: flex; flex-direction: column; gap: 10px; }
.data-point {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.data-point:last-child { border-bottom: none; }
.data-icon { font-size: 1rem; flex-shrink: 0; width: 22px; }
.data-label { flex: 1; font-size: 0.83rem; color: var(--fg-muted); }
.data-value { font-family: var(--font-display); font-size: 0.88rem; font-weight: 600; }

.rapport-text {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.75;
  white-space: pre-wrap;
}

/* Global ring animation via JS — set stroke-dashoffset from 314 down */

/* ─── FINANCIAL SECTION ──────────────────────────────────────────────────── */
.financier-section {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.financier-card {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 24px;
}

.financier-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.financier-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.financier-card-title-block {
  flex: 1;
  min-width: 0;
}

.financier-title {
  font-size: 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.financier-source {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.financier-disclaimer-tag {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  white-space: nowrap;
}

.financier-tag-official {
  background: var(--accent-dim);
  color: var(--accent);
}

/* 4-column metrics grid */
.financier-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.fin-metric {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(255,255,255,0.025);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.fin-metric-label {
  font-size: 0.73rem;
  color: var(--fg-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fin-metric-value {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fg);
}

.fin-highlight {
  color: var(--accent);
}

.financier-disclaimer {
  font-size: 0.78rem;
  color: var(--fg-muted);
  line-height: 1.6;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.financier-disclaimer strong { color: var(--fg); }

/* Pappers unavailable state */
.pappers-unavailable {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.025);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--fg-muted);
}

.pappers-unavail-icon { font-size: 1rem; flex-shrink: 0; }

/* Dirigeant / extra info row */
.pappers-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 6px;
}

.pappers-extra-item {
  font-size: 0.8rem;
  color: var(--fg-muted);
  padding: 5px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
}

/* ─── RESPONSIVE: analysis ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .scores-result-grid { grid-template-columns: 1fr 1fr; }
  .analysis-bottom { grid-template-columns: 1fr; }
  .financier-metrics-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .commerce-header { flex-direction: column; gap: 24px; }
  .commerce-global { flex-direction: row; align-items: center; gap: 16px; }
  .scores-result-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}
@media (max-width: 480px) {
  .scores-result-grid { grid-template-columns: 1fr; }
  .financier-metrics-grid { grid-template-columns: 1fr 1fr; }
  .search-btn-text { display: none; }
  .search-btn { padding: 10px 12px; }
}