/* ========================================
   RAPPORT V5 — Premium dark
   ======================================== */

@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes countIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes glowPulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.7; } }
@keyframes barGrow { from { width: 0; } }

:root {
  --bg: #0c0f1a;
  --bg2: #111627;
  --bg3: #171d30;
  --glass: rgba(23, 29, 48, 0.7);
  --glass-b: rgba(99, 102, 241, 0.08);
  --bd: rgba(255,255,255,0.06);
  --tx: #f1f3f8;
  --tx2: #a0a6be;
  --tx3: #636a82;
  --acc: #7c6ef6;
  --acc2: #a78bfa;
  --grn: #34d399;
  --grn2: #10b981;
  --red: #f87171;
  --org: #fbbf24;
  --blu: #60a5fa;
  --font: 'Inter', -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font); background: var(--bg); color: var(--tx);
  line-height: 1.6; -webkit-font-smoothing: antialiased;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

.w { max-width: 820px; margin: 0 auto; padding: 0 24px; }

/* ======== HEADER ======== */

.hd {
  padding: 16px 0; border-bottom: 1px solid var(--bd);
  position: sticky; top: 0; z-index: 100;
  background: rgba(12, 15, 26, 0.9); backdrop-filter: blur(16px);
}
.hd .w { display: flex; justify-content: space-between; align-items: center; }
.hd-brand { font-weight: 900; font-size: 1rem; background: linear-gradient(135deg, var(--acc), var(--acc2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hd-r { display: flex; align-items: center; gap: 16px; }
.hd-client { font-weight: 600; font-size: 0.88rem; color: var(--tx2); }
.hd-month {
  font-family: var(--font); font-weight: 600; font-size: 0.82rem;
  background: var(--bg3); border: 1px solid var(--bd); border-radius: 8px;
  color: var(--tx); padding: 6px 28px 6px 12px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23636a82'%3E%3Cpath d='M5 7L0 2h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.hd-month:focus { outline: none; border-color: var(--acc); }

/* ======== HERO ======== */

.hero {
  position: relative; padding: 80px 0 60px; text-align: center;
  overflow: hidden;
}
.hero-glow {
  position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 110, 246, 0.15) 0%, transparent 70%);
  animation: glowPulse 4s ease-in-out infinite;
  pointer-events: none;
}
.hero-label { font-size: 1rem; color: var(--tx2); font-weight: 500; letter-spacing: 0.02em; margin-bottom: 12px; animation: fadeUp 0.6s ease both; }
.hero-num {
  font-size: 8rem; font-weight: 900; line-height: 1; letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--acc), var(--grn));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: countIn 0.8s ease both 0.2s;
  margin-bottom: 8px;
}
.hero-sub { font-size: 1.1rem; color: var(--tx2); font-weight: 500; animation: fadeUp 0.6s ease both 0.3s; margin-bottom: 24px; }

.hero-pills { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; animation: fadeUp 0.6s ease both 0.5s; }

.h-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 100px;
  font-size: 0.82rem; font-weight: 600;
  border: 1px solid var(--bd); background: var(--glass);
  backdrop-filter: blur(8px);
}
.h-pill__dot { width: 8px; height: 8px; border-radius: 50%; }
.h-pill--medias .h-pill__dot { background: var(--acc2); }
.h-pill--neufs .h-pill__dot { background: var(--grn); }
.h-pill--positionnes .h-pill__dot { background: var(--org); }
.h-pill--relinking .h-pill__dot { background: var(--blu); }

/* ======== SECTIONS ======== */

.sec { padding: 48px 0; }
.sec--glass { background: var(--bg2); border-top: 1px solid var(--bd); border-bottom: 1px solid var(--bd); }
.sec-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 24px; letter-spacing: -0.01em; }

/* ======== URL CARDS ======== */

.url-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }

.url-card {
  position: relative; padding: 22px; border-radius: 14px;
  background: var(--bg2); border: 1px solid var(--bd);
  cursor: pointer; transition: all 0.25s; overflow: hidden;
}
.url-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: 14px 14px 0 0; transition: height 0.3s;
}
.url-card:hover { border-color: rgba(124, 110, 246, 0.3); transform: translateY(-3px); }
.url-card:hover::before { height: 3px; }

