/* ============================================================
   index.css — Styles page d'accueil DevBoard (multi-projets)
   ============================================================ */

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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #0f1117;
  color: #e8e8e8;
  min-height: 100vh;
}

/* ── Header ──────────────────────────────────────────────── */
.idx-header {
  background: #13151f;
  border-bottom: 1px solid #1e2130;
  padding: 28px 40px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.idx-header-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 20px;
}

.idx-brand h1 {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
}
.idx-brand h1 span { color: #f5a623; }
.idx-brand p { color: #555; font-size: 11px; margin-top: 3px; }

/* Stats header */
.idx-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.idx-stat { text-align: center; }
.idx-stat-val {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #f5a623;
  line-height: 1;
}
.idx-stat-val em {
  font-style: normal;
  font-size: 12px;
  color: #555;
  font-weight: 400;
}
.idx-stat-lbl {
  display: block;
  font-size: 9px;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 3px;
}
.idx-stat-sep {
  width: 1px;
  height: 28px;
  background: #1e2130;
}

/* Barre de progression globale */
.idx-global-bar-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding-bottom: 0;
}
.idx-global-bar {
  height: 3px;
  background: #1e2130;
  overflow: hidden;
}
.idx-global-fill {
  height: 100%;
  background: linear-gradient(90deg, #f5a623, #4ade80);
  transition: width .6s ease;
}

/* ── Main ────────────────────────────────────────────────── */
.idx-main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 36px 40px;
}

/* ── Grille de projets ───────────────────────────────────── */
.idx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}

/* ── Carte projet ────────────────────────────────────────── */
.idx-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #1a1d27;
  border: 1px solid #252836;
  border-radius: 14px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color .18s, transform .15s, box-shadow .18s;
}
.idx-card:hover {
  border-color: #f5a623;
  transform: translateY(-3px);
  box-shadow: 0 10px 40px rgba(0,0,0,.45);
}
.idx-card.status-done {
  border-color: #1a3a1a;
  opacity: .85;
}
.idx-card.status-done:hover {
  border-color: #4ade80;
  opacity: 1;
}
.idx-card.status-pending { opacity: .7; }
.idx-card.status-pending:hover { opacity: 1; }

/* Top */
.idx-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.idx-card-identity { flex: 1; min-width: 0; }
.idx-card-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.idx-card-client {
  font-size: 12px;
  color: #888;
  margin-top: 3px;
}
.idx-card-baseline {
  font-size: 11px;
  color: #555;
  margin-top: 2px;
  font-style: italic;
}

/* Badge */
.idx-badge {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 3px 9px;
  border-radius: 20px;
}
.idx-badge.active  { background: #1c3555; color: #60a5fa; }
.idx-badge.done    { background: #1a3a1a; color: #4ade80; }
.idx-badge.pending { background: #22253a; color: #555; }

/* Phase courante */
.idx-card-phase {
  font-size: 11px;
  color: #666;
}

/* Barre progression */
.idx-card-progress { display: flex; flex-direction: column; gap: 5px; }
.idx-progress-bar {
  height: 5px;
  background: #22253a;
  border-radius: 4px;
  overflow: hidden;
}
.idx-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .5s ease;
}
.idx-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #555;
}
.idx-pct { font-weight: 700; color: #888; }

/* Scores SEO */
.idx-card-scores {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
}
.idx-score {
  font-size: 14px;
  font-weight: 700;
}
.idx-score em {
  font-style: normal;
  font-size: 9px;
  color: #444;
  font-weight: 400;
}
.idx-score.avant  { color: #f87171; }
.idx-score.actuel { color: #f5a623; }
.idx-score.cible  { color: #4ade80; font-size: 11px; }
.idx-arrow { color: #333; font-size: 11px; }
.idx-score-change {
  font-size: 11px;
  color: #4ade80;
  font-weight: 700;
  margin-left: 2px;
}
.idx-score-lbl {
  margin-left: auto;
  font-size: 9px;
  color: #383c52;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Footer carte */
.idx-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #1e2130;
  padding-top: 11px;
  margin-top: auto;
}
.idx-date { font-size: 11px; color: #444; }
.idx-open-lnk {
  font-size: 11px;
  color: #f5a623;
  font-weight: 600;
  opacity: 0;
  transition: opacity .15s;
}
.idx-card:hover .idx-open-lnk { opacity: 1; }

/* ── État vide ───────────────────────────────────────────── */
.idx-empty {
  text-align: center;
  padding: 80px 20px;
  color: #555;
}
.idx-empty-icon { font-size: 48px; margin-bottom: 16px; }
.idx-empty h2 { font-size: 18px; color: #888; margin-bottom: 12px; }
.idx-empty p { font-size: 13px; margin-bottom: 6px; line-height: 1.6; }
.idx-empty code {
  background: #1a1d27;
  padding: 2px 6px;
  border-radius: 4px;
  color: #f5a623;
  font-size: 12px;
}

/* ── Footer ──────────────────────────────────────────────── */
.idx-footer {
  text-align: center;
  padding: 28px;
  color: #2a2d3a;
  font-size: 11px;
  border-top: 1px solid #13151f;
  margin-top: 20px;
}

/* ── Refresh / sync ─────────────────────────────────────── */
.idx-refresh-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.idx-refresh-btn {
  background: none;
  border: 1px solid #252836;
  border-radius: 50%;
  color: #555;
  font-size: 16px;
  line-height: 1;
  width: 30px;
  height: 30px;
  cursor: pointer;
  transition: color .15s, border-color .15s, transform .15s;
  font-family: inherit;
}
.idx-refresh-btn:hover { color: #f5a623; border-color: #f5a623; }
.idx-refresh-btn.spinning {
  animation: idx-spin .7s linear infinite;
  color: #f5a623;
  border-color: #f5a623;
}
@keyframes idx-spin { to { transform: rotate(360deg); } }
.idx-sync-label {
  font-size: 9px;
  color: #333;
  white-space: nowrap;
  letter-spacing: .3px;
}

/* ── Utilisateur connecté / déconnexion ──────────────────── */
.idx-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.idx-user-name {
  font-size: 11px;
  color: #888;
}
.idx-logout {
  font-size: 10px;
  color: #f87171;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .4px;
  transition: color .15s;
}
.idx-logout:hover { color: #fca5a5; text-decoration: underline; }

/* ── Page de connexion ───────────────────────────────────── */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-wrap {
  width: 100%;
  max-width: 380px;
  padding: 20px;
}

.login-box {
  background: #1a1d27;
  border: 1px solid #252836;
  border-radius: 16px;
  padding: 36px 32px;
  text-align: center;
}

.login-logo {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  margin-bottom: 6px;
}
.login-logo span { color: #f5a623; }

.login-sub {
  font-size: 11px;
  color: #444;
  margin-bottom: 28px;
}

.login-error {
  background: #2a1010;
  border: 1px solid #5c1a1a;
  color: #f87171;
  font-size: 12px;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 18px;
  text-align: left;
}

.login-form { text-align: left; }

.login-field {
  margin-bottom: 16px;
}
.login-field label {
  display: block;
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 6px;
}
.login-field input {
  width: 100%;
  background: #0f1117;
  border: 1px solid #2a2d3a;
  border-radius: 8px;
  color: #e8e8e8;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}
.login-field input:focus {
  border-color: #f5a623;
}

.login-btn {
  width: 100%;
  background: #f5a623;
  color: #0f1117;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  margin-top: 6px;
  transition: background .15s, transform .1s;
  font-family: inherit;
}
.login-btn:hover  { background: #e8961a; }
.login-btn:active { transform: scale(.98); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 720px) {
  .idx-header { padding: 20px 20px 0; position: static; }
  .idx-main { padding: 24px 20px; }
  .idx-grid { grid-template-columns: 1fr; }
  .idx-header-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .idx-stats { gap: 16px; }
  .login-box { padding: 28px 20px; }
}