.url-card:nth-child(1)::before { background: linear-gradient(90deg, var(--acc), var(--acc2)); }
.url-card:nth-child(2)::before { background: linear-gradient(90deg, var(--grn2), var(--grn)); }
.url-card:nth-child(3)::before { background: linear-gradient(90deg, var(--org), #f59e0b); }
.url-card:nth-child(4)::before { background: linear-gradient(90deg, var(--blu), #3b82f6); }
.url-card:nth-child(5)::before { background: linear-gradient(90deg, #ec4899, #f472b6); }
.url-card:nth-child(6)::before { background: linear-gradient(90deg, #14b8a6, #2dd4bf); }

.url-card__num { font-size: 2.2rem; font-weight: 900; color: var(--tx); margin-bottom: 2px; }
.url-card__label { font-size: 0.72rem; color: var(--tx3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-bottom: 10px; }
.url-card__url { font-size: 0.82rem; color: var(--tx2); font-weight: 500; margin-bottom: 8px; word-break: break-all; }
.url-card__pills { display: flex; gap: 5px; flex-wrap: wrap; }

.mini-pill {
  font-size: 0.65rem; font-weight: 600; padding: 2px 8px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.mini-pill--medias { background: rgba(167, 139, 250, 0.15); color: var(--acc2); }
.mini-pill--neufs { background: rgba(52, 211, 153, 0.15); color: var(--grn); }
.mini-pill--positionnes { background: rgba(251, 191, 36, 0.15); color: var(--org); }
.mini-pill--relinking { background: rgba(96, 165, 250, 0.15); color: var(--blu); }

.url-card__cta { font-size: 0.75rem; color: var(--tx3); margin-top: 12px; transition: color 0.2s; }
.url-card:hover .url-card__cta { color: var(--acc2); }

/* ======== DETAIL ======== */

.detail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.close-btn {
  font-family: var(--font); font-size: 0.82rem; font-weight: 600;
  background: transparent; color: var(--tx3); border: 1px solid var(--bd);
  padding: 6px 14px; border-radius: 8px; cursor: pointer; transition: all 0.2s;
}
.close-btn:hover { border-color: var(--acc); color: var(--acc2); }

.detail-link {
  display: grid; grid-template-columns: auto 1fr auto auto;
  align-items: center; gap: 16px;
  padding: 14px 18px; border-radius: 10px; margin-bottom: 8px;
  background: var(--bg3); border: 1px solid var(--bd);
  transition: border-color 0.2s; animation: fadeUp 0.4s ease both;
}
.detail-link:hover { border-color: rgba(124, 110, 246, 0.2); }

.dl-date { font-size: 0.78rem; color: var(--tx3); min-width: 50px; }
.dl-domain { font-weight: 600; font-size: 0.9rem; }
.dl-anchor { font-size: 0.82rem; color: var(--tx2); margin-top: 2px; }
.dl-dr { font-weight: 700; font-size: 0.75rem; background: var(--acc); color: #fff; padding: 3px 8px; border-radius: 8px; }
.dl-type { display: inline-block; }

.dl-status { display: flex; align-items: center; gap: 5px; font-size: 0.78rem; color: var(--tx2); }
.dl-dot { width: 7px; height: 7px; border-radius: 50%; }
.dl-dot--indexed { background: var(--blu); }
.dl-dot--live { background: var(--grn); }
.dl-dot--pending { background: var(--org); }

/* ======== POSITIONS ======== */

.pos-list { display: flex; flex-direction: column; gap: 10px; }

.pos-item {
  display: grid; grid-template-columns: 1.5fr 1fr auto;
  align-items: center; gap: 16px;
  padding: 16px 20px; border-radius: 12px;
  background: var(--bg2); border: 1px solid var(--bd);
  transition: all 0.2s;
}
.pos-item:hover { border-color: rgba(124, 110, 246, 0.2); transform: translateX(4px); }

.pos-kw { font-weight: 600; font-size: 0.95rem; }
.pos-url { font-size: 0.75rem; color: var(--tx3); margin-top: 2px; }
.pos-sec { font-size: 0.72rem; color: var(--tx3); font-style: italic; margin-top: 4px; }

.pos-bar-wrap { position: relative; }
.pos-move { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--tx2); margin-bottom: 6px; }
.pos-from { color: var(--tx3); }
.pos-arrow { color: var(--tx3); }
.pos-to { font-weight: 700; color: var(--tx); }

.pos-bar { height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.pos-bar__fill { height: 100%; border-radius: 3px; animation: barGrow 1s ease both; }
.pos-bar__fill--top3 { background: linear-gradient(90deg, var(--grn2), var(--grn)); }
.pos-bar__fill--top10 { background: linear-gradient(90deg, #3b82f6, var(--blu)); }
.pos-bar__fill--top20 { background: linear-gradient(90deg, #d97706, var(--org)); }
.pos-bar__fill--beyond { background: var(--tx3); }

.pos-delta {
  font-weight: 800; font-size: 1rem; min-width: 50px; text-align: center;
  padding: 6px 12px; border-radius: 8px;
}
.pos-delta--up { color: var(--grn); background: rgba(52, 211, 153, 0.1); }
.pos-delta--down { color: var(--red); background: rgba(248, 113, 113, 0.1); }
.pos-delta--flat { color: var(--tx3); background: rgba(99, 106, 130, 0.1); }

/* ======== VISIBILITY ======== */

.vis-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.vis-card {
  text-align: center; padding: 28px 16px; border-radius: 14px;
  background: var(--bg2); border: 1px solid var(--bd);
  transition: all 0.25s;
}
.vis-card:hover { border-color: rgba(124, 110, 246, 0.2); transform: translateY(-2px); }

.vis-num { font-size: 2.8rem; font-weight: 900; display: block; margin-bottom: 4px; }
.vis-card:nth-child(1) .vis-num { background: linear-gradient(135deg, var(--grn2), var(--grn)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.vis-card:nth-child(2) .vis-num { background: linear-gradient(135deg, #3b82f6, var(--blu)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.vis-card:nth-child(3) .vis-num { background: linear-gradient(135deg, var(--acc), var(--acc2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.vis-label { font-size: 0.72rem; color: var(--tx3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-bottom: 8px; display: block; }
.vis-delta { font-size: 0.85rem; font-weight: 700; }
.vis-delta--up { color: var(--grn); }
.vis-delta--down { color: var(--red); }

.vis-bar { height: 4px; border-radius: 2px; background: var(--bg); margin: 12px 24px 0; overflow: hidden; }
.vis-bar__fill { height: 100%; border-radius: 2px; animation: barGrow 1.2s ease both; }

/* ======== HISTORY BARS ======== */

.cumul-text { font-size: 0.95rem; color: var(--tx2); margin-bottom: 28px; line-height: 1.75; }
.cumul-text strong { color: var(--tx); }

.hist-bars { display: flex; align-items: flex-end; gap: 12px; padding: 28px 0; }

.hist-col {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: default;
}

.hist-col__bar-wrap {
  width: 100%; height: 200px; display: flex; flex-direction: column;
  justify-content: flex-end; align-items: center; position: relative;
}

.hist-col__bar {
  width: 100%; max-width: 52px; border-radius: 8px 8px 4px 4px;
  position: relative; overflow: hidden;
  transition: all 0.3s; animation: barGrow 0.8s ease both;
}
.hist-col:hover .hist-col__bar { filter: brightness(1.2); transform: scaleY(1.03); transform-origin: bottom; }

.hist-col__seg {
  width: 100%; display: block;
}

.hist-col__count {
  font-size: 1.1rem; font-weight: 800; color: var(--tx);
  margin-bottom: 4px;
}

.hist-col__month {
  font-size: 0.72rem; color: var(--tx3); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}

.hist-col--current .hist-col__month { color: var(--acc2); }
.hist-col--current .hist-col__count { color: var(--acc2); }

.hist-legend {
  display: flex; justify-content: center; gap: 18px; margin-top: 20px; flex-wrap: wrap;
}
.hist-legend__item {
  display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--tx2);
}
.hist-legend__dot { width: 10px; height: 10px; border-radius: 3px; }

/* ======== BILAN ======== */

.bilan {
  border-radius: 14px; padding: 28px;
  background: var(--bg2); border: 1px solid var(--bd);
  line-height: 1.85; color: var(--tx2); font-size: 0.95rem;
}
.bilan p { margin-bottom: 12px; }
.bilan p:last-child { margin-bottom: 0; }
.bilan strong { color: var(--tx); }

.b-tag {
  display: inline-block; font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 3px 10px; border-radius: 6px; margin-bottom: 6px;
}
.b-tag--ok { background: rgba(52, 211, 153, 0.12); color: var(--grn); }
.b-tag--next { background: rgba(96, 165, 250, 0.12); color: var(--blu); }

/* ======== CTA ======== */

.cta { padding: 56px 0; text-align: center; }
.cta-text { font-size: 1rem; color: var(--tx2); margin-bottom: 18px; }
.cta-btn {
  display: inline-block; font-family: var(--font); font-size: 0.95rem; font-weight: 700;
  text-decoration: none; padding: 14px 32px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  color: #fff; cursor: pointer; transition: all 0.25s;
  box-shadow: 0 4px 20px rgba(124, 110, 246, 0.25);
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(124, 110, 246, 0.35); }

/* ======== PRINT ======== */

@media print {
  body { background: #fff; color: #000; }
  .hd, .cta, .close-btn, .hd-month { display: none !important; }
  .url-card, .pos-item, .vis-card, .bilan, .detail-link { background: #f5f5f5; border-color: #ddd; }
  .hero-num { -webkit-text-fill-color: #4f46e5; }
  .hero-glow { display: none; }
}

/* ======== RESPONSIVE ======== */

@media (max-width: 768px) {
  .hero-num { font-size: 5rem; }
  .url-cards { grid-template-columns: 1fr; }
  .vis-cards { grid-template-columns: 1fr; }
  .pos-item { grid-template-columns: 1fr; gap: 10px; }
  .detail-link { grid-template-columns: 1fr; gap: 8px; }
  .hd .w { flex-wrap: wrap; gap: 8px; }
}
